/*******************************************************************************
 *  Copyright 2017-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.echocardiographyprocedurereport;

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CardiacPhase_CID12233;
import cdac.medinfo.sdk.dcm30_04.templates.cid.EchocardiographyImageView_CID12226;
import cdac.medinfo.sdk.dcm30_04.templates.cid.FlowDirection_CID12221;
import cdac.medinfo.sdk.dcm30_04.templates.cid.RespirationState_CID12234;
import cdac.medinfo.sdk.dcm30_04.templates.cid.UltrasoundImageModes_CID12224;
import cdac.medinfo.sdk.dcm30_04.templates.cid.UltrasoundProtocolStageTypes_CID12002;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CardiacPhase;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_EchoMeasurement;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_EchocardiographyImageView;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_FlowDirection;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RespirationState;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_UltrasoundImageModes;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_UltrasoundProtocolStageTypes;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_EchoMeasurement;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Measurement_TID300;
//import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.ObservationContext_TID1001;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents EchoMeasurement - TID5203
 */
public class EchoMeasurement_TID5203 extends Template
{
	/**
	 * Object of Measurement_TID300
	 */
	private Measurement_TID300 objMeasurementTID300;
	/**
	 * Object of UltrasoundImageModes_CID12224
	 */
	private UltrasoundImageModes_CID12224 objUltrasoundImageModesCID12224;

	/**
	 * Object of EchocardiographyImageView_CID12226
	 */
	private EchocardiographyImageView_CID12226 objEchocardiographyImageViewCID12226;
	/**
	 * Object of UltrasoundProtocolStageTypes_CID12002
	 */
	private UltrasoundProtocolStageTypes_CID12002 objUltrasoundProtocolStageTypesCID12002;

	/**
	 * Object of FlowDirection_CID12221
	 */
	private FlowDirection_CID12221 objFlowDirectionCID12221;

	/**
	 * Object of RespirationState_CID12234
	 */
	private RespirationState_CID12234 objRespirationStateCID12234;

	/**
	 * Object of CardiacPhase_CID12233
	 */
	private CardiacPhase_CID12233 objCardiacPhaseCID12233;

	/**
	 * Instantiates EchoMeasurement_TID5203 Template.
	 * @param objTree Object of SRTree.
	 */
	public EchoMeasurement_TID5203(SRTree objTree)
	{
		super(objTree);
	}
	
	/**
	 * Retrieves the object of Measurement_TID300
	 * @return objMeasurementTID300 Object of Measurement_TID300.
	 */
	public Measurement_TID300 getMeasurement() 
	{
		if(null == objMeasurementTID300)
			objMeasurementTID300 = new Measurement_TID300(getSRTree());
		return objMeasurementTID300;
	}
	/**
	 * Sets value for Flow Direction.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumFlowDirection Enumerated value for FlowDirection
	 */
	public void setFlowDirection(int[] arrPosition, EnumCM_FlowDirection enumFlowDirection)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchoMeasurement.FLOW_DIRECTION.getValue();
		String strCodeValue = EnumCV_EchoMeasurement.FLOW_DIRECTION_G_C048.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objFlowDirectionCID12221)
			this.objFlowDirectionCID12221 = new FlowDirection_CID12221();
		this.objFlowDirectionCID12221.setFlowDirection(enumFlowDirection);

		String strCM = objFlowDirectionCID12221.getCodeMeaning();
		String strCV = objFlowDirectionCID12221.getCodeValue();
		String strCSD = objFlowDirectionCID12221.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);
	}
	/**
	 * Sets value for Stage.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumUltrasoundProtocolStageTypes Enumerated value for UltrasoundProtocolStageTypes
	 */
	public void setStage(int[] arrPosition, EnumCM_UltrasoundProtocolStageTypes enumUltrasoundProtocolStageTypes)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchoMeasurement.STAGE.getValue();
		String strCodeValue = EnumCV_EchoMeasurement.STAGE_18139_6.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.LN.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objUltrasoundProtocolStageTypesCID12002)
			this.objUltrasoundProtocolStageTypesCID12002 = new UltrasoundProtocolStageTypes_CID12002();
		this.objUltrasoundProtocolStageTypesCID12002.setUltrasoundProtocolStageTypes(enumUltrasoundProtocolStageTypes);

		String strCM = objUltrasoundProtocolStageTypesCID12002.getCodeMeaning();
		String strCV = objUltrasoundProtocolStageTypesCID12002.getCodeValue();
		String strCSD = objUltrasoundProtocolStageTypesCID12002.getCodingSchemeDesignator();
		String strSNOMEDCTID = objUltrasoundProtocolStageTypesCID12002.getSNOMEDCTID();

		/**
		 * 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,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets value for Respiratory Cycle Point.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumRespirationState Enumerated value for RespirationState
	 */
	public void setRespiratoryCyclePoint(int[] arrPosition, EnumCM_RespirationState enumRespirationState)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchoMeasurement.RESPIRATORY_CYCLE_POINT.getValue();
		String strCodeValue = EnumCV_EchoMeasurement.RESPIRATORY_CYCLE_POINT_R_40899.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objRespirationStateCID12234)
			this.objRespirationStateCID12234 = new RespirationState_CID12234();
		this.objRespirationStateCID12234.setRespirationState(enumRespirationState);

		String strCM = objRespirationStateCID12234.getCodeMeaning();
		String strCV = objRespirationStateCID12234.getCodeValue();
		String strCSD = objRespirationStateCID12234.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);
	}

	/**
	 * Sets value for Cardiac Cycle Point.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCardiacPhase Enumerated value for CardiacPhase
	 */
	public void setCardiacCyclePoint(int[] arrPosition, EnumCM_CardiacPhase enumCardiacPhase)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchoMeasurement.CARDIAC_CYCLE_POINT.getValue();
		String strCodeValue = EnumCV_EchoMeasurement.CARDIAC_CYCLE_POINT_R_4089A.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objCardiacPhaseCID12233)
			this.objCardiacPhaseCID12233 = new CardiacPhase_CID12233();
		this.objCardiacPhaseCID12233.setCardiacPhase(enumCardiacPhase);

		String strCM = objCardiacPhaseCID12233.getCodeMeaning();
		String strCV = objCardiacPhaseCID12233.getCodeValue();
		String strCSD = objCardiacPhaseCID12233.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);
	}

	/**
	 * Sets value for Image Mode.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumUltrasoundImageModes Enumerated value for UltrasoundImageModes
	 */
	public void setImageMode(int[] arrPosition, EnumCM_UltrasoundImageModes enumUltrasoundImageModes)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchoMeasurement.IMAGE_MODE.getValue();
		String strCodeValue = EnumCV_EchoMeasurement.IMAGE_MODE_G_0373.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objUltrasoundImageModesCID12224)
			this.objUltrasoundImageModesCID12224 = new UltrasoundImageModes_CID12224();
		this.objUltrasoundImageModesCID12224.setUltrasoundImageModes(enumUltrasoundImageModes);

		String strCM = objUltrasoundImageModesCID12224.getCodeMeaning();
		String strCV = objUltrasoundImageModesCID12224.getCodeValue();
		String strCSD = objUltrasoundImageModesCID12224.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);
	}

	/**
	 * Sets value for Image View.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumEchocardiographyImageView Enumerated value for EchocardiographyImageView
	 */
	public void setImageView(int[] arrPosition, EnumCM_EchocardiographyImageView enumEchocardiographyImageView)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_EchoMeasurement.IMAGE_VIEW.getValue();
		String strCodeValue = EnumCV_EchoMeasurement.IMAGE_VIEW_111031.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objEchocardiographyImageViewCID12226)
			this.objEchocardiographyImageViewCID12226 = new EchocardiographyImageView_CID12226();
		this.objEchocardiographyImageViewCID12226.setEchocardiographyImageView(enumEchocardiographyImageView);

		String strCM = objEchocardiographyImageViewCID12226.getCodeMeaning();
		String strCV = objEchocardiographyImageViewCID12226.getCodeValue();
		String strCSD = objEchocardiographyImageViewCID12226.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);
	}
}
