/*******************************************************************************
 *  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.DateTimeQualifiers_CID3430;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DateTimeQualifiers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_LogEntryQualifiers;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_LogEntryQualifiers;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Quotation_TID1000;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents LogEntryQualifiers - TID3010
 */
public class LogEntryQualifiers_TID3010 extends Template
{
	/**
	 * Object of Quotation_TID1000
	 */
	private Quotation_TID1000 objQuotation_TID1000;

	/**
	 * Object of DateTimeQualifiers_CID3430
	 */
	private DateTimeQualifiers_CID3430 objDateTimeQualifiers_CID3430;

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

	/**
	 * Retrieves the Object of Quotation_TID1000
	 * @return objQuotation_TID1000 object of Quotation_TID1000
	 */
	public Quotation_TID1000 getQuotation_TID1000() 
	{
		if(objQuotation_TID1000 == null)
			objQuotation_TID1000 = new Quotation_TID1000(getSRTree());
		return this.objQuotation_TID1000;
	}

	/**
	 * Sets the value for Comment.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strComment String value for Comment
	 */
	public void setComment(int[] arrPosition, String strComment)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_LogEntryQualifiers.COMMENT.getValue();
		String strCodeValue = EnumCV_LogEntryQualifiers.COMMENT_121106.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, strComment);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for ProcedureActionID.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strProcedureActionID String value for Procedure Action ID
	 */
	public void setProcedureActionID(int[] arrPosition, String strProcedureActionID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_LogEntryQualifiers.PROCEDURE_ACTION_ID.getValue();
		String strCodeValue = EnumCV_LogEntryQualifiers.PROCEDURE_ACTION_ID_121124.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, strProcedureActionID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Lesion Identifier.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strLesionIdentifier String value for Lesion Identifier
	 */
	public void setLesionIdentifier(int[] arrPosition, String strLesionIdentifier)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_LogEntryQualifiers.LESION_IDENTIFIER.getValue();
		String strCodeValue = EnumCV_LogEntryQualifiers.LESION_IDENTIFIER_121151.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, strLesionIdentifier);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for DateTime of Recording of Log Entry.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDateTimeOfRecordingOfLogEntry String value for Date Time Of Recording Of Log Entry
	 */
	public void setDateTimeOfRecordingOfLogEntry(int[] arrPosition, String strDateTimeOfRecordingOfLogEntry)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_LogEntryQualifiers.DATETIME_OF_RECORDING_OF_LOG_ENTRY.getValue();
		String strCodeValue = EnumCV_LogEntryQualifiers.DATETIME_OF_RECORDING_OF_LOG_ENTRY_121125.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

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

	/**
	 * Sets the value for DateTimeQualifiers.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumOrganizationalRoles value for OrganizationalRoles
	 * @param strCodingSchemeVersionForCode CodingSchemeVersion 
	 * @param argstrCodeMeaningForCode Code Meaning (Heading) 
	 */
	public void setObservationDateTimeQualifiers(int[] arrPosition, EnumCM_DateTimeQualifiers enumDateTimeQualifiers,String strCodingSchemeVersionForCode)
	{
		/**
		 * Sets the value for OrganizationalRoles which follows the template CID7452
		 */
		if(objDateTimeQualifiers_CID3430 == null)
			objDateTimeQualifiers_CID3430 = new DateTimeQualifiers_CID3430();
		this.objDateTimeQualifiers_CID3430.setDateTimeQualifiers(enumDateTimeQualifiers);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_LogEntryQualifiers.OBSERVATION_DATETIME_QUALIFIER.getValue();
		String strCodeValue = EnumCV_LogEntryQualifiers.OBSERVATION_DATETIME_QUALIFIER_121135.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);
	}
}
