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

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.PrimaryCauseOfDeath_CID3733;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ProcedureUrgency_CID3414;
import cdac.medinfo.sdk.dcm30_04.templates.cid.YesNo_CID230;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DischargeSummaryCath;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PrimaryCauseOfDeath;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ProcedureUrgency;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_YesNo;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_DischargeSummaryCath;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents DischargeSummaryCath - TID3828
 */
public class DischargeSummaryCath_TID3828 extends Template
{
	/**
	 * Object of ProcedureUrgency_CID3414
	 */
	private ProcedureUrgency_CID3414 objProcedureUrgencyCID3414;

	/**
	 * Object of PrimaryCauseOfDeath_CID3733
	 */
	private PrimaryCauseOfDeath_CID3733 objPrimaryCauseOfDeathCID3733;

	/**
	 * Object of YesNo_CID230
	 */
	private YesNo_CID230 objYesNoCID230;

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

	/**
	 * Sets the value for Discharge Summary
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setDischargeSummary(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.DISCHARGE_SUMMARY.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.DISCHARGE_SUMMARY_121115.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 Discharge DateTime.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDischargeDateTime String value for DateTime of Intervention
	 */
	public void setDischargeDateTime(int[] arrPosition, String strDischargeDateTime)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.DISCHARGE_DATETIME.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.DISCHARGE_DATETIME_122163.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type DATETIME and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createDateTimeNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strDischargeDateTime);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Coronary Artery Bypass During This Admission.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumYesNo Enum value for Yes-No.
	 */
	public void setCoronaryArteryBypassDuringThisAdmission(int[] arrPosition, EnumCM_YesNo enumYesNo)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objYesNoCID230)
			this.objYesNoCID230 = new YesNo_CID230();
		this.objYesNoCID230.setYesNo(enumYesNo);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.CORONARY_ARTERY_BYPASS_DURING_THIS_ADMISSION.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.CORONARY_ARTERY_BYPASS_DURING_THIS_ADMISSION_122164.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,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Procedure Datetime.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strProcedureDatetime String value for DateTime of Intervention
	 */
	public void setProcedureDatetime(int[] arrPosition, String strProcedureDatetime)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.PROCEDURE_DATETIME.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.PROCEDURE_DATETIME_122146.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type DATETIME and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createDateTimeNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strProcedureDatetime);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Death During This Admission.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumYesNo Enum value for Yes-No.
	 */
	public void setDeathDuringThisAdmission(int[] arrPosition, EnumCM_YesNo enumYesNo)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objYesNoCID230)
			this.objYesNoCID230 = new YesNo_CID230();
		this.objYesNoCID230.setYesNo(enumYesNo);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.DEATH_DURING_THIS_ADMISSION.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.DEATH_DURING_THIS_ADMISSION_122166.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,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Date of Death.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDateOfDeath String value for DateTime of Intervention
	 */
	public void setDateOfDeath(int[] arrPosition, String strDateOfDeath)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.DATE_OF_DEATH.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.DATE_OF_DEATH_122165.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type DATETIME and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createDateTimeNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strDateOfDeath);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Procedure Priority.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumProcedureUrgency Enum value for ProcedureUrgency
	 */
	public void setProcedurePriority(int[] arrPosition, EnumCM_ProcedureUrgency enumProcedureUrgency)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objProcedureUrgencyCID3414)
			this.objProcedureUrgencyCID3414 = new ProcedureUrgency_CID3414();
		this.objProcedureUrgencyCID3414.setProcedureUrgency(enumProcedureUrgency);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.PROCEDURE_PRIORITY.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.PROCEDURE_PRIORITY_G_C09C.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.SRT.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);
	}

	/**
	 * Sets the value for Primary Cause of Death.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumPrimaryCauseOfDeath Enum value for PrimaryCauseOfDeath
	 */
	public void setPrimaryCauseOfDeath(int[] arrPosition, EnumCM_PrimaryCauseOfDeath enumPrimaryCauseOfDeath)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objPrimaryCauseOfDeathCID3733)
			this.objPrimaryCauseOfDeathCID3733 = new PrimaryCauseOfDeath_CID3733();
		this.objPrimaryCauseOfDeathCID3733.setPrimaryCauseOfDeath(enumPrimaryCauseOfDeath);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.PROCEDURE_PRIORITY.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.PROCEDURE_PRIORITY_G_C09C.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.SRT.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 Death During Catheterization.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumYesNo Enum value for Yes-No.
	 */
	public void setDeathDuringCatheterization(int[] arrPosition, EnumCM_YesNo enumYesNo)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objYesNoCID230)
			this.objYesNoCID230 = new YesNo_CID230();
		this.objYesNoCID230.setYesNo(enumYesNo);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = this.objYesNoCID230.getCodeMeaning();
		String strCV = this.objYesNoCID230.getCodeValue();
		String strCSD1 = this.objYesNoCID230.getCodingSchemeDesignator();
		String strSNOMEDCTID = objYesNoCID230.getSNOMEDCTID();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.DEATH_DURING_CATHETERIZATION.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.DEATH_DURING_CATHETERIZATION_122167.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,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Summary
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strSummary String value for Summary.
	 */
	public void setSummary(int[] arrPosition, String strSummary)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DischargeSummaryCath.SUMMARY.getValue();
		String strCodeValue = EnumCV_DischargeSummaryCath.SUMMARY_121111.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, strSummary);
		getSRTree().addChild(objContentSequenceItem);
	}
}
