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

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.AcquisitionModality_CID29;
import cdac.medinfo.sdk.dcm30_04.templates.cid.DiagnosticImagingReportDocumentTitles_CID7000;
import cdac.medinfo.sdk.dcm30_04.templates.cid.DiagnosticImagingReportHeadings_CID7001;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_AcquisitionModality;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BasicDiagnosticImagingReport;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ChestCADDocumentRootTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DiagnosticImagingReportDocumentTitles;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_BasicDiagnosticImagingReport;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_ChestCADDocumentRootTemplate;

/**
 * This class represents BasicDiagnosticImagingReport_TID2000  
 */
public class BasicDiagnosticImagingReport_TID2000 extends Template {

	/**
	 * Object of DiagnosticImagingReportHeadings_CID7001 
	 */
	private DiagnosticImagingReportHeadings_CID7001 objDiagnosticImagingReportHeadings_CID7001 = null;
	/**
	 * Object of AcquisitionModality which represents the CID29 Template. 
	 */
	private AcquisitionModality_CID29 objAcquisitionModality_CID29 = null;
	
	/**
	 * Object of ReportNarrative which represents  TID2002 Template. 
	 */
	private ReportNarrative_TID2002 objReportNarrative_TID2002 = null;
	/**
	 * Object of LanguageOfContentItemandDescendants which represents the TID1204 Template. 
	 */
	private LanguageOfContentItemAndDescendants_TID1204 objLanguageOfContentItemAndDescendants_TID1204 = null;
	
	/**
	 * Object of DiagnosticImagingReportDocumentTitles which represents the CID7000 Template. 
	 */
	private DiagnosticImagingReportDocumentTitles_CID7000 objDiagnosticImagingReportDocumentTitles_CID7000 = null;
	/**
	 * Object of EquivalentMeaningOfConceptName_TID1210 which represents the CID7000 Template. 
	 */
	private EquivalentMeaningOfConceptName_TID1210 objEquivalentMeaningOfConceptName_TID1210= null;
	/**
	 * Object of AcquisitionModality which represents the CID29 Template. 
	 */
	private ObservationContext_TID1001 objObservationContext_TID1001 = null;
	public BasicDiagnosticImagingReport_TID2000(SRTree objTree) {
		super(objTree);
	}
	/**
	 * Retrieves ObservationContext
	 * @return objObservationContext_TID1001 Object of ObservationContext_TID1001
	 */
	public ObservationContext_TID1001 getObservationContext() 
	{
		if(objObservationContext_TID1001 == null )
			this.objObservationContext_TID1001 = new ObservationContext_TID1001(getSRTree());

		return this.objObservationContext_TID1001;
	}
	/**
	 * Retrieves ReportNarrative
	 * @return objReportNarrative_TID2002 Object of ReportNarrative_TID2002
	 */
	public ReportNarrative_TID2002 getReportNarrative() 
	{
		if(objReportNarrative_TID2002 == null )
			this.objReportNarrative_TID2002 = new ReportNarrative_TID2002(getSRTree());

		return this.objReportNarrative_TID2002;
	}
	/**
	 * Retrieves EquivalentMeaningOfConceptName
	 * @return objEquivalentMeaningOfConceptName_TID1210 Object of EquivalentMeaningOfConceptName_TID1210
	 */
	public EquivalentMeaningOfConceptName_TID1210 getEquivalentMeaningOfConceptName() 
	{
		if(objEquivalentMeaningOfConceptName_TID1210 == null )
			this.objEquivalentMeaningOfConceptName_TID1210 = new EquivalentMeaningOfConceptName_TID1210(getSRTree());

		return this.objEquivalentMeaningOfConceptName_TID1210;
	}
	/**
	 * Retrieves LanguageOfContentItemandDescendants
	 * @return objLanguageOfContentItemAndDescendants_TID1204 Object of LanguageOfContentItemAndDescendants_TID1204
	 */
	public LanguageOfContentItemAndDescendants_TID1204 getLanguageOfContentItemandDescendants() 
	{
		if(objLanguageOfContentItemAndDescendants_TID1204 == null )
			this.objLanguageOfContentItemAndDescendants_TID1204 = new LanguageOfContentItemAndDescendants_TID1204(getSRTree());

		return this.objLanguageOfContentItemAndDescendants_TID1204;
	}

	/**
	 * Sets the Diagnostic Imaging Report Document Titles.
	 * @param enumDiagnosticImagingReportDocumentTitles object of EnumCM_DiagnosticImagingReportDocumentTitles
	 * @param enumContinuityOfContent object of EnumContinuityOfContent
	 */	
	public void setDiagnosticImagingReportDocumentTitles(EnumCM_DiagnosticImagingReportDocumentTitles enumDiagnosticImagingReportDocumentTitles, EnumContinuityOfContent enumContinuityOfContent)
	{
		if(objDiagnosticImagingReportDocumentTitles_CID7000 == null )
			objDiagnosticImagingReportDocumentTitles_CID7000 = new DiagnosticImagingReportDocumentTitles_CID7000();

		objDiagnosticImagingReportDocumentTitles_CID7000.setDiagnosticImagingReportDocumentTitles(enumDiagnosticImagingReportDocumentTitles);

		// get string values for all
		String strCodeMeaning = objDiagnosticImagingReportDocumentTitles_CID7000.getCodeMeaning();
		String strCodeValue = objDiagnosticImagingReportDocumentTitles_CID7000.getCodeValue();
		String strCodeSchemeDesignator = objDiagnosticImagingReportDocumentTitles_CID7000.getCodingSchemeDesignator();

		SRDocumentContentModule objDocumentContentModule = getSRTree().getSRDocumentContentModule();
		getSRTree().createRoot(objDocumentContentModule,strCodeMeaning,strCodeValue , strCodeSchemeDesignator, enumContinuityOfContent);
	}
	/**
	 * Sets the value for Procedure reported
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setProcedurereported(int[] arrPosition)
	{
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_BasicDiagnosticImagingReport.PROCEDURE_REPORTED.getValue();
		String strCodeValue = EnumCV_BasicDiagnosticImagingReport.PROCEDURE_REPORTED_121058.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, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Acquisition Device Type.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumAcquisitionModality value for AcquisitionModality
	 * @param strCodingSchemeVersionForCode CodingSchemeVersion 
	 */
	public void setAcquisitionDeviceType(int[] arrPosition, EnumCM_AcquisitionModality enumAcquisitionModality,String strCodingSchemeVersionForCode)
	{
		/**
		 * Sets the value for Patient Status And Events which follows the template CID3402
		 */
		if(objAcquisitionModality_CID29 == null )
			this.objAcquisitionModality_CID29 = new AcquisitionModality_CID29();

		this.objAcquisitionModality_CID29.setAcquisitionModality(enumAcquisitionModality);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_BasicDiagnosticImagingReport.ACQUISITION_DEVICE_TYPE.getValue();
		String strCodeValue = EnumCV_BasicDiagnosticImagingReport.ACQUISITION_DEVICE_TYPE_122142.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, strCodingSchemeVersionForCode, strCM);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Target Region
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setTargetRegion(int[] arrPosition)
	{
		
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = objDiagnosticImagingReportHeadings_CID7001.getCodeMeaning();
		String strCV = objDiagnosticImagingReportHeadings_CID7001.getCodeValue();
		String strCSD1 = objDiagnosticImagingReportHeadings_CID7001.getCodingSchemeDesignator();

		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, strCM,strCV , strCSD1, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setDiagnosticImagingReportHeadings(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_ChestCADDocumentRootTemplate.IMAGE_LIBRARY.getValue();
		String strCodeValue = EnumCV_ChestCADDocumentRootTemplate.IMAGE_LIBRARY_111028.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);
	}
}