/*******************************************************************************
 *  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.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.HemodynamicMeasurementPhase_CID3651;
import cdac.medinfo.sdk.dcm30_04.templates.ecgreporttemplates.ECGLeadMeasurements_TID3714;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_HemodynamicMeasurementPhase;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_HemodynamicsMeasurementGroup;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_HemodynamicsMeasurementGroup;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents HemodynamicsMeasurementGroup - TID3501
 */
public class HemodynamicsMeasurementGroup_TID3501 extends Template
{
	/**
	 * Object of HemodynamicClinicalContext_TID3520
	 */

	private HemodynamicClinicalContext_TID3520 objHemodynamicClinicalContextTID3520;

	/**
	 * Object of HemodynamicMeasurementPhase_CID3651
	 */
	private HemodynamicMeasurementPhase_CID3651 objHemodynamicMeasurementPhaseCID3651;

	/**
	 * Object of VitalSigns_TID3510
	 */

	private VitalSigns_TID3510 objVitalSignsTID3510;

	/**
	 * Object of ArterialPressureMeasurement_TID3504
	 */

	private ArterialPressureMeasurement_TID3504 objArterialPressureMeasurementTID3504;

	/**
	 * Object of VenousPressureMeasurement_TID3506
	 */

	private VenousPressureMeasurement_TID3506 objVenousPressureMeasurementTID3506;

	/**
	 * Object of VentricularPressureMeasurement_TID3507
	 */

	private VentricularPressureMeasurement_TID3507 objVentricularPressureMeasurementTID3507;

	/**
	 * Object of GradientMeasurement_TID3508
	 */

	private GradientMeasurement_TID3508 objGradientMeasurementTID3508;

	/**
	 * Object of BloodVelocityMeasurement_TID3509
	 */

	private BloodVelocityMeasurement_TID3509 objBloodVelocityMeasurementTID3509;

	/**
	 * Object of CardiacOutputMeasurementByIndicatorDilution_TID3515
	 */

	private CardiacOutputMeasurementByIndicatorDilution_TID3515 objCardiacOutputMeasurementByIndicatorDilutionTID3515;
	
	/**
	 * Object of BloodLabMeasurements_TID3516
	 */
	private BloodLabMeasurements_TID3516 objBloodLabMeasurementsTID3516;
	
	/**
	 * Object of DerivedHemodynamicMeasurements_TID3560
	 */
	private DerivedHemodynamicMeasurements_TID3560 objDerivedHemodynamicMeasurementsTID3560;
	
	/**
	 * Object of ECGLeadMeasurements_TID3714
	 */
	private ECGLeadMeasurements_TID3714 objECGLeadMeasurementsTID3714;
	
	/**
	 * Instantiates a new HemodynamicsMeasurementGroup_TID3501 Template.
	 * @param objTree Object of SRTree.
	 */
	public HemodynamicsMeasurementGroup_TID3501(SRTree objTree)
	{
		super(objTree);
	}

	/**
	 * Retrieves HemodynamicClinicalContext 
	 * @return objHemodynamicClinicalContextTID3520 Object of HemodynamicClinicalContext_TID3520 
	 */
	public HemodynamicClinicalContext_TID3520 getHemodynamicClinicalContext() 
	{
		if(null == this.objHemodynamicClinicalContextTID3520)
			this.objHemodynamicClinicalContextTID3520 = new HemodynamicClinicalContext_TID3520(getSRTree());
		return this.objHemodynamicClinicalContextTID3520;
	}

	/**
	 * Retrieves ECG Lead Measurements
	 * @return objECGLeadMeasurementsTID3714 Object of ECGLeadMeasurements_TID3714 
	 */
	public ECGLeadMeasurements_TID3714 getECGLeadMeasurements() 
	{
		if(null == this.objECGLeadMeasurementsTID3714)
			this.objECGLeadMeasurementsTID3714 = new ECGLeadMeasurements_TID3714(getSRTree());
		return this.objECGLeadMeasurementsTID3714;
	}
	/**
	 * Retrieves DerivedHemodynamicMeasurements
	 * @return objDerivedHemodynamicMeasurementsTID3560 Object of DerivedHemodynamicMeasurements_TID3560 
	 */
	public DerivedHemodynamicMeasurements_TID3560 getDerivedHemodynamicMeasurements() 
	{
		if(null == this.objDerivedHemodynamicMeasurementsTID3560)
			this.objDerivedHemodynamicMeasurementsTID3560 = new DerivedHemodynamicMeasurements_TID3560(getSRTree());
		return this.objDerivedHemodynamicMeasurementsTID3560;
	}
	/**
	 * Retrieves BloodLabMeasurements
	 * @return objBloodLabMeasurementsTID3516 Object of BloodLabMeasurements_TID3516 
	 */
	public BloodLabMeasurements_TID3516 getBloodLabMeasurements()
	{
		if(null == this.objBloodLabMeasurementsTID3516)
			this.objBloodLabMeasurementsTID3516 = new BloodLabMeasurements_TID3516(getSRTree());
		return this.objBloodLabMeasurementsTID3516;
	}
	
	/**
	 * Retrieves VitalSigns 
	 * @return objVitalSignsTID3510 Object of VitalSigns_TID3510 
	 */
	public VitalSigns_TID3510 getVitalSigns() 
	{
		if(null == this.objVitalSignsTID3510)
			this.objVitalSignsTID3510 = new VitalSigns_TID3510(getSRTree());
		return this.objVitalSignsTID3510;
	}

	/**
	 * Retrieves ArterialPressureMeasurement 
	 * @return objArterialPressureMeasurementTID3504 Object of ArterialPressureMeasurement_TID3504 
	 */
	public ArterialPressureMeasurement_TID3504 getArterialPressureMeasurement() 
	{
		if(null == this.objArterialPressureMeasurementTID3504)
			this.objArterialPressureMeasurementTID3504 = new ArterialPressureMeasurement_TID3504(getSRTree());
		return this.objArterialPressureMeasurementTID3504;
	}

	/**
	 * Retrieves VenousPressureMeasurement 
	 * @return objVenousPressureMeasurementTID3506 Object of VenousPressureMeasurement_TID3506 
	 */
	public VenousPressureMeasurement_TID3506 getVenousPressureMeasurement() 
	{
		if(null == this.objVenousPressureMeasurementTID3506)
			this.objVenousPressureMeasurementTID3506 = new VenousPressureMeasurement_TID3506(getSRTree());
		return this.objVenousPressureMeasurementTID3506;
	}

	/**
	 * Retrieves VentricularPressureMeasurement 
	 * @return objVentricularPressureMeasurementTID3507 Object of VentricularPressureMeasurement_TID3507 
	 */
	public VentricularPressureMeasurement_TID3507 getVentricularPressureMeasurement() 
	{
		if(null == this.objVentricularPressureMeasurementTID3507)
			this.objVentricularPressureMeasurementTID3507 = new VentricularPressureMeasurement_TID3507(getSRTree());
		return this.objVentricularPressureMeasurementTID3507;
	}

	/**
	 * Retrieves GradientMeasurement 
	 * @return objGradientMeasurementTID3508 Object of GradientMeasurement_TID3508 
	 */
	public GradientMeasurement_TID3508 getGradientMeasurement() 
	{
		if(null == this.objGradientMeasurementTID3508)
			this.objGradientMeasurementTID3508 = new GradientMeasurement_TID3508(getSRTree());
		return this.objGradientMeasurementTID3508;
	}

	/**
	 * Retrieves BloodVelocityMeasurement 
	 * @return objBloodVelocityMeasurementTID3509 Object of BloodVelocityMeasurement_TID3509 
	 */
	public BloodVelocityMeasurement_TID3509 getBloodVelocityMeasurement() 
	{
		if(null == this.objBloodVelocityMeasurementTID3509)
			this.objBloodVelocityMeasurementTID3509 = new BloodVelocityMeasurement_TID3509(getSRTree());
		return this.objBloodVelocityMeasurementTID3509;
	}

	/**
	 * Retrieves CardiacOutputMeasurementByIndicatorDilution 
	 * @return objCardiacOutputMeasurementByIndicatorDilutionTID3515 Object of CardiacOutputMeasurementByIndicatorDilution_TID3515 
	 */
	public CardiacOutputMeasurementByIndicatorDilution_TID3515 getCardiacOutputMeasurementByIndicatorDilution() 
	{
		if(null == this.objCardiacOutputMeasurementByIndicatorDilutionTID3515)
			this.objCardiacOutputMeasurementByIndicatorDilutionTID3515 = new CardiacOutputMeasurementByIndicatorDilution_TID3515(getSRTree());
		return this.objCardiacOutputMeasurementByIndicatorDilutionTID3515;
	}

	/**
	 * Sets the value for Catheterization Procedure Phase
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 * @param enumHemodynamicMeasurementPhase Enumerated value for Hemodynamic Measurement Phase
	 */
	public void setCatheterizationProcedurePhase(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent, EnumCM_HemodynamicMeasurementPhase enumHemodynamicMeasurementPhase)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_HemodynamicsMeasurementGroup.CATHETERIZATION_PROCEDURE_PHASE.getValue();
		String strCodeValue = EnumCV_HemodynamicsMeasurementGroup.CATHETERIZATION_PROCEDURE_PHASE_G_72BB.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objHemodynamicMeasurementPhaseCID3651)
			this.objHemodynamicMeasurementPhaseCID3651 = new HemodynamicMeasurementPhase_CID3651();
		this.objHemodynamicMeasurementPhaseCID3651.setHemodynamicMeasurementPhase(enumHemodynamicMeasurementPhase);

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

		/**
		 * Creating a node of Value Type UIDREF and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strCV, strCSDesg, "", strCM,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for ProcedureActionID.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strProcedureActionID String value for Procedure Action ID
	 */
	public void setProcedureActionID(int[] arrPosition, String strProcedureActionID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_HemodynamicsMeasurementGroup.PROCEDURE_ACTION_ID.getValue();
		String strCodeValue = EnumCV_HemodynamicsMeasurementGroup.PROCEDURE_ACTION_ID_121124.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, strProcedureActionID);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Findings.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strProcedureActionID String value for Procedure Action ID
	 * @param enumContinuityOfContent 
	 */
	public void setFindings(int[] arrPosition, String strProcedureActionID, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_HemodynamicsMeasurementGroup.FINDINGS.getValue();
		String strCodeValue = EnumCV_HemodynamicsMeasurementGroup.FINDINGS_121070.getValue();
		String strCSD = 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, strCSD, enumContinuityOfContent);
		getSRTree().addChild(objContentSequenceItem);
	}
}
