/*******************************************************************************
 *  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.BloodSourceType_CID3520;
import cdac.medinfo.sdk.dcm30_04.templates.cid.CardiovascularAnatomicLocations_CID3630;
import cdac.medinfo.sdk.dcm30_04.templates.cid.SpecimenCollection_CID3515;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_BloodSourceType;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SpecimenCollection;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_SpecimenObtained;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_SpecimenObtained;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.SubjectContextSpecimen_TID1009;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * This class represents SpecimenObtained - TID3112
 */
public class SpecimenObtained_TID3112 extends Template
{
	/**
	 * Object of SpecimenCollection_CID3515
	 */
	private SpecimenCollection_CID3515 objSpecimenCollection_CID3515;

	/**
	 * Object of BloodSourceType_CID3520
	 */
	private BloodSourceType_CID3520 objBloodSourceType_CID3520;

	/**
	 * Object of CardiovascularAnatomicLocations_CID3630
	 */
	private CardiovascularAnatomicLocations_CID3630 objCardiovascularAnatomicLocations_CID3630;

	/**
	 * Object of SubjectContextSpecimen_TID1009
	 */

	private SubjectContextSpecimen_TID1009 objSubjectContextSpecimen_TID1009;

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

	/**
	 * Sets the value for Patient Status or Event.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumSpecimenCollection value for Specimen Collection
	 */
	public void setPatientStatusOrEvent(int[] arrPosition, EnumCM_SpecimenCollection enumSpecimenCollection)
	{
		/**
		 * Sets the value for OrganizationalRoles which follows the template CID7452
		 */
		if(null== this.objSpecimenCollection_CID3515)
			this.objSpecimenCollection_CID3515 = new SpecimenCollection_CID3515();
		this.objSpecimenCollection_CID3515.setSpecimenCollection(enumSpecimenCollection);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SpecimenObtained.PATIENT_STATUS_EVENT.getValue();
		String strCodeValue = EnumCV_SpecimenObtained.PATIENT_STATUS_OR_EVENT_121123.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, "", strCM,strSNMDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Specimen Type.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumBloodSourceType value for Blood Source Type
	 */
	public void setSpecimenType(int[] arrPosition, EnumCM_BloodSourceType enumBloodSourceType)
	{
		/**
		 * Sets the value for OrganizationalRoles which follows the template CID7452
		 */
		if(null== this.objBloodSourceType_CID3520)
			this.objBloodSourceType_CID3520 = new BloodSourceType_CID3520();
		this.objBloodSourceType_CID3520.setBloodSourceType(enumBloodSourceType);

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

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SpecimenObtained.SPECIMEN_TYPE.getValue();
		String strCodeValue = EnumCV_SpecimenObtained.SPECIMEN_TYPE_121042.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, "", strCM,strSNMDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets value for Procedure site.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumValue This value can be one of the three Enum - EnumCM_ArterialSourceLocations, EnumVenousSourceLocations
	 * EnumCM_AtrialSourceLocations, EnumVentricularSourceLocations,EnumGradientSourceLocations.
	 */
	public void setProcedureSite(int[] arrPosition, Enum enumValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_SpecimenObtained.PROCEDURE_SITE.getValue();
		String strCodeValue = EnumCV_SpecimenObtained.PROCEDURE_SITE_G_C0E9.getValue();
		String strCSDesg = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Setting value for Cardiovascular Anatomic Locations
		 */
		if(null== this.objCardiovascularAnatomicLocations_CID3630)
			this.objCardiovascularAnatomicLocations_CID3630 = new CardiovascularAnatomicLocations_CID3630();
		this.objCardiovascularAnatomicLocations_CID3630.setCardiovascularAnatomicLocations(enumValue);

		String strCM = objCardiovascularAnatomicLocations_CID3630.getCodeMeaning();
		String strCV = objCardiovascularAnatomicLocations_CID3630.getCodeValue();
		String strCSD = objCardiovascularAnatomicLocations_CID3630.getCodingSchemeDesignator();
		String strSNMDCTID = objCardiovascularAnatomicLocations_CID3630.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,strSNMDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Retrieves the object of SubjectContextSpecimen_TID1009
	 * @return objSubjectContextSpecimen_TID1009 object of SubjectContextSpecimen_TID1009
	 */
	public SubjectContextSpecimen_TID1009 getObjSubjectContextSpecimen_TID1009() 
	{
		if(null == objSubjectContextSpecimen_TID1009)
			objSubjectContextSpecimen_TID1009 = new SubjectContextSpecimen_TID1009(getSRTree());
		return objSubjectContextSpecimen_TID1009;
	}
}
