/*******************************************************************************
 *  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.Diagnosis_CID3673;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ECGPatientStateValues_CID3262;
import cdac.medinfo.sdk.dcm30_04.templates.cid.Pacemakers_CID3672;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ReasonForECGExam_CID3671;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ClinicalContextECG;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Diagnosis;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ECGPatientStateValues;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_NoBCIDSpecified;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Pacemakers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ReasonForECGExam;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_ClinicalContextECG;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents ClinicalContextECG - TID3701
 */
public class ClinicalContextECG_TID3701 extends Template
{
	/**
	 * Object of ReasonForECGExam_CID3671
	 */
	private ReasonForECGExam_CID3671 objReasonForECGExamCID3671;

	/**
	 * Object of ECGPatientStateValues_CID3262
	 */
	private ECGPatientStateValues_CID3262 objPatientStateValuesCID3262;

	/**
	 * Object of Pacemakers_CID3672
	 */
	private Pacemakers_CID3672 objPacemakersCID3672;

	/**
	 * Object of Diagnosis_CID3673
	 */
	private Diagnosis_CID3673 objDiagnosisCID3673;

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

	/**
	 * Sets the value for Clinical Context
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setClinicalContext(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.CLINICAL_CONTEXT.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.CLINICAL_CONTEXT_122127.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 Reason for Exam.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumReasonForECGExam Enumerated value for value for Reason for Exam
	 */
	public void setReasonForExam(int[] arrPosition, EnumCM_ReasonForECGExam enumReasonForECGExam)
	{
		/**
		 * Sets the value for Subject Sex which follows the template CID7455
		 */
		if(null== this.objReasonForECGExamCID3671)
			this.objReasonForECGExamCID3671 = new ReasonForECGExam_CID3671();
		this.objReasonForECGExamCID3671.setReasonForECGExam(enumReasonForECGExam);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.REASON_FOR_EXAM.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.REASON_FOR_EXAM_122139.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, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for ReasonForExam
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strReasonForExam String value for ReasonForExam.
	 */
	public void setReasonForExam(int[] arrPosition, String strReasonForExam)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.REASON_FOR_EXAM.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.REASON_FOR_EXAM_122139.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, strReasonForExam);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Patient State.
	 * @param arrPosition  arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumECGPatientStateValues Enum value for ECGPatientStateValues
	 */
	public void setPatientState(int[] arrPosition, EnumCM_ECGPatientStateValues enumECGPatientStateValues)
	{
		/**
		 * Sets the value for ProcedureIntent.
		 */
		if(null== this.objPatientStateValuesCID3262)
			this.objPatientStateValuesCID3262 = new ECGPatientStateValues_CID3262();
		this.objPatientStateValuesCID3262.setECGPatientStateValues(enumECGPatientStateValues);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.PATIENT_STATE.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.PATIENT_STATE_109054.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 Regular Medication.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setRegularMedication(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = EnumCM_NoBCIDSpecified.NO_VALUE.getValue();
		String strCV = EnumCM_NoBCIDSpecified.NO_VALUE.getValue();
		String strCSD1 = EnumCodingSchemeDesignator.NO_VALUE.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.REGULAR_MEDICATION.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.REGULAR_MEDICATION_G_02D0.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, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for RegularMedication
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strRegularMedication String value for RegularMedication.
	 */
	public void setRegularMedication(int[] arrPosition, String strRegularMedication)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.REGULAR_MEDICATION.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.REGULAR_MEDICATION_G_02D0.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, strRegularMedication);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Pacemaker in situ.
	 * @param arrPosition  arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumPacemakers Enum value for Pacemakers
	 */
	public void setPacemakerInSitu(int[] arrPosition, EnumCM_Pacemakers enumPacemakers)
	{
		/**
		 * Sets the value for ProcedureIntent.
		 */
		if(null== this.objPacemakersCID3672)
			this.objPacemakersCID3672 = new Pacemakers_CID3672();
		this.objPacemakersCID3672.setPacemakers(enumPacemakers);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.PACEMAKER_IN_SITU.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.PACEMAKER_IN_SITU_G_02EC.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 PacemakerInSitu
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strPacemakerInSitu String value for PacemakerInSitu.
	 */
	public void setPacemakerInSitu(int[] arrPosition, String strPacemakerInSitu)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.PACEMAKER_IN_SITU.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.PACEMAKER_IN_SITU_G_02EC.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, strPacemakerInSitu);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for History.
	 * @param arrPosition  arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumDiagnosis Enum value for Diagnosis
	 */
	public void setHistory(int[] arrPosition, EnumCM_Diagnosis enumDiagnosis)
	{
		/**
		 * Sets the value for ProcedureIntent.
		 */
		if(null== this.objDiagnosisCID3673)
			this.objDiagnosisCID3673 = new Diagnosis_CID3673();
		this.objDiagnosisCID3673.setDiagnosis(enumDiagnosis);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.HISTORY.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.HISTORY_121060.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 History
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strHistory String value for History.
	 */
	public void setHistory(int[] arrPosition, String strHistory)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ClinicalContextECG.HISTORY.getValue();
		String strCodeValue = EnumCV_ClinicalContextECG.HISTORY_121060.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, strHistory);
		getSRTree().addChild(objContentSequenceItem);
	}
}
