/*******************************************************************************
 *  Copyright 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.chestcadsriodtemplates.TrackingIdentifier_TID4108;
import cdac.medinfo.sdk.dcm30_04.templates.cid.IntendedUseOfCADOutput_CID6034;
import cdac.medinfo.sdk.dcm30_04.templates.cid.MammographyCompositeFeature_CID6016;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_IntendedUseOfCADOutput;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_MammographyCADCompositeFeature;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_MammographyCADCompositeFeature;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents MammographyCADCompositeFeature_TID4004
 */
public class MammographyCADCompositeFeature_TID4004 extends Template
{
	/**
	 * Object of TrackingIdentifier_TID4108
	 */

	private TrackingIdentifier_TID4108 objTrackingIdentifierTID4108;

	/**
	 * Object of MammographyCompositeFeature_CID6016
	 */
	private MammographyCompositeFeature_CID6016 objMammographyCompositeFeatureCID6016;

	/**
	 * Object of IntendedUseOfCADOutput_CID6034
	 */
	private IntendedUseOfCADOutput_CID6034 objIntendedUseOfCADOutputCID6034;

	/**
	 * Object of MammographyCADSingleImageFindingTemplate_TID4006
	 */
	private MammographyCADSingleImageFindingTemplate_TID4006 objMammographyCADSingleImageFindingTemplateTID4006;

	/**
	 * Object of MammographyCADCompositeFeatureBodyTemplate_TID4005
	 */
	private MammographyCADCompositeFeatureBodyTemplate_TID4005 objMammographyCADCompositeFeatureBodyTemplateTID4005;
	
	/**
	 * Object of CADObservationContextTemplate_TID4022
	 */
	private CADObservationContextTemplate_TID4022 objCADObservationContextTemplateTID4022;

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

	/**
	 * Retrieves Tracking Identifier.
	 * @return objTrackingIdentifierTID4108 Object of TrackingIdentifier_TID4108 
	 */
	public TrackingIdentifier_TID4108 getTrackingIdentifier() 
	{
		if(null == this.objTrackingIdentifierTID4108)
			this.objTrackingIdentifierTID4108 = new TrackingIdentifier_TID4108(getSRTree());
		return this.objTrackingIdentifierTID4108;
	}

	/**
	 * Retrieves MammographyCADSingleImageFindingTemplate
	 * @return objMammographyCADSingleImageFindingTemplateTID4006 Object of MammographyCADSingleImageFindingTemplate_TID4006 
	 */
	public MammographyCADSingleImageFindingTemplate_TID4006 getMammographyCADSingleImageFindingTemplate() 
	{
		if(null == this.objMammographyCADSingleImageFindingTemplateTID4006)
			this.objMammographyCADSingleImageFindingTemplateTID4006 = new MammographyCADSingleImageFindingTemplate_TID4006(getSRTree());
		return this.objMammographyCADSingleImageFindingTemplateTID4006;
	}

	/**
	 * Retrieves MammographyCADCompositeFeatureBodyTemplate.
	 * @return objMammographyCADCompositeFeatureBodyTemplateTID4005 Object of MammographyCADCompositeFeatureBodyTemplate_TID4005 
	 */
	public MammographyCADCompositeFeatureBodyTemplate_TID4005 getMammographyCADCompositeFeatureBodyTemplate() 
	{
		if(null == this.objMammographyCADCompositeFeatureBodyTemplateTID4005)
			this.objMammographyCADCompositeFeatureBodyTemplateTID4005 = new MammographyCADCompositeFeatureBodyTemplate_TID4005(getSRTree());
		return this.objMammographyCADCompositeFeatureBodyTemplateTID4005;
	}

	/**
	 * Retrieves AreaMeasurementTemplate 
	 * @return objCADObservationContextTemplateTID4022 Object of CADObservationContextTemplate_TID4022 
	 */
	public CADObservationContextTemplate_TID4022 getCADObservationContextTemplate() 
	{
		if(null == this.objCADObservationContextTemplateTID4022)
			this.objCADObservationContextTemplateTID4022 = new CADObservationContextTemplate_TID4022(getSRTree());
		return this.objCADObservationContextTemplateTID4022;
	}

	/**
	 * Sets value for RenderingIntent.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumIntendedUseOfCADOutput Enumerated value forIntendedUseOfCADOutput.
	 */
	public void setRenderingIntent(int[] arrPosition, EnumCM_IntendedUseOfCADOutput enumIntendedUseOfCADOutput)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADCompositeFeature.RENDERING_INTENT.getValue();
		String strCodeValue = EnumCV_MammographyCADCompositeFeature.RENDERING_INTENT_111056.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for Quality Assessment
		 */
		if(null== this.objIntendedUseOfCADOutputCID6034)
			this.objIntendedUseOfCADOutputCID6034 = new IntendedUseOfCADOutput_CID6034();
		this.objIntendedUseOfCADOutputCID6034.setIntendedUseOfCADOutput(enumIntendedUseOfCADOutput);

		String strCM = objIntendedUseOfCADOutputCID6034.getCodeMeaning();
		String strCV = objIntendedUseOfCADOutputCID6034.getCodeValue();
		String strCSD = objIntendedUseOfCADOutputCID6034.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 CompositeFeature.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setCompositeFeature(int[] arrPosition, Enum enumValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADCompositeFeature.COMPOSITE_FEATURE.getValue();
		String strCodeValue = EnumCV_MammographyCADCompositeFeature.COMPOSITE_FEATURE_111015.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for MammographyCompositeFeature
		 */
		if(null== this.objMammographyCompositeFeatureCID6016)
			this.objMammographyCompositeFeatureCID6016 = new MammographyCompositeFeature_CID6016();
		this.objMammographyCompositeFeatureCID6016.setMammographyCompositeFeature(enumValue);

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

}
