/*******************************************************************************
 *  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.DensityModifier_CID6008;
import cdac.medinfo.sdk.dcm30_04.templates.cid.MammographyCharacteristicsOfMargin_CID6006;
import cdac.medinfo.sdk.dcm30_04.templates.cid.MammographyCharacteristicsOfShape_CID6004;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CharacteristicsOfMarginFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CharacteristicsOfShapeFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DensityModifierFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_MammographyCADDensityTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_MammographyCADDensityTemplate;
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 MammographyCADDensityTemplate - TID4011
 */
public class MammographyCADDensityTemplate_TID4011 extends Template
{
	/**
	 * Object of LinearMeasurementTemplate_TID1400
	 */

	private LinearMeasurementTemplate_TID1400 objLinearMeasurementTemplateTID1400;

	/**
	 * Object of AreaMeasurementTemplate_TID1401
	 */

	private AreaMeasurementTemplate_TID1401 objAreaMeasurementTemplateTID1401;

	/**
	 * Object of VolumeMeasurementTemplate_TID1402
	 */

	private VolumeMeasurementTemplate_TID1402 objVolumeMeasurementTemplateTID1402;

	/**
	 * Object of DensityModifier_CID6008
	 */
	private DensityModifier_CID6008 objDensityModifierCID6008;

	/**
	 * Object of MammographyCharacteristicsOfShape_CID6004
	 */
	private MammographyCharacteristicsOfShape_CID6004 objCharacteristicsOfShapeCID6004;

	/**
	 * Object of MammographyCharacteristicsOfMargin_CID6006
	 */
	private MammographyCharacteristicsOfMargin_CID6006 objCharacteristicsOfMarginCID6006;

	/**
	 * Instantiates a new MammographyCADDensityTemplate_TID4011 Template.
	 * @param objTree Object of SRTree.
	 */
	public MammographyCADDensityTemplate_TID4011(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 Lesion Density.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumDensityModifierFromBI_RADS Enumerated value for DensityModifierFromBI_RADS
	 */
	public void setLesionDensity(int[] arrPosition, EnumCM_DensityModifierFromBI_RADS enumDensityModifierFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADDensityTemplate.LESION_DENSITY.getValue();
		String strCodeValue = EnumCV_MammographyCADDensityTemplate.LESION_DENSITY_111035.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Density Modifier.
		 */
		if(null== this.objDensityModifierCID6008)
			this.objDensityModifierCID6008 = new DensityModifier_CID6008();
		this.objDensityModifierCID6008.setDensityModifier(enumDensityModifierFromBI_RADS);

		String strCM = objDensityModifierCID6008.getCodeMeaning();
		String strCV = objDensityModifierCID6008.getCodeValue();
		String strCSD = objDensityModifierCID6008.getCodingSchemeDesignator();
		String strCSV = objDensityModifierCID6008.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 Shape.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCharacteristicsOfShapeFromBI_RADS Enumerated value for CharacteristicsOfShapeFromBI_RADS
	 */
	public void setShape(int[] arrPosition, EnumCM_CharacteristicsOfShapeFromBI_RADS enumCharacteristicsOfShapeFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADDensityTemplate.SHAPE.getValue();
		String strCodeValue = EnumCV_MammographyCADDensityTemplate.SHAPE_M_020F9.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Shape
		 */
		if(null== this.objCharacteristicsOfShapeCID6004)
			this.objCharacteristicsOfShapeCID6004 = new MammographyCharacteristicsOfShape_CID6004();
		this.objCharacteristicsOfShapeCID6004.setMammographyCharacteristicsOfShape(enumCharacteristicsOfShapeFromBI_RADS);

		String strCM = objCharacteristicsOfShapeCID6004.getCodeMeaning();
		String strCV = objCharacteristicsOfShapeCID6004.getCodeValue();
		String strCSD = objCharacteristicsOfShapeCID6004.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 value for Margins.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumCharacteristicsOfMarginFromBI_RADS Enumerated value for CharacteristicsOfMarginFromBI_RADS
	 */
	public void setMargins(int[] arrPosition, EnumCM_CharacteristicsOfMarginFromBI_RADS enumCharacteristicsOfMarginFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADDensityTemplate.MARGINS.getValue();
		String strCodeValue = EnumCV_MammographyCADDensityTemplate.MARGINS_111037.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Margins.
		 */
		if(null== this.objCharacteristicsOfMarginCID6006)
			this.objCharacteristicsOfMarginCID6006 = new MammographyCharacteristicsOfMargin_CID6006();
		this.objCharacteristicsOfMarginCID6006.setMammographyCharacteristicsOfMargin(enumCharacteristicsOfMarginFromBI_RADS);

		String strCM = objCharacteristicsOfMarginCID6006.getCodeMeaning();
		String strCV = objCharacteristicsOfMarginCID6006.getCodeValue();
		String strCSD = objCharacteristicsOfMarginCID6006.getCodingSchemeDesignator();
		String strCSV = objCharacteristicsOfMarginCID6006.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);
	}
}
