/*******************************************************************************
 *  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.AdministrationOfDrugsContrast_CID3409;
import cdac.medinfo.sdk.dcm30_04.templates.cid.InterventionalDrug_CID10;
import cdac.medinfo.sdk.dcm30_04.templates.cid.NumericParametersOfDrugsContrast_CID3410;
import cdac.medinfo.sdk.dcm30_04.templates.cid.RadiographicContrastAgent_CID12;
import cdac.medinfo.sdk.dcm30_04.templates.cid.RouteOfAdministration_CID11;
import cdac.medinfo.sdk.dcm30_04.templates.enums.EnumCodingSchemeDesignator;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_AdministrationOfDrugsContrast;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_DrugsContrastAdministered;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_InterventionalDrug;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_NumericParametersOfDrugsContrast;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RadiographicContrastAgent;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cm.EnumCM_RouteOfAdministration;
import cdac.medinfo.sdk.dcm30_04.templates.enums.cv.EnumCV_DrugsContrastAdministered;
import cdac.medinfo.sdk.dcm30_04.templates.generaltemplates.Template;

/**
 * The Drugs/Contrast Administered Template allows the recording of the start or end of that type of event,
 * together with its parameters. If start and end are represented by a single log entry (e.g., for an injection),
 * the concept name Drug/contrast administered shall be used.
 */
/**
 * This class represents DrugsContrastAdministered - TID3106
 */
public class DrugsContrastAdministered_TID3106 extends Template
{
	/**
	 * Object of AdministrationOfDrugsContrast_CID3409
	 */
	private AdministrationOfDrugsContrast_CID3409 objAdministrationOfDrugsContrast_CID3409;

	/**
	 * Object of InterventionalDrug_CID10
	 */
	private InterventionalDrug_CID10 objInterventionalDrug_CID10;

	/**
	 * Object of RadiographicContrastAgent_CID12
	 */
	private RadiographicContrastAgent_CID12 objRadiographicContrastAgent_CID12;

	/**
	 * Object of RouteOfAdministration_CID11
	 */
	private RouteOfAdministration_CID11 objRouteOfAdministration_CID11;

	/**
	 * Object of NumericParametersOfDrugsContrast_CID3410
	 */
	private NumericParametersOfDrugsContrast_CID3410 objNumericParametersOfDrugsContrast_CID3410;

	/**
	 * Object of LogEntryQualifiers_TID3010
	 */
	private LogEntryQualifiers_TID3010 objLogEntryQualifiers;

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

	/**
	 * Retrieves LogEntryQualifiers
	 * @return objLogEntryQualifiers Object of LogEntryQualifiers_TID3010
	 */
	public LogEntryQualifiers_TID3010 getLogEntryQualifiers() 
	{
		if(objLogEntryQualifiers == null)
			this.objLogEntryQualifiers = new LogEntryQualifiers_TID3010(getSRTree());
		return this.objLogEntryQualifiers;
	}

	/**
	 * Sets the value for Administration Of Drugs/Contrast.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumAdministrationOfDrugsContrast Enum value for AdministrationOfDrugsContrast
	 * @param enumRadiographicContrastAgent Enum value for RadiographicContrastAgent
	 */
	public void setAdministrationOfDrugsContrast(int[] arrPosition,EnumCM_AdministrationOfDrugsContrast enumAdministrationOfDrugsContrast, EnumCM_RadiographicContrastAgent enumRadiographicContrastAgent)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(objAdministrationOfDrugsContrast_CID3409 == null)
			this.objAdministrationOfDrugsContrast_CID3409 = new AdministrationOfDrugsContrast_CID3409();
		this.objAdministrationOfDrugsContrast_CID3409.setAdministrationOfDrugsContrast(enumAdministrationOfDrugsContrast);

		String strCodeMeaning = objAdministrationOfDrugsContrast_CID3409.getCodeMeaning();
		String strCodeValue = objAdministrationOfDrugsContrast_CID3409.getCodeValue();
		String strCSD2 = objAdministrationOfDrugsContrast_CID3409.getCodingSchemeDesignator();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(objRadiographicContrastAgent_CID12 == null)
			this.objRadiographicContrastAgent_CID12 = new RadiographicContrastAgent_CID12();
		this.objRadiographicContrastAgent_CID12.setRadiographicContrastAgent(enumRadiographicContrastAgent);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = objRadiographicContrastAgent_CID12.getCodeMeaning();
		String strCV = objRadiographicContrastAgent_CID12.getCodeValue();
		String strCSD1 = objRadiographicContrastAgent_CID12.getCodingSchemeDesignator();
		String strSNOMEDCTID = objRadiographicContrastAgent_CID12.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 , strCSD2, strCV, strCSD1, strCSD1, strCM,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Administration Of Drugs/Contrast.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumAdministrationOfDrugsContrast Enum value for AdministrationOfDrugsContrast
	 * @param enumInterventionalDrug Enum value for InterventionalDrug
	 */
	public void setAdministrationOfDrugsContrast(int[] arrPosition,EnumCM_AdministrationOfDrugsContrast enumAdministrationOfDrugsContrast, EnumCM_InterventionalDrug enumInterventionalDrug)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(objAdministrationOfDrugsContrast_CID3409 == null)
			this.objAdministrationOfDrugsContrast_CID3409 = new AdministrationOfDrugsContrast_CID3409();
		this.objAdministrationOfDrugsContrast_CID3409.setAdministrationOfDrugsContrast(enumAdministrationOfDrugsContrast);

		String strCodeMeaning = objAdministrationOfDrugsContrast_CID3409.getCodeMeaning();
		String strCodeValue = objAdministrationOfDrugsContrast_CID3409.getCodeValue();
		String strCSD2 = objAdministrationOfDrugsContrast_CID3409.getCodingSchemeDesignator();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(objInterventionalDrug_CID10 == null)
			this.objInterventionalDrug_CID10 = new InterventionalDrug_CID10();
		this.objInterventionalDrug_CID10.setInterventionalDrug(enumInterventionalDrug);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = objInterventionalDrug_CID10.getCodeMeaning();
		String strCV = objInterventionalDrug_CID10.getCodeValue();
		String strCSD1 = objInterventionalDrug_CID10.getCodingSchemeDesignator();
		String strSNOMEDCTID = objInterventionalDrug_CID10.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 , strCSD2, strCV, strCSD1, strCSD1, strCM,strSNOMEDCTID);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Description of Material
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strDescriptionOfMaterial String value for Description Of Material.
	 */
	public void setDescriptionOfMaterial(int[] arrPosition, String strDescriptionOfMaterial)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DrugsContrastAdministered.DESCRIPTION_OF_MATERIAL.getValue();
		String strCodeValue = EnumCV_DrugsContrastAdministered.DESCRIPTION_OF_MATERIAL_121145.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, strDescriptionOfMaterial);
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Route of administration.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumRouteOfAdministration Enum value for RouteOfAdministration
	 */
	public void setRouteOfAdministration(int[] arrPosition,EnumCM_RouteOfAdministration enumRouteOfAdministration)
	{
		String strCodeMeaning = EnumCM_DrugsContrastAdministered.ROUTE_OF_ADMINISTRATION.getValue();
		String strCodeValue = EnumCV_DrugsContrastAdministered.ROUTE_OF_ADMINISTRATION_G_C295.getValue();
		String strCSD2 = EnumCodingSchemeDesignator.SRT.getValue();

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(objRouteOfAdministration_CID11 == null)
			this.objRouteOfAdministration_CID11 = new RouteOfAdministration_CID11();
		this.objRouteOfAdministration_CID11.setRouteOfAdministration(enumRouteOfAdministration);

		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCM = objRouteOfAdministration_CID11.getCodeMeaning();
		String strCV = objRouteOfAdministration_CID11.getCodeValue();
		String strCSD1 = objRouteOfAdministration_CID11.getCodingSchemeDesignator();
		String strSNOMEDCTID = objRouteOfAdministration_CID11.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 , strCSD2, strCV, strCSD1, strCSD1, strCM,strSNOMEDCTID );
		getSRTree().addChild(objContentSequenceItem);
	}

	/**
	 * Sets the value for Numeric Parameters of Drugs/Contrast.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param enumNumericParametersOfDrugsContrast Enum Value for NumericParametersOfDrugsContrast
	 * @param arrNumericValue String array for Quatity Of Material
	 */
	public void setNumericParametersOfDrugsContrast(int[] arrPosition,EnumCM_NumericParametersOfDrugsContrast enumNumericParametersOfDrugsContrast, String[] arrNumericValue)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		if(objNumericParametersOfDrugsContrast_CID3410 == null)
			this.objNumericParametersOfDrugsContrast_CID3410 = new NumericParametersOfDrugsContrast_CID3410();
		this.objNumericParametersOfDrugsContrast_CID3410.setNumericParametersOfDrugsContrast(enumNumericParametersOfDrugsContrast);

		String strCodeMeaning = objNumericParametersOfDrugsContrast_CID3410.getCodeMeaning();
		String strCodeValue = objNumericParametersOfDrugsContrast_CID3410.getCodeValue();
		String strCSD = objNumericParametersOfDrugsContrast_CID3410.getCodingSchemeDesignator();

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

	/**
	 * Sets the value for Person administering drug/contrast.
	 * @param arrPosition Identifier which shows the position of the node in the SR Tree.
	 * @param strPersonAdministeringDrugContrast String value for Person Administering Drug/Contrast
	 */
	public void setPersonAdministeringDrugContrast(int[] arrPosition, String strPersonAdministeringDrugContrast)
	{
		/**
		 * Retrieves the corresponding values of CodeMeaning,CodeValue and CodingSchemeDesignator.
		 */
		String strCodeMeaning = EnumCM_DrugsContrastAdministered.PERSON_ADMINISTERING_DRUG_CONTRAST.getValue();
		String strCodeValue = EnumCV_DrugsContrastAdministered.PERSON_ADMINISTERING_DRUG_CONTRAST_121152.getValue();
		String strCSD = EnumCodingSchemeDesignator.DCM.getValue();

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