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

import cdac.medinfo.sdk.dcm30_04.baselibs.ContentSequenceItem;
import cdac.medinfo.sdk.dcm30_04.srtree.SRTree;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_CommonFindings;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_PurposeOfReferenceToObject;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_CommonFindings;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Quotation_TID1000;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents CommonFindings - TID3819
 */
public class CommonFindings_TID3819 extends Template
{
	/**
	 * Object of  Quotation_TID1000
	 */

	private Quotation_TID1000 objQuotationTID1000;

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

	/**
	 * Retrieves Quotation 
	 * @return objQuotationTID1000 Object of Quotation_TID1000 
	 */
	public Quotation_TID1000 getObserverContext() 
	{
		if(null == this.objQuotationTID1000)
			this.objQuotationTID1000 = new Quotation_TID1000(getSRTree());
		return this.objQuotationTID1000;
	}

	/**
	 * Sets the value for Finding
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strFinding String value for Finding.
	 */
	public void setFinding(int[] arrPosition, String strFinding)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CommonFindings.FINDING.getValue();
		String strCodeValue = EnumCV_CommonFindings.FINDING_121071.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, strFinding);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Best illustration of finding
	 * @param arrPosition identifier which shows the position of the node in the SR Tree.
	 *@param strRefSOPClassUIDForCORefMacro Reference SOP Class UID for Composite Object Reference Macro.
	 * @param strRefSOPInstanceUIDForCORefMacro Reference SOP Instance UID for Composite Object Reference Macro.
	 * @param arrStrReferencedFrameNumber String Array of Referenced Frame Number.
	 * @param strRefSOPClassUID Referenced SOP Class UID.
	 * @param strRefSOPInstanceUID Referenced SOP Instance UID.
	 */
	public void setBestIllustrationOfFinding(int[] arrPosition, String strRefSOPClassUIDForCORefMacro, String strRefSOPInstanceUIDForCORefMacro, String[] arrStrReferencedFrameNumber, String strRefSOPClassUID, String strRefSOPInstanceUID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CommonFindings.BEST_ILLUSTRATION_OF_FINDING.getValue();
		String strCodeValue = EnumCV_CommonFindings.BEST_ILLUSTRATION_OF_FINDING_121080.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

		/**
		 * Creating a node of Value Type UIDREF and adding this node at specified identifier in the SR Tree.
		 */
		ContentSequenceItem objContentSequenceItem = getSRTree().createImageNode(arrPosition, strCodeMeaning, strCodeValue, strCSD, strRefSOPClassUIDForCORefMacro, strRefSOPInstanceUIDForCORefMacro, arrStrReferencedFrameNumber, strRefSOPClassUID, strRefSOPInstanceUID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets Current procedure evidence
	 * @param arrPosition position at which the node will get added in the tree.
	 * @param enumPurposeOfReferenceToObject Enum value for Purpose Of Reference To Object
	 * @param strReferencedSOPClassUID Referenced SOP Class UID
	 * @param strReferencedSOPInstanceUID Referenced SOP Instance UID
	 */
	public void setCurrentProcedureEvidence(int[] arrPosition, EnumCM_PurposeOfReferenceToObject enumPurposeOfReferenceToObject, String strReferencedSOPClassUID, String strReferencedSOPInstanceUID)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CommonFindings.CURRENT_PROCEDURE_EVIDENCE.getValue();
		String strCodeValue = EnumCV_CommonFindings.CURRENT_PROCEDURE_EVIDENCE_122073.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

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

	/**
	 * Sets the value for Document Title.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 */
	public void setDocumentTitle(int[] arrPosition)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_CommonFindings.DOCUMENT_TITLE.getValue();
		String strCodeValue = EnumCV_CommonFindings.DOCUMENT_TITLE_121144.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, "", "", "", "");
		getSRTree().addChild(objContentSequenceItem);
	}
}
