/*******************************************************************************
 *  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.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.DiagnosticImagingReportElements_CID7002;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DiagnosticImagingReportElements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PlanarROIMeasurements;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_PlanarROIMeasurements;

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

	/**
	 * Object of BasicDiagnosticImagingReportObservations_TID2001
	 */
	private BasicDiagnosticImagingReportObservations_TID2001 objBasicDiagnosticImagingReportObservations_TID2001;
	/**
	 * Object of BasicDiagnosticImagingReportObservations_TID2001
	 */
	private DiagnosticImagingReportElements_CID7002 objDiagnosticImagingReportElements_CID7002;
	/**
	 * Instantiates a new TID3001_ProcedureLog Template.
	 * @param objTree Object of SRTree.
	 */
	public ReportNarrative_TID2002(SRTree objTree)
	{
		super(objTree);
	}
	/**
	 * Retrieves BasicDiagnosticImagingReportObservations_TID2001 
	 * @return objBasicDiagnosticImagingReportObservations_TID2001 Object of BasicDiagnosticImagingReportObservations_TID2001 
	 */
	public BasicDiagnosticImagingReportObservations_TID2001 getROIMeasurements() 
	{
		if(null == this.objBasicDiagnosticImagingReportObservations_TID2001)
			this.objBasicDiagnosticImagingReportObservations_TID2001 = new BasicDiagnosticImagingReportObservations_TID2001(getSRTree());
		return this.objBasicDiagnosticImagingReportObservations_TID2001;
	}
	public void setTrackingIdentifier(int[] arrPosition, String strTrackingIdentifier)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PlanarROIMeasurements.TRACKING_IDENTIFIER.getValue();
		String strCodeValue = EnumCV_PlanarROIMeasurements.TRACKING_IDENTIFIER_122039.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, strTrackingIdentifier);
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setDiagnosticImagingReportElements(int[] arrPosition,EnumCM_DiagnosticImagingReportElements enumDiagnosticImagingReportElements)
	{
		
		String strCM,strCV,strCSD,strSNMDCTID;

		if(null== this.objDiagnosticImagingReportElements_CID7002)
			this.objDiagnosticImagingReportElements_CID7002 = new DiagnosticImagingReportElements_CID7002();
		this.objDiagnosticImagingReportElements_CID7002.setDiagnosticImagingReportElements(enumDiagnosticImagingReportElements);
		 strCM = objDiagnosticImagingReportElements_CID7002.getCodeMeaning();
		 strCV = objDiagnosticImagingReportElements_CID7002.getCodeValue();
		 strCSD = objDiagnosticImagingReportElements_CID7002.getCodingSchemeDesignator();
		 strSNMDCTID = objDiagnosticImagingReportElements_CID7002.getSNOMEDCTID();
		
		
		/**
		 * Creating a node of Value Type CODE and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createCodeNode(arrPosition, "", "", "", strCV, strCSD, "", strCM,strSNMDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}
}
