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

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.cid.CardiacRhythms_CID3415;
import cdac.medinfo.sdk.dcm30_04.templates.cid.RespirationRhythms_CID3416;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CardiacRhythms;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RespirationRhythms;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_VitalSigns;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_VitalSigns;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Measurement_TID300;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents VitalSigns - TID3510
 */
public class VitalSigns_TID3510 extends Template
{
	/**
	 * Object of Measurement_TID300
	 */
	private Measurement_TID300 objMeasurementTID300;
	/**
	 * Object of CardiacRhythms_CID3415
	 */
	private CardiacRhythms_CID3415 objCardiacRhythms_CID3415;
	
	/**
	 * Object of RespirationRhythms_CID3416
	 */
	private RespirationRhythms_CID3416 objRespirationRhythms_CID3416;
	
	/**
	 * Instantiates a new VitalSigns_TID3510 Template.
	 * @param objTree Object of SRTree.
	 */
	public VitalSigns_TID3510(SRTree objTree)
	{
		super(objTree);
	}
	/**
	 * Retrieves Measurement 
	 * @return objMeasurementID300 Object of Measurement_TID300 
	 */
	public Measurement_TID300 getMeasurement() 
	{
		if(null == this.objMeasurementTID300)
			this.objMeasurementTID300 = new Measurement_TID300(getSRTree());
		return this.objMeasurementTID300;
	}
	/**
	 * Sets the value for Vital Signs
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setVitalSigns(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_VitalSigns.VITAL_SIGNS.getValue();
		String strCodeValue = EnumCV_VitalSigns.VITAL_SIGNS_8716_3.getValue();
		String strCSD = EnumCodingSchemeDesignator.LN.getValue();

		/**
		 * Creating a node of Value Type UIDREF and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createContainer(arrPosition, strCodeMeaning, strCodeValue, strCSD, enumContinuityOfContent);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Cardiac Rhythm.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCardiacRhythms value for Cardiac Rhythms
	 */
	public void setCardiacRhythm(int[] arrPosition, EnumCM_CardiacRhythms enumCardiacRhythms)
	{
		/**
		 * Sets the value for template object.
		 */
		if(null== this.objCardiacRhythms_CID3415)
	this.objCardiacRhythms_CID3415 = new CardiacRhythms_CID3415();
		this.objCardiacRhythms_CID3415.setCardiacRhythms(enumCardiacRhythms);
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = objCardiacRhythms_CID3415.getCodeMeaning();
		String strCV = objCardiacRhythms_CID3415.getCodeValue();
		String strCSD1 = objCardiacRhythms_CID3415.getCodingSchemeDesignator();
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_VitalSigns.CARDIAC_RHYTHM.getValue();
		String strCodeValue = EnumCV_VitalSigns.CARDIAC_RHYTHM_8884_9.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.LN.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 , strCSD2, strCV, strCSD1, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Respiration Rhythm.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumRespirationRhythms value for Respiration Rhythm
	 */
	public void setRespirationRhythm(int[] arrPosition, EnumCM_RespirationRhythms enumRespirationRhythms)
	{
		/**
		 * Sets the value for template object.
		 */
		if(null== this.objRespirationRhythms_CID3416)
	this.objRespirationRhythms_CID3416 = new RespirationRhythms_CID3416();
		this.objRespirationRhythms_CID3416.setRespirationRhythms(enumRespirationRhythms);
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = objRespirationRhythms_CID3416.getCodeMeaning();
		String strCV = objRespirationRhythms_CID3416.getCodeValue();
		String strCSD1 = objRespirationRhythms_CID3416.getCodingSchemeDesignator();
		String strSNOMEDCTID = objRespirationRhythms_CID3416.getSNOMEDCTID();
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_VitalSigns.RESPIRATION_RHYTHM.getValue();
		String strCodeValue = EnumCV_VitalSigns.RESPIRATION_RHYTHM_9304_7.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.LN.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 , strCSD2, strCV, strCSD1, "", strCM,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}
}
