/*******************************************************************************
 *  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.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ArterialLesionLocations_CID3604;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CardiovascularAnatomicLocationModifiers_CID3019;
import cdac.medinfo.sdk.dcm30_04.templates.cid.QAReferenceMethods_CID3465;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_AngiographicLesionAnalysisTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CardiovascularAnatomicLocationModifiers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_QAReferenceMethods;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_AngiographicLesionAnalysisTemplate;
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;

/**
 * This class represents AngiographicLesionAnalysisTemplate - TID3215
 */
public class AngiographicLesionAnalysisTemplate_TID3215 extends Template
{
	/**
	 * Object of Measurement_TID300
	 */
	private Measurement_TID300 objMeasurementTID300;
	/**
	 * Object of CardiovascularAnatomicLocationModifiers_CID3019
	 */
	private CardiovascularAnatomicLocationModifiers_CID3019 objAnatomicLocationModifiersCID3019;

	/**
	 * Object of ArterialSourceLocations_CID3606
	 */
	private ArterialLesionLocations_CID3604 objArterialLesionLocations_CID3604;

	/**
	 * Object of QAReferenceMethods_CID3465
	 */
	private QAReferenceMethods_CID3465 objQaReferenceMethodsCID3465;

	/**
	 * Object of PositionInArterialSegment_TID3218
	 */

	private PositionInArterialSegment_TID3218 objPositionInArterialSegmentTID3218;
	/**
	 * Object of StenoticFlowReserve_TID3216
	 */

	private StenoticFlowReserve_TID3216 objStenoticFlowReserveTID3216;

	/**
	 * Instantiates AngiographicLesionAnalysisTemplate_TID3215 Template.
	 * @param objTree Object of SRTree.
	 */
	public AngiographicLesionAnalysisTemplate_TID3215(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 StenoticFlowReserve
	 * @return objStenoticFlowReserveTID3216 Object of StenoticFlowReserve_TID3216 
	 */
	public StenoticFlowReserve_TID3216 getStenoticFlowReserve() 
	{
		if(null == this.objStenoticFlowReserveTID3216)
			this.objStenoticFlowReserveTID3216 = new StenoticFlowReserve_TID3216(getSRTree());
		return this.objStenoticFlowReserveTID3216;
	}
	/**
	 * Retrieves PositionInArterialSegment 
	 * @return objObserverContext Object of PositionInArterialSegment_TID3218 
	 */
	public PositionInArterialSegment_TID3218 getPositionInArterialSegment() 
	{
		if(null == this.objPositionInArterialSegmentTID3218)
			this.objPositionInArterialSegmentTID3218 = new PositionInArterialSegment_TID3218(getSRTree());
		return this.objPositionInArterialSegmentTID3218;
	}

	/**
	 * Sets the value for Lesion Finding
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setLesionFinding(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AngiographicLesionAnalysisTemplate.LESION_FINDING.getValue();
		String strCodeValue = EnumCV_AngiographicLesionAnalysisTemplate.LESION_FINDING_F_00585.getValue();
		String strCSD = EnumCodingSchemeDesignator.SRT.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 Lesion Identifier
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strLesionIdentifier String value for Lesion Identifier.
	 */
	public void setLesionIdentifier(int[] arrPosition, String strLesionIdentifier)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AngiographicLesionAnalysisTemplate.LESION_IDENTIFIER.getValue();
		String strCodeValue = EnumCV_AngiographicLesionAnalysisTemplate.LESION_IDENTIFIER_121151.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, strLesionIdentifier);
		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_AngiographicLesionAnalysisTemplate.FINDING_SITE.getValue();
		String strCodeValue = EnumCV_AngiographicLesionAnalysisTemplate.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 Topographical modifier.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCardiovascularAnatomicLocationModifiers Enumerated value for Topographical modifier.
	 */
	public void setTopographicalModifier(int[] arrPosition, EnumCM_CardiovascularAnatomicLocationModifiers enumCardiovascularAnatomicLocationModifiers)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AngiographicLesionAnalysisTemplate.TOPOGRAPHICAL_MODIFIER.getValue();
		String strCodeValue = EnumCV_AngiographicLesionAnalysisTemplate.TOPOGRAPHICAL_MODIFIER_G_A1F8.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Topographical modifier
		 */
		if(null== this.objAnatomicLocationModifiersCID3019)
			this.objAnatomicLocationModifiersCID3019 = new CardiovascularAnatomicLocationModifiers_CID3019();
		this.objAnatomicLocationModifiersCID3019.setCardiovascularAnatomicLocationModifiers(enumCardiovascularAnatomicLocationModifiers);

		String strCM = objAnatomicLocationModifiersCID3019.getCodeMeaning();
		String strCV = objAnatomicLocationModifiersCID3019.getCodeValue();
		String strCSD = objAnatomicLocationModifiersCID3019.getCodingSchemeDesignator();
		String strSNOMEDCTID = objAnatomicLocationModifiersCID3019.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 Reference Method.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumQAReferenceMethods Enumerated value for Reference Method.
	 */
	public void setReferenceMethod(int[] arrPosition, EnumCM_QAReferenceMethods enumQAReferenceMethods)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AngiographicLesionAnalysisTemplate.REFERENCE_METHOD.getValue();
		String strCodeValue = EnumCV_AngiographicLesionAnalysisTemplate.REFERENCE_METHOD_122430.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Reference Method
		 */
		if(null== this.objQaReferenceMethodsCID3465)
			this.objQaReferenceMethodsCID3465 = new QAReferenceMethods_CID3465();
		this.objQaReferenceMethodsCID3465.setQAReferenceMethods(enumQAReferenceMethods);

		String strCM = objQaReferenceMethodsCID3465.getCodeMeaning();
		String strCV = objQaReferenceMethodsCID3465.getCodeValue();
		String strCSD = objQaReferenceMethodsCID3465.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 the value for Relative Position.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String numeric array for Relative Position
	 */
	public void setRelativePosition(int[] arrPosition,String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCMForUnit = EnumCM_Unit.MM.getValue();
		String strCVForUnit = EnumCV_Unit.MM.getValue();
		String strCSDForUnit = EnumCodingSchemeDesignator.UCUM.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AngiographicLesionAnalysisTemplate.RELATIVE_POSITION.getValue();
		String strCodeValue = EnumCV_AngiographicLesionAnalysisTemplate.RELATIVE_POSITION_122337.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Reference Points.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param arrNumericValue String numeric array for Relative Position
	 * @param enumContinuityOfContent 
	 */
	public void setReferencePoints(int[] arrPosition,String[] arrNumericValue, EnumContinuityOfContent enumContinuityOfContent)
	{

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AngiographicLesionAnalysisTemplate.REFERENCE_POINTS.getValue();
		String strCodeValue = EnumCV_AngiographicLesionAnalysisTemplate.REFERENCE_POINTS_122438.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createContainer(arrPosition, strCodeMeaning, strCodeValue, strCSD, enumContinuityOfContent);
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Densitometrical Luminal Cross-sectional Area Graph
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setDensitometricalLuminalCrossSectionalAreaGraph(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_AngiographicLesionAnalysisTemplate.DENSITOMETRICAL_LUMINAL_CROSS_SECTIONAL_AREA_GRAPH.getValue();
		String strCodeValue = EnumCV_AngiographicLesionAnalysisTemplate.DENSITOMETRICAL_LUMINAL_CROSS_SECTIONAL_AREA_GRAPH_122517.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_AngiographicLesionAnalysisTemplate.GRAPH_INCREMENT.getValue();
		String strCodeValue = EnumCV_AngiographicLesionAnalysisTemplate.GRAPH_INCREMENT_122511.getValue();
		String strCSD = EnumCodingSchemeDesignator.SUP76.getValue();

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