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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CardiovascularAnatomicLocationModifiers_CID3019;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CathFindings_CID3728;
import cdac.medinfo.sdk.dcm30_04.templates.cid.FindingsTitles_CID3419;
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_CardiovascularAnatomicLocationModifiers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CathFindings;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_FindingsTitles;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ImpressionsOrFindings;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Severity;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_ImpressionsOrFindings;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * The Impressions or Findings Template allows the recording of unconfirmed (provisional) impressions or
 * findings noted during the procedure. It is not intended to convey the Cath Lab Clinical Report (the formal
 * report from the performing physician), although it may be used (like any Procedure Log entry) for the
 * subsequent construction of the Cath Lab Clinical Report.
 * A finding that is supported by a specific image frame may reference that image in the INFERRED FROM /
 * IMAGE row of the included TID 3010 Log Entry Qualifiers template.
 */
/**
 * This class represents ImpressionsOrFindings - TID3110
 */
public class ImpressionsOrFindings_TID3110 extends Template
{
	/**
	 * Object of CathFindings_CID3728
	 */
	private CathFindings_CID3728 objCathFindings_CID3728;

	/**
	 * Object of Severity_CID3716
	 */
	private Severity_CID3716 objSeverity_CID3716;

	/**
	 * Object of CardiovascularAnatomicLocationModifiers_CID3019
	 */
	private CardiovascularAnatomicLocationModifiers_CID3019 objCardiovascularAnatomicLocationModifiers_CID3019;

	/**
	 * Object of LogEntryQualifiers_TID3010
	 */
	private LogEntryQualifiers_TID3010 objLogEntryQualifiers;

	/**
	 * Object of FindingsTitles_CID3419
	 */
	private FindingsTitles_CID3419 objFindingsTitles_CID3419;

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

	/**
	 * Retrieves LogEntryQualifiers
	 * @return objLogEntryQualifiers Object of LogEntryQualifiers_TID3010
	 */
	public LogEntryQualifiers_TID3010 getLogEntryQualifiers() 
	{
		if(objLogEntryQualifiers == null)
			this.objLogEntryQualifiers = new LogEntryQualifiers_TID3010(getSRTree());
		return this.objLogEntryQualifiers;
	}

	/**
	 * Sets the value for Finding.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCathFindings value for EnumCM_CathFindings
	 */
	public void setFinding(int[] arrPosition, EnumCM_CathFindings enumCathFindings)
	{
		/**
		 * Sets the value for InterventionActionsAndStatus.
		 */
		if(objCathFindings_CID3728 == null)
			this.objCathFindings_CID3728 = new CathFindings_CID3728();
		this.objCathFindings_CID3728.setCathFindings(enumCathFindings);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ImpressionsOrFindings.FINDING.getValue();
		String strCodeValue = EnumCV_ImpressionsOrFindings.FINDING_121071.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,strSNMDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

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

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ImpressionsOrFindings.SEVERITY.getValue();
		String strCodeValue = EnumCV_ImpressionsOrFindings.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,strSNMDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Finding Site.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strFindingSite value for Finding Site
	 */
	public void setFindingSite(int[] arrPosition, String strFindingSite)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ImpressionsOrFindings.FINDING_SITE.getValue();
		String strCodeValue = EnumCV_ImpressionsOrFindings.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, "", "", "", strFindingSite);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Topographical modifier.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCardiovascularAnatomicLocationModifiers Enum of EnumCM_CardiovascularAnatomicLocationModifiers
	 */
	public void setTopographicalModifier(int[] arrPosition, EnumCM_CardiovascularAnatomicLocationModifiers enumCardiovascularAnatomicLocationModifiers)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ImpressionsOrFindings.TOPOGRAPHICAL_MODIFIER.getValue();
		String strCodeValue = EnumCV_ImpressionsOrFindings.TOPOGRAPHICAL_MODIFIERS_G_A1F8.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Cardiovascular Anatomic Location Modifiers
		 */
		if(objCardiovascularAnatomicLocationModifiers_CID3019 == null)
			this.objCardiovascularAnatomicLocationModifiers_CID3019 = new CardiovascularAnatomicLocationModifiers_CID3019();
		this.objCardiovascularAnatomicLocationModifiers_CID3019.setCardiovascularAnatomicLocationModifiers(enumCardiovascularAnatomicLocationModifiers);

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

	/**
	 * Sets the value for Findings Titles
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumFindingsTitles Enum value for FindingsTitles
	 * @param strFindingsTitles String value for Findings Titles.
	 */
	public void setFindingsTitles(int[] arrPosition, EnumCM_FindingsTitles enumFindingsTitles, String strFindingsTitles)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(objFindingsTitles_CID3419 == null)
			this.objFindingsTitles_CID3419 = new FindingsTitles_CID3419();
		this.objFindingsTitles_CID3419.setFindingsTitles(enumFindingsTitles);

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

		/**
		 * 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, strFindingsTitles);
		getSRTree().addChild(objContentSequenceItem);
	}
}
