/*******************************************************************************
 *  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.IDictionaryReader;
import cdac.medinfo.sdk.dcm30_04.commoninterface.ITransferSyntax;
import cdac.medinfo.sdk.dcm30_04.enums.EnumDoseReferenceStructureType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumDoseReferenceType;
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 provides methods to validate, set and get the attributes of {@link DoseReferenceSequence}.
 */
public class DoseReferenceSequenceItem extends Item   
{
	

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * This constructor creates the item and internal code sequence macro with default TransferSyntax 
	 */
	DoseReferenceSequenceItem()
	{
		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
	 */
	DoseReferenceSequenceItem(ITransferSyntax objITransferSyntax)
	{
		super(objITransferSyntax);
	}

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


	/**
	 * Validates all the attributes in DoseReferenceSequenceItem that are present in the DataSet
	 * @return boolean - Success -true, Failure - false
	 * @throws InvalidItemException throws InvalidItemException If Conditional element fails.
	 */
	public boolean validateForModule()  throws InvalidItemException
	{
		try
		{
			if(!contains(0x300A,0x0012))
				throw new MandatoryMissingException("300A,0012 is not prsesent") ;
			if(!contains(0x3006,0x0014))
				throw new MandatoryMissingException("300A,0014 is not prsesent") ;

			String strDoseReferenceStructureType = getDoseReferenceStructureType();
			if((strDoseReferenceStructureType.equalsIgnoreCase(EnumDoseReferenceStructureType.DOSE_REFERENCE_POINT.getValue()) || strDoseReferenceStructureType.equalsIgnoreCase(EnumDoseReferenceStructureType.DOSE_REFERENCE_VOLUME.getValue())) && (!contains(0x3006,0x0084)))
				throw new ConditionFailedException("value of conditional Element 3006,0084 is required if value of element 300A,0014 is POINT or VOLUME") ;
			if((strDoseReferenceStructureType.equalsIgnoreCase(EnumDoseReferenceStructureType.DOSE_REFERENCE_POINT_COORDINATES.getValue()) && (!contains(0x300A,0x0018))))
				throw new ConditionFailedException("value of conditional Element 300A,0018 is required if value of element 300A,0014 is COORDINATES") ;
			if(!contains(0x300A,0x0020))
				throw new MandatoryMissingException("300A,0020 is not prsesent") ;
		}
		catch(MandatoryMissingException me)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(me.getMessage());
			}
			throw new InvalidItemException(this.getClass().getSimpleName(),me);
		}
		catch( ConditionFailedException ce)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(ce.getMessage());
			}
			throw new InvalidItemException(this.getClass().getSimpleName(),ce); 
		}
		return true;
	}

	/**
	 * Identification number of the Dose Reference
	 * Sets Dose Reference Number .Uniquely identifies Dose Reference Number(300A,0012) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strDoseReferenceNumber String value of Dose Reference Number.
	 */
	public void setDoseReferenceNumber(String strDoseReferenceNumber)
	{
		/*Accept the DoseReferenceNumber 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,0x0012, strDoseReferenceNumber,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0012,DicomConstants.DCM_DT_IS, strDoseReferenceNumber);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Dose Reference Number.
	 * @return String - value of Dose Reference Number.
	 */
	public String getDoseReferenceNumber()
	{
		Object objValue = getValue(0x300A,0x0012);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * A unique identifier for a Dose Reference that can be used to link the same entity across multiple RT Plan objects.
	 * Sets Dose Reference UID .Uniquely identifies Dose Reference UID(300A,0013) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strDoseReferenceUID String value of Dose Reference UID.
	 */
	public void setDoseReferenceUID(String strDoseReferenceUID)
	{
		/*Accept the DoseReferenceUID in String format of type UI.
		 * 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,0x0013, strDoseReferenceUID,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0013,DicomConstants.DCM_DT_UI, strDoseReferenceUID);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Dose Reference UID.
	 * @return String - value of Dose Reference UID.
	 */
	public String getDoseReferenceUID()
	{
		Object objValue = getValue(0x300A,0x0013);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Sets Structure type of Dose Reference.
	 * @param enumDoseReferenceStructureType Enum value of Dose Reference Structure Type.
	 */
	public void setDoseReferenceStructureType(EnumDoseReferenceStructureType enumDoseReferenceStructureType)
	{
		/*Accept the DoseReferenceStructureType 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,0x0014, enumDoseReferenceStructureType.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0014,DicomConstants.DCM_DT_CS, enumDoseReferenceStructureType.getValue());

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Structure type of Dose Reference.
	 * @return String - value of Dose Reference Structure Type.
	 */
	public String getDoseReferenceStructureType()
	{
		Object objValue = getValue(0x300A,0x0014);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * User-defined description of Dose Reference.
	 * Sets Dose Reference Description .Uniquely identifies Dose Reference Description(300A,0016) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strDoseReferenceDescription String value of User-defined description of Dose Reference.
	 */
	public void setDoseReferenceDescription(String strDoseReferenceDescription)
	{
		/*Accept the DoseReferenceDescription 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,0x0016, strDoseReferenceDescription,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0016,DicomConstants.DCM_DT_LO, strDoseReferenceDescription);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Dose Reference Description.
	 * @return String - value of Dose Reference Description.
	 */
	public String getDoseReferenceDescription()
	{
		Object objValue = getValue(0x300A,0x0016);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Sets Referenced ROI Number.Uniquely identifies Referenced ROI Number(3006,0084) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strReferencedROINumber String value of Referenced ROI Number.
	 */
	public void setReferencedROINumber(String strReferencedROINumber)
	{
		/*Accept the ReferencedROINumber 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(0x3006,0x0084, strReferencedROINumber,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x3006,0x0084,DicomConstants.DCM_DT_IS, strReferencedROINumber);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Referenced ROI Number.
	 * @return String - value of Referenced ROI Number.
	 */
	public String getReferencedROINumber()
	{
		Object objValue = getValue(0x3006,0x0084);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Sets Dose Reference Point Coordinates.Uniquely identifies Dose Reference Point Coordinates(300A,0018) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param arrstrDoseReferencePointCoordinates String value of Dose Reference Point Coordinates.
	 */
	public void setDoseReferencePointCoordinates(String[] arrstrDoseReferencePointCoordinates)
	{
		/*Accept the DoseReferencePointCoordinates in String format of type DS.
		 * 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,0x0018, arrstrDoseReferencePointCoordinates,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0018,DicomConstants.DCM_DT_DS, arrstrDoseReferencePointCoordinates);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Dose Reference Point Coordinates.
	 * @return String - value of Dose Reference Point Coordinates.
	 */
	public String[] getDoseReferencePointCoordinates()
	{
		Object objValue = getValue(0x300A,0x0018);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}


	/**
	 * Sets Nominal Prior Dose.Uniquely identifies Nominal Prior Dose(300A,001A) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strNominalPriorDose String value of Nominal Prior Dose.
	 */
	public void setNominalPriorDose(String strNominalPriorDose)
	{
		/*Accept the NominalPriorDose in String format of type DS.
		 * 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,0x001A, strNominalPriorDose,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x001A,DicomConstants.DCM_DT_DS, strNominalPriorDose);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Nominal Prior Dose.
	 * @return String - value of Nominal Prior Dose.
	 */
	public String getNominalPriorDose()
	{
		Object objValue = getValue(0x300A,0x001A);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Sets Dose Reference Type.Uniquely identifies Dose Reference Type(300A,0020) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param enumDoseReferenceType Enum value of Dose Reference Type.
	 */
	public void setDoseReferenceType(EnumDoseReferenceType enumDoseReferenceType)
	{
		/*Accept the DoseReferenceType 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,0x0020, enumDoseReferenceType.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0020,DicomConstants.DCM_DT_CS, enumDoseReferenceType.getValue());

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Dose Reference Type.
	 * @return String - value of Dose Reference Type.
	 */
	public String getDoseReferenceType()
	{
		Object objValue = getValue(0x300A,0x0020);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Relative importance of satisfying constraint, where high values represent more important constraints.
	 * Sets Constraint Weight.Uniquely identifies Constraint Weight(300A,0021) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strConstraintWeight String value of Constraint Weight.
	 */
	public void setConstraintWeight(String strConstraintWeight)
	{
		/*Accept the ConstraintWeight in String format of type DS.
		 * 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,0x0021, strConstraintWeight,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0021,DicomConstants.DCM_DT_DS, strConstraintWeight);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Constraint Weight.
	 * @return String - value of Constraint Weight.
	 */
	public String getConstraintWeight()
	{
		Object objValue = getValue(0x300A,0x0021);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * The dose (in Gy) which when reached or exceeded should cause some action to be taken.
	 * Sets Delivery Warning Dose.Uniquely identifies Delivery Warning Dose(300A,0022) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strDeliveryWarningDose String value of Delivery Warning Dose.
	 */
	public void setDeliveryWarningDose(String strDeliveryWarningDose)
	{
		/*Accept the DeliveryWarningDose in String format of type DS.
		 * 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,0x0022, strDeliveryWarningDose,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0022,DicomConstants.DCM_DT_DS, strDeliveryWarningDose);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Delivery Warning Dose.
	 * @return String value of Delivery Warning Dose.
	 */
	public String getDeliveryWarningDose()
	{
		Object objValue = getValue(0x300A,0x0022);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * The maximum dose (in Gy) which can be delivered to the dose reference
	 * Sets Delivery Maximum Dose.Uniquely identifies Delivery Maximum Dose(300A,0023) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strDeliveryMaximumDose String value of Delivery Maximum Dose.
	 */
	public void setDeliveryMaximumDose(String strDeliveryMaximumDose)
	{
		/*Accept the DeliveryMaximumDose in String format of type DS.
		 * 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,0x0023, strDeliveryMaximumDose,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0023,DicomConstants.DCM_DT_DS, strDeliveryMaximumDose);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Delivery Maximum Dose.
	 * @return String - value of Delivery Maximum Dose.
	 */
	public String getDeliveryMaximumDose()
	{
		Object objValue = getValue(0x300A,0x0023);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Minimum permitted dose (in Gy) to Dose Reference
	 * Sets Target Minimum Dose.Uniquely identifies Target Minimum Dose(300A,0025) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strTargetMinimumDose String value of Target Minimum Dose.
	 */
	public void setTargetMinimumDose(String strTargetMinimumDose)
	{
		/*Accept the TargetMinimumDose in String format of type DS.
		 * 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,0x0025, strTargetMinimumDose,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0025,DicomConstants.DCM_DT_DS, strTargetMinimumDose);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Target Minimum Dose.
	 * @return String - value of Target Minimum Dose.
	 */
	public String getTargetMinimumDose()
	{
		Object objValue = getValue(0x300A,0x0025);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Prescribed dose (in Gy) to Dose Reference.
	 * Sets Target Prescription Dose.Uniquely identifies Target Prescription Dose(300A,0026) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strTargetPrescriptionDose String value of Target Prescription Dose.
	 */
	public void setTargetPrescriptionDose(String strTargetPrescriptionDose)
	{
		/*Accept the TargetPrescriptionDose in String format of type DS.
		 * 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,0x0026, strTargetPrescriptionDose,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0026,DicomConstants.DCM_DT_DS, strTargetPrescriptionDose);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Target Prescription Dose.
	 * @return String - value of Target Prescription Dose.
	 */
	public String getTargetPrescriptionDose()
	{
		Object objValue = getValue(0x300A,0x0026);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Prescribed dose (in Gy) to Dose Reference.
	 * Sets Target Maximum Dose.Uniquely identifies Target Maximum Dose(300A,0027) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strTargetMaximumDose String value of Target Maximum Dose.
	 */
	public void setTargetMaximumDose(String strTargetMaximumDose)
	{
		/*Accept the TargetMaximumDose in String format of type DS.
		 * 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,0x0027, strTargetMaximumDose,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0027,DicomConstants.DCM_DT_DS, strTargetMaximumDose);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Target Maximum Dose.
	 * @return String - value of Target Maximum Dose.
	 */
	public String getTargetMaximumDose()
	{
		Object objValue = getValue(0x300A,0x0027);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Maximum permitted fraction (in percent) of Target to receive less than the Target Prescription Dose.
	 * Sets Target Underdose Volume Fraction.Uniquely identifies Target Underdose Volume Fraction(300A,0028) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strTargetUnderdoseVolumeFraction String value of Target Underdose Volume Fraction.
	 */
	public void setTargetUnderdoseVolumeFraction(String strTargetUnderdoseVolumeFraction)
	{
		/*Accept the TargetUnderdoseVolumeFraction in String format of type DS.
		 * 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,0x0028, strTargetUnderdoseVolumeFraction,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0028,DicomConstants.DCM_DT_DS, strTargetUnderdoseVolumeFraction);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Target Underdose Volume Fraction.
	 * @return String - value of Target Underdose Volume Fraction.
	 */
	public String getTargetUnderdoseVolumeFraction()
	{
		Object objValue = getValue(0x300A,0x0028);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Maximum dose (in Gy) to entire Dose Reference.
	 * Sets Organ at Risk Full-volume Dose.Uniquely identifies Organ at Risk Full-volume Dose(300A,002A) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strOrganatRiskFull_volumeDose String value of Organ at Risk Full-volume Dose.
	 */
	public void setOrganatRiskFull_volumeDose(String strOrganatRiskFull_volumeDose)
	{
		/*Accept the OrganatRiskFull_volumeDose in String format of type DS.
		 * 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,0x002A, strOrganatRiskFull_volumeDose,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x002A,DicomConstants.DCM_DT_DS, strOrganatRiskFull_volumeDose);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Organ at Risk Full-volume Dose.
	 * @return String - value of Organ at Risk Full-volume Dose.
	 */
	public String getOrganatRiskFull_volumeDose()
	{
		Object objValue = getValue(0x300A,0x002A);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Maximum permitted dose (in Gy) to any part of Dose Reference.
	 * Sets Organ at Risk Limit Dose.Uniquely identifies Organ at Risk Limit Dose(300A,002B) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strOrganatRiskLimitDose String value of Organ at Risk Limit Dose.
	 */
	public void setOrganatRiskLimitDose(String strOrganatRiskLimitDose)
	{
		/*Accept the OrganatRiskLimitDose in String format of type DS.
		 * 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,0x002B, strOrganatRiskLimitDose,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x002B,DicomConstants.DCM_DT_DS, strOrganatRiskLimitDose);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Organ at Risk Limit Dose.
	 * @return String - value of Organ at Risk Limit Dose.
	 */
	public String getOrganatRiskLimitDose()
	{
		Object objValue = getValue(0x300A,0x002B);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Maximum dose (in Gy) to non-overdosed part of Dose Reference.
	 * Sets Organ at Risk Maximum Dose.Uniquely identifiesOrgan at Risk Maximum Dose(300A,002C) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strOrganatRiskMaximumDose String value of Organ at Risk Maximum Dose.
	 */
	public void setOrganatRiskMaximumDose(String strOrganatRiskMaximumDose)
	{
		/*Accept the OrganatRiskMaximumDose in String format of type DS.
		 * 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,0x002C, strOrganatRiskMaximumDose,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x002C,DicomConstants.DCM_DT_DS, strOrganatRiskMaximumDose);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Organ at Risk Maximum Dose.
	 * @return String - value of Organ at Risk Maximum Dose.
	 */
	public String getOrganatRiskMaximumDose()
	{
		Object objValue = getValue(0x300A,0x002C);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Maximum permitted fraction (in percent) of the Organ at Risk to receive more than the Organ at Risk Maximum Dose.
	 * Sets Organ at Risk Overdose Volume Fraction.Uniquely identifies Organ at Risk Overdose Volume Fraction(300A,002D) in Dose Reference Sequence (300A,0010) in RT Prescription Module of RT Plan IOD.
	 * @param strOrganatRiskOverdoseVolumeFraction String value of Organ at Risk Overdose Volume Fraction.
	 */
	public void setOrganatRiskOverdoseVolumeFraction(String strOrganatRiskOverdoseVolumeFraction)
	{
		/*Accept the OrganatRiskOverdoseVolumeFraction in String format of type DS.
		 * 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,0x002D, strOrganatRiskOverdoseVolumeFraction,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x002D,DicomConstants.DCM_DT_DS, strOrganatRiskOverdoseVolumeFraction);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Organ at Risk Overdose Volume Fraction.
	 * @return String - value of Organ at Risk Overdose Volume Fraction.
	 */
	public String getOrganatRiskOverdoseVolumeFraction()
	{
		Object objValue = getValue(0x300A,0x002D);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


}
