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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.enums.EnumGraphicType;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CADAnalysisPerformedTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_CADAnalysisPerformedTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents CADAnalysisPerformedTemplate - TID4018
 */
public class CADAnalysisPerformedTemplate_TID4018 extends Template
{
	/**
	 * Object of CADAlgorithmIdentificationTemplate_TID4019
	 */

	private CADAlgorithmIdentificationTemplate_TID4019 objAlgorithmIdentificationTemplateTID4019;
	
	/**
	 * Object of CADOperatingPoints_TID4023
	 */
	private CADOperatingPoints_TID4023 objCADOperatingPointsTID4023;

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

	/**
	 * Retrieves CADAlgorithmIdentificationTemplate 
	 * @return objAlgorithmIdentificationTemplateTID4019 Object of CADAlgorithmIdentificationTemplate_TID4019 
	 */
	public CADAlgorithmIdentificationTemplate_TID4019 getCADAlgorithmIdentificationTemplate() 
	{
		if(null == this.objAlgorithmIdentificationTemplateTID4019)
			this.objAlgorithmIdentificationTemplateTID4019 = new CADAlgorithmIdentificationTemplate_TID4019(getSRTree());
		return this.objAlgorithmIdentificationTemplateTID4019;
	}


	/**
	 * Retrieves CADOperatingPoints. 
	 * @return objCADOperatingPointsTID4023 Object of CADOperatingPoints_TID4023 
	 */
	public CADOperatingPoints_TID4023 getCADOperatingPoints() 
	{
		if(null == this.objCADOperatingPointsTID4023)
			this.objCADOperatingPointsTID4023 = new CADOperatingPoints_TID4023(getSRTree());
		return this.objCADOperatingPointsTID4023;
	}

	
	/**
	 * Sets the value for Series Instance UID
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strSeriesInstanceUID String value for SeriesInstanceUID.
	 */
	public void setSeriesInstanceUID(int[] arrPosition, String strSeriesInstanceUID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CADAnalysisPerformedTemplate.SERIES_INSTANCE_UID.getValue();
		String strCodeValue = EnumCV_CADAnalysisPerformedTemplate.SERIES_INSTANCE_UID_112002.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().createUIDREFNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strSeriesInstanceUID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Image Region.
	 * @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 setImageRegion(int[] arrPosition, float []arrFlGraphicData, EnumGraphicType enumGraphicType)
	{	
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CADAnalysisPerformedTemplate.IMAGE_REGION.getValue();
		String strCodeValue = EnumCV_CADAnalysisPerformedTemplate.IMAGE_REGION_111030.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 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 strCodeMeaning = EnumCM_CADAnalysisPerformedTemplate.ANALYSIS_PERFORMED.getValue();
		String strCodeValue = EnumCV_CADAnalysisPerformedTemplate.ANALYSIS_PERFORMED_111004.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);
	}
}
