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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.enums.EnumContinuityOfContent;
import cdac.medinfo.sdk.dcm30_04.enums.EnumGraphicType;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ArterialLesionLocations_CID3604;
import cdac.medinfo.sdk.dcm30_04.templates.cid.HemodynamicMeasurementPhase_CID3651;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_AnalyzedSegmentTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_HemodynamicMeasurementPhase;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_AnalyzedSegmentTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Measurement_TID300;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;
import cdac.medinfo.sdk.dcm30_04.templates.hemodynamicsreporttemplates.HemodynamicClinicalContext_TID3520;
import cdac.medinfo.sdk.dcm30_04.templates.quantventricularanalysisrepsriodtemplates.CalibrationTemplate_TID3205;

/**
 * This class represents AnalyzedSegmentTemplate - TID3214
 */
public class AnalyzedSegmentTemplate_TID3214 extends Template
{
	/**
	 * Object of ArterialSourceLocations_CID3606
	 */
	private ArterialLesionLocations_CID3604 objArterialLesionLocations_CID3604;
	/**
	 * Object of HemodynamicMeasurementPhase_CID3651
	 */
	private HemodynamicMeasurementPhase_CID3651 objHemodynamicMeasurementPhaseCID3651;

	/**
	 * Object of CalibrationTemplate_TID3205
	 */

	private CalibrationTemplate_TID3205 objCalibrationTemplateTID3205;

	/**
	 * Object of HemodynamicClinicalContext_TID3520
	 */

	private HemodynamicClinicalContext_TID3520 objHemodynamicClinicalContextTID3520;

	/**
	 * Object of AngiographicLesionAnalysisTemplate_TID3215
	 */

	private AngiographicLesionAnalysisTemplate_TID3215 objAnalysisTemplateTID3215;

	/**
	 * Object of SubSegmentalDataTemplate_TID3217
	 */

	private SubSegmentalDataTemplate_TID3217 objSegmentalDataTemplateTID3217;
	
	/**
	 * Object of SegmentValues_TID3219
	 */
	private SegmentValues_TID3219 objSegmentValuesTID3219;
	/**
	 * Object of Measurement_TID300
	 */
	private Measurement_TID300 objMeasurementTID300;
	/**
	 * Instantiates AnalyzedSegmentTemplate_TID3214 Template.
	 * @param objTree Object of SRTree.
	 */
	public AnalyzedSegmentTemplate_TID3214(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;
	}
	
	/**
	 * Retrieves SegmentValues
	 * @return objSegmentValuesTID3219 Object of SegmentValues_TID3219 
	 */
	public SegmentValues_TID3219 getSegmentValues() 
	{
		if(null == this.objSegmentValuesTID3219)
			this.objSegmentValuesTID3219 = new SegmentValues_TID3219(getSRTree());
		return this.objSegmentValuesTID3219;
	}
	/**
	 * Retrieves Calibration 
	 * @return objCalibrationTemplateTID3205 Object of CalibrationTemplate_TID3205 
	 */
	public CalibrationTemplate_TID3205 getCalibration() 
	{
		if(null == this.objCalibrationTemplateTID3205)
			this.objCalibrationTemplateTID3205 = new CalibrationTemplate_TID3205(getSRTree());
		return this.objCalibrationTemplateTID3205;
	}

	/**
	 * Retrieves SubSegmentalDataTemplate 
	 * @return objSegmentalDataTemplateTID3217 Object of SubSegmentalDataTemplate_TID3217 
	 */
	public SubSegmentalDataTemplate_TID3217 getSubSegmentalDataTemplate() 
	{
		if(null == this.objSegmentalDataTemplateTID3217)
			this.objSegmentalDataTemplateTID3217 = new SubSegmentalDataTemplate_TID3217(getSRTree());
		return this.objSegmentalDataTemplateTID3217;
	}

	/**
	 * Retrieves AngiographicLesionAnalysisTemplate 
	 * @return objAnalysisTemplateTID3215 Object of AngiographicLesionAnalysisTemplate_TID3215 
	 */
	public AngiographicLesionAnalysisTemplate_TID3215 getAngiographicLesionAnalysisTemplate() 
	{
		if(null == this.objAnalysisTemplateTID3215)
			this.objAnalysisTemplateTID3215 = new AngiographicLesionAnalysisTemplate_TID3215(getSRTree());
		return this.objAnalysisTemplateTID3215;
	}

	/**
	 * Retrieves HemodynamicClinicalContext 
	 * @return objHemodynamicClinicalContextTID3520 Object of HemodynamicClinicalContext_TID3520 
	 */
	public HemodynamicClinicalContext_TID3520 getHemodynamicClinicalContext() 
	{
		if(null == this.objHemodynamicClinicalContextTID3520)
			this.objHemodynamicClinicalContextTID3520 = new HemodynamicClinicalContext_TID3520(getSRTree());
		return this.objHemodynamicClinicalContextTID3520;
	}

	/**
	 * 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_AnalyzedSegmentTemplate.FINDINGS.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.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 value for Catheterization Procedure Phase.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumValue This value can be one of the three Enum - EnumCM_ArterialSourceLocations, EnumCM_CoronaryArteries
	 * or EnumCM_CoronaryArterySegments.
	 */
	public void setCatheterizationProcedurePhase(int[] arrPosition, EnumCM_HemodynamicMeasurementPhase enumHemodynamicMeasurementPhase)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AnalyzedSegmentTemplate.CATHETERIZATION_PROCEDURE_PHASE.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.CATHETERIZATION_PROCEDURE_PHASE_G_72BB.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Hemodynamic Measurement Phase
		 */
		if(null== this.objHemodynamicMeasurementPhaseCID3651)
			this.objHemodynamicMeasurementPhaseCID3651 = new HemodynamicMeasurementPhase_CID3651();
		this.objHemodynamicMeasurementPhaseCID3651.setHemodynamicMeasurementPhase(enumHemodynamicMeasurementPhase);

		String strCM = objHemodynamicMeasurementPhaseCID3651.getCodeMeaning();
		String strCV = objHemodynamicMeasurementPhaseCID3651.getCodeValue();
		String strCSD = objHemodynamicMeasurementPhaseCID3651.getCodingSchemeDesignator();
		String strSNOMEDCTID = objHemodynamicMeasurementPhaseCID3651.getSNOMEDCTID();

		/**
		 * 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,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets value for Finding Site.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumValue This value can be one of the three Enum - EnumCM_ArterialSourceLocations, EnumCM_CoronaryArteries
	 * or EnumCM_CoronaryArterySegments.
	 */
	public void setFindingSite(int[] arrPosition, Enum enumValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AnalyzedSegmentTemplate.FINDING_SITE.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.FINDING_SITE_G_C0E3.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Arterial Lesion Location
		 */
		if(null== this.objArterialLesionLocations_CID3604)
			this.objArterialLesionLocations_CID3604 = new ArterialLesionLocations_CID3604();
		this.objArterialLesionLocations_CID3604.setArterialLesionLocation(enumValue);

		String strCM = objArterialLesionLocations_CID3604.getCodeMeaning();
		String strCV = objArterialLesionLocations_CID3604.getCodeValue();
		String strCSD = objArterialLesionLocations_CID3604.getCodingSchemeDesignator();
		String strCSV = objArterialLesionLocations_CID3604.getCodingSchemeVersion();

		/**
		 * 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, strCSV, 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_AnalyzedSegmentTemplate.SOURCE_OF_MEASUREMENTS.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.SOURCE_OF_MEASUREMENTS_121112.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type IMAGE 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);
	}

	/**
	 * Sets the value for Left Contour
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrFlGraphicData Float array for FlGraphicData.
	 * @param enumGraphicType Enumerated value for GraphicType.
	 */
	public void setLeftContour(int[] arrPosition, float []arrFlGraphicData, EnumGraphicType enumGraphicType)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AnalyzedSegmentTemplate.LEFT_CONTOUR.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.LEFT_CONTOUR_122507.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type SCOORD and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createSCOORDNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, arrFlGraphicData, enumGraphicType);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Right Contour
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrFlGraphicData Float array for FlGraphicData.
	 * @param enumGraphicType Enumerated value for GraphicType.
	 */
	public void setRightContour(int[] arrPosition, float []arrFlGraphicData, EnumGraphicType enumGraphicType)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AnalyzedSegmentTemplate.RIGHT_CONTOUR.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.RIGHT_CONTOUR_122508.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type SCOORD and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createSCOORDNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, arrFlGraphicData, enumGraphicType);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Diameter Graph
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setDiameterGraph(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AnalyzedSegmentTemplate.DIAMETER_GRAPH.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.DIAMETER_GRAPH_122509.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 Graph Increment.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String numeric array for Graph Increment
	 */
	public void setGraphIncrement(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.PIXELS.getValue();
		String strCVForUnit = EnumCV_Unit.PIXELS.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AnalyzedSegmentTemplate.GRAPH_INCREMENT.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.GRAPH_INCREMENT_122511.getValue();
		String strCSD = EnumCodingSchemeDesignator.SUP76.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Site of Luminal Minimum.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Site of Luminal Minimum.
	 */
	public void setSiteOfLuminalMinimum(int[] arrPosition, String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AnalyzedSegmentTemplate.SITE_OF_LUMINAL_MINIMUM.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.SITE_OF_LUMINAL_MINIMUM_122382.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator For Unit 
		 */
		String strCMForUnit = EnumCM_Unit.PIXELS.getValue();
		String strCVForUnit = EnumCV_Unit.PIXELS.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Site of Luminal Maximum.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String array for Site of Luminal Maximum.
	 */
	public void setSiteOfLuminalMaximum(int[] arrPosition, String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AnalyzedSegmentTemplate.SITE_OF_LUMINAL_MAXIMUM.getValue();
		String strCodeValue = EnumCV_AnalyzedSegmentTemplate.SITE_OF_LUMINAL_MAXIMUM_122516.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator For Unit 
		 */
		String strCMForUnit = EnumCM_Unit.PIXELS.getValue();
		String strCVForUnit = EnumCV_Unit.PIXELS.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
}
