/*******************************************************************************
 *  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.TimePointTypes_CID6146;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_TimePointContext;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_TimePointTypes;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_TimePointContext;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
/**
 * This class represents VolumeMeasurementTemplate - TID1402
 */
public class TimePointContext_TID1502 extends Template {

	private TimePointTypes_CID6146 objTimePointTypes_CID6146;
	/**
	 * Instantiates TimePointContext_TID1502 Template.
	 * @param objTree Object of SRTree.
	 */
	public TimePointContext_TID1502(SRTree objTree)
	{
		super(objTree);
	}
	/**
	 * Sets the value for SubjectTime Point Identifier
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strSubjectTimePointIdentifier String value for Comment.
	 */
	public void setSubjectTimePointIdentifier(int[] arrPosition, String strSubjectTimePointIdentifier)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_TimePointContext.SUBJECT_TIME_POINT_IDENTIFIER.getValue();
		String strCodeValue = EnumCV_TimePointContext.SUBJECT_TIME_POINT_IDENTIFIER_126070.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, strSubjectTimePointIdentifier);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for ProtocolTimePointIdentifier
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strSubjectTimePointIdentifier String value for Comment.
	 */
	public void strProtocolTimePointIdentifier(int[] arrPosition, String strProtocolTimePointIdentifier)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_TimePointContext.PROTOCOL_TIME_POINT_IDENTIFIER.getValue();
		String strCodeValue = EnumCV_TimePointContext.PROTOCOL_TIME_POINT_IDENTIFIER_126071.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, strProtocolTimePointIdentifier);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for TimePoint
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strTimePoint String value for Comment.
	 */
	public void strTimePoint(int[] arrPosition, String strTimePoint)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_TimePointContext.TIME_POINT.getValue();
		String strCodeValue = EnumCV_TimePointContext.TIME_POINT_C2348792.getValue();
		String strCSD = EnumCodingSchemeDesignator.UMLS.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, strTimePoint);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Time PointType
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 */
	public void setTimePointType(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.ONE.getValue();
		String strCVForUnit = EnumCV_Unit.ONE.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_TimePointContext.TIME_POINT_TYPE.getValue();
		String strCodeValue = EnumCV_TimePointContext.TIME_POINT_TYPE_126072.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setTimePointOrder(int[] arrPosition, EnumCM_TimePointTypes enumTimePointTypes)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_TimePointContext.TIME_POINT_ORDER.getValue();
		String strCodeValue = EnumCV_TimePointContext.TIME_POINT_ORDER_126073.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();
		if(null== this.objTimePointTypes_CID6146)
			this.objTimePointTypes_CID6146 = new TimePointTypes_CID6146();
		this.objTimePointTypes_CID6146.setTimePointTypes(enumTimePointTypes);
		String strCM = objTimePointTypes_CID6146.getCodeMeaning();
		 String strCV = objTimePointTypes_CID6146.getCodeValue();
		 String strCSD = objTimePointTypes_CID6146.getCodingSchemeDesignator();
		
		
		/**
		 * 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);
		getSRTree().addChild(objContentSequenceItem);
	}
}
