/*******************************************************************************
 *  Copyright 2017-2018 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.dcm30_04.templates.mammographycadsriodtemplates;

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CalculatedValue_CID6142;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CalculationMethods_CID6140;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ChangeSinceLastMammogramOrPriorSurgery_CID6002;
import cdac.medinfo.sdk.dcm30_04.templates.cid.MammographyAssessment_CID6026;
import cdac.medinfo.sdk.dcm30_04.templates.cid.MammographyRecommendedFollowup_CID6028;
import cdac.medinfo.sdk.dcm30_04.templates.cid.Side_CID6022;
import cdac.medinfo.sdk.dcm30_04.templates.cid.UnitsOfFollowupInterval_CID6046;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_AssessmentFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CalculatedValue;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CalculationMethods;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ChangeSinceLastMammogramOrPriorSurgeryFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_MammographyCADImpressionRecommendationBodyTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RecommendedFollowupFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SideFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_UnitsOfFollowupInterval;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_MammographyCADImpressionRecommendationBodyTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents MammographyCADImpressionRecommendationBodyTemplate - TID4002
 */
public class MammographyCADImpressionRecommendationBodyTemplate_TID4002 extends Template
{
	/**
	 * Object of CADAlgorithmIdentificationTemplate_TID4019
	 */

	private CADAlgorithmIdentificationTemplate_TID4019 objAlgorithmIdentificationTemplateTID4019;

	/**
	 * Object of MammographyAssessment_CID6026
	 */
	private MammographyAssessment_CID6026 objMammographyAssessmentCID6026;

	/**
	 * Object of MammographyRecommendedFollowup_CID6028
	 */
	private MammographyRecommendedFollowup_CID6028 objRecommendedFollowupCID6028;
	
	/**
	 * Object of CalculatedValue_CID6142
	 */
	private CalculatedValue_CID6142 objCalculatedValueCID6142;
	
	/**
	 * Object of CalculationMethods_CID6140
	 */
	private CalculationMethods_CID6140 objCalculationMethodsCID6140;
		
	/**
	 * Object of Side_CID6022
	 */
	private Side_CID6022 objSideCID6022;

	/**
	 * Object of ChangeSinceLastMammogramOrPriorSurgery_CID6002
	 */
	private ChangeSinceLastMammogramOrPriorSurgery_CID6002 objChangeSinceLastMammogramOrPriorSurgeryCID6002;

	/**
	 * Object of UnitsOfFollowupInterval_CID6046
	 */
	private UnitsOfFollowupInterval_CID6046 objUnitsOfFollowupIntervalCID6046;

	/**
	 * Instantiates MammographyCADImpressionRecommendationBodyTemplate_TID4002 Template.
	 * @param objTree Object of SRTree.
	 */
	public MammographyCADImpressionRecommendationBodyTemplate_TID4002(SRTree objTree)
	{
		super(objTree);
	}

	/**
	 * Retrieves CADAlgorithmIdentificationTemplate 
	 * @return objAlgorithmIdentificationTemplateTID4019 Object of CADAlgorithmIdentificationTemplate_TID4019 
	 */
	public CADAlgorithmIdentificationTemplate_TID4019 getCADAlgorithmIdentificationTemplate() 
	{
		if(null == this.objAlgorithmIdentificationTemplateTID4019)
			this.objAlgorithmIdentificationTemplateTID4019 = new CADAlgorithmIdentificationTemplate_TID4019(getSRTree());
		return this.objAlgorithmIdentificationTemplateTID4019;
	}

	/**
	 * Sets value for Assessment Category.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumAssessmentFromBI_RADS Enumerated value for AssessmentFromBI_RADS
	 */
	public void setAssessmentCategory(int[] arrPosition, EnumCM_AssessmentFromBI_RADS enumAssessmentFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.ASSESSMENT_CATEGORY.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.ASSESSMENT_CATEGORY_111005.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Assessment Category
		 */
		if(null== this.objMammographyAssessmentCID6026)
			this.objMammographyAssessmentCID6026 = new MammographyAssessment_CID6026();
		this.objMammographyAssessmentCID6026.setMammographyAssessment(enumAssessmentFromBI_RADS);

		String strCM = objMammographyAssessmentCID6026.getCodeMeaning();
		String strCV = objMammographyAssessmentCID6026.getCodeValue();
		String strCSD = objMammographyAssessmentCID6026.getCodingSchemeDesignator();
		String strCSV = objMammographyAssessmentCID6026.getCodingSchemeVersion();

		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, strCV, strCSD, strCSV, strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Differential Diagnosis Impression.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumChangeSinceLastMammogramOrPriorSurgeryFromBI_RADS Enumerated value for ChangeSinceLastMammogramOrPriorSurgeryFromBI_RADS
	 */
	public void setDifferentialDiagnosisImpression(int[] arrPosition, EnumCM_ChangeSinceLastMammogramOrPriorSurgeryFromBI_RADS enumChangeSinceLastMammogramOrPriorSurgeryFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.DIFFERENTIAL_DIAGNOSIS_IMPRESSION.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.DIFFERENTIAL_DIAGNOSIS_IMPRESSION_111023.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Differential Diagnosis Impression
		 */
		if(null== this.objChangeSinceLastMammogramOrPriorSurgeryCID6002)
			this.objChangeSinceLastMammogramOrPriorSurgeryCID6002 = new ChangeSinceLastMammogramOrPriorSurgery_CID6002();
		this.objChangeSinceLastMammogramOrPriorSurgeryCID6002.setChangeSinceLastMammogramOrPriorSurgeryFromBI_RADS(enumChangeSinceLastMammogramOrPriorSurgeryFromBI_RADS);

		String strCM = objChangeSinceLastMammogramOrPriorSurgeryCID6002.getCodeMeaning();
		String strCV = objChangeSinceLastMammogramOrPriorSurgeryCID6002.getCodeValue();
		String strCSD = objChangeSinceLastMammogramOrPriorSurgeryCID6002.getCodingSchemeDesignator();
		String strCSV = objChangeSinceLastMammogramOrPriorSurgeryCID6002.getCodingSchemeVersion();

		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, strCV, strCSD, strCSV, strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Impression Description
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strComplicationOfProcedure String value for ComplicationOfProcedure.
	 */
	public void setImpressionDescription(int[] arrPosition, String strComplicationOfProcedure)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.IMPRESSION_DESCRIPTION.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.IMPRESSION_DESCRIPTION_111033.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type TEXT and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createTextNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strComplicationOfProcedure);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Recommended Follow-up.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumRecommendedFollowupFromBIRADS Enumerated value for RecommendedFollowupFromBIRADS
	 */
	public void setRecommendedFollowUp(int[] arrPosition, EnumCM_RecommendedFollowupFromBI_RADS enumRecommendedFollowupFromBIRADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.RECOMMENDED_FOLLOW_UP.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.RECOMMENDED_FOLLOW_UP_111053.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Differential Diagnosis Impression
		 */
		if(null== this.objRecommendedFollowupCID6028)
			this.objRecommendedFollowupCID6028 = new MammographyRecommendedFollowup_CID6028();
		this.objRecommendedFollowupCID6028.setMammographyRecommendedFollowup(enumRecommendedFollowupFromBIRADS);

		String strCM = objRecommendedFollowupCID6028.getCodeMeaning();
		String strCV = objRecommendedFollowupCID6028.getCodeValue();
		String strCSD = objRecommendedFollowupCID6028.getCodingSchemeDesignator();
		String strCSV = objRecommendedFollowupCID6028.getCodingSchemeVersion();

		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, strCV, strCSD, strCSV, strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Recommended Follow-up Interval
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 * @param enumUnitsOfFollowupInterval Enumerated value for UnitsOfFollowupInterval.
	 */
	public void setRecommendedFollowUpInterval(int[] arrPosition,String[] arrNumericValue, EnumCM_UnitsOfFollowupInterval enumUnitsOfFollowupInterval)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objUnitsOfFollowupIntervalCID6046)
			this.objUnitsOfFollowupIntervalCID6046 = new UnitsOfFollowupInterval_CID6046();
		this.objUnitsOfFollowupIntervalCID6046.setUnitsOfFollowupInterval(enumUnitsOfFollowupInterval);

		String strCMForUnit = objUnitsOfFollowupIntervalCID6046.getCodeMeaning();
		String strCVForUnit = objUnitsOfFollowupIntervalCID6046.getCodeValue();
		String strCSDForUnit = objUnitsOfFollowupIntervalCID6046.getCodingSchemeDesignator();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.RECOMMENDED_FOLLOW_UP_INTERVAL.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.RECOMMENDED_FOLLOW_UP_INTERVAL_111055.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Laterality.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setLaterality(int[] arrPosition, EnumCM_SideFromBI_RADS enumSideFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objSideCID6022)
			this.objSideCID6022 = new Side_CID6022();
		this.objSideCID6022.setSide(enumSideFromBI_RADS);

		String strCMForUnit = objSideCID6022.getCodeMeaning();
		String strCVForUnit = objSideCID6022.getCodeValue();
		String strCSDForUnit = objSideCID6022.getCodingSchemeDesignator();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.LATERALITY.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.LATERALITY_G_C171.getValue();
		String strCSD = EnumCodingSchemeDesignator.SRT.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strCMForUnit, strCVForUnit, "", strCSDForUnit);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Calculated Value.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue 
	 * @param enumCalculatedValue Enumerated value for CalculatedValue
	 */
	public void setCalculatedValue(int[] arrPosition, EnumCM_CalculatedValue enumCalculatedValue, String[] arrNumericValue)
	{
		/**
		 * Setting value for MammographyQuantitativeTemporalDifferenceTypeCID6037
		 */
		if(null== this.objCalculatedValueCID6142)
			this.objCalculatedValueCID6142 = new CalculatedValue_CID6142();
		this.objCalculatedValueCID6142.setCalculatedValue(enumCalculatedValue);

		String strCM = objCalculatedValueCID6142.getCodeMeaning();
		String strCV = objCalculatedValueCID6142.getCodeValue();
		String strCSD = objCalculatedValueCID6142.getCodingSchemeDesignator();

		/**
		 * Creating a node of Value Type NUM and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition, strCM, strCV, strCSD, arrNumericValue, "", "", "", "", "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets value for Derivation.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue 
	 * @param enumCalculationMethods Enumerated value for CalculationMethods
	 */
	public void setDerivation(int[] arrPosition, EnumCM_CalculationMethods enumCalculationMethods)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.DERIVATION.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.DERIVATION_121401.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();
		/**
		 * Setting value for CalculationMethods
		 */
		if(null== this.objCalculationMethodsCID6140)
			this.objCalculationMethodsCID6140 = new CalculationMethods_CID6140();
		this.objCalculationMethodsCID6140.setCalculationMethods(enumCalculationMethods);

		String strCM = objCalculationMethodsCID6140.getCodeMeaning();
		String strCV = objCalculationMethodsCID6140.getCodeValue();
		String strCSD = objCalculationMethodsCID6140.getCodingSchemeDesignator();
		String strSNOMEDCTID = objCalculationMethodsCID6140.getSNOMEDCTID();

		/**
		 * Creating a node of Value Type NUM and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strCV, strCSDesg, "", strCM,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Recommended Follow-up Date.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strRecommendedFollowUpDate String value for DateTime of Intervention
	 */
	public void setRecommendedFollowUpDate(int[] arrPosition, String strRecommendedFollowUpDate)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.RECOMMENDED_FOLLOW_UP_DATE.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.RECOMMENDED_FOLLOW_UP_DATE_111054.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type DATETIME and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createDateTimeNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strRecommendedFollowUpDate);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Certainty of impression
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value. for Certainty of impression
	 */
	public void setCertaintyOfImpression(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.PERCENTAGE.getValue();
		String strCVForUnit = EnumCV_Unit.PERCENTAGE.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.CERTAINTY_OF_IMPRESSION.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.CERTAINTY_OF_IMPRESSION_111013.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Calculation Description.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strValue 
	 */
	public void setCalculationDescription(int[] arrPosition,String strValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADImpressionRecommendationBodyTemplate.CALCULATION_DESCRIPTION.getValue();
		String strCodeValue = EnumCV_MammographyCADImpressionRecommendationBodyTemplate.CALCULATION_DESCRIPTION_112034.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type TEXT and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createTextNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strValue);
		getSRTree().addChild(objContentSequenceItem);
	}
}
