/*******************************************************************************
 *  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.CathDiagnosis_CID3700;
import cdac.medinfo.sdk.dcm30_04.templates.cid.Severity_CID3716;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CardiacCatheterizationFindings;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CathDiagnosis;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Severity;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_CardiacCatheterizationFindings;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents CardiacCatheterizationFindings - TID3810
 */
public class CardiacCatheterizationFindings_TID3810 extends Template
{
	/**
	 * Object of Severity_CID3716
	 */
	private Severity_CID3716 objSeverityCID3716;

	/**
	 * Object of CathDiagnosis_CID3700
	 */
	private CathDiagnosis_CID3700 objCathDiagnosisCID3700;

	/**
	 * Object of HemodynamicFindings_TID3812
	 */

	private HemodynamicFindings_TID3812 objHemodynamicFindingsTID3812;


	/**
	 * Object of CoronaryArteriographyFindings_TID3817
	 */

	private CoronaryArteriographyFindings_TID3817 objCoronaryArteriographyFindingsTID3817;

	/**
	 * Object of LeftVentriculographyFindings_TID3814
	 */

	private LeftVentriculographyFindings_TID3814 objLeftVentriculographyFindingsTID3814;

	/**
	 * Object of RightVentriculographyFindings_TID3815
	 */

	private RightVentriculographyFindings_TID3815 objRightVentriculographyFindingsTID3815;

	/**
	 * Object of OtherCardiographicFindings_TID3818
	 */

	private OtherCardiographicFindings_TID3818 objOtherCardiographicFindingsTID3818;

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

	/**
	 * Retrieves HemodynamicFindings
	 * @return objHemodynamicFindingsTID3812 Object of HemodynamicFindings_TID3812 
	 */
	public HemodynamicFindings_TID3812 getHemodynamicFindings() 
	{
		if(null == this.objHemodynamicFindingsTID3812)
			this.objHemodynamicFindingsTID3812 = new HemodynamicFindings_TID3812(getSRTree());
		return this.objHemodynamicFindingsTID3812;
	}

	/**
	 * Retrieves CoronaryArteriographyFindings 
	 * @return objCoronaryArteriographyFindingsTID3817 Object of CoronaryArteriographyFindings_TID3817 
	 */
	public CoronaryArteriographyFindings_TID3817 getCoronaryArteriographyFindings() 
	{
		if(null == this.objCoronaryArteriographyFindingsTID3817)
			this.objCoronaryArteriographyFindingsTID3817 = new CoronaryArteriographyFindings_TID3817(getSRTree());
		return this.objCoronaryArteriographyFindingsTID3817;
	}

	/**
	 * Retrieves LeftVentriculographyFindings 
	 * @return objLeftVentriculographyFindingsTID3814 Object of LeftVentriculographyFindings_TID3814 
	 */
	public LeftVentriculographyFindings_TID3814 getLeftVentriculographyFindings() 
	{
		if(null == this.objLeftVentriculographyFindingsTID3814)
			this.objLeftVentriculographyFindingsTID3814 = new LeftVentriculographyFindings_TID3814(getSRTree());
		return this.objLeftVentriculographyFindingsTID3814;
	}

	/**
	 * Retrieves RightVentriculographyFindings 
	 * @return objRightVentriculographyFindingsTID3815 Object of RightVentriculographyFindings_TID3815 
	 */
	public RightVentriculographyFindings_TID3815 getRightVentriculographyFindings() 
	{
		if(null == this.objRightVentriculographyFindingsTID3815)
			this.objRightVentriculographyFindingsTID3815 = new RightVentriculographyFindings_TID3815(getSRTree());
		return this.objRightVentriculographyFindingsTID3815;
	}

	/**
	 * Retrieves OtherCardiographicFindings 
	 * @return objOtherCardiographicFindingsTID3818 Object of OtherCardiographicFindings_TID3818 
	 */
	public OtherCardiographicFindings_TID3818 getOtherCardiographicFindings() 
	{
		if(null == this.objOtherCardiographicFindingsTID3818)
			this.objOtherCardiographicFindingsTID3818 = new OtherCardiographicFindings_TID3818(getSRTree());
		return this.objOtherCardiographicFindingsTID3818;
	}

	/**
	 * Sets the value for Findings
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setFindings(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CardiacCatheterizationFindings.FINDINGS.getValue();
		String strCodeValue = EnumCV_CardiacCatheterizationFindings.FINDINGS_121070.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 value for Finding.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCathDiagnosis Enumerated value for CathDiagnosis
	 */
	public void setFinding(int[] arrPosition, EnumCM_CathDiagnosis enumCathDiagnosis)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CardiacCatheterizationFindings.FINDING.getValue();
		String strCodeValue = EnumCV_CardiacCatheterizationFindings.FINDING_121071.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Finding
		 */
		if(null== this.objCathDiagnosisCID3700)
			this.objCathDiagnosisCID3700 = new CathDiagnosis_CID3700();
		this.objCathDiagnosisCID3700.setCathDiagnosis(enumCathDiagnosis);

		String strCM = objCathDiagnosisCID3700.getCodeMeaning();
		String strCV = objCathDiagnosisCID3700.getCodeValue();
		String strCSD = objCathDiagnosisCID3700.getCodingSchemeDesignator();
		String strSNOMEDCTID = objCathDiagnosisCID3700.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,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Severity.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumSeverity Enumerated value for value for Severity
	 */
	public void setSeverity(int[] arrPosition, EnumCM_Severity enumSeverity)
	{
		/**
		 * Sets the value for Subject Sex which follows the template CID7455
		 */
		if(null== this.objSeverityCID3716)
			this.objSeverityCID3716 = new Severity_CID3716();
		this.objSeverityCID3716.setSeverity(enumSeverity);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CardiacCatheterizationFindings.SEVERITY.getValue();
		String strCodeValue = EnumCV_CardiacCatheterizationFindings.SEVERITY_G_C197.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 Finding
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strFinding String value for Finding.
	 */
	public void setFinding(int[] arrPosition, String strFinding)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CardiacCatheterizationFindings.FINDING.getValue();
		String strCodeValue = EnumCV_CardiacCatheterizationFindings.FINDING_121071.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, strFinding);
		getSRTree().addChild(objContentSequenceItem);
	}
}
