/*******************************************************************************
 *  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.OverallBreastComposition_CID6000;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_MammographyCADBreastCompositionTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_OverallBreastCompositionFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_MammographyCADBreastCompositionTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents MammographyCADBreastCompositionTemplate - TID4007
 */
public class MammographyCADBreastCompositionTemplate_TID4007 extends Template
{
	/**
	 * Object of OverallBreastComposition_CID6000
	 */
	private OverallBreastComposition_CID6000 objOverallBreastCompositionCID6000;

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

	/**
	 * Sets value for Breast composition.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumOverallBreastCompositionFromBI_RADS Enumerated value for enumOverallBreastCompositionFromBI_RADS
	 */
	public void setBreastComposition(int[] arrPosition, EnumCM_OverallBreastCompositionFromBI_RADS enumOverallBreastCompositionFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADBreastCompositionTemplate.BREAST_COMPOSITION.getValue();
		String strCodeValue = EnumCV_MammographyCADBreastCompositionTemplate.BREAST_COMPOSITION_F_01710.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Breast Composition.
		 */
		if(null== this.objOverallBreastCompositionCID6000)
			this.objOverallBreastCompositionCID6000 = new OverallBreastComposition_CID6000();
		this.objOverallBreastCompositionCID6000.setOverallBreastComposition(enumOverallBreastCompositionFromBI_RADS);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADBreastCompositionTemplate.PERCENT_FIBROGLANDULAR_TISSUE.getValue();
		String strCodeValue = EnumCV_MammographyCADBreastCompositionTemplate.PERCENT_FIBROGLANDULAR_TISSUE_111046.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

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