/*******************************************************************************
 *  Copyright 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.generaltemplates;

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.chestcadsriodtemplates.TrackingIdentifier_TID4108;
import cdac.medinfo.sdk.dcm30_04.templates.cid.EquationOrTable_CID228;
import cdac.medinfo.sdk.dcm30_04.templates.cid.Laterality_CID244;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_EquationOrTable;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Laterality;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Measurement;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Measurement;
/**
* This class represents Measurement_TID300
*/
public class Measurement_TID300 extends Template{
	/**
	 * Object of EquationOrTable_CID228
	 */
	private EquationOrTable_CID228 objEquationOrTable_CID228;
	
	/**
	 * Object of TrackingIdentifier_TID4108
	 */
	private TrackingIdentifier_TID4108 objTrackingIdentifier_TID4108;
	/**
	 * Object of MeasurementRangeConcepts_CID221
	 */
	private ImageOrSpatialCoordinates_TID320 objImageOrSpatialCoordinates_TID320;
	/**
	 * Object of MeasurementRangeConcepts_CID221
	 */
	private EquationOrTable_TID315 objEquationOrTable_TID315;
	/**
	 * Object of MeasurementRangeConcepts_CID221
	 */
	private Measurement_TID300 objMeasurement_TID300;
	/**
	 * Object of Quotation_TID1000
	 */
	private Quotation_TID1000 objQuotation_TID1000;
	/**
	 * Object of MeasurementRangeConcepts_CID221
	 */
	private WaveformOrTemporalCoordinates_TID321 objWaveformOrTemporalCoordinates_TID321;
	
	/**
	 * Retrieves the object of ImageOrSpatialCoordinates_TID320
	 * @return objImageOrSpatialCoordinates_TID320 object of ImageOrSpatialCoordinates_TID320
	 */
	public TrackingIdentifier_TID4108 getTrackingIdentifier()
	
	{
		if(null == objTrackingIdentifier_TID4108)
			objTrackingIdentifier_TID4108 = new TrackingIdentifier_TID4108(getSRTree());
		return objTrackingIdentifier_TID4108;
	}
	/**
	 * Retrieves the object of ImageOrSpatialCoordinates_TID320
	 * @return objImageOrSpatialCoordinates_TID320 object of ImageOrSpatialCoordinates_TID320
	 */
	public WaveformOrTemporalCoordinates_TID321 getWaveformOrTemporalCoordinates()
	{
		if(null == objWaveformOrTemporalCoordinates_TID321)
			objWaveformOrTemporalCoordinates_TID321 = new WaveformOrTemporalCoordinates_TID321(getSRTree());
		return objWaveformOrTemporalCoordinates_TID321;
	}
	
	/**
	  * Instantiates a new AreaMeasurementTemplate_TID1401 Template.
	  * @param objTree Object of SRTree.
	  */
	public Measurement_TID300(SRTree objTree)
	{
		super(objTree);
	}	
	/**
	 * Retrieves the object of Quotation_TID1000
	 * @return objQuotation_TID1000 object of Quotation_TID1000
	 */
	public Quotation_TID1000 getobjQuotation()
	{
		if(null == objQuotation_TID1000)
			objQuotation_TID1000 = new Quotation_TID1000(getSRTree());
		return objQuotation_TID1000;
	}
	/**
	 * Object of TimePointContext_TID1502
	 */
	private Laterality_CID244 objLaterality_CID244 ;
	/**
	 * Retrieves the object of ImageOrSpatialCoordinates_TID320
	 * @return objImageOrSpatialCoordinates_TID320 object of ImageOrSpatialCoordinates_TID320
	 */
	public ImageOrSpatialCoordinates_TID320 getImageOrSpatialCoordinates()
	{
		if(null == objImageOrSpatialCoordinates_TID320)
			objImageOrSpatialCoordinates_TID320 = new ImageOrSpatialCoordinates_TID320(getSRTree());
		return objImageOrSpatialCoordinates_TID320;
	}
	/**
	 * Retrieves the object of MeasurementStatisticalProperties_TID311
	 * @return objMeasurement_TID300 object of MeasurementStatisticalProperties_TID311
	 */
	public EquationOrTable_TID315 getEquationOrTable()
	{
		if(null == objMeasurement_TID300)
			objEquationOrTable_TID315 = new EquationOrTable_TID315(getSRTree());
		return objEquationOrTable_TID315;
	}
	/**
	 * Retrieves the object of MeasurementStatisticalProperties_TID311
	 * @return objMeasurement_TID300 object of MeasurementStatisticalProperties_TID311
	 */
	public Measurement_TID300 getMeasurementStatisticalProperties()
	{
		if(null == objMeasurement_TID300)
			objMeasurement_TID300 = new Measurement_TID300(getSRTree());
		return objMeasurement_TID300;
	}
	public void setMeasurementMethod(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_Measurement.MEASUREMENT_METHOD.getValue();
		String strCodeValue = EnumCV_Measurement.MEASUREMENT_METHOD_G_C036.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
	
		/**
		 * 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, "","", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setDerivation(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_Measurement.DERIVATION.getValue();
		String strCodeValue = EnumCV_Measurement.DERIVATION_121401.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
	
		/**
		 * 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, "","", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setFindingSite(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_Measurement.FINDING_SITE.getValue();
		String strCodeValue = EnumCV_Measurement.FINDING_SITE_G_C0E3.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
	
		/**
		 * 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, "","", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setLaterality(int[] arrPosition, EnumCM_Laterality enumLaterality)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_Measurement.LATERALITY.getValue();
		String strCodeValue = EnumCV_Measurement.LATERALITY_G_C171.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
		String strCM,strCV,strCSD,strSNMDCTID;

		if(null== this.objLaterality_CID244)
			this.objLaterality_CID244 = new Laterality_CID244();
		this.objLaterality_CID244.setLaterality(enumLaterality);
		 strCM = objLaterality_CID244.getCodeMeaning();
		 strCV = objLaterality_CID244.getCodeValue();
		 strCSD = objLaterality_CID244.getCodingSchemeDesignator();
		 strSNMDCTID = objLaterality_CID244.getSNOMEDCTID();
		
		
		/**
		 * 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, "", strCM,strSNMDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setTopographicalModifier(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_Measurement.TOPOGRAPHICAL_MODIFIER.getValue();
		String strCodeValue = EnumCV_Measurement.TOPOGRAPHICAL_MODIFIER_G_A1F8.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
	
		/**
		 * 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, "","", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setRealWorldValueMapUsedForMeasurement(int[] arrPosition,String strReferencedSOPClassUID,String   strReferencedSOPInstanceUID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_Measurement.REALWORLD_VALUE_MAP_USED_FORMEASUREMENT.getValue();
		String strCodeValue = EnumCV_Measurement.REALWORLD_VALUE_MAP_USED_FORMEASUREMENT_126100.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();
	
		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCompositeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, strReferencedSOPClassUID, strReferencedSOPInstanceUID);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Equivalent Meaning ofConcept Name
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strMeasurementMethod String value for Comment.
	 */
	public void setEquivalentMeaningOfConceptName(int[] arrPosition, String strTracking)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_Measurement.EQUIVALENT_MEANING_OF_CONCEPT_NAME.getValue();
		String strCodeValue = EnumCV_Measurement.EQUIVALENT_MEANING_OF_CONCEPT_NAME_121050.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, strTracking);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for “Equation orTable
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strMeasurementMethod String value for Comment.
	 */
	public void setEquationorTable(int[] arrPosition,EnumCM_EquationOrTable enumEquationOrTable)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objEquationOrTable_CID228)
			this.objEquationOrTable_CID228 = new EquationOrTable_CID228();
		this.objEquationOrTable_CID228.setEquationOrTable(enumEquationOrTable);
		String strCM = objEquationOrTable_CID228.getCodeMeaning();
		 String strCV = objEquationOrTable_CID228.getCodeValue();
		 String strCSD = objEquationOrTable_CID228.getCodingSchemeDesignator();
		
		/**
		 * Creating a node of Value Type TEXT and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createTextNode(arrPosition, strCM, strCV, strCSD, "");
		getSRTree().addChild(objContentSequenceItem);
	}
}
