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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.enums.EnumContinuityOfContent;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.BestInSet_CID7012;
import cdac.medinfo.sdk.dcm30_04.templates.cid.KeyObjectSelectionDocumentTitle_CID7010;
import cdac.medinfo.sdk.dcm30_04.templates.cid.RejectedForQualityReasons_CID7011;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BestInSet;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_KeyObjectSelection;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_KeyObjectSelectionDocumentTitle;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RejectedForQualityReasons;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_KeyObjectSelection;


/**
 * This class represents KeyObjectSelection_TID2010
 */
public class KeyObjectSelection_TID2010 extends Template{

	private KeyObjectSelectionDocumentTitle_CID7010 objKeyObjectSelectionDocumentTitle_CID7010;
	
	private BestInSet_CID7012 objBestInSet_CID7012;
	
	private RejectedForQualityReasons_CID7011 objRejectedForQualityReasons_CID7011;
	/**
	 * Object of LanguageOfContentItemandDescendants_TID1204
	 */
	private LanguageOfContentItemAndDescendants_TID1204 objLanguageOfContentItemandDescendants_TID1204;
	/**
	 * Object of ObservationContext_TID1001
	 */
	private ObservationContext_TID1001 objObservationContext_TID1001;
	
	public KeyObjectSelection_TID2010(SRTree objTree) {
		super(objTree);
	}
	/**
	 * Retrieves ObservationContext_TID1001 
	 * @return objObservationContext_TID1001 Object of ObservationContext_TID1001 
	 */
	public ObservationContext_TID1001 getObservationContext() 
	{
		if(null == this.objObservationContext_TID1001)
			this.objObservationContext_TID1001 = new ObservationContext_TID1001(getSRTree());
		return this.objObservationContext_TID1001;
	}
	/**
	 * Retrieves LanguageOfContentItemandDescendants_TID1204 
	 * @return objLanguageOfContentItemandDescendants_TID1204 Object of LanguageOfContentItemandDescendants_TID1204 
	 */
	public LanguageOfContentItemAndDescendants_TID1204 getLanguageOfContentItemandDescendants() 
	{
		if(null == this.objLanguageOfContentItemandDescendants_TID1204)
			this.objLanguageOfContentItemandDescendants_TID1204 = new LanguageOfContentItemAndDescendants_TID1204(getSRTree());
		return this.objLanguageOfContentItemandDescendants_TID1204;
	}
	/**
	 * Sets the value for OrganDoseInformation 
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumContinuityOfContent Enumerated Value for ContinuityOfContent.
	 */
	public void setKeyObjectSelectionDocumentTitle_CID7010(int[] arrPosition, EnumContinuityOfContent enumContinuityOfContent,EnumCM_KeyObjectSelectionDocumentTitle enumKeyObjectSelectionDocumentTitle)
	{
		if(null== this.objKeyObjectSelectionDocumentTitle_CID7010)
			this.objKeyObjectSelectionDocumentTitle_CID7010 = new KeyObjectSelectionDocumentTitle_CID7010();
		this.objKeyObjectSelectionDocumentTitle_CID7010.setKeyObjectSelectionDocumentTitle(enumKeyObjectSelectionDocumentTitle);
		String strCM,strCV,strCSD;
		 strCM = objKeyObjectSelectionDocumentTitle_CID7010.getCodeMeaning();
		 strCV = objKeyObjectSelectionDocumentTitle_CID7010.getCodeValue();
		 strCSD = objKeyObjectSelectionDocumentTitle_CID7010.getCodingSchemeDesignator();
		

		/**
		 * Creating a node of Value Type UIDREF and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createContainer(arrPosition, strCM, strCV, strCSD, enumContinuityOfContent);
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setDocumentTitleModifier(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_KeyObjectSelection.DOCUMENT_TITLE_MODIFIER.getValue();
		String strCodeValue = EnumCV_KeyObjectSelection.DOCUMENT_TITLE_MODIFIER_113011.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();
		
				
		
		/**
		 * 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, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
	public void setDocumentTitleModifier(int[] arrPosition,EnumCM_RejectedForQualityReasons enumRejectedForQualityReasons)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
	
		String strCM,strCV,strCSD;
		if(null== this.objRejectedForQualityReasons_CID7011)
			this.objRejectedForQualityReasons_CID7011 = new RejectedForQualityReasons_CID7011();
		this.objRejectedForQualityReasons_CID7011.setRejectedForQualityReasons(enumRejectedForQualityReasons);
		 strCM = objRejectedForQualityReasons_CID7011.getCodeMeaning();
		 strCV = objRejectedForQualityReasons_CID7011.getCodeValue();
		 strCSD = objRejectedForQualityReasons_CID7011.getCodingSchemeDesignator();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_KeyObjectSelection.DOCUMENT_TITLE_MODIFIER.getValue();
		String strCodeValue = EnumCV_KeyObjectSelection.DOCUMENT_TITLE_MODIFIER_113011.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();
		
				
		
		/**
		 * 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);
	}
	public void setDocumentTitleModifier(int[] arrPosition,EnumCM_BestInSet enumBestInSet)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
	
		String strCM,strCV,strCSD;
		if(null== this.objBestInSet_CID7012)
			this.objBestInSet_CID7012 = new BestInSet_CID7012();
		this.objBestInSet_CID7012.setBestInSet(enumBestInSet);
		 strCM = objBestInSet_CID7012.getCodeMeaning();
		 strCV = objBestInSet_CID7012.getCodeValue();
		 strCSD = objBestInSet_CID7012.getCodingSchemeDesignator();
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_KeyObjectSelection.DOCUMENT_TITLE_MODIFIER.getValue();
		String strCodeValue = EnumCV_KeyObjectSelection.DOCUMENT_TITLE_MODIFIER_113011.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.DCM.getValue();
		
				
		
		/**
		 * 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 the value for Key Object Description
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strMeasurementMethod String value for Comment.
	 */
	public void setKeyObjectDescription(int[] arrPosition, String strMeasurementMethod)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_KeyObjectSelection.KEY_OBJECT_DESCRIPTION.getValue();
		String strCodeValue = EnumCV_KeyObjectSelection.KEY_OBJECT_DESCRIPTION_113012.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type TEXT and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createTextNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strMeasurementMethod);
		getSRTree().addChild(objContentSequenceItem);
	}
}
