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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.BackgroundEchotexture_CID6151;
import cdac.medinfo.sdk.dcm30_04.templates.cid.OverallBreastComposition_CID6000;
import cdac.medinfo.sdk.dcm30_04.templates.cid.Side_CID6022;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BackgroundEchotexture;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BreastCompositionSection;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_OverallBreastCompositionFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SideFromBI_RADS;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_BreastCompositionSection;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_Unit;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents BreastCompositionSection - TID4205
 */
public class BreastCompositionSection_TID4205 extends Template
{
	/**
	 * Object of Side_CID6022
	 */
	private Side_CID6022 objSideCID6022;

	/**
	 * Object of BreastImagingProcedureReported_TID4201. 
	 */
	private BreastImagingProcedureReported_TID4201 objBreastImagingProcedureReportedTID4201;

	/**
	 * Object of OverallBreastComposition_CID6000
	 */
	private OverallBreastComposition_CID6000 objOverallBreastCompositionCID6000;

	/**
	 * Object of BackgroundEchotexture_CID6151
	 */
	private BackgroundEchotexture_CID6151 objBackgroundEchotextureCID6151;
	

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

	/**
	 * Retrieves the object of BreastImagingProcedureReported.
	 * @param objBreastImagingProcedureReportedTID4201 Enumerated value for BreastImagingProcedureReportedTID4201
	 * @return objBreastImagingProcedureReportedTID4201 object of BreastImagingProcedureReported_TID4201
	 */
	public BreastImagingProcedureReported_TID4201 getBreastImagingProcedureReported() 
	{
		if(null == this.objBreastImagingProcedureReportedTID4201)
			this.objBreastImagingProcedureReportedTID4201 = new BreastImagingProcedureReported_TID4201(getSRTree());
		return this.objBreastImagingProcedureReportedTID4201;
	}

	/**
	 * 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_BreastCompositionSection.BREAST_COMPOSITION.getValue();
		String strCodeValue = EnumCV_BreastCompositionSection.BREAST_COMPOSITION_F_01710.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Assessment Category
		 */
		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 value for Laterality.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumSideFromBI_RADS Enumerated value for SideFromBI_RADS.
	 */
	public void setLaterality(int[] arrPosition, EnumCM_SideFromBI_RADS enumSideFromBI_RADS)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_BreastCompositionSection.LATERALITY.getValue();
		String strCodeValue = EnumCV_BreastCompositionSection.LATERALITY_G_C171.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for ComplicationOfProcedure
		 */
		if(null== this.objSideCID6022)
			this.objSideCID6022 = new Side_CID6022();
		this.objSideCID6022.setSide(enumSideFromBI_RADS);

		String strCM = objSideCID6022.getCodeMeaning();
		String strCV = objSideCID6022.getCodeValue();
		String strCSD = objSideCID6022.getCodingSchemeDesignator();
		String strCSV = objSideCID6022.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.
	 */
	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_BreastCompositionSection.PERCENT_GLANDULAR_TISSUE.getValue();
		String strCodeValue = EnumCV_BreastCompositionSection.PERCENT_GLANDULAR_TISSUE_111046.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		ContentSequenceItem objContentSequenceItem = getSRTree().createNumNode(arrPosition,strCodeMeaning,strCodeValue,strCSD,arrNumericValue,strCVForUnit,strCSDForUnit,"",strCMForUnit,"","","","");
		getSRTree().addChild(objContentSequenceItem);
	}
	/**
	 * 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 setBreastBackgroundEchoTexture(int[] arrPosition, EnumCM_BackgroundEchotexture enumBackgroundEchotexture)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_BreastCompositionSection.BREAST_BACKGROUND_ECHO_TEXTURE.getValue();
		String strCodeValue = EnumCV_BreastCompositionSection.BREAST_BACKGROUND_ECHO_TEXTURE_111350.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Assessment Category
		 */
		if(null== this.objBackgroundEchotextureCID6151)
			this.objBackgroundEchotextureCID6151 = new BackgroundEchotexture_CID6151();
		this.objBackgroundEchotextureCID6151.setBackgroundEchotexture(enumBackgroundEchotexture);

		String strCM = objBackgroundEchotextureCID6151.getCodeMeaning();
		String strCV = objBackgroundEchotextureCID6151.getCodeValue();
		String strCSD = objBackgroundEchotextureCID6151.getCodingSchemeDesignator();
		//String strCSV = objBackgroundEchotextureCID6151.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, "", strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

}
