/*******************************************************************************
 *  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.cid.EquationOrTable_CID228;
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_ROIMeasurements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_ROIMeasurements;

/**
 * This class represents ROIMeasurements - TID1419
 */
public class ROIMeasurements_TID1419 extends Template{

	/**
	 * Object of EquationOrTable_TID315
	 */
	private EquationOrTable_TID315 objEquationOrTable_TID315;
	/**
	 * Object of EquationOrTable_CID228
	 */
	private EquationOrTable_CID228 objEquationOrTable_CID228;
	/**
	 * Object of MeasurementProperties_TID310
	 */
	private MeasurementProperties_TID310 objMeasurementProperties_TID310;
	/**
	 * Object of Quotation_TID1000
	 */
	private Quotation_TID1000 objQuotation_TID1000;
	/**
	 * Instantiates ROIMeasurements_TID1419 Template.
	 * @param objTree Object of SRTree.
	 */
	public ROIMeasurements_TID1419(SRTree objTree)
	{
		super(objTree);
	}
	/**
	 * Retrieves the object of Quotation_TID1000
	 * @return objQuotation_TID1000 object of Quotation_TID1000
	 */
	public Quotation_TID1000 getQuotation()
	{
		if(null == objQuotation_TID1000)
			objQuotation_TID1000 = new Quotation_TID1000(getSRTree());
		return objQuotation_TID1000;
	}
	/**
	 * Retrieves the object of EquationOrTable_TID315
	 * @return objEquationOrTable_TID315 object of EquationOrTable_TID315
	 */
	public EquationOrTable_TID315 getEquationOrTable()
	{
		if(null == objEquationOrTable_TID315)
			objEquationOrTable_TID315 = new EquationOrTable_TID315(getSRTree());
		return objEquationOrTable_TID315;
	}
	/**
	 * Retrieves the object of MeasurementStatisticalProperties_TID311
	 * @return objMeasurementStatisticalProperties_TID311 object of MeasurementStatisticalProperties_TID311
	 */
	public MeasurementProperties_TID310 getMeasurementProperties()
	{
		if(null == objMeasurementProperties_TID310)
			objMeasurementProperties_TID310 = new MeasurementProperties_TID310(getSRTree());
		return objMeasurementProperties_TID310;
	}

	/**
	 * Sets value for Measurement Method
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setMeasurementMethod(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ROIMeasurements.MEASUREMENT_METHOD.getValue();
		String strCodeValue = EnumCV_ROIMeasurements.MEASUREMENT_METHOD_G_C036.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets value for FINDING SITE
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setFindingSite(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ROIMeasurements.FINDING_SITE.getValue();
		String strCodeValue = EnumCV_ROIMeasurements.FINDING_SITE_G_C0E3.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets value for Laterality
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setLaterality(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ROIMeasurements.LATERALITY.getValue();
		String strCodeValue = EnumCV_ROIMeasurements.LATERALITY_G_C171.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets value for Topographicalmodifier
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setTopographicalmodifier(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ROIMeasurements.TOPOGRAPHICAL_MODIFIER.getValue();
		String strCodeValue = EnumCV_ROIMeasurements.TOPOGRAPHICAL_MODIFIER_G_A1F8.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		
		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_ROIMeasurements.DERIVATION.getValue();
		String strCodeValue = EnumCV_ROIMeasurements.DERIVATION_121401.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSDesg, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets Real World Value Map used for measurement
	 * @param arrPosition position at which the node will get added in the tree.
	 * @param strReferencedSOPClassUID Referenced SOP Class UID
	 * @param strReferencedSOPInstanceUID Referenced SOP Instance UID
	 */
	public void setRealWorldValueMapusedformeasurement(int[] arrPosition, String strReferencedSOPClassUID, String strReferencedSOPInstanceUID)
	{
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ROIMeasurements.REALWORLD_VALUE_MAP_USEDFOR_MEASUREMENT.getValue();
		String strCodeValue = EnumCV_ROIMeasurements.REALWORLD_VALUE_MAP_USEDFOR_MEASUREMENT_126100.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();
		/**
		 * Creating a node of Value Type COMPOSITE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCompositeNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strReferencedSOPClassUID, strReferencedSOPInstanceUID);
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setTrackingIdentifier(int[] arrPosition, String strTrackingIdentifier)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ROIMeasurements.EQUIVALENT_MEANING_OFCONCEPT_NAME.getValue();
		String strCodeValue = EnumCV_ROIMeasurements.EQUIVALENT_MEANING_OFCONCEPT_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, strTrackingIdentifier);
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setEquationOrTable(int[] arrPosition, EnumCM_EquationOrTable enumEquationOrTable, String strNote)
	{
		if(objEquationOrTable_CID228 == null )
			this.objEquationOrTable_CID228 = new EquationOrTable_CID228();

		objEquationOrTable_CID228.setEquationOrTable(enumEquationOrTable);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = objEquationOrTable_CID228.getCodeMeaning();
		String strCodeValue = 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, strCodeMeaning, strCodeValue, strCSD, strNote);

		getSRTree().addChild(objContentSequenceItem);
	}
}
