/*******************************************************************************
 *  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.EnumBorderDensity;
import cdac.medinfo.sdk.dcm30_04.enums.EnumEmptyImageDensity;
import cdac.medinfo.sdk.dcm30_04.enums.EnumFilmOrientation;
import cdac.medinfo.sdk.dcm30_04.enums.EnumFilmSizeID;
import cdac.medinfo.sdk.dcm30_04.enums.EnumImageDisplayFormat;
import cdac.medinfo.sdk.dcm30_04.enums.EnumMagnificationType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumRequestedResolutionID;
import cdac.medinfo.sdk.dcm30_04.enums.EnumTrim;
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.exceptions.ValidationException;
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 Film Box Content Sequence Item.
 */
public class FilmBoxContentSequenceItem extends Item  
{
	        

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

	/**
	 * This constructor creates the item and internal code sequence macro with default TransferSyntax 
	 */
	FilmBoxContentSequenceItem()
	{
		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
	 */
	FilmBoxContentSequenceItem(ITransferSyntax objITransferSyntax)
	{
		super(objITransferSyntax);
	}

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

	/**
	 * Sets Type of image display format. Enumerated Values:
	 * STANDARD\C,R       : film contains equal size rectangular image boxes with R rows of image boxes and C columns 
	 * 					    of image boxes; C and R are integers.
	 * ROW\R1,R2,R3, etc. : film contains rows with equal size rectangular image boxes with R1 image boxes
	 * 						in the first row, R2 image boxes in second row, R3 image boxes in third row, etc.;
	 * 						R1, R2, R3, etc. are integers.
	 * COL\C1,C2,C3, etc. : film contains columns with equal size rectangular image boxes with C1 image
	 * 						boxes in the first column, C2 image boxes in second column, C3 image boxes in third 
	 * 						column, etc.; C1,C2, C3, etc. are integers.
	 * SLIDE              : film contains 35mm slides; the number of slides for a particular film size is configuration
	 * 					    dependent.
	 * SUPERSLIDE 		  :	film contains 40mm slides; the number of slides for a particular film size is
	 * 						configuration dependent.
	 * CUSTOM\i 		  : film contains a customized ordering of rectangular image boxes; i identifies the image
	 * 						display format; the definition of the image display formats is defined in the 
	 * 						Conformance Statement; i is an integer.
	 * @param enumImageDisplayFormat Enum value of Image Display Format.
	 */
	public void setImageDisplayFormat(EnumImageDisplayFormat  enumImageDisplayFormat)
	{
		/*Accept Image Display Format 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0010,enumImageDisplayFormat.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0010, DicomConstants.DCM_DT_ST,enumImageDisplayFormat.getValue());
		addDataElement(objIDataElement);
	}

	/**
	 * Return Type of image display format.
	 * @return String - value of Image Display Format.
	 */
	public String getImageDisplayFormat()
	{
		Object objValue = getValue(0x2010,0x0010);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets identification of annotation display format. The definition of the annotation display formats and the
	 * annotation box position sequence are defined in the Conformance Statement.
	 * @param strAnnotationDisplayFormatID String value of Annotation Display Format ID.
	 */
	public void setAnnotationDisplayFormatID(String strAnnotationDisplayFormatID)
	{
		/* Accept Annotation Display Format ID 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0030,strAnnotationDisplayFormatID,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0030, DicomConstants.DCM_DT_CS,strAnnotationDisplayFormatID);
		addDataElement(objIDataElement);
	}

	/**
	 * Return identification of annotation display format.
	 * @return String - value of Annotation Display Format ID.
	 */
	public String getAnnotationDisplayFormatID()
	{
		Object objValue = getValue(0x2010,0x0030);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Film orientation. 
	 * Enumerated Values: 
	 * PORTRAIT = vertical film position.
	 * LANDSCAPE = horizontal film position.
	 * @param enumFilmOrientation Enum value of Film Orientation.
	 */
	public void setFilmOrientation(EnumFilmOrientation enumFilmOrientation)
	{
		/* Accept Film Orientation 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0040,enumFilmOrientation.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0040, DicomConstants.DCM_DT_CS,enumFilmOrientation.getValue());
		addDataElement(objIDataElement);
	}

	/**
	 * Return Film orientation.
	 * @return String - value of Film orientation.
	 */
	public String getFilmOrientation()
	{
		Object objValue = getValue(0x2010,0x0040);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Film size identification. 
	 * Defined Terms: 8INX10IN,8_5INX11IN,10INX12IN,10INX14IN,11INX14IN,,11INX17IN,14INX14IN,
					  14INX17IN,24CMX24CM,24CMX30CM,A4,A3.
	 * @param enumFilmSizeID Enum value of Film Size ID.
	 */
	public void setFilmSizeID(EnumFilmSizeID enumFilmSizeID)
	{
		/* Accept Film Size ID 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0050,enumFilmSizeID.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0050, DicomConstants.DCM_DT_CS,enumFilmSizeID.getValue());
		addDataElement(objIDataElement);
	}

	/**
	 * Return Film size identification. 
	 * @return String - value of Film size ID. 
	 */
	public String getFilmSizeID()
	{
		Object objValue = getValue(0x2010,0x0050);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets interpolation type by which the printer magnifies or decimates the image in order to fit the image in the
	 * image box on film. 
	 * Defined Terms: REPLICATE, BILINEAR,CUBIC,NONE.
	 * @param enumMagnificationType Enum value of Magnification Type.
	 */
	public void setMagnificationType(EnumMagnificationType enumMagnificationType)
	{
		/* Accept Magnification Type in String format of type CS.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create.
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0060,enumMagnificationType.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0060, DicomConstants.DCM_DT_CS,enumMagnificationType.getValue());
		addDataElement(objIDataElement);
	}

	/**
	 * Return interpolation type by which the printer magnifies or decimates the image in order to fit the image in the
	 * image box on film.
	 * @return String - value of Magnification Type. 
	 */
	public String getMagnificationType()
	{
		Object objValue = getValue(0x2010,0x0060);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets value that specifies the type of the interpolation function. Values are defined in Conformance
	 * Statement. Only valid for Magnification Type (2010,0060) = CUBIC.
	 * @param strSmoothingType String value of Smoothing Type.
	 */
	public void setSmoothingType(String strSmoothingType)
	{
		/* Accept Smoothing Type in String format of type CS.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create.
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0080,strSmoothingType,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0080, DicomConstants.DCM_DT_CS,strSmoothingType);
		addDataElement(objIDataElement);
	}

	/**
	 * Return value that specifies the type of the interpolation function.
	 * @return String - value of Smoothing Type. 
	 */
	public String getSmoothingType()
	{
		Object objValue = getValue(0x2010,0x0080);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets density of the film areas surrounding and between images on the film. 
	 * Defined Terms: 
	 * 1) BLACK
	 * 2) WHITE
	 * 3) i where i represents the desired density in hundreds of OD (e.g. 150 corresponds with 1.5 OD)
	 * @param enumBorderDensity Enum value of Border Density.
	 */
	public void setBorderDensity(EnumBorderDensity enumBorderDensity)
	{
		/* Accept Border Density 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0100,enumBorderDensity.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0100, DicomConstants.DCM_DT_CS,enumBorderDensity.getValue());
		if(objIDataElement != null)
			addDataElement(objIDataElement);
	}

	/**
	 * Return density of the film areas surrounding and between images on the film.
	 * @return String - value of Border Density. 
	 */
	public String getBorderDensity()
	{
		Object objValue = getValue(0x2010,0x0100);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets density of the image box area on the film that contains no image. 
	 * Defined Terms: 
	 * 1) BLACK
	 * 2) WHITE
	 * 3) i where i represents the desired density in hundreds of OD (e.g. 150 corresponds with 1.5 OD)
	 * @param enumEmptyImageDensity Enum value of Empty Image Density.
	 */
	public void setEmptyImageDensity(EnumEmptyImageDensity enumEmptyImageDensity)
	{
		/* Accept Empty Image Density 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0110,enumEmptyImageDensity.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0110, DicomConstants.DCM_DT_CS,enumEmptyImageDensity.getValue());
		addDataElement(objIDataElement);
	}

	/**
	 * Return density of the image box area on the film that contains no image. 
	 * @return String - value of Empty Image Density. 
	 */
	public String getEmptyImageDensity()
	{
		Object objValue = getValue(0x2010,0x0110);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets minimum density of the images on the film, expressed in hundredths of OD. If Min Density is
	 * lower than minimum printer density than Min Density is set to minimum printer density.
	 * @param shMinDensity short value of Min Density.
	 */
	public void setMinDensity(short shMinDensity)
	{
		/* Accept Min Density in String format of type US.
		 * 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0120,shMinDensity,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0120, DicomConstants.DCM_DT_US,shMinDensity);
		addDataElement(objIDataElement);
	}

	/**
	 * Return minimum density of the images on the film, expressed in hundredths of OD.
	 * @return short - short value of Min Density. 
	 */
	public short getMinDensity()
	{
		Object objValue = getValue(0x2010,0x0120);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets maximum density of the images on the film, expressed in hundredths of OD. If Max Density is
	 * higher than maximum printer density than Max Density is set to maximum printer density.
	 * @param shMaxDensity short value of Max Density.
	 */
	public void setMaxDensity(short shMaxDensity)
	{
		/* Accept Max Density in String format of type US.
		 * 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0130,shMaxDensity,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0130, DicomConstants.DCM_DT_US,shMaxDensity);
		addDataElement(objIDataElement);
	}

	/**
	 * Return maximum density of the images on the film, expressed in hundredths of OD.
	 * @return short short value of Max Density. 
	 */
	public short getMaxDensity()
	{
		Object objValue = getValue(0x2010,0x0130);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets whether a trim box shall be printed surrounding each image on the film. 
	 * Enumerated Values: 
	 * 1) YES
	 * 2) NO.
	 * @param enumTrim Enum value of Trim.
	 */
	public void setTrim(EnumTrim  enumTrim)
	{
		/* Accept Trim 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0140,enumTrim.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0140, DicomConstants.DCM_DT_CS,enumTrim.getValue());
		addDataElement(objIDataElement);
	}

	/**
	 * Return whether a trim box shall be printed surrounding each image on the film.
	 * @return String - value of Trim.
	 */
	public String getTrim()
	{
		Object objValue = getValue(0x2010,0x0140);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets character string that contains either the ID of the printer configuration table that contains a set of
	 * values for implementation specific print parameters (e.g. perception LUT related parameters) or one or
	 * more configuration data values, encoded as characters.
	 * @param strConfigurationInformation String value of Configuration Information.
	 */
	public void setConfigurationInformation(String strConfigurationInformation)
	{
		/* Accept Configuration Information 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0150,strConfigurationInformation,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0150, DicomConstants.DCM_DT_ST,strConfigurationInformation);
		addDataElement(objIDataElement);
	}

	/**
	 * Return character string that contains either the ID of the printer configuration table that contains a set of
	 * values for implementation specific print parameters (e.g. perception LUT related parameters) or one or
	 * more configuration data values, encoded as characters.
	 * @return String value of Configuration Information.
	 */
	public String getConfigurationInformation()
	{
		Object objValue = getValue(0x2010,0x0150);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets luminance of lightbox illuminating a piece of transmissive film, or for the case of reflective media,
	 * luminance obtainable from diffuse reflection of the illumination present.
	 * @param shIllumination short value of Illumination.
	 */
	public void setIllumination(short shIllumination)
	{
		/* Accept Illumination in String format of type US.
		 * 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x015E,shIllumination,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x015E, DicomConstants.DCM_DT_US,shIllumination);
		addDataElement(objIDataElement);
	}

	/**
	 * Return luminance of lightbox illuminating a piece of transmissive film, or for the case of reflective media,
	 * luminance obtainable from diffuse reflection of the illumination present.
	 * @return short - short value of Illumination.
	 */
	public short getIllumination()
	{
		Object objValue = getValue(0x2010,0x015E);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets luminance contribution due to reflected ambient light.
	 * @param shReflectedAmbientLight short value of Reflected Ambient Light.
	 */
	public void setReflectedAmbientLight(short shReflectedAmbientLight)
	{
		/* Accept Reflected Ambient Light in String format of type US.
		 * 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0160,shReflectedAmbientLight,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2010,0x0160, DicomConstants.DCM_DT_US,shReflectedAmbientLight);
		addDataElement(objIDataElement);
	}

	/**
	 * Return luminance contribution due to reflected ambient light.
	 * @return short - short value of Reflected Ambient Light.
	 */
	public short getReflectedAmbientLight()
	{
		Object objValue = getValue(0x2010,0x0160);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the resolution at which images in this Film Box are to be printed.
	 * Defined Terms:
	 * 1) STANDARD = approximately 4k x 5k printable pixels on a 14 x 17 inch film
	 * 2) HIGH = Approximately twice the resolution of STANDARD.
	 * @param enumRequestedResolutionID Enum value of Requested Resolution ID.
	 */
	public void setRequestedResolutionID(EnumRequestedResolutionID enumRequestedResolutionID)
	{
		/* Accept Requested Resolution ID 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2020,0x0050,enumRequestedResolutionID.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x2020,0x0050, DicomConstants.DCM_DT_CS,enumRequestedResolutionID.getValue());
		addDataElement(objIDataElement);
	}

	/**
	 * Return the resolution at which images in this Film Box are to be printed.
	 * @return String - value of Requested Resolution ID.
	 */
	public String getRequestedResolutionID()
	{
		Object objValue = getValue(0x2020,0x0050);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Retrieves pre-initialized object of Referenced Presentation LUT 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 ReferencedPresentationLUTSequence - instance of Referenced Presentation LUT Sequence.
	 */
	public ReferencedPresentationLUTSequence getReferencedPresentationLUTSequence()
	{
		ReferencedPresentationLUTSequence objReferencedPresentationLUTSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x2050,0x0500);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objReferencedPresentationLUTSequence = (ReferencedPresentationLUTSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objReferencedPresentationLUTSequence = (ReferencedPresentationLUTSequence)objDicomV3Factory.createSequence(0x2050,0x0500,objITransferSyntax, objIDictionaryReader);

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

	/**
	 * Validates all the attributes in {@link FilmBoxContentSequenceItem} 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(0x2010,0x0010))
				throw new MandatoryMissingException("2010,0010");
			if(!contains(0x2010,0x0040))
				throw new MandatoryMissingException("2010,0040");
			if(!contains(0x2010,0x0050))
				throw new MandatoryMissingException("2010,0050");
			if(!contains(0x2010,0x0060))
				throw new MandatoryMissingException("2010,0060");
			if(!contains(0x2010,0x0130))
				throw new MandatoryMissingException("2010,0130");
			if(!contains(0x2010,0x0150))
				throw new MandatoryMissingException("2010,0150");
			/*
			 * llumination (2010,015E). Required if Presentation SOP Class is present.
			 * Reflected Ambient Light (2010,0160) Required if Presentation SOP Class is present.
			 * Referenced Presentation LUT Sequence Required if a Presentation LUT is to be applied to the image.
			 */
		}
		catch(MandatoryMissingException me)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(me.getMessage());
			}
			throw new ValidationException(this.getClass().getSimpleName(),me);
		}
		catch( ConditionFailedException cfe)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(cfe.getMessage());
			}
			throw new ValidationException(this.getClass().getSimpleName(),cfe);
		}
		return true;
	}
}
