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

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.BreastImagingReportElements_CID6053;
import cdac.medinfo.sdk.dcm30_04.templates.cid.BreastImagingReportSectionTitle_CID6052;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BreastImagingReportElements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BreastImagingReportNarrative;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BreastImagingReportSectionTitle;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_BreastImagingReportNarrative;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.ObserverContext_TID1002;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.ReferencesToSupportingEvidence_TID350;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents BreastImagingReportNarrative - TID4202
 */
public class BreastImagingReportNarrative_TID4202 extends Template
{
	/**
	 * Object of ObserverContext_TID1002. 
	 */

	private ObserverContext_TID1002 objObserverContext_TID1002 = null;

	/**
	 * Object of BreastImagingReportSectionTitle_CID6052
	 */
	private BreastImagingReportSectionTitle_CID6052 objBreastImagingReportSectionTitleCID6052;

	/**
	 * Object of BreastImagingReportElements_CID6053
	 */
	private BreastImagingReportElements_CID6053 objBreastImagingReportElementsCID6053;
	/**
	 * Object of ReferencesToSupportingEvidence_TID350. 
	 */
	private ReferencesToSupportingEvidence_TID350 objReferencesToSupportingEvidenceTID350 = null;

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

	/**
	 * Retrieves the object of ObserverContext_TID1002 which provides the methods for setting different
	 * attributes of Observer Context.
	 * @return objObserverContext_TID1002 object of ObserverContext_TID1002
	 */
	public ObserverContext_TID1002 getObserverContext_TID1002() 
	{
		if(null == this.objObserverContext_TID1002)
			this.objObserverContext_TID1002 = new ObserverContext_TID1002(getSRTree());
		return this.objObserverContext_TID1002;
	}
	/**
	 * Retrieves ReferencesToSupportingEvidence
	 * @return objReferencesToSupportingEvidenceTID350 Object of ReferencesToSupportingEvidence_TID350 
	 */
	public ReferencesToSupportingEvidence_TID350 getReferencesToSupportingEvidence() 
	{
		if(null == this.objReferencesToSupportingEvidenceTID350)
			this.objReferencesToSupportingEvidenceTID350 = new ReferencesToSupportingEvidence_TID350(getSRTree());
		return this.objReferencesToSupportingEvidenceTID350;
	}
	/**
	 * Sets the value for Narrative Summary
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setNarrativeSummary(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_BreastImagingReportNarrative.NARRATIVE_SUMMARY.getValue();
		String strCodeValue = EnumCV_BreastImagingReportNarrative.NARRATIVE_SUMMARY_111412.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type CONTAINER 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 Narrative Summary
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 * @param enumBreastImagingReportSectionTitle Enumerated value for BreastImagingReportSectionTitle
	 */
	public void setNarrativeSummary(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent, EnumCM_BreastImagingReportSectionTitle enumBreastImagingReportSectionTitle)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objBreastImagingReportSectionTitleCID6052)
			this.objBreastImagingReportSectionTitleCID6052 = new BreastImagingReportSectionTitle_CID6052();
		this.objBreastImagingReportSectionTitleCID6052.setBreastImagingReportSectionTitle(enumBreastImagingReportSectionTitle);

		String strCodeMeaning = objBreastImagingReportSectionTitleCID6052.getCodeMeaning();
		String strCodeValue = objBreastImagingReportSectionTitleCID6052.getCodeValue();
		String strCSD = objBreastImagingReportSectionTitleCID6052.getCodingSchemeDesignator();
		String strSNOMEDCTID = objBreastImagingReportSectionTitleCID6052.getSNOMEDCTID();

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

	/**
	 * Sets the value for Algorithm Version
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strAlgorithmVersion String value for Algorithm Version.
	 * @param enumBreastImagingReportElements Enumerated value for BreastImagingReportElements
	 */
	public void setAlgorithmVersion(int[] arrPosition, String strAlgorithmVersion, EnumCM_BreastImagingReportElements enumBreastImagingReportElements)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objBreastImagingReportElementsCID6053)
			this.objBreastImagingReportElementsCID6053 = new BreastImagingReportElements_CID6053();
		this.objBreastImagingReportElementsCID6053.setBreastImagingReportElements(enumBreastImagingReportElements);

		String strCodeMeaning = objBreastImagingReportElementsCID6053.getCodeMeaning();
		String strCodeValue = objBreastImagingReportElementsCID6053.getCodeValue();
		String strCSD = objBreastImagingReportElementsCID6053.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, strAlgorithmVersion);
		getSRTree().addChild(objContentSequenceItem);
	}
}
