
/*******************************************************************************
 *  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.EnumContinuityOfContent;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SpectaclePrescriptionReport;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_SpectaclePrescriptionReport;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
/**
 * This class represents SpectaclePrescriptionReport
 */
public class SpectaclePrescriptionReport_TID2020 extends Template{

	/**
	 * Object of TemplateForSpectaclePrescriptionDetails_TID2021 
	 */

	private TemplateForSpectaclePrescriptionDetails_TID2021 objTemplateForSpectaclePrescriptionDetails_TID2021 = null;
	
	/**
	 * Instantiates SpectaclePrescriptionReport_TID2020 Template.
	 * @param objTree Object of SRTree.
	 */
	public SpectaclePrescriptionReport_TID2020(SRTree objTree) {
		super(objTree);
	}
	
	/**
	 * Retrieves the Object of TemplateForSpectaclePrescriptionDetails_TID2021 template
	 * @return objTemplateForSpectaclePrescriptionDetails_TID2021 Object of TemplateForSpectaclePrescriptionDetails_TID2021 template
	 */
	public TemplateForSpectaclePrescriptionDetails_TID2021 getPersonObserverIdentifyingAttributes() 
	{
		if(null == objTemplateForSpectaclePrescriptionDetails_TID2021)
			objTemplateForSpectaclePrescriptionDetails_TID2021 = new TemplateForSpectaclePrescriptionDetails_TID2021(getSRTree());
		return objTemplateForSpectaclePrescriptionDetails_TID2021;
	}
	
	public void setSpectaclePrescriptionReport(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SpectaclePrescriptionReport.SPECTACLE_PRESCRIPTION_REPORT.getValue();
		String strCodeValue = EnumCV_SpectaclePrescriptionReport.SPECTACLE_PRESCRIPTION_REPORT_111671.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.DCM.getValue();
		/**
		 * Creating a node of Value Type Container and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createContainer(arrPosition, strCodeMeaning, strCodeValue, strCSD2, enumContinuityOfContent);
		getSRTree().addChild(objContentSequenceItem);
}
	
	public void setRightEyeRx(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SpectaclePrescriptionReport.RIGHT_EYE_RX.getValue();
		String strCodeValue = EnumCV_SpectaclePrescriptionReport.RIGHT_EYE_RX_111688.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.DCM.getValue();
		/**
		 * Creating a node of Value Type Container and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createContainer(arrPosition, strCodeMeaning, strCodeValue, strCSD2, enumContinuityOfContent);
		getSRTree().addChild(objContentSequenceItem);
}
	public void setLeftEyeRx(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SpectaclePrescriptionReport.LEFT_EYE_RX.getValue();
		String strCodeValue = EnumCV_SpectaclePrescriptionReport.LEFT_EYE_RX_111689.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.DCM.getValue();
		/**
		 * Creating a node of Value Type Container and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createContainer(arrPosition, strCodeMeaning, strCodeValue, strCSD2, enumContinuityOfContent);
		getSRTree().addChild(objContentSequenceItem);
}
	
	/**
	 * Sets the value for DistancePupillary Distance
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setDistancePupillaryDistance(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.MM.getValue();
		String strCVForUnit = EnumCV_Unit.MM.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SpectaclePrescriptionReport.DISTANCE_PUPILLARY_DISTANCE.getValue();
		String strCodeValue = EnumCV_SpectaclePrescriptionReport.DISTANCE_PUPILLARY_DISTANCE_111679.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 DistancePupillary Distance
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setNearPupillaryDistance(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.MM.getValue();
		String strCVForUnit = EnumCV_Unit.MM.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SpectaclePrescriptionReport.NEAR_PUPILLARY_DISTANCE.getValue();
		String strCodeValue = EnumCV_SpectaclePrescriptionReport.NEAR_PUPILLARY_DISTANCE_111680.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 Comment
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strMeasurementMethod String value for Comment.
	 */
	public void setComment(int[] arrPosition, String strComment)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SpectaclePrescriptionReport.COMMENT.getValue();
		String strCodeValue = EnumCV_SpectaclePrescriptionReport.COMMENT_121106.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, strComment);
		getSRTree().addChild(objContentSequenceItem);
	}
}
