/*******************************************************************************
 *  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.enums.EnumGraphicType;
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.LinearMeasurements_CID7470;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_LinearMeasurements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ThreeDimensionalLinearMeasurement;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_ThreeDimensionalLinearMeasurement;

/**
 * This class represents VolumeMeasurementTemplate - TID1402
 */
public class ThreeDimensionalLinearMeasurement_TID1406 extends Template{
	/**
	 * Object of AdministrationOfDrugsContrast_CID3409
	 */
	private LinearMeasurements_CID7470 objLinearMeasurements_CID7470;
	/**
	 * Object of AdministrationOfDrugsContrast_CID3409
	 */
	private TrackingIdentifier_TID4108 objTrackingIdentifier_TID4108;
	/**
	  * Instantiates a new ThreeDimensionalLinearMeasurement_TID1406 Template.
	  * @param objTree Object of SRTree.
	  */
	public ThreeDimensionalLinearMeasurement_TID1406(SRTree objTree)
	{
		super(objTree);
	}
	/**
	 * Retrieves TrackingIdentifier
	 * @return objTrackingIdentifier_TID4108 Object of TrackingIdentifier_TID4108
	 */
	public TrackingIdentifier_TID4108 getLogEntryQualifiers() 
	{
		if(objTrackingIdentifier_TID4108 == null)
			this.objTrackingIdentifier_TID4108 = new TrackingIdentifier_TID4108(getSRTree());
		return this.objTrackingIdentifier_TID4108;
	}
	/**
	 * Sets the value for Linear Measurements
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumLinearMeasurements Enum Value for LinearMeasurements
	 * @param arrNumericValue String array for Quatity Of Material
	 */
	public void setLinearMeasurements(int[] arrPosition,EnumCM_LinearMeasurements enumLinearMeasurements, String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(objLinearMeasurements_CID7470 == null)
			this.objLinearMeasurements_CID7470 = new LinearMeasurements_CID7470();
		this.objLinearMeasurements_CID7470.setLinearMeasurements(enumLinearMeasurements);

		String strCodeMeaning = objLinearMeasurements_CID7470.getCodeMeaning();
		String strCodeValue = objLinearMeasurements_CID7470.getCodeValue();
		String strCSD = objLinearMeasurements_CID7470.getCodingSchemeDesignator();

		/**
		 * Creating a node of Value Type NUM and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,"","","","","","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Path
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrFlGraphicData Float array for FlGraphicData.
	 * @param enumGraphicType Enumerated value for GraphicType.
	 */
	public void setPath(int[] arrPosition, float []arrFlGraphicData, EnumGraphicType enumGraphicType)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ThreeDimensionalLinearMeasurement.PATH.getValue();
		String strCodeValue = EnumCV_ThreeDimensionalLinearMeasurement.PATH_121055.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

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