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

import cdac.medinfo.sdk.dcm30_04.baselibs.SpecimenMacro;
import cdac.medinfo.sdk.dcm30_04.baselibs.Tag;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataSet;
import cdac.medinfo.sdk.dcm30_04.commoninterface.ITag;
import cdac.medinfo.sdk.dcm30_04.enums.EnumSubstanceAdministrationApproval;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidModuleException;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConstants;
import cdac.medinfo.sdk.dcm30_04.utils.ISingleCollection;
import cdac.medinfo.sdk.dcm30_04.utils.SingleCollection;

//TODO: Auto-generated Javadoc
/**
\* This module specifies the Attributes that describe Substance Approval Module.
*/
public class SubstanceApprovalModule extends Module
{
	/**
	 * The obj single collection.
	 */
	public static ISingleCollection<ITag> objSingleCollection = null;

	/**
	 * The obj Specimen Macro.
	 */
	SpecimenMacro objSpecimenMacro = null ;

	/**
	 * Instantiates a new Substance Approval Module
	 * 
	 * @param objIDataSet the obj i data set
	 */
	public SubstanceApprovalModule(IDataSet objIDataSet)
	{
		super(objIDataSet);
	}

	static
	{
		objSingleCollection = new SingleCollection<ITag>();
		objSingleCollection.add(new Tag(0x0044,0x0002));
		objSingleCollection.add(new Tag(0x0044,0x0003));
		objSingleCollection.add(new Tag(0x0044,0x0004));

	}
	public boolean validateModule() throws InvalidModuleException 
	{
		return true;
	}
	/**
	 * Sets Status of request for substance administration.
	 *Enumerated Values:
	 *APPROVED:Use of the substance for the patient is approved, with related notes (e.g., appropriate dose for age/weight)in Approval Status Further Description (0044,0003)
	 *WARNING:The substance may be used for the patient subject to warnings described in Approval Status FurtherDescription (0044,0003)
	 *CONTRA_INDICATED:The substance should not be used for the patient for the reasons described in Approval Status FurtherDescription (0044,0003)
	 * @param enumSubstanceAdministrationApproval enum value of Setup Device Type.
	 */
	public void setSubstanceAdministrationApproval(EnumSubstanceAdministrationApproval enumSubstanceAdministrationApproval)
	{
		/* Accept the Setup Device Type in String format of type CS.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		addDataElement(0x0044,0x0002,DicomConstants.DCM_DT_CS,enumSubstanceAdministrationApproval);
	}
	/**
	 * Return Substance Administration Approval
	 * @return String - value of Substance Administration Approval
	 */
	public String getSubstanceAdministrationApproval()
	{
		Object objValue = getValue(0x0044,0x0002);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets ApprovalStatusFurtherDescription
	 * @param strApprovalStatusFurtherDescription String value of ApprovalStatusFurtherDescription
	 */
	public void setApprovalStatusFurtherDescription(String strApprovalStatusFurtherDescription)
	{
		/* Accept ApprovalStatusFurtherDescription of type LT.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		addDataElement(0x0044,0x0003,DicomConstants.DCM_DT_LT,strApprovalStatusFurtherDescription);
	}

	/**
	 * Retrieves ApprovalStatusFurtherDescription
	 * @return String - value of ApprovalStatusFurtherDescription
	 */
	public String getApprovalStatusFurtherDescription()
	{
		Object objValue = getValue(0x0044,0x0003);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Approval Status DateTime
	 * @param strApprovalStatusDateTime String value of Approval Status DateTime
	 */
	public void setApprovalStatusDateTime(String strVerificationDateTime)
	{
		/* Accept the Approval Status DateTime of type DT.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		addDataElement(0x0044,0x0004,DicomConstants.DCM_DT_DT,strVerificationDateTime);
	}

	/**
	 * Retrieves Approval Status DateTime
	 * @return String - value of Approval Status DateTime
	 */
	public String getApprovalStatusDateTime()
	{
		Object objValue = getValue(0x0044,0x0004);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/*
	 * This method is used by the Module Iterator to iterate through the DataSet and return only
	 * those elements that belong to the respective Module class whose this is called.
	 */
	/**
	 * This method returns the collection of keys representing the DataElements
	 * that belong to this module.
	 * 
	 * @return ISingleCollection - the customized collection containing the dataelement tags
	 * that beling to this module
	 */
	public ISingleCollection<ITag> getVectorOfKeys()
	{
		return objSingleCollection;
	}
}
