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

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_MammographyCADDocumentRootTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_StatusOfResults;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_MammographyCADDocumentRootTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.LanguageOfContentItemAndDescendants_TID1204;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents MammographyCADDocumentRootTemplate - TID4000
 */
public class MammographyCADDocumentRootTemplate_TID4000 extends Template
{
	/**
	 * Object of CADImageLibraryEntryTemplate_TID4020
	 */

	private CADImageLibraryEntryTemplate_TID4020 objCadImageLibraryEntryTemplateTID4020;
	
	/**
	 * Object of LanguageOfContentItemAndDescendants_TID1204
	 */

	private LanguageOfContentItemAndDescendants_TID1204 objLanguageOfContentItemAndDescendantsTID1204;

	/**
	 * Object of StatusOfResults_CID6042
	 */
	private StatusOfResults_CID6042 objStatusOfResultsCID6042;

	/**
	 * Object of MammographyCADOverallImpressionRecommendationTemplate_TID4001
	 */

	private MammographyCADOverallImpressionRecommendationTemplate_TID4001 objCadOverallImpressionRecommendationTemplateTID4001;

	/**
	 * Object of CADDetectionsPerformedTemplate_TID4015
	 */

	private CADDetectionsPerformedTemplate_TID4015 objCadDetectionsPerformedTemplateTID4015;

	/** Object of CADAnalysesPerformedTemplate_TID4016
	 */

	private CADAnalysesPerformedTemplate_TID4016 objCadAnalysesPerformedTemplateTID4016;

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

	/**
	 * Retrieves CADImageLibraryEntryTemplate 
	 * @return objCadImageLibraryEntryTemplateTID4020 Object of CADImageLibraryEntryTemplate_TID4020 
	 */
	public CADImageLibraryEntryTemplate_TID4020 getCADImageLibraryEntryTemplate() 
	{
		if(null == this.objCadImageLibraryEntryTemplateTID4020)
			this.objCadImageLibraryEntryTemplateTID4020 = new CADImageLibraryEntryTemplate_TID4020(getSRTree());
		return this.objCadImageLibraryEntryTemplateTID4020;
	}

	/**
	 * Retrieves LanguageOfContentItemAndDescendantsTID1204 
	 * @return objLanguageOfContentItemAndDescendantsTID1204 Object of LanguageOfContentItemAndDescendants_TID1204 
	 */
	public LanguageOfContentItemAndDescendants_TID1204 getLanguageOfContentItemAndDescendants() 
	{
		if(null == this.objLanguageOfContentItemAndDescendantsTID1204)
			this.objLanguageOfContentItemAndDescendantsTID1204 = new LanguageOfContentItemAndDescendants_TID1204(getSRTree());
		return this.objLanguageOfContentItemAndDescendantsTID1204;
	}
	
	/**
	 * Retrieves CADDetectionsPerformedTemplate 
	 * @return objCadDetectionsPerformedTemplateTID4015 Object of CADDetectionsPerformedTemplate_TID4015 
	 */
	public CADDetectionsPerformedTemplate_TID4015 getCADDetectionsPerformedTemplate() 
	{
		if(null == this.objCadDetectionsPerformedTemplateTID4015)
			this.objCadDetectionsPerformedTemplateTID4015 = new CADDetectionsPerformedTemplate_TID4015(getSRTree());
		return this.objCadDetectionsPerformedTemplateTID4015;
	}

	/**
	 * Retrieves MammographyCADOverallImpressionRecommendationTemplate 
	 * @return objCadOverallImpressionRecommendationTemplateTID4001 Object of MammographyCADOverallImpressionRecommendationTemplate_TID4001 
	 */
	public MammographyCADOverallImpressionRecommendationTemplate_TID4001 getMammographyCADOverallImpressionRecommendationTemplate() 
	{
		if(null == this.objCadOverallImpressionRecommendationTemplateTID4001)
			this.objCadOverallImpressionRecommendationTemplateTID4001 = new MammographyCADOverallImpressionRecommendationTemplate_TID4001(getSRTree());
		return this.objCadOverallImpressionRecommendationTemplateTID4001;
	}

	/**
	 * Retrieves CADAnalysesPerformedTemplate 
	 * @return objCadAnalysesPerformedTemplateTID4016 Object of CADAnalysesPerformedTemplate_TID4016 
	 */
	public CADAnalysesPerformedTemplate_TID4016 getCADAnalysesPerformedTemplate() 
	{
		if(null == this.objCadAnalysesPerformedTemplateTID4016)
			this.objCadAnalysesPerformedTemplateTID4016 = new CADAnalysesPerformedTemplate_TID4016(getSRTree());
		return this.objCadAnalysesPerformedTemplateTID4016;
	}

	/**
	 * Sets the value for Mammography CAD Report
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setMammographyCADReport(EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADDocumentRootTemplate.MAMMOGRAPHY_CAD_REPORT.getValue();
		String strCodeValue = EnumCV_MammographyCADDocumentRootTemplate.MAMMOGRAPHY_CAD_REPORT_111036.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type CONTAINER and adding this node as root of a tree.
		 */
		SRDocumentContentModule objDocumentContentModule = getSRTree().getSRDocumentContentModule();
		getSRTree().createRoot(objDocumentContentModule,strCodeMeaning,strCodeValue , strCSD, enumContinuityOfContent);
	}

	/**
	 * Sets the value for Image Library
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setImageLibrary(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADDocumentRootTemplate.IMAGE_LIBRARY.getValue();
		String strCodeValue = EnumCV_MammographyCADDocumentRootTemplate.IMAGE_LIBRARY_111028.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 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_MammographyCADDocumentRootTemplate.SUMMARY_OF_DETECTIONS.getValue();
		String strCodeValue = EnumCV_MammographyCADDocumentRootTemplate.SUMMARY_OF_DETECTIONS_111064.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Assessment Category
		 */
		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 Analyses.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumStatusOfResults Enumerated value for StatusOfResults
	 */
	public void setSummaryOfAnalyses(int[] arrPosition, EnumCM_StatusOfResults enumStatusOfResults)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADDocumentRootTemplate.SUMMARY_OF_ANALYSES.getValue();
		String strCodeValue = EnumCV_MammographyCADDocumentRootTemplate.SUMMARY_OF_ANALYSES_111065.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Assessment Category
		 */
		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);
	}
}
