/*******************************************************************************
 *  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.CardiovascularAnatomicLocations_CID3630;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ImagingProcedures_CID3428;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ImagingProcedures;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_OtherCardiographicFindings;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_OtherCardiographicFindings;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents OtherCardiographicFindings - TID3818
 */
public class OtherCardiographicFindings_TID3818 extends Template
{
	/**
	 * Object of ImagingProcedures_CID3428
	 */
	private ImagingProcedures_CID3428 objImagingProceduresCID3428;

	/**
	 * Object of CardiovascularAnatomicLocations_CID3630
	 */
	private CardiovascularAnatomicLocations_CID3630 objCardiovascularAnatomicLocationsCID3630;

	/**
	 * Object of CommonFindings_TID3819
	 */

	private CommonFindings_TID3819 objCommonFindingsTID3819;

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

	/**
	 * Retrieves CommonFindings 
	 * @return objCommonFindingsTID3819 Object of CommonFindings_TID3819 
	 */
	public CommonFindings_TID3819 getCommonFindings() 
	{
		if(null == this.objCommonFindingsTID3819)
			this.objCommonFindingsTID3819 = new CommonFindings_TID3819(getSRTree());
		return this.objCommonFindingsTID3819;
	}

	/**
	 * 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_OtherCardiographicFindings.FINDINGS.getValue();
		String strCodeValue = EnumCV_OtherCardiographicFindings.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 the value for Procedure Reported.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumImagingProcedures Enumerated value for ImagingProcedures
	 */
	public void setProcedureReported(int[] arrPosition, EnumCM_ImagingProcedures enumImagingProcedures)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objImagingProceduresCID3428)
			this.objImagingProceduresCID3428 = new ImagingProcedures_CID3428();
		this.objImagingProceduresCID3428.setImagingProcedures(enumImagingProcedures);

		String strCM = objImagingProceduresCID3428.getCodeMeaning();
		String strCV = objImagingProceduresCID3428.getCodeValue();
		String strCSD1 = objImagingProceduresCID3428.getCodingSchemeDesignator();
		String strSNOMEDCTID = objImagingProceduresCID3428.getSNOMEDCTID();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_OtherCardiographicFindings.PROCEDURE_REPORTED.getValue();
		String strCodeValue = EnumCV_OtherCardiographicFindings.PROCEDURE_REPORTED_121058.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 Finding Site.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumValue This value can be one of the three Enum - EnumCM_ArterialSourceLocations, EnumVenousSourceLocations
	 * EnumCM_AtrialSourceLocations, EnumVentricularSourceLocations,EnumGradientSourceLocations.
	 */
	public void setFindingSite(int[] arrPosition, Enum enumValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objCardiovascularAnatomicLocationsCID3630)
			this.objCardiovascularAnatomicLocationsCID3630 = new CardiovascularAnatomicLocations_CID3630();
		this.objCardiovascularAnatomicLocationsCID3630.setCardiovascularAnatomicLocations(enumValue);

		String strCM = objCardiovascularAnatomicLocationsCID3630.getCodeMeaning();
		String strCV = objCardiovascularAnatomicLocationsCID3630.getCodeValue();
		String strCSD1 = objCardiovascularAnatomicLocationsCID3630.getCodingSchemeDesignator();
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_OtherCardiographicFindings.FINDING_SITE.getValue();
		String strCodeValue = EnumCV_OtherCardiographicFindings.FINDING_SITE_G_C0E3.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);
		getSRTree().addChild(objContentSequenceItem);
	}
}
