/*******************************************************************************
 *  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.CardiacHistoryDates_CID3720;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CathPatientHistory_CID3721;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CathPatientRiskFactors_CID3756;
import cdac.medinfo.sdk.dcm30_04.templates.cid.DiabeticTherapy_CID3722;
import cdac.medinfo.sdk.dcm30_04.templates.cid.MITypes_CID3723;
import cdac.medinfo.sdk.dcm30_04.templates.cid.PresentAbsent_CID240;
import cdac.medinfo.sdk.dcm30_04.templates.cid.SmokingHistory_CID3724;
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_CardiacHistoryDates;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CathPatientHistory;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CathPatientRiskFactors;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DiabeticTherapy;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_MITypes;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PatientHistoryCath;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PresentAbsent;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PurposeOfReferenceToObject;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SmokingHistory;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_YesNo;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_PatientHistoryCath;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents PatientHistoryCath - TID3802
 */
public class PatientHistoryCath_TID3802 extends Template
{
	/**
	 * Object of SmokingHistory_CID3724
	 */
	private SmokingHistory_CID3724 objSmokingHistoryCID3724;

	/**
	 * Object of DiabeticTherapy_CID3722
	 */
	private DiabeticTherapy_CID3722 objDiabeticTherapyCID3722;

	/**
	 * Object of MITypes_CID3723
	 */
	private MITypes_CID3723 objMiTypesCID3723;

	/**
	 * Object of CardiacHistoryDates_CID3720
	 */
	private CardiacHistoryDates_CID3720 objCardiacHistoryDatesCID3720;

	/**
	 * Object of PresentAbsent_CID240
	 */
	private PresentAbsent_CID240 objPresentAbsentCID240;

	/**
	 * Object of CathPatientRiskFactors_CID3756
	 */
	private CathPatientRiskFactors_CID3756 objPatientRiskFactorsCID3756;

	/**
	 * Object of CathPatientHistory_CID3721
	 */
	private CathPatientHistory_CID3721 objCathPatientHistoryCID3721;

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

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

	/**
	 * Sets the value for History
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setHistory(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PatientHistoryCath.HISTORY.getValue();
		String strCodeValue = EnumCV_PatientHistoryCath.HISTORY_121060.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 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_PatientHistoryCath.HISTORY.getValue();
		String strCodeValue = EnumCV_PatientHistoryCath.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);
	}

	/**
	 * Sets the value for Periprocedural MI occurred.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumYesNo Enum value for Yes-No.
	 * @param enumCathPatientHistory Enumerated value for CathPatientHistory
	 */
	public void setPeriproceduralMIOccurred(int[] arrPosition, EnumCM_YesNo enumYesNo,EnumCM_CathPatientHistory enumCathPatientHistory)
	{
		/**
		 * 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();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objCathPatientHistoryCID3721)
			this.objCathPatientHistoryCID3721 = new CathPatientHistory_CID3721();
		this.objCathPatientHistoryCID3721.setCathPatientHistory(enumCathPatientHistory);

		String strCodeMeaning = objCathPatientHistoryCID3721.getCodeMeaning();
		String strCodeValue = objCathPatientHistoryCID3721.getCodeValue();
		String strCSD2 = objCathPatientHistoryCID3721.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 , strCSD2, strCV, strCSD1, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for PresenceOfProperty.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumPresentAbsent Enum value of EnumCM_PresentAbsent
	 * @param enumCathPatientRiskFactors Enumerated value for CathPatientRiskFactors
	 */
	public void setPresenceOfProperty(int[] arrPosition, EnumCM_PresentAbsent enumPresentAbsent, EnumCM_CathPatientRiskFactors enumCathPatientRiskFactors)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objPatientRiskFactorsCID3756)
			this.objPatientRiskFactorsCID3756 = new CathPatientRiskFactors_CID3756();
		this.objPatientRiskFactorsCID3756.setCathPatientRiskFactors(enumCathPatientRiskFactors);

		String strCodeMeaning = objPatientRiskFactorsCID3756.getCodeMeaning();
		String strCodeValue = objPatientRiskFactorsCID3756.getCodeValue();
		String strCSDesg = objPatientRiskFactorsCID3756.getCodingSchemeDesignator();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objPresentAbsentCID240)
			this.objPresentAbsentCID240 = new PresentAbsent_CID240(); 
		objPresentAbsentCID240.setPresentAbsent(enumPresentAbsent);

		String strCM = objPresentAbsentCID240.getCodeMeaning();
		String strCV = objPresentAbsentCID240.getCodeValue();
		String strCSD = objPresentAbsentCID240.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 the value for CardiacHistoryDates
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strCardiacHistoryDates String value for CardiacHistoryDates.
	 * @param enumCardiacHistoryDates Enumerated value for enumCardiacHistoryDates
	 */
	public void setCardiacCardiacHistoryDatesDates(int[] arrPosition, String strCardiacHistoryDates, EnumCM_CardiacHistoryDates enumCardiacHistoryDates)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objCardiacHistoryDatesCID3720)
			this.objCardiacHistoryDatesCID3720 = new CardiacHistoryDates_CID3720();
		this.objCardiacHistoryDatesCID3720.setCardiacHistoryDates(enumCardiacHistoryDates);

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

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

	/**
	 * Sets the value for Previous Myocardial Infarction 1 week prior.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumYesNo Enum value for Yes-No.
	 */
	public void setPreviousMyocardialInfarctionOneWeekPrior(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();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PatientHistoryCath.PREVIOUS_MYOCARDIAL_INFARCTION_1_WEEK_PRIOR.getValue();
		String strCodeValue = EnumCV_PatientHistoryCath.PREVIOUS_MYOCARDIAL_INFARCTION_1_WEEK_PRIOR_36.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.NCDR.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 Type of Myocardial Infarction.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumMITypes Enum value for MITypes
	 */
	public void setTypeOfMyocardialInfarction(int[] arrPosition, EnumCM_MITypes enumMITypes)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objMiTypesCID3723)
			this.objMiTypesCID3723 = new MITypes_CID3723();
		this.objMiTypesCID3723.setMITypes(enumMITypes);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PatientHistoryCath.TYPE_OF_MYOCARDIAL_INFARCTION.getValue();
		String strCodeValue = EnumCV_PatientHistoryCath.TYPE_OF_MYOCARDIAL_INFARCTION_122170.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 forDiabetic Therapy.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumDiabeticTherapy Enum value for DiabeticTherapy
	 */
	public void setDiabeticTherapy(int[] arrPosition, EnumCM_DiabeticTherapy enumDiabeticTherapy)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objDiabeticTherapyCID3722)
			this.objDiabeticTherapyCID3722 = new DiabeticTherapy_CID3722();
		this.objDiabeticTherapyCID3722.setDiabeticTherapy(enumDiabeticTherapy);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PatientHistoryCath.DIABETIC_THERAPY.getValue();
		String strCodeValue = EnumCV_PatientHistoryCath.DIABETIC_THERAPY_31_1.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.NCDR.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 Lipid Lowering Therapy.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumYesNo Enum value for Yes-No.
	 */
	public void setLipidLoweringTherapy(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();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PatientHistoryCath.LIPID_LOWERING_THERAPY.getValue();
		String strCodeValue = EnumCV_PatientHistoryCath.LIPID_LOWERING_THERAPY_39_1.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.NCDR.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 Smoking History.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumSmokingHistory Enum value for SmokingHistory
	 */
	public void setSmokingHistory(int[] arrPosition, EnumCM_SmokingHistory enumSmokingHistory)
	{
		/**
		 * Sets the value for Primary Intervention Device.
		 */
		if(null== this.objSmokingHistoryCID3724)
			this.objSmokingHistoryCID3724 = new SmokingHistory_CID3724();
		this.objSmokingHistoryCID3724.setSmokingHistory(enumSmokingHistory);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PatientHistoryCath.SMOKING_HISTORY.getValue();
		String strCodeValue = EnumCV_PatientHistoryCath.SMOKING_HISTORY_38.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.NCDR.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 Prior report for current patient
	 * @param arrPosition position at which the node will get added in the tree.
	 * @param enumPurposeOfReferenceToObject Enum value for Purpose Of Reference To Object
	 * @param strReferencedSOPClassUID Referenced SOP Class UID
	 * @param strReferencedSOPInstanceUID Referenced SOP Instance UID
	 */
	public void setPriorReportForCurrentPatient(int[] arrPosition, EnumCM_PurposeOfReferenceToObject enumPurposeOfReferenceToObject, String strReferencedSOPClassUID, String strReferencedSOPInstanceUID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PatientHistoryCath.PRIOR_REPORT_FOR_CURRENT_PATIENT.getValue();
		String strCodeValue = EnumCV_PatientHistoryCath.PRIOR_REPORT_FOR_CURRENT_PATIENT_122075.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

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

	/**
	 * Sets the value for Document Title.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setDocumentTitle(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PatientHistoryCath.DOCUMENT_TITLE.getValue();
		String strCodeValue = EnumCV_PatientHistoryCath.DOCUMENT_TITLE_121144.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, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
}
