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

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.VolumeMethods_CID3453;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_EV;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_FrameToFrameResultsTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_VolumeMethods;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_EV;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_FrameToFrameResultsTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Measurement_TID300;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents FrameToFrameResultsTemplate - TID3208
 */
public class FrameToFrameResultsTemplate_TID3208 extends Template
{
	/**
	 * Object of Measurement_TID300
	 */
	private Measurement_TID300 objMeasurementTID300;
	/**
	 * Object of VolumeMethods_CID3453
	 */
	private VolumeMethods_CID3453 objVolumeMethodsCID3453;

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

	/**
	 * Retrieves Measurement 
	 * @return objMeasurementID300 Object of Measurement_TID300 
	 */
	public Measurement_TID300 getMeasurement() 
	{
		if(null == this.objMeasurementTID300)
			this.objMeasurementTID300 = new Measurement_TID300(getSRTree());
		return this.objMeasurementTID300;
	}
	/**
	 * Sets the value for Findings
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setFindings(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_FrameToFrameResultsTemplate.FINDINGS.getValue();
		String strCodeValue = EnumCV_FrameToFrameResultsTemplate.FINDINGS_121070.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);
	}

	/**
	 * Sets the value for Volume Method.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumVolumeMethods Enumerated value for value for enumVolumeMethods
	 */
	public void setVolumeMethod(int[] arrPosition, EnumCM_VolumeMethods enumVolumeMethods)
	{
		/**
		 * Sets the value for Subject Sex which follows the template CID7455
		 */
		if(null== this.objVolumeMethodsCID3453)
			this.objVolumeMethodsCID3453 = new VolumeMethods_CID3453();
		this.objVolumeMethodsCID3453.setVolumeMethods(enumVolumeMethods);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_FrameToFrameResultsTemplate.VOLUME_METHOD.getValue();
		String strCodeValue = EnumCV_FrameToFrameResultsTemplate.VOLUME_METHOD_122429.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, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * 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 strCM = EnumCM_EV.FRAME_TO_FRAME_ANALYSIS.getValue();
		String strCV = EnumCV_EV.FRAME_TO_FRAME_ANALYSIS_122499.getValue();
		String strCSD1 = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_FrameToFrameResultsTemplate.PROCEDURE_REPORTED.getValue();
		String strCodeValue = EnumCV_FrameToFrameResultsTemplate.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, strCV, strCSD1, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Analysis Performed.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setAnalysisPerformed(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = EnumCM_EV.FRAME_TO_FRAME_ANALYSIS.getValue();
		String strCV = EnumCV_EV.FRAME_TO_FRAME_ANALYSIS_122499.getValue();
		String strCSD1 = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_FrameToFrameResultsTemplate.ANALYSIS_PERFORMED.getValue();
		String strCodeValue = EnumCV_FrameToFrameResultsTemplate.ANALYSIS_PERFORMED_111004.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, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Frame to Frame Analysis.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setFrameToFrameAnalysis(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = EnumCM_EV.FRAME_TO_FRAME_ANALYSIS.getValue();
		String strCV = EnumCV_EV.FRAME_TO_FRAME_ANALYSIS_122499.getValue();
		String strCSD1 = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_FrameToFrameResultsTemplate.FRAME_TO_FRAME_ANALYSIS.getValue();
		String strCodeValue = EnumCV_FrameToFrameResultsTemplate.FRAME_TO_FRAME_ANALYSIS_122499.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, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets value for Source of Measurements
	 * @param arrPosition identifier which shows the position of the node in the SR Tree.
	 *@param strRefSOPClassUIDForCORefMacro Reference SOP Class UID for Composite Object Reference Macro.
	 * @param strRefSOPInstanceUIDForCORefMacro Reference SOP Instance UID for Composite Object Reference Macro.
	 * @param arrStrReferencedFrameNumber String Array of Referenced Frame Number.
	 * @param strRefSOPClassUID Referenced SOP Class UID.
	 * @param strRefSOPInstanceUID Referenced SOP Instance UID.
	 */
	public void setSourceOfMeasurements(int[] arrPosition, String strRefSOPClassUIDForCORefMacro, String strRefSOPInstanceUIDForCORefMacro, String[] arrStrReferencedFrameNumber, String strRefSOPClassUID, String strRefSOPInstanceUID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_FrameToFrameResultsTemplate.SOURCE_OF_MEASUREMENTS.getValue();
		String strCodeValue = EnumCV_FrameToFrameResultsTemplate.SOURCE_OF_MEASUREMENTS_121112.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().createImageNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strRefSOPClassUIDForCORefMacro, strRefSOPInstanceUIDForCORefMacro, arrStrReferencedFrameNumber, strRefSOPClassUID, strRefSOPInstanceUID);
		getSRTree().addChild(objContentSequenceItem);
	}
}
