/*******************************************************************************
 *  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.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CalcificationDistributionModifier_CID6012;
import cdac.medinfo.sdk.dcm30_04.templates.cid.MammographyCalcificationTypes_CID6010;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CalcificationDistributionModifierFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CalcificationTypesFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_MammographyCADCalcificationClusterTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_MammographyCADCalcificationClusterTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.AreaMeasurementTemplate_TID1401;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.LinearMeasurementTemplate_TID1400;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.VolumeMeasurementTemplate_TID1402;

/**
 * This class represents MammographyCADCalcificationClusterTemplate - TID4010
 */
public class MammographyCADCalcificationClusterTemplate_TID4010 extends Template
{
	/**
	 * Object of LinearMeasurementTemplate_TID1400
	 */

	private LinearMeasurementTemplate_TID1400 objLinearMeasurementTemplateTID1400;

	/**
	 * Object of AreaMeasurementTemplate_TID1401
	 */

	private AreaMeasurementTemplate_TID1401 objAreaMeasurementTemplateTID1401;

	/**
	 * Object of MammographyCalcificationTypes_CID6010
	 */
	private MammographyCalcificationTypes_CID6010 objCalcificationTypesCID6010;

	/**
	 * Object of CalcificationDistributionModifier_CID6012
	 */
	private CalcificationDistributionModifier_CID6012 objCalcificationDistributionModifierCID6012;

	/**
	 * Object of VolumeMeasurementTemplate_TID1402
	 */

	private VolumeMeasurementTemplate_TID1402 objVolumeMeasurementTemplateTID1402;

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

	/**
	 * Retrieves LinearMeasurementTemplate. 
	 * @return objLinearMeasurementTemplateTID1400 Object of LinearMeasurementTemplate_TID1400 
	 */
	public LinearMeasurementTemplate_TID1400 getLinearMeasurementTemplate() 
	{
		if(null == this.objLinearMeasurementTemplateTID1400)
			this.objLinearMeasurementTemplateTID1400 = new LinearMeasurementTemplate_TID1400(getSRTree());
		return this.objLinearMeasurementTemplateTID1400;
	}

	/**
	 * Retrieves AreaMeasurementTemplate. 
	 * @return objAreaMeasurementTemplateTID1401 Object of AreaMeasurementTemplate_TID1401 
	 */
	public AreaMeasurementTemplate_TID1401 getAreaMeasurementTemplate() 
	{
		if(null == this.objAreaMeasurementTemplateTID1401)
			this.objAreaMeasurementTemplateTID1401 = new AreaMeasurementTemplate_TID1401(getSRTree());
		return this.objAreaMeasurementTemplateTID1401;
	}

	/**
	 * Retrieves VolumeMeasurementTemplate. 
	 * @return objVolumeMeasurementTemplateTID1402 Object of VolumeMeasurementTemplate_TID1402 
	 */
	public VolumeMeasurementTemplate_TID1402 getVolumeMeasurementTemplate() 
	{
		if(null == this.objVolumeMeasurementTemplateTID1402)
			this.objVolumeMeasurementTemplateTID1402 = new VolumeMeasurementTemplate_TID1402(getSRTree());
		return this.objVolumeMeasurementTemplateTID1402;
	}

	/**
	 * Sets value for Calcification Type.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCalcificationTypesFromBI_RADS Enumerated value for CalcificationTypesFromBI_RADS
	 */
	public void setCalcificationType(int[] arrPosition, EnumCM_CalcificationTypesFromBI_RADS enumCalcificationTypesFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADCalcificationClusterTemplate.CALCIFICATION_TYPE.getValue();
		String strCodeValue = EnumCV_MammographyCADCalcificationClusterTemplate.CALCIFICATION_TYPE_111009.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for CalcificationType.
		 */
		if(null== this.objCalcificationTypesCID6010)
			this.objCalcificationTypesCID6010 = new MammographyCalcificationTypes_CID6010();
		this.objCalcificationTypesCID6010.setMammographyCalcificationTypes(enumCalcificationTypesFromBI_RADS);

		String strCM = objCalcificationTypesCID6010.getCodeMeaning();
		String strCV = objCalcificationTypesCID6010.getCodeValue();
		String strCSD = objCalcificationTypesCID6010.getCodingSchemeDesignator();
		String strCSV = objCalcificationTypesCID6010.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 Calcification Distribution.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCalcificationDistributionModifierFromBI_RADS Enumerated value for CalcificationDistributionModifierFromBI_RADS
	 */
	public void setCalcificationDistribution(int[] arrPosition, EnumCM_CalcificationDistributionModifierFromBI_RADS enumCalcificationDistributionModifierFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADCalcificationClusterTemplate.CALCIFICATION_DISTRIBUTION.getValue();
		String strCodeValue = EnumCV_MammographyCADCalcificationClusterTemplate.CALCIFICATION_DISTRIBUTION_111008.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Calcification Distribution
		 */
		if(null== this.objCalcificationDistributionModifierCID6012)
			this.objCalcificationDistributionModifierCID6012 = new CalcificationDistributionModifier_CID6012();
		this.objCalcificationDistributionModifierCID6012.setCalcificationDistributionModifier(enumCalcificationDistributionModifierFromBI_RADS);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADCalcificationClusterTemplate.NUMBER_OF_CALCIFICATIONS.getValue();
		String strCodeValue = EnumCV_MammographyCADCalcificationClusterTemplate.NUMBER_OF_CALCIFICATIONS_111038.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

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