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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.LesionMargin_CID3715;
import cdac.medinfo.sdk.dcm30_04.templates.cid.PlaqueStructures_CID3802;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_LesionMargin;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PlaqueProperties;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PlaqueStructures;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_PlaqueProperties;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents PlaqueProperties_TID3911
 */
public class PlaqueProperties_TID3911 extends Template
{
	private static final String strCM = null;
	
	/**
	 * Object of CalciumScoringResults_TID3905
	 */
	private CalciumScoringResults_TID3905 objCalciumScoringResultsTID3905;
		
	/**
	 * Object of PlaqueStructures_CID3802
	 */
	private PlaqueStructures_CID3802 objPlaqueStructuresCID3802;
	
	/**
	 * Object of LesionMargin_CID3715
	 */
	private LesionMargin_CID3715 objLesionMarginCID3715;
	
	/**
	 * Instantiates a new PlaqueProperties_TID3911 Template.
	 * @param objTree Object of SRTree.
	 */
	public PlaqueProperties_TID3911(SRTree objTree)
	{
		super(objTree);
	}

	/**
	 * Retrieves Calcium Scoring Results.
	 * @return objCalciumScoringResultsTID3905 Object of CalciumScoringResults_TID3905 
	 */
	public CalciumScoringResults_TID3905 getCalciumScoringResults() 
	{
		if(null == this.objCalciumScoringResultsTID3905)
			this.objCalciumScoringResultsTID3905 = new CalciumScoringResults_TID3905(getSRTree());
		return this.objCalciumScoringResultsTID3905;
	}
	
	/**
	 * Sets the value for Morphological Abnormal Structure.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setMorphologicalAbnormalStructure(int[] arrPosition, EnumCM_PlaqueStructures enumPlaqueStructures)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PlaqueProperties.MORPHOLOGICAL_ABNORMAL_STRUCTURE.getValue();
		String strCodeValue = EnumCV_PlaqueProperties.MORPHOLOGICAL_ABNORMAL_STRUCTURE_M_01000.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objPlaqueStructuresCID3802)
			this.objPlaqueStructuresCID3802 = new PlaqueStructures_CID3802();
		this.objPlaqueStructuresCID3802.setPlaqueStructures(enumPlaqueStructures);

		String strCM = objPlaqueStructuresCID3802.getCodeMeaning();
		String strCV = objPlaqueStructuresCID3802.getCodeValue();
		String strCSD = objPlaqueStructuresCID3802.getCodingSchemeDesignator();
		String strSNOMEDCTID = objPlaqueStructuresCID3802.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, strCSD, strCSDesg, strCM ,strCV, strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Margin.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setMargin(int[] arrPosition, EnumCM_LesionMargin enumLesionMargin)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PlaqueProperties.MARGIN.getValue();
		String strCodeValue = EnumCV_PlaqueProperties.MARGIN_G_A428.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(null== this.objLesionMarginCID3715)
			this.objLesionMarginCID3715 = new LesionMargin_CID3715();
		this.objLesionMarginCID3715.setLesionMargin(enumLesionMargin);

		String strCM = objLesionMarginCID3715.getCodeMeaning();
		String strCV = objLesionMarginCID3715.getCodeValue();
		String strCSD = objLesionMarginCID3715.getCodingSchemeDesignator();
		String strSNOMEDCTID = objLesionMarginCID3715.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, strCSD, strCSDesg, strCM ,strCV, strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Finding.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree. 
	 */
	public void setFinding(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PlaqueProperties.FINDING.getValue();
		String strCodeValue = EnumCV_PlaqueProperties.FINDING_121071.getValue();
		String strCSD = 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, strCSD, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	
	/**
	 * Sets the value for Contrast Media Seen in Plaque.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strValue 
	 */
	public void setContrastMediaSeenInPlaque(int[] arrPosition, String strValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PlaqueProperties.CONTRAST_MEDIA_SEEN_IN_PLAQUE.getValue();
		String strCodeValue = EnumCV_PlaqueProperties.CONTRAST_MEDIA_SEEN_IN_PLAQUE_R_102DA.getValue();
		String strCSD = EnumCodingSchemeDesignator.SRT.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, strCSD, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * Sets the value for Total Plaque Volume.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strValue 
	 * @param arrNumericValue 
	 * @param string 
	 */
	public void setTotalPlaqueVolume(int[] arrPosition, String strValue, String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_PlaqueProperties.TOTAL_PLAQUE_VOLUME.getValue();
		String strCodeValue = EnumCV_PlaqueProperties.TOTAL_PLAQUE_VOLUME_122376.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

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

}
