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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ProcedureIntent_CID3629;
import cdac.medinfo.sdk.dcm30_04.templates.cid.ProcedureUrgency_CID3414;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_NoBCIDSpecified;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ProcedureIntent;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_ProcedureUrgency;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_TID3601ProcedureContext;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_TID3601ProcedureContext;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * The Procedure Context template describes acquisition context for measurements made or events
 * recorded in a procedure.
 */
/**
 * This class represents ProcedureContext - TID3601
 */
public class ProcedureContext_TID3601 extends Template
{
	/**
	 * Object of ProcedureIntent_CID3629 which represents the CID3629 Template. 
	 */
	private ProcedureIntent_CID3629 objProcedureIntent;

	/**
	 * Object of ProcedureUrgency_CID3414 which represents the CID3414 Template. 
	 */
	private ProcedureUrgency_CID3414 objProcedureUrgency;

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


	/**
	 * Sets the value for Procedure Description
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strProcedureDescription String value for ProcedureDescription.
	 */
	public void setProcedureDescription(int[] arrPosition, String strProcedureDescription)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_TID3601ProcedureContext.PROCEDURE_DESCRIPTION.getValue();
		String strCodeValue = EnumCV_TID3601ProcedureContext.PROCEDURE_DESCRIPTION_121065.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, strProcedureDescription);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Has Intent.
	 * @param arrPosition  arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumProcedureIntent Enum value for Procedure Intent
	 * @param strCodingSchemeVersionForCode String value for CodingSchemeVersion 
	 */
	public void setHasIntent(int[] arrPosition, EnumCM_ProcedureIntent enumProcedureIntent,String strCodingSchemeVersionForCode)
	{
		/**
		 * Sets the value for ProcedureIntent.
		 */
		this.objProcedureIntent.setProcedureIntent(enumProcedureIntent);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = this.objProcedureIntent.getCodeMeaning();
		String strCV = this.objProcedureIntent.getCodeValue();
		String strCSD1 = this.objProcedureIntent.getCodingSchemeDesignator();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_TID3601ProcedureContext.HAS_INTENT.getValue();
		String strCodeValue = EnumCV_TID3601ProcedureContext.HAS_INTENT_G_C0E8.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.SRT.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 , strCSD2, strCV, strCSD1, strCodingSchemeVersionForCode, strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Procedure Priority.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumProcedureUrgency value for ProcedureUrgency
	 * @param strCodingSchemeVersionForCode CodingSchemeVersion 
	 */
	public void setProcedurePriority(int[] arrPosition, EnumCM_ProcedureUrgency enumProcedureUrgency,String strCodingSchemeVersionForCode)
	{
		/**
		 * Sets the value for ProcedureUrgency.
		 */
		this.objProcedureUrgency.setProcedureUrgency(enumProcedureUrgency);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = this.objProcedureUrgency.getCodeMeaning();
		String strCV = this.objProcedureUrgency.getCodeValue();
		String strCSD1 = this.objProcedureUrgency.getCodingSchemeDesignator();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_TID3601ProcedureContext.PROCEDURE_PRIORITY.getValue();
		String strCodeValue = EnumCV_TID3601ProcedureContext.PROCEDURE_PRIORITY_G_C09C.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.SRT.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 , strCSD2, strCV, strCSD1, strCodingSchemeVersionForCode, strCM);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Procedure Code.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strCodingSchemeVersionForCode CodingSchemeVersion 
	 */
	public void setProcedureCode(int[] arrPosition, String strCodingSchemeVersionForCode)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = EnumCM_NoBCIDSpecified.NO_VALUE.getValue();
		String strCV = EnumCM_NoBCIDSpecified.NO_VALUE.getValue();
		String strCSD1 = EnumCodingSchemeDesignator.NO_VALUE.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_TID3601ProcedureContext.PROCEDURE_CODE.getValue();
		String strCodeValue = EnumCV_TID3601ProcedureContext.PROCEDURE_CODE_121023.getValue();
		String strCSD2 = 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 , strCSD2, strCV, strCSD1, strCodingSchemeVersionForCode, strCM);
		getSRTree().addChild(objContentSequenceItem);
	}
}
