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

import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataElement;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDicomValue;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDictionaryReader;
import cdac.medinfo.sdk.dcm30_04.commoninterface.ITransferSyntax;
import cdac.medinfo.sdk.dcm30_04.enums.EnumBeamType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPrimaryDosimeterUnit;
import cdac.medinfo.sdk.dcm30_04.enums.EnumRadiationType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumScanMode;
import cdac.medinfo.sdk.dcm30_04.enums.EnumTreatmentDeliveryType;
import cdac.medinfo.sdk.dcm30_04.exceptions.ConditionFailedException;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidItemException;
import cdac.medinfo.sdk.dcm30_04.exceptions.MandatoryMissingException;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConfig;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConstants;
import cdac.medinfo.sdk.dcm30_04.utils.DicomLogger;
/**
* This item class contains the methods to set, get and validate the attribute present in Ion Beam Sequence .
 */

public class IonBeamSequenceItem  extends Item  
{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;


	/**
	 * This constructor creates the item and internal code sequence macro with default TransferSyntax 
	 */
	IonBeamSequenceItem()
	{
		super();
	}

	/**
	 * This constructor creates the item and internal code sequence macro with default TransferSyntax 
	 * and default DictionaryReader
	 * @param objITransferSyntax specifies the DICOM Standard defined TransfeSyntax
	 */
	IonBeamSequenceItem(ITransferSyntax objITransferSyntax)
	{
		super(objITransferSyntax);
	}

	/**
	 * This constructor creates IonBeamSequenceItem with specified TransferSyntax and
	 * specified DictionaryReader
	 * @param objTransferSyntax specifies the DICOM Standard defined TransfeSyntax
	 * @param objDictionaryReader specifies the DICOM Dictionary reader to be used 
	 */
	IonBeamSequenceItem(ITransferSyntax objTransferSyntax, IDictionaryReader objDictionaryReader)
	{
		super(objTransferSyntax,objDictionaryReader);
	}

	/**
	 * Validates all the attributes in BeamSequenceItem  that are present in the DataSet
	 * @return boolean - Success -true, Failure - false
	 * @throws InvalidItemException throws InvalidItemException If Mandatory or Conditional element fails.
	 */

	public boolean validateForModule()  throws InvalidItemException
	{
		try
		{

			if((!contains(0x300A,0x00C0)))
				throw new MandatoryMissingException("300A,00C0");
			
			if((!contains(0x300A,0x00C2)))
				throw new MandatoryMissingException("300A,00C2");
			
			if((!contains(0x300A,0x00C4)))
				throw new MandatoryMissingException("300A,00C4");
			
			if((!contains(0x300A,0x00C6)))
				throw new MandatoryMissingException("300A,00C6");
			
			if((!contains(0x300A,0x0302)))
				throw new ConditionFailedException("300A,0302");
			
			if((!contains(0x300A,0x0304)))
				throw new ConditionFailedException("300A,0304");
			
			if((!contains(0x300A,0x0306)))
				throw new ConditionFailedException("300A,0306");
			
			if((!contains(0x300A,0x0308)))
				throw new MandatoryMissingException("300A,0308");
			
			if((!contains(0x300A,0x00B3)))
				throw new MandatoryMissingException("300A,00B3");

			if((!contains(0x300A,0x030A)))
				throw new MandatoryMissingException("300A,030A");
			
			if((!contains(0x300A,0x00CE)))
				throw new MandatoryMissingException("300A,00CE");
			if((!contains(0x300A,0x00D0)))
			
				throw new MandatoryMissingException("300A,00D0");
		
			if((!contains(0x300A,0x03AA)))
				throw new ConditionFailedException("300A,03AA");
			
			if((!contains(0x300A,0x00E0)))
				throw new MandatoryMissingException("300A,00E0");
			
			if((!contains(0x300A,0x02EA)))
				throw new ConditionFailedException("300A,02EA");
			
			if((!contains(0x300A,0x00ED)))
				throw new MandatoryMissingException("300A,00ED");
			
			if((!contains(0x300A,0x00B0)))
				throw new ConditionFailedException("300A,00B0");
			
			if((!contains(0x300A,0x00F0)))
				throw new ConditionFailedException("300A,00F0");
			
			if((!contains(0x300A,0x03A6)))
				throw new MandatoryMissingException("300A,03A6");
			
			if((!contains(0x300A,0x0312)))
				throw new MandatoryMissingException("300A,0312");
			
			if((!contains(0x300A,0x0314)))
				throw new ConditionFailedException("300A,0314");
			
			if((!contains(0x300A,0x0342)))	
				throw new ConditionFailedException("300A,0342");

			if((!contains(0x300A,0x010E)))
				throw new MandatoryMissingException("300A,010E");
			
			if((!contains(0x300A,0x0110)))
				throw new MandatoryMissingException("300A,0110");

			if((!contains(0x300A,0x03A8)))
				throw new MandatoryMissingException("300A,03A8");
			
		}
		catch( ConditionFailedException ce)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(ce.getMessage());
			}
			throw new InvalidItemException(this.getClass().getSimpleName(),ce); 
		}
		catch( MandatoryMissingException me)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(me.getMessage());
			}
			throw new InvalidItemException(this.getClass().getSimpleName(),me);
		}
		return true;
	}
	/**
	 * Identification number of the Beam.It should be unique within the beam in which it is created.
	 * @param strBeamNumber String value of Beam Number.
	 */
	public void setBeamNumber(String strBeamNumber)
	{
		/*Accept the BeamNumber in String format of type IS.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x300A,0x00C0, strBeamNumber,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00C0,DicomConstants.DCM_DT_IS, strBeamNumber);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Identification number of the Beam.It should be unique within the beam in which it is created.
	 * @return String - value of Beam Number.
	 */
	public String getBeamNumber()
	{
		Object objValue = getValue(0x300A,0x00C0);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets User-defined name for Beam.
	 * @param strBeamName String value of Beam Name.
	 */
	public void setBeamName(String strBeamName)
	{
		/*Accept the BeamName in String format of type LO.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x00C2, strBeamName,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00C2,DicomConstants.DCM_DT_LO, strBeamName);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves User-defined name for Beam.
	 * @return String value of Beam Name.
	 */
	public String getBeamName()
	{
		Object objValue = getValue(0x300A,0x00C2);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets User-defined Description for Beam.
	 * @param strBeamDescription String value of Beam Description.
	 */
	public void setBeamDescription(String strBeamDescription)
	{
		/*Accept the Beam Description in String format of type ST.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x300A,0x00C3, strBeamDescription,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00C3,DicomConstants.DCM_DT_ST, strBeamDescription);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves User-defined Description for Beam.
	 * @return String - value of Beam Description.
	 */
	public String getBeamDescription()
	{
		Object objValue = getValue(0x300A,0x00C3);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Motion characteristic of Beam.
	 * Enumerated Values:
	 * STATIC = All Control Point Sequence (300A,0111) attributes remain unchanged between consecutive pairs of control points  with changing Cumulative Meterset Weight (300A,0134).
	 * DYNAMIC = One or more Control Point Sequence (300A,0111) attributes change between one or more consecutive pairs of control points with changing Cumulative Meterset Weight (300A,0134).
	 * @param enumBeamType Enum value of Beam Type.
	 */
	public void setBeamType(EnumBeamType enumBeamType)
	{
		/*Accept the BeamType 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x00C4, enumBeamType.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00C4,DicomConstants.DCM_DT_CS, enumBeamType.getValue());

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Motion characteristic of Beam.
	 * @return String - value of Beam Type.
	 */
	public String getBeamType()
	{
		Object objValue = getValue(0x300A,0x00C4);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Particle type of Beam.
	 * Defined Terms:
	 * PHOTON,
	 * ELECTRON,
	 * NEUTRON,
	 * PROTON.
	 * @param enumRadiationType Enum value of Radiation Type.
	 */
	public void setRadiationType(EnumRadiationType enumRadiationType)
	{
		/*Accept the RadiationType 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x00C6, enumRadiationType.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00C6,DicomConstants.DCM_DT_CS, enumRadiationType.getValue());

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Particle type of Beam.
	 * @return String - value of Radiation Type.
	 */
	public String getRadiationType()
	{
		Object objValue = getValue(0x300A,0x00C6);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets Radiation Mass Number. 
	 * Mass number of radiation.
	 * @param strRadiationAtomicNumber String value of Radiation Atomic Number.
	 */
	public void setRadiationMassNumber (String strRadiationMassNumber )
	{
		/* Accept the Radiation Atomic Number  in String format of type IS.
		 * Mass number of radiation.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0302, strRadiationMassNumber ,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0302,DicomConstants.DCM_DT_IS, strRadiationMassNumber);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Radiation Mass Number. 
	 * Mass number of radiation.
	 * @return String - value of Radiation Mass Number.
	 */
	public String getRadiationMassNumber()
	{
		Object objValue = getValue(0x300A,0x0302);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets Radiation Atomic Number. 
	 * Atomic number of radiation.
	 * @param strRadiationAtomicNumber String value of Radiation Atomic Number.
	 */
	public void setRadiationAtomicNumber (String strRadiationAtomicNumber )
	{
		/* Accept the Radiation Atomic Number  in String format of type IS.
		 * Atomic number of radiation.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0304, strRadiationAtomicNumber ,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0304,DicomConstants.DCM_DT_IS, strRadiationAtomicNumber );

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Radiation Atomic Number. 
	 * Atomic number of radiation.
	 * @return String - value of Atomic number of radiation.
	 */
	public String getRadiationAtomicNumber()
	{
		Object objValue = getValue(0x300A,0x0304);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets RadiationChargeState
	 * Charge state of radiation.
	 * @param sRadiationChargeState short array of LUT Descriptor values. 
	 */
	public void setRadiationChargeState(short[] sRadiationChargeState)
	{
		/* Accept the RadiationChargeState in short Array format of type SS.
		 * Charge state of radiation.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0306, sRadiationChargeState,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x300A,0x0306,DicomConstants.DCM_DT_US, sRadiationChargeState);
		addDataElement(objIDataElement);
	}
	/**
	 * Returns the Charge state of radiation .
	 * @return short[] - short array of RadiationChargeState.
	 */
	public short[] getRadiationChargeState()
	{
		Object objValue = getValue(0x300A,0x0306);
		if(objValue != null)
			return (short[])objValue;
		return null;
	}

	/**
	 * Sets the Value Type Defined in Terms of
	 * Enumerated Values:
	 * NONE	: No beam scanning is performed
	 * UNIFORM	: The beam is scanned between control points to create a uniform lateral fluence distribution across the field
	 * MODULATED : The beam is scanned between control points to create a modulated lateral fluence distribution across the field
	 * The method of beam scanning to be used during treatment.
	 * @param enumScanMode Specifies type of the value encoded in this Item
	 */
	public void setScanMode(EnumScanMode enumScanMode)
	{
		/* Accept the Value Type in Enum format of type CS.
		 * The method of beam scanning to be used during treatment.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0308, enumScanMode,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0308,DicomConstants.DCM_DT_CS, enumScanMode);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves type of the value encoded in this Item
	 * @return String - Type of the value encoded in this Item
	 */
	public String getScanMode()
	{
		Object objValue = getValue(0x300A,0x0308);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets User-defined name identifying treatment machine used for beam delivery.
	 * @param strTreatmentMachineName String value of Treatment Machine Name.
	 */
	public void setTreatmentMachineName(String strTreatmentMachineName)
	{
		/*Accept the TreatmentMachineName in String format of type SH.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x00B2, strTreatmentMachineName,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00B2,DicomConstants.DCM_DT_SH, strTreatmentMachineName);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Treatment Machine Name.
	 * @return String - value of Treatment Machine Name
	 */
	public String getTreatmentMachineName()
	{
		Object objValue = getValue(0x300A,0x00B2);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Manufacturer of the equipment used for beam delivery..
	 * @param strManufacturer String value of Manufacturer .
	 */
	public void setManufacturer(String strManufacturer)
	{
		/*Accept the Manufacturer in String format of type LO.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0008,0x0070, strManufacturer,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0008,0x0070,DicomConstants.DCM_DT_LO, strManufacturer);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Manufacturer of the equipment used for beam delivery.
	 * @return String - value of Manufacturer.
	 */
	public String getManufacturer()
	{
		Object objValue = getValue(0x0008,0x0070);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Sets Institution where the equipment is located that was used for beam delivery.
	 * @param strInstitutionName String value of Institution Name .
	 */
	public void setInstitutionName(String strInstitutionName)
	{
		/*Accept the InstitutionName in String format of type LO.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0008,0x0080, strInstitutionName,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0008,0x0080,DicomConstants.DCM_DT_LO, strInstitutionName);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Institution where the equipment is located that was used for beam delivery.
	 * @return String - value of Institution Name.
	 */
	public String getInstitutionName()
	{
		Object objValue = getValue(0x0008,0x0080);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Mailing address of the institution where the equipment is located that was used for beam delivery.
	 * @param strInstitutionAddress String value of Institution Address .
	 */
	public void setInstitutionAddress(String strInstitutionAddress)
	{
		/*Accept the InstitutionAddress in String format of type ST.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0008,0x0081, strInstitutionAddress,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0008,0x0081,DicomConstants.DCM_DT_ST, strInstitutionAddress);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Mailing address of the institution where the equipment is located that was used for beam delivery.
	 * @return String - value of Institution Address.
	 */
	public String getInstitutionAddress()
	{
		Object objValue = getValue(0x0008,0x0081);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Institution where the equipment is located that was used for beam delivery.
	 * @param strInstitutionalDepartmentName String value of Institution Name .
	 */
	public void setInstitutionalDepartmentName(String strInstitutionalDepartmentName)
	{
		/*Accept the InstitutionalDepartmentName in String format of type LO.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0008,0x1040, strInstitutionalDepartmentName,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0008,0x1040,DicomConstants.DCM_DT_LO, strInstitutionalDepartmentName);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Institution where the equipment is located that was used for beam delivery.
	 * @return String - value of Institution Name.
	 */
	public String getInstitutionalDepartmentName()
	{
		Object objValue = getValue(0x0008,0x1040);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Manufacturer's model name of the equipment used for beam delivery.
	 * @param strManufacturersModelName String value of Manufacturers Model Name .
	 */
	public void setManufacturersModelName(String strManufacturersModelName)
	{
		/*Accept the ManufacturersModelName in String format of type LO.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0008,0x1090, strManufacturersModelName,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0008,0x1090,DicomConstants.DCM_DT_LO, strManufacturersModelName);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Manufacturer's model name of the equipment used for beam delivery.
	 * @return String - value of Manufacturers Model Name.
	 */
	public String getManufacturersModelName()
	{
		Object objValue = getValue(0x0008,0x1090);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Sets Manufacturer's serial number of the equipment used for beam delivery.
	 * @param strDeviceSerialNumber  String value of Device Serial Number.
	 */
	public void setDeviceSerialNumber(String strDeviceSerialNumber)
	{
		/*Accept the DeviceSerialNumber in String format of type LO.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0018,0x1000, strDeviceSerialNumber,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x1000,DicomConstants.DCM_DT_LO, strDeviceSerialNumber);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Manufacturer's serial number of the equipment used for beam delivery.
	 * @return String - value of Device Serial Number.
	 */
	public String getDeviceSerialNumber()
	{
		Object objValue = getValue(0x0018,0x1000);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Sets Measurement unit of machine dosimeter.
	 * Enumerated Values:
	 * MU = Monitor Unit
	 * MINUTE = minute
	 * @param enumPrimaryDosimeterUnit Enum value of Primary Dosimeter Unit.
	 */
	public void setPrimaryDosimeterUnit(EnumPrimaryDosimeterUnit enumPrimaryDosimeterUnit)
	{
		/*Accept the Primary Dosimeter Unit. 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x00B3, enumPrimaryDosimeterUnit.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00B3,DicomConstants.DCM_DT_CS, enumPrimaryDosimeterUnit.getValue());

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Measurement unit of machine dosimeter.
	 * @return String - value of Primary Dosimeter Unit.
	 */
	public String getPrimaryDosimeterUnit()
	{
		Object objValue = getValue(0x300A,0x00B3);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Uniquely identifies Tolerance Table specified by Tolerance Table Number (300A,0042) within Tolerance Table Sequence in RT Tolerance Tables Module.
	 * @param strReferencedToleranceTableNumber  String value of Referenced Tolerance Table Number.
	 */
	public void setReferencedToleranceTableNumber(String strReferencedToleranceTableNumber)
	{
		/*Accept the Referenced Tolerance Table Number in String format of type IS.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x300C,0x00A0, strReferencedToleranceTableNumber,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300C,0x00A0,DicomConstants.DCM_DT_IS, strReferencedToleranceTableNumber);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Referenced Tolerance Table Number.
	 * @return String - value of Referenced Tolerance Table Number.
	 */
	public String getReferencedToleranceTableNumber()
	{
		Object objValue = getValue(0x300C,0x00A0);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets VirtualSourceAxisDistances
	 * @param arrVirtualSourceAxisDistances pair of floating point numbers
	 */
	public void setVirtualSourceAxisDistances(float[] arrVirtualSourceAxisDistances)
	{
		/* Accept the VirtualSourceAxisDistances in short format of type FL.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT) 
			objIDataElement = new ImplicitDE(0x300A,0x030A, arrVirtualSourceAxisDistances,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x030A,DicomConstants.DCM_DT_FL, arrVirtualSourceAxisDistances);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves VirtualSourceAxisDistances.
	 * @return float[] - Float array of Virtual Source Axis Distances.
	 */
	public float[] getVirtualSourceAxisDistances()
	{
		Object objValue = getValue(0x300A,0x030A);
		if(objValue != null)
			return (float[])objValue;
		return null;
	}
	/**
	 * Retrieves pre-initialized object of Ion Beam Limiting Device Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence.
	 * @return IonBeamLimitingDeviceSequence - instance of BeamLimitingDeviceLeafPairsSequence. 
	 */
	public IonBeamLimitingDeviceSequence getIonBeamLimitingDeviceSequence()
	{
		IonBeamLimitingDeviceSequence objIonBeamLimitingDeviceSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x3008, 0x03A4); 
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objIonBeamLimitingDeviceSequence = (IonBeamLimitingDeviceSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objIonBeamLimitingDeviceSequence = (IonBeamLimitingDeviceSequence)objDicomV3Factory.createSequence(0x3008, 0x03A4, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x3008, 0x03A4, objIonBeamLimitingDeviceSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x3008, 0x03A4, DicomConstants.DCM_DT_SQ, objIonBeamLimitingDeviceSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objIonBeamLimitingDeviceSequence;
	}
	/**
	 * Sets Referenced Patient Setup Number. Uniquely identifies Patient Setup used within current beam, specified by Patient Setup Number (300A, 0182) within Patient Setup Sequence (300A, 0180) of RT Treatment Record.
	 * @param strReferencedPatientSetupNumber String value of Referenced Patient Setup Number.
	 */
	public void setReferencedPatientSetupNumber(String strReferencedPatientSetupNumber)
	{
		/*Accept the ReferencedPatientSetupNumber in String format of type IS.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x300C,0x006A,strReferencedPatientSetupNumber,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300C,0x006A,DicomConstants.DCM_DT_IS, strReferencedPatientSetupNumber);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Referenced Patient Setup Number. 
	 * @return String - value of Referenced Patient Setup Number.
	 */
	public String getReferencedPatientSeupNumber()
	{
		Object objValue = getValue(0x300C,0x006A);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Retrieves pre-initialized object of Referenced Reference Image Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 * @return ReferencedReferenceImageSequence - instance of Referenced Reference Image Sequence.
	 */
	public ReferencedReferenceImageSequence getReferencedReferenceImageSequence()
	{
		ReferencedReferenceImageSequence objReferencedReferenceImageSequence= null;
		IDataElement objIDataElement =  getDataForTag(0x300C,0x0042);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objReferencedReferenceImageSequence = (ReferencedReferenceImageSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objReferencedReferenceImageSequence = (ReferencedReferenceImageSequence)objDicomV3Factory.createSequence(0x300C,0x0042, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300C,0x0042,objReferencedReferenceImageSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300C,0x0042,DicomConstants.DCM_DT_SQ, objReferencedReferenceImageSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objReferencedReferenceImageSequence;
	}

	/**
	 * Sets Treatment Delivery Type.
	 * Defined Terms:
	 * TREATMENT = normal patient treatment
	 * OPEN_PORTFILM = portal image acquisition with open field
	 * TRMT_PORTFILM = portal image acquisition with treatment port
	 * CONTINUATION = continuation of interrupted treatment.
	 * @param enumTreatmentDeliveryType Enum value of Treatment Delivery Type.
	 */
	public void setTreatmentDeliveryType(EnumTreatmentDeliveryType enumTreatmentDeliveryType)
	{
		/*Accept the TreatmentDeliveryType 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x00CE,enumTreatmentDeliveryType.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00CE,DicomConstants.DCM_DT_CS, enumTreatmentDeliveryType.getValue());

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Treatment Delivery Type.
	 * @return String - value Treatment Delivery Type.
	 */
	public String getTreatmentDeliveryType()
	{
		Object objValue = getValue(0x300A,0x00CE);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Retrieves pre-initialized object of Referenced Dose Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 * @return ReferencedDoseSequence - instance of Referenced Dose Sequence.
	 */
	public ReferencedDoseSequence getReferencedDoseSequence()
	{
		ReferencedDoseSequence objReferencedDoseSequence= null;
		IDataElement objIDataElement =  getDataForTag(0x300C,0x0080);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objReferencedDoseSequence = (ReferencedDoseSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objReferencedDoseSequence = (ReferencedDoseSequence)objDicomV3Factory.createSequence(0x300C,0x0080, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300C,0x0080,objReferencedDoseSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300C,0x0080,DicomConstants.DCM_DT_SQ, objReferencedDoseSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objReferencedDoseSequence;
	}
	/**
	 * Sets Number of Wedges associated with current delivered Beam.
	 * @param strNumberofWedges String value of Number of Wedges.
	 */
	public void setNumberofWedges(String strNumberofWedges)
	{
		/*Accept the NumberofWedges in String format of type IS.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x00D0,strNumberofWedges,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00D0,DicomConstants.DCM_DT_IS, strNumberofWedges);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Number of Wedges. 
	 * @return String - value of Number of Wedges.
	 */
	public String getNumberofWedges()
	{
		Object objValue = getValue(0x300A,0x00D0);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets the TotalWedgeTrayWaterEquivalentThickness.
	 * @param fTotalWedgeTrayWaterEquivalentThickness Float value of the Total Wedge Tray Water Equivalent Thickness
	 */
	public void setTotalWedgeTrayWaterEquivalentThickness( float fTotalWedgeTrayWaterEquivalentThickness)
	{
		/*
		 * Accept the TotalWedgeTrayWaterEquivalentThickness in String format of type FL.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x300A,0x00D7, fTotalWedgeTrayWaterEquivalentThickness,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00D7,DicomConstants.DCM_DT_FL, fTotalWedgeTrayWaterEquivalentThickness);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves the TotalWedgeTrayWaterEquivalentThickness.
	 * @return float - Float value of the TotalWedgeTrayWaterEquivalentThickness
	 */
	public float getTotalWedgeTrayWaterEquivalentThickness()
	{
		Object objValue = getValue(0x300A,0x00D7);
		if(objValue != null)
			return Float.parseFloat(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Retrieves pre-initialized object of Ion Wedge Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 * @return IonWedgeSequence - instance of Ion Wedge Sequence. 
	 */
	public IonWedgeSequence getIonWedgeSequence()
	{
		IonWedgeSequence objIonWedgeSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A,0x03AA);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objIonWedgeSequence = (IonWedgeSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objIonWedgeSequence = (IonWedgeSequence)objDicomV3Factory.createSequence(0x300A,0x03AA, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A,0x03AA, objIonWedgeSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A,0x03AA, DicomConstants.DCM_DT_SQ, objIonWedgeSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objIonWedgeSequence;
	}
	/**
	 * Sets Number of Compensators associated with current delivered Beam.
	 * @param strNumberofCompensators String value of Number of Compensators.
	 */
	public void setNumberofCompensators(String strNumberofCompensators)
	{
		/*Accept the NumberofCompensators in String format of type IS.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x300A,0x00E0,strNumberofCompensators,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00E0,DicomConstants.DCM_DT_IS, strNumberofCompensators);

		addDataElement(objIDataElement);
	}

	/**
	 * RetrievesNumber of Compensators associated with current delivered Beam.
	 * @return String - value of  Number of Compensators.
	 */
	public String getNumberofCompensators()
	{
		Object objValue = getValue(0x300A,0x00E0);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets the TotalCompensatorTrayWaterEquivalentThickness.
	 * @param fTotalCompensatorTrayWaterEquivalentThickness Float value of the Total Compensator Tray Water Equivalent Thickness
	 */
	public void setTotalCompensatorTrayWaterEquivalentThickness( float fTotalCompensatorTrayWaterEquivalentThickness)
	{
		/*
		 * Accept the TotalCompensatorTrayWaterEquivalentThickness in String format of type FL.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x300A,0x02E3, fTotalCompensatorTrayWaterEquivalentThickness,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x02E3,DicomConstants.DCM_DT_FL, fTotalCompensatorTrayWaterEquivalentThickness);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves the TotalCompensatorTrayWaterEquivalentThickness.
	 * @return float - Float value of Total Compensator Tray Water Equivalent Thickness .
	 */
	public float getTotalCompensatorTrayWaterEquivalentThickness()
	{
		Object objValue = getValue(0x300A,0x02E3);
		if(objValue != null)
			return Float.parseFloat(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	

/**
 * Retrieves pre-initialized object of Ion Range Compensator Sequence.If the module contains the sequence object
 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
 * and then returns the object of sequence.
 * @return IonRangeCompensatorSequence - instance of Ion Range Compensator Sequence. 
 */
public IonRangeCompensatorSequence getIonRangeCompensatorSequence()
{
	IonRangeCompensatorSequence objIonRangeCompensatorSequence = null; 
	IDataElement objIDataElement =  getDataForTag(0x300A, 0x02EA);
	if(objIDataElement != null)
	{
		IDicomValue objIDicomValue = objIDataElement.getDicomValue();
		if(objIDicomValue != null)
			objIonRangeCompensatorSequence = (IonRangeCompensatorSequence)objIDicomValue;
	}
	else
	{
		DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
		int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
		objIDataElement = null;
		objIonRangeCompensatorSequence = (IonRangeCompensatorSequence)objDicomV3Factory.createSequence(0x300A, 0x02EA, objITransferSyntax, objIDictionaryReader);

		if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x02EA, objIonRangeCompensatorSequence.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x300A, 0x02EA, DicomConstants.DCM_DT_SQ, objIonRangeCompensatorSequence.getValue());
		objIDataElement.setTransferSyntax(objITransferSyntax);
		if(objIDataElement != null)
			addDataElement(objIDataElement);
	}
	return objIonRangeCompensatorSequence;
}
	/**
	 * Retrieves pre-initialized object of Recorded Compensator Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 * @return RecordedCompensatorSequence - instance of Recorded Compensator Sequence. 
	 */
	public RecordedCompensatorSequence getRecordedCompensatorSequence()
	{
		RecordedCompensatorSequence objRecordedCompensatorSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x3008,0x00C0);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objRecordedCompensatorSequence = (RecordedCompensatorSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objRecordedCompensatorSequence = (RecordedCompensatorSequence)objDicomV3Factory.createSequence(0x3008,0x00C0, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x3008,0x00C0, objRecordedCompensatorSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x3008,0x00C0, DicomConstants.DCM_DT_SQ, objRecordedCompensatorSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objRecordedCompensatorSequence;
	}
	/**
	 * Sets Number of Boli used with current  Beam.
	 * @param strNumberOfBoli String value of Number of Boli.
	 */
	public void setNumberOfBoli(String strNumberOfBoli)
	{
		/*Accept the NumberOfBoli in String format of type IS.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x00ED,strNumberOfBoli,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00ED,DicomConstants.DCM_DT_IS, strNumberOfBoli);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Number of Boli used with current  Beam.
	 * @return String - value of  Number of Boli
	 */
	public String getNumberOfBoli()
	{
		Object objValue = getValue(0x300A,0x00ED);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Retrieves pre-initialized object of Referenced Bolus Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 * @return ReferencedBolusSequence - instance of Referenced Bolus Sequence. 
	 */
	public ReferencedBolusSequence getReferencedBolusSequence()
	{
		ReferencedBolusSequence objReferencedBolusSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300C,0x00B0);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objReferencedBolusSequence = (ReferencedBolusSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objReferencedBolusSequence = (ReferencedBolusSequence)objDicomV3Factory.createSequence(0x300C,0x00B0, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300C,0x00B0, objReferencedBolusSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300C,0x00B0, DicomConstants.DCM_DT_SQ, objReferencedBolusSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objReferencedBolusSequence;
	}
	
	/**
	 * Sets Number of Blocks or Electron Electron Inserts associated with Beam. 
	 * @param strNumberOfBlocks String value of Number of Blocks.
	 */
	public void setNumberOfBlocks(String strNumberOfBlocks)
	{
		/*Accept the NumberOfBlocks in String format of type IS.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x00F0,strNumberOfBlocks,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00F0,DicomConstants.DCM_DT_IS, strNumberOfBlocks);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Number of Blocks or Electron Electron Inserts associated with Beam.
	 * @return String - value of  Number of Blocks
	 */
	public String getNumberOfBlocks()
	{
		Object objValue = getValue(0x300A,0x00F0);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets the TotalBlockTrayWaterEquivalentThickness.
	 * @param fTotalBlockTrayWaterEquivalentThickness Float value of the Total Wedge Tray Water Equivalent Thickness
	 */
	public void setTotalBlockTrayWaterEquivalentThickness( float fTotalBlockTrayWaterEquivalentThickness)
	{
		/*
		 * Accept the TotalBlockTrayWaterEquivalentThickness in String format of type FL.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x300A,0x00F3, fTotalBlockTrayWaterEquivalentThickness,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x00F3,DicomConstants.DCM_DT_FL, fTotalBlockTrayWaterEquivalentThickness);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves the TotalBlockTrayWaterEquivalentThickness.
	 * @return float - Float value of the TotalBlockTrayWaterEquivalentThickness
	 */
	public float getTotalBlockTrayWaterEquivalentThickness()
	{
		Object objValue = getValue(0x300A,0x00F3);
		if(objValue != null)
			return Float.parseFloat(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Retrieves pre-initialized object of Ion Block Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 * @return IonBlockSequence - instance of Ion Block Sequence. 
	 */
	public IonBlockSequence getIonBlockSequence()
	{
		IonBlockSequence objIonBlockSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A,0x03A6);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objIonBlockSequence = (IonBlockSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objIonBlockSequence = (IonBlockSequence)objDicomV3Factory.createSequence(0x300A,0x03A6, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A,0x03A6, objIonBlockSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A,0x03A6, DicomConstants.DCM_DT_SQ, objIonBlockSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objIonBlockSequence;
	}
	/**
	 * Retrieves pre-initialized object of IRecorded Snout Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence.
	 * @return RecordedSnoutSequence - instance of RecordedSnoutSequence. 
	 */
	public RecordedSnoutSequence getRecordedSnoutSequence()
	{
		RecordedSnoutSequence objRecordedSnoutSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x3008, 0x00F0);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objRecordedSnoutSequence = (RecordedSnoutSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objRecordedSnoutSequence = (RecordedSnoutSequence)objDicomV3Factory.createSequence(0x3008, 0x00F0, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x3008, 0x00F0, objRecordedSnoutSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x3008, 0x00F0, DicomConstants.DCM_DT_SQ, objRecordedSnoutSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objRecordedSnoutSequence;
	}
	/**
	 * Retrieves pre-initialized object of Applicator Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence.
	 * @return ApplicatorSequence - instance of Applicator Sequence. 
	 */
	public ApplicatorSequence getApplicatorSequence()
	{
		ApplicatorSequence objApplicatorSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A,0x0107);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objApplicatorSequence = (ApplicatorSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objApplicatorSequence = (ApplicatorSequence)objDicomV3Factory.createSequence(0x300A,0x0107, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A,0x0107, objApplicatorSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A,0x0107, DicomConstants.DCM_DT_SQ, objApplicatorSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objApplicatorSequence;
	}
	/**
	 * Retrieves pre-initialized object of General Accessory Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 * @return General Accessory Sequence - instance of General Accessory Sequence. 
	 */
	public GeneralAccessorySequence getGeneralAccessorySequence()
	{
		GeneralAccessorySequence objGeneralAccessorySequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A,0x0314);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objGeneralAccessorySequence = (GeneralAccessorySequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objGeneralAccessorySequence = (GeneralAccessorySequence)objDicomV3Factory.createSequence(0x300A,0x0314, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A,0x0314, objGeneralAccessorySequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A,0x0314, DicomConstants.DCM_DT_SQ, objGeneralAccessorySequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objGeneralAccessorySequence;
	}
	/**
	 * Sets Number of Range Shifters.
	 * Number of range shifters associated with current beam.
	 * @param strReferencedReferenceImageNumber String value of Referenced Reference Image Number.
	 */
	public void setNumberofRangeShifters(String strReferencedReferenceImageNumber )
	{
		/* Accept the Number of Range Shifters  in String format of type IS.
		 * Number of range shifters associated with current beam.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0312, strReferencedReferenceImageNumber ,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0312,DicomConstants.DCM_DT_IS, strReferencedReferenceImageNumber );

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Number of Range Shifters.
	 * Number of range shifters associated with current beam.
	 * @return String - value of Referenced Reference Image Number.
	 */
	public String getNumberofRangeShifters()
	{
		Object objValue = getValue(0x300A,0x0312);
		if(objValue != null)
			return objValue.toString();
		return null;
	
	}
	/**
	 * Retrieves pre-initialized object of  Range Shifter Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence.
	 * @return RangeShifterSequence - instance of Range Shifter Sequence. 
	 */
	public RangeShifterSequence getRangeShifterSequence()
	{
		RangeShifterSequence objRangeShifterSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x3008, 0x00F2);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objRangeShifterSequence = (RangeShifterSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objRangeShifterSequence = (RangeShifterSequence)objDicomV3Factory.createSequence(0x3008, 0x00F2, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x3008, 0x00F2, objRangeShifterSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x3008, 0x00F2, DicomConstants.DCM_DT_SQ, objRangeShifterSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objRangeShifterSequence;
	}
	/**
	 * Sets Number of Lateral Spreading Devices. 
	 * Number of lateral spreading devices associated with current beam.
	 * @param strNumberofLateralSpreadingDevices String value of Number of Lateral Spreading Devices.
	 */
	public void setNumberofLateralSpreadingDevices(String strNumberofLateralSpreadingDevices )
	{
		/* Accept the strNumberofLateralSpreadingDevices  in String format of type IS.
		 * Number of lateral spreading devices associated with current beam.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0330, strNumberofLateralSpreadingDevices ,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0330,DicomConstants.DCM_DT_IS, strNumberofLateralSpreadingDevices );

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Number of Lateral Spreading Devices. 
	 * @return String - value of Number of Lateral Spreading Devices.
	 */
	public String getNumberofLateralSpreadingDevices()
	{
		Object objValue = getValue(0x300A,0x0330);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Retrieves pre-initialized object of Recorded Lateral Spreading Device Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence.
	 * @return RecordedLateralSpreadingDeviceSequence - instance of Recorded Lateral Spreading Device Sequence. 
	 */
	public RecordedLateralSpreadingDeviceSequence getRecordedLateralSpreadingDeviceSequence()
	{
		RecordedLateralSpreadingDeviceSequence objRecordedLateralSpreadingDeviceSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x3008, 0x00F4);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objRecordedLateralSpreadingDeviceSequence = (RecordedLateralSpreadingDeviceSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objRecordedLateralSpreadingDeviceSequence = (RecordedLateralSpreadingDeviceSequence)objDicomV3Factory.createSequence(0x3008, 0x00F4, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x3008, 0x00F4, objRecordedLateralSpreadingDeviceSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x3008, 0x00F4, DicomConstants.DCM_DT_SQ, objRecordedLateralSpreadingDeviceSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objRecordedLateralSpreadingDeviceSequence;
	}
	/**
	 * Sets Number of Range Modulators. 
	 * Number of range modulators associated with current beam.
	 * @param strNumber of Range Modulators String value of NumberofNumberofRangeModulators.
	 */
	public void setNumberofRangeModulators(String strNumberofRangeModulators)
	{
		/* Accept the strNumberofRangeModulators  in String format of type IS.
		 * Number of range modulators associated with current beam.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0340, strNumberofRangeModulators ,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0340,DicomConstants.DCM_DT_IS, strNumberofRangeModulators );

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Number of Number of Range Modulators. 
	 * @return String - value of Number of Range Modulators.
	 */
	public String getNumberofRangeModulators()
	{
		Object objValue = getValue(0x300A,0x0340);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Retrieves pre-initialized object of Recorded Range Modulator Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence.
	 * @return RecordedRangeModulatorSequence - instance of Recorded Range Modulator Sequence. 
	 */
	public RangeModulatorSequence getRangeModulatorSequence()
	{
		RangeModulatorSequence objRangeModulatorSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A, 0x0342);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objRangeModulatorSequence = (RangeModulatorSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objRangeModulatorSequence = (RangeModulatorSequence)objDicomV3Factory.createSequence(0x300A, 0x0342, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A, 0x0342, objRangeModulatorSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A, 0x0342, DicomConstants.DCM_DT_SQ, objRangeModulatorSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objRangeModulatorSequence;
	}
	/**
	 * Sets FixationLightAzimuthalAngle
	 * Azimuthal angle in degrees of the fixation light coordinate around the IEC BEAM LIMITING DEVICE Y-axis. Used for eye treatments. 
	 * @param arrFixationLightAzimuthalAngle pair of floating point numbers
	 */
	public void setFixationLightAzimuthalAngle(float[] arrFixationLightAzimuthalAngle)
	{
		/* Accept the Fixation Light Azimuthal Angle in degree format of type FL.
		 * Azimuthal angle in degrees of the fixation light coordinate around the IEC BEAM LIMITING DEVICE Y-axis. Used for eye treatments. 
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0356, arrFixationLightAzimuthalAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0356,DicomConstants.DCM_DT_FL, arrFixationLightAzimuthalAngle);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Fixation Light Azimuthal Angle.
	 * @return float[] - Float array of FixationLightAzimuthalAngle.
	 */
	public float[] getFixationLightAzimuthalAngle()
	{
		Object objValue = getValue(0x300A,0x0356);
		if(objValue != null)
			return (float[])objValue;
		return null;
	}
	/**
	 * Sets FixationLightPolarAngle
	 * Polar angle in degrees of the fixation light coordinate. Used for eye treatments. 
	 * @param arrFixationLightPolarAngle pair of floating point numbers
	 */
	public void setFixationLightPolarAngle(float[] arrFixationLightAzimuthalAngle)
	{
		/* Accept the Fixation Light Polar Angle in degree format of type FL.
		 * Polar angle in degrees of the fixation light coordinate. Used for eye treatments. 
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0358, arrFixationLightAzimuthalAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0358,DicomConstants.DCM_DT_FL, arrFixationLightAzimuthalAngle);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Fixation Light Polar Angle.
	 * @return float[] - Float array of FixationLightPolarAngle.
	 */
	public float[] getFixationLightPolarAngle()
	{
		Object objValue = getValue(0x300A,0x0358);
		if(objValue != null)
			return (float[])objValue;
		return null;
	}
	/**
	 * Retrieves Value of Cumulative Meterset Weight (300A,0134) for final Control Point in Control Point Sequence (300A,0111).
	 * @return String - value of Final Cumulative Meterset Weight.
	 */
	public String getFinalCumulativeMetersetWeight()
	{
		Object objValue = getValue(0x300A,0x010E);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Number of control points delivered.
	 * @param strNumberOfControlPoints String value of Number Of Control Points.
	 */
	public void setNumberOfControlPoints(String strNumberOfControlPoints)
	{
		/*Accept the NumberOfControlPoints in String format of type IS.
		 * 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0110,strNumberOfControlPoints,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0110,DicomConstants.DCM_DT_IS, strNumberOfControlPoints);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves  Number of control points delivered .
	 * @return String - value of Number Of Control Points.
	 */
	public String getNumberOfControlPoints()
	{
		Object objValue = getValue(0x300A,0x0110);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Retrieves pre-initialized object of Ion Control Point Sequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 * @return ControlPointSequence - instance of Ion Control Point Sequence. 
	 */
	public IonControlPointSequence getIonControlPointSequence()
	{
		IonControlPointSequence objIonControlPointSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A,0x03A8);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objIonControlPointSequence = (IonControlPointSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objIonControlPointSequence = (IonControlPointSequence)objDicomV3Factory.createSequence(0x300A,0x03A8, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A,0x03A81, objIonControlPointSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A,0x03A8, DicomConstants.DCM_DT_SQ, objIonControlPointSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objIonControlPointSequence;
	}
	
	
	
}

