/*******************************************************************************
 *  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.CathFindings_CID3728;
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_CathFindings;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Severity;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SummaryCath;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_SummaryCath;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents SummaryCath - TID3824
 */
public class SummaryCath_TID3824 extends Template
{
	/**
	 * Object of Severity_CID3716
	 */
	private Severity_CID3716 objSeverityCID3716;

	/**
	 * Object of CathFindings_CID3728
	 */
	private CathFindings_CID3728 objCathFindingsCID3728;

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

	/**
	 * Sets the value for Summary
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setSummary(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SummaryCath.SUMMARY.getValue();
		String strCodeValue = EnumCV_SummaryCath.SUMMARY_121111.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 Finding.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCathFindings Enumerated value for value for Cath Findings
	 */
	public void setFinding(int[] arrPosition, EnumCM_CathFindings enumCathFindings)
	{
		/**
		 * Sets the value for Subject Sex which follows the template CID7455
		 */
		if(null== this.objCathFindingsCID3728)
			this.objCathFindingsCID3728 = new CathFindings_CID3728();
		this.objCathFindingsCID3728.setCathFindings(enumCathFindings);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = objCathFindingsCID3728.getCodeMeaning();
		String strCV = objCathFindingsCID3728.getCodeValue();
		String strCSD1 = objCathFindingsCID3728.getCodingSchemeDesignator();
		String strSNOMEDCTID = objCathFindingsCID3728.getSNOMEDCTID();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SummaryCath.FINDING.getValue();
		String strCodeValue = EnumCV_SummaryCath.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,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_SummaryCath.SEVERITY.getValue();
		String strCodeValue = EnumCV_SummaryCath.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 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_SummaryCath.SUMMARY.getValue();
		String strCodeValue = EnumCV_SummaryCath.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);
	}

	/**
	 * Sets the value for Recommendation
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strRecommendation String value for Recommendation.
	 */
	public void setRecommendation(int[] arrPosition, String strRecommendation)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SummaryCath.RECOMMENDATION.getValue();
		String strCodeValue = EnumCV_SummaryCath.RECOMMENDATION_121075.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, strRecommendation);
		getSRTree().addChild(objContentSequenceItem);
	}
}
