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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.dicommodel.modules.SRDocumentContentModule;
import cdac.medinfo.sdk.dcm30_04.enums.EnumContinuityOfContent;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.StatusOfResults_CID6042;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ColonCADDocumentRoot;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_StatusOfResults;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_ColonCADDocumentRoot;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.LanguageOfContentItemAndDescendants_TID1204;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;
import cdac.medinfo.sdk.dcm30_04.templates.mammographycadsriodtemplates.CADAnalysesPerformedTemplate_TID4016;
import cdac.medinfo.sdk.dcm30_04.templates.mammographycadsriodtemplates.CADDetectionsPerformedTemplate_TID4015;

/**
 * This class represents ColonCADDocumentRoot_TID4120 
 */
public class ColonCADDocumentRoot_TID4120 extends Template{
	/**
	 * Object of LanguageOfContentItemAndDescendants_TID1204
	 */

	private LanguageOfContentItemAndDescendants_TID1204 objLanguageOfContentItemAndDescendantsTID1204;

	/**
	 * Object of StatusOfResults_CID6042
	 */
	private StatusOfResults_CID6042 objStatusOfResultsCID6042;
	
	/**
	 * Object of CADDetectionsPerformedTemplate_TID4015
	 */
	private CADDetectionsPerformedTemplate_TID4015 objCADDetectionsPerformedTemplateTID4015;
	
	/**
	 * Object of CADAnalysesPerformedTemplate_TID4016
	 */
	private CADAnalysesPerformedTemplate_TID4016 objCADAnalysesPerformedTemplateTID4016;
	
	/**
	 * Object of CADCommonImagePropertiesEntry_TID4122
	 */
	private CADCommonImagePropertiesEntry_TID4122 objCADCommonImagePropertiesEntryTID4122;
	/**
	 * Object of ColonCADFindingsSummary_TID4121
	 */
	private ColonCADFindingsSummary_TID4121 objColonCADFindingsSummaryTID4121;
	

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

	/**
	 * Retrieves the object of LanguageOfContentItemAndDescendants
	 * @return objLanguageOfContentItemAndDescendantsTID1204 object of LanguageOfContentItemAndDescendants_TID1204
	 */
	public LanguageOfContentItemAndDescendants_TID1204 getLanguageOfContentItemAndDescendants() 
	{
		if(null == objLanguageOfContentItemAndDescendantsTID1204)
			objLanguageOfContentItemAndDescendantsTID1204 = new LanguageOfContentItemAndDescendants_TID1204(getSRTree());
		return objLanguageOfContentItemAndDescendantsTID1204;
	}
	/**
	 * Retrieves the object of CADCommonImagePropertiesEntry
	 * @return objCADCommonImagePropertiesEntryTID4122 object of CADCommonImagePropertiesEntry_TID4122
	 */
	public CADCommonImagePropertiesEntry_TID4122 getCADCommonImagePropertiesEntry() 
	{
		if(null == objCADCommonImagePropertiesEntryTID4122)
			objCADCommonImagePropertiesEntryTID4122 = new CADCommonImagePropertiesEntry_TID4122(getSRTree());
		return objCADCommonImagePropertiesEntryTID4122;
	}
	/**
	 * Retrieves the object of ColonCADFindingsSummary
	 * @return objColonCADFindingsSummaryTID4121 object of ColonCADFindingsSummary_TID4121
	 */
	public ColonCADFindingsSummary_TID4121 getColonCADFindingsSummary() 
	{
		if(null == objColonCADFindingsSummaryTID4121)
			objColonCADFindingsSummaryTID4121 = new ColonCADFindingsSummary_TID4121(getSRTree());
		return objColonCADFindingsSummaryTID4121;
	}
	
	/**
	 * Retrieves the object of CADDetectionsPerformedTemplate
	 * @return objCADDetectionsPerformedTemplateTID4015 object of CADDetectionsPerformedTemplate_TID4015
	 */
	public CADDetectionsPerformedTemplate_TID4015 getCADDetectionsPerformed() 
	{
		if(null == objCADDetectionsPerformedTemplateTID4015)
			objCADDetectionsPerformedTemplateTID4015 = new CADDetectionsPerformedTemplate_TID4015(getSRTree());
		return objCADDetectionsPerformedTemplateTID4015;
	}
	
	/**
	 * Retrieves the object of CADAnalysesPerformedTemplate
	 * @return objCADAnalysesPerformedTemplateTID4016 object of CADAnalysesPerformedTemplate_TID4016
	 */
	public CADAnalysesPerformedTemplate_TID4016 getCADAnalysesPerformed() 
	{
		if(null == objCADAnalysesPerformedTemplateTID4016)
			objCADAnalysesPerformedTemplateTID4016 = new CADAnalysesPerformedTemplate_TID4016(getSRTree());
		return objCADAnalysesPerformedTemplateTID4016;
	}
	/**
	 * Sets the value for Patient Colon CAD Report
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent 
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 * @param objDocumentContentModule 
	 */
	public void setColonCADReport(EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ColonCADDocumentRoot.COLON_CAD_REPORT.getValue();
		String strCodeValue = EnumCV_ColonCADDocumentRoot.COLON_CAD_REPORT_112220.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type Root and adding this node at specified identifier in the SR Tree.
		 */
		SRDocumentContentModule objDocumentContentModule = getSRTree().getSRDocumentContentModule();
		getSRTree().createRoot(objDocumentContentModule,strCodeMeaning,strCodeValue , strCSD, enumContinuityOfContent);
	}


	/**
	 * Sets value for Summary Of Detections.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumStatusOfResults Enumerated value for StatusOfResults
	 */
	public void setSummaryOfDetections(int[] arrPosition, EnumCM_StatusOfResults enumStatusOfResults)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ColonCADDocumentRoot.SUMMARY_OF_DETECTION.getValue();
		String strCodeValue = EnumCV_ColonCADDocumentRoot.SUMMARY_OF_DETECTION_111064.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objStatusOfResultsCID6042)
			this.objStatusOfResultsCID6042 = new StatusOfResults_CID6042();
		this.objStatusOfResultsCID6042.setStatusOfResults(enumStatusOfResults);

		String strCM = objStatusOfResultsCID6042.getCodeMeaning();
		String strCV = objStatusOfResultsCID6042.getCodeValue();
		String strCSD = objStatusOfResultsCID6042.getCodingSchemeDesignator();

		/**
		 * 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);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets value for Summary Of Analysis.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumStatusOfResults Enumerated value for StatusOfResults
	 */
	public void setSummaryOfAnalysis(int[] arrPosition, EnumCM_StatusOfResults enumStatusOfResults)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ColonCADDocumentRoot.SUMMARY_OF_ANALYSIS.getValue();
		String strCodeValue = EnumCV_ColonCADDocumentRoot.SUMMARY_OF_ANALYSIS_111065.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objStatusOfResultsCID6042)
			this.objStatusOfResultsCID6042 = new StatusOfResults_CID6042();
		this.objStatusOfResultsCID6042.setStatusOfResults(enumStatusOfResults);

		String strCM = objStatusOfResultsCID6042.getCodeMeaning();
		String strCV = objStatusOfResultsCID6042.getCodeValue();
		String strCSD = objStatusOfResultsCID6042.getCodingSchemeDesignator();

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

}
