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

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.ECGLeadNoiseDescriptions_CID3680;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ECGLeadNoiseModifiers_CID3681;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ECGLeads_CID3001;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ECGMorphologyDescriptions_CID3679;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ElectrophysiologyWaveformDurations_CID3687;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ElectrophysiologyWaveformVoltages_CID3688;
import cdac.medinfo.sdk.dcm30_04.templates.cid.STSegmentMorpholog_CID3233;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ECGLeadMeasurements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ECGLeadNoiseDescriptions;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ECGLeadNoiseModifiers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ECGLeads;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ECGMorphologyDescriptions;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ElectrophysiologyWaveformDurations;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ElectrophysiologyWaveformVoltages;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_OrganDoseTemplates;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RadiosensitiveOrgans;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_STSegmentMorpholog;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_ECGLeadMeasurements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_OrganDoseTemplates;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents ECGLeadMeasurements - TID3714
 */
public class ECGLeadMeasurements_TID3714 extends Template
{
	/**
	 * Object of ECGLeadNoiseDescriptions_CID3680
	 */
	private ECGLeadNoiseDescriptions_CID3680 objECGLeadNoiseDescriptions_CID3680;


	/**
	 * Object of ECGLeads_CID3001
	 */
	private ECGLeads_CID3001 objLeads_CID3001;
	
	/**
	 * Object of ECGMeasurementSource_TID3715
	 */

	private ECGMeasurementSource_TID3715 objMeasurementSourceTID3715;

	/**
	 * Object of ElectrophysiologyWaveformDurations_CID3687
	 */
	private ElectrophysiologyWaveformDurations_CID3687 objElectrophysiologyWaveformDurationsCID3687;

	/**
	 * Object of ElectrophysiologyWaveformVoltages_CID3688
	 */
	private ElectrophysiologyWaveformVoltages_CID3688 objElectrophysiologyWaveformVoltagesCID3688;

	private STSegmentMorpholog_CID3233 objSTSegmentMorpholog_CID3233;

	/**
	 * Instantiates a new ECGLeadMeasurements_TID3714 Template.
	 * @param objTree Object of SRTree.
	 */
	public ECGLeadMeasurements_TID3714(SRTree objTree)
	{
		super(objTree);
	}

	/**
	 * Retrieves ECGMeasurementSource 
	 * @return objMeasurementSourceTID3715 Object of ECGMeasurementSource_TID3715 
	 */
	public ECGMeasurementSource_TID3715 getECGMeasurementSource() 
	{
		if(null == this.objMeasurementSourceTID3715)
			this.objMeasurementSourceTID3715 = new ECGMeasurementSource_TID3715(getSRTree());
		return this.objMeasurementSourceTID3715;
	}

	/**
	 * Sets the value for ECG Lead Measurements
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setECGLeadMeasurements(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ECGLeadMeasurements.ECG_LEAD_MEASUREMENTS.getValue();
		String strCodeValue = EnumCV_ECGLeadMeasurements.ECG_LEAD_MEASUREMENTS_122159.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.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 Lead ID.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumECGLeads Enum value for ECG Leads
	 */
	public void setLeadID(int[] arrPosition, EnumCM_ECGLeads enumECGLeads)
	{
		/**
		 * Sets the value for InterventionActionsAndStatus.
		 */
		if(null== this.objLeads_CID3001)
			this.objLeads_CID3001 = new ECGLeads_CID3001();
		this.objLeads_CID3001.setECGLeads(enumECGLeads);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = this.objLeads_CID3001.getCodeMeaning();
		String strCV = this.objLeads_CID3001.getCodeValue();
		String strCSD1 = this.objLeads_CID3001.getCodingSchemeDesignator();
		String strCSV = this.objLeads_CID3001.getCodingSchemeVersion();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ECGLeadMeasurements.LEAD_ID.getValue();
		String strCodeValue = EnumCV_ECGLeadMeasurements.LEAD_ID_122148.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.DCM.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, strCSV, strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for ElectrophysiologyWaveformDurations.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 * @param enumElectrophysiologyWaveformDurations Enum value for ElectrophysiologyWaveformDurations
	 */
	public void setElectrophysiologyWaveformDurations(int[] arrPosition,String[] arrNumericValue, EnumCM_ElectrophysiologyWaveformDurations enumElectrophysiologyWaveformDurations)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.MS.getValue();
		String strCVForUnit = EnumCV_Unit.MS.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objElectrophysiologyWaveformDurationsCID3687)
			this.objElectrophysiologyWaveformDurationsCID3687 = new ElectrophysiologyWaveformDurations_CID3687();
		this.objElectrophysiologyWaveformDurationsCID3687.setElectrophysiologyWaveformDurations(enumElectrophysiologyWaveformDurations);

		String strCodeMeaning = objElectrophysiologyWaveformDurationsCID3687.getCodeMeaning();
		String strCodeValue = objElectrophysiologyWaveformDurationsCID3687.getCodeValue();
		String strCSD = objElectrophysiologyWaveformDurationsCID3687.getCodingSchemeDesignator();

		String strCSV = objElectrophysiologyWaveformDurationsCID3687.getCodingSchemeVersion();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,strCSV,strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for ElectrophysiologyWaveformVoltages.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Numeric Value.
	 * @param enumEnumCM_ElectrophysiologyWaveformVoltages Enum value for EnumCM_ElectrophysiologyWaveformVoltages
	 */
	public void setElectrophysiologyWaveformVoltages(int[] arrPosition,String[] arrNumericValue, EnumCM_ElectrophysiologyWaveformVoltages enumElectrophysiologyWaveformVoltages)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.MV.getValue();
		String strCVForUnit = EnumCV_Unit.MV.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objElectrophysiologyWaveformVoltagesCID3688)
			this.objElectrophysiologyWaveformVoltagesCID3688 = new ElectrophysiologyWaveformVoltages_CID3688();
		this.objElectrophysiologyWaveformVoltagesCID3688.setElectrophysiologyWaveformVoltages(enumElectrophysiologyWaveformVoltages);

		String strCodeMeaning = objElectrophysiologyWaveformVoltagesCID3688.getCodeMeaning();
		String strCodeValue = objElectrophysiologyWaveformVoltagesCID3688.getCodeValue();
		String strCSD = objElectrophysiologyWaveformVoltagesCID3688.getCodingSchemeDesignator();

		String strCSV = objElectrophysiologyWaveformVoltagesCID3688.getCodingSchemeVersion();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,strCSV,strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setSTSegmentFinding(int[] arrPosition,EnumCM_STSegmentMorpholog enumSTSegmentMorpholog)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ECGLeadMeasurements.ST_SEGMENT_FINDING.getValue();
		String strCodeValue = EnumCM_ECGLeadMeasurements.ST_SEGMENT_FINDING.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
		String strCM,strCV,strCSD,strSNMDCTID;
		if(null== this.objSTSegmentMorpholog_CID3233)
			this.objSTSegmentMorpholog_CID3233 = new STSegmentMorpholog_CID3233();
		this.objSTSegmentMorpholog_CID3233.setSTSegmentMorpholog(enumSTSegmentMorpholog);
		
		 strCM = objSTSegmentMorpholog_CID3233.getCodeMeaning();
		 strCV = objSTSegmentMorpholog_CID3233.getCodeValue();
		 strCSD = objSTSegmentMorpholog_CID3233.getCodingSchemeDesignator();
		 strSNMDCTID = objSTSegmentMorpholog_CID3233.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,strSNMDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	public void setFinding(int[] arrPosition,EnumCM_ECGLeadNoiseDescriptions enumECGLeadNoiseDescriptions)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ECGLeadMeasurements.FINDING.getValue();
		String strCodeValue = EnumCV_ECGLeadMeasurements.FINDING_121071.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
		String strCM,strCV,strCSD;
		if(null== this.objECGLeadNoiseDescriptions_CID3680)
			this.objECGLeadNoiseDescriptions_CID3680 = new ECGLeadNoiseDescriptions_CID3680();
		this.objECGLeadNoiseDescriptions_CID3680.setECGLeadNoiseDescriptions(enumECGLeadNoiseDescriptions);
		
		 strCM = objECGLeadNoiseDescriptions_CID3680.getCodeMeaning();
		 strCV = objECGLeadNoiseDescriptions_CID3680.getCodeValue();
		 strCSD = objECGLeadNoiseDescriptions_CID3680.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);
	}
}
