/*******************************************************************************
 *  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.NonLesionObjectType_CID6040;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_MammographyCADNonLesionTemplate;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_NonLesionObjectType;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_MammographyCADNonLesionTemplate;
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 MammographyCADNonLesionTemplate - TID4012
 */
public class MammographyCADNonLesionTemplate_TID4012 extends Template
{
	/**
	 * Object of LinearMeasurementTemplate_TID1400
	 */

	private LinearMeasurementTemplate_TID1400 objLinearMeasurementTemplateTID1400;

	/**
	 * Object of AreaMeasurementTemplate_TID1401
	 */

	private AreaMeasurementTemplate_TID1401 objAreaMeasurementTemplateTID1401;

	/**
	 * Object of NonLesionObjectType_CID6040
	 */
	private NonLesionObjectType_CID6040 objNonLesionObjectTypeCID6040;

	/**
	 * Object of VolumeMeasurementTemplate_TID1402
	 */

	private VolumeMeasurementTemplate_TID1402 objVolumeMeasurementTemplateTID1402;

	/**
	 * Instantiates a new MammographyCADNonLesionTemplate_TID4012 Template.
	 * @param objTree Object of SRTree.
	 */
	public MammographyCADNonLesionTemplate_TID4012(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 Object type.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumNonLesionObjectType Enumerated value for NonLesionObjectType
	 */
	public void setObjectType(int[] arrPosition, EnumCM_NonLesionObjectType enumNonLesionObjectType)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_MammographyCADNonLesionTemplate.OBJECT_TYPE.getValue();
		String strCodeValue = EnumCV_MammographyCADNonLesionTemplate.OBJECT_TYPE_111039.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Setting value for NonLesionObjectType
		 */
		if(null== this.objNonLesionObjectTypeCID6040)
			this.objNonLesionObjectTypeCID6040 = new NonLesionObjectType_CID6040();
		this.objNonLesionObjectTypeCID6040.setNonLesionObjectType(enumNonLesionObjectType);

		String strCM = objNonLesionObjectTypeCID6040.getCodeMeaning();
		String strCV = objNonLesionObjectTypeCID6040.getCodeValue();
		String strCSD = objNonLesionObjectTypeCID6040.getCodingSchemeDesignator();
		String strSNOMEDCTID = objNonLesionObjectTypeCID6040.getSNOMEDCTID();
		
		/**
		 * 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,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}
}
