/*******************************************************************************
 *  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.EnumDecimateCropResult;
import cdac.medinfo.sdk.dcm30_04.enums.EnumMagnificationType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumRequestedResolutionID;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidItemException;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConstants;




/**
* This item class contains the methods to set, get and validate the attribute 
 * present in Printer Configuration Sequence Item.
 */
public class PrinterConfigurationSequenceItem extends Item  
{
	

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

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

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

	/**
	 * Sets The Meta-SOP Class and a list of optional SOP Classes supported. It shall contain one Meta SOP
	 * Class UID and 0-n optional SOP Class UIDs.
	 * @param strArrSOPClassesSupported String array of SOP Classes Supported.
	 */
	public void setSOPClassesSupported(String[] strArrSOPClassesSupported)
	{
		/* Accept the SOP Classes Supported 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(0x0008,0x115A, strArrSOPClassesSupported,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0008,0x115A,DicomConstants.DCM_DT_UI, strArrSOPClassesSupported);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves  The Meta-SOP Class and a list of optional SOP Classes supported.
	 * @return String - value of  SOP Classes Supported
	 */
	public String[] getSOPClassesSupported()
	{
		Object objValue = getValue(0x0008,0x115A);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}

	/**
	 * Sets Maximum number of kilobytes of memory that can be allocated for a Film Session. 
	 * The value shall be 0 if Memory Allocation (2000,0060) is not supported.
	 * @param strMaximumMemoryAllocation String value of Maximum number of kilobytes of memory that can be allocated for a Film Session.
	 */
	public void setMaximumMemoryAllocation(String strMaximumMemoryAllocation)
	{
		/* Accept the Maximum Memory Allocation 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(0x2000,0x0061, strMaximumMemoryAllocation,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2000,0x0061,DicomConstants.DCM_DT_IS, strMaximumMemoryAllocation);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Maximum number of kilobytes of memory that can be allocated for a Film Session. 
	 * @return String - value of  Maximum number of kilobytes of memory that can be allocated for a Film Session. 
	 */
	public String getMaximumMemoryAllocation()
	{
		Object objValue = getValue(0x2000,0x0061);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets The maximum number of bits for each pixel that can be stored in printer memory.
	 * @param shMemoryBitDepth short value of Memory Bit Depth.
	 */
	public void setMemoryBitDepth(short shMemoryBitDepth)
	{
		/* Accept the MemoryBitDepth 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 Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2000,0x00A0, shMemoryBitDepth,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2000,0x00A0,DicomConstants.DCM_DT_US, shMemoryBitDepth);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves The maximum number of bits for each pixel that can be stored in printer memory.
	 * @return short - short value of Number of Memory Bit Depth.
	 */
	public short getMemoryBitDepth()
	{
		Object objValue = getValue(0x2000,0x00A0);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets The number of bits used by the print engine for internal LUT calculation and printing of each pixel.
	 * @param shPrintingBitDepth short value of Printing Bit Depth.
	 */
	public void setPrintingBitDepth(short shPrintingBitDepth)
	{
		/* Accept the PrintingBitDepth 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 Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2000,0x00A1, shPrintingBitDepth,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2000,0x00A1,DicomConstants.DCM_DT_US, shPrintingBitDepth);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves The number of bits used by the print engine for internal LUT calculation and printing of each pixel.
	 * @return short - short value of Number of Printing Bit Depth.
	 */
	public short getPrintingBitDepth()
	{
		Object objValue = getValue(0x2000,0x00A1);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Retrieves pre-initialized object of Media Installed 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 MediaInstalledSequence - instance of Media Installed Sequence. 
	 */
	public MediaInstalledSequence getMediaInstalledSequence()
	{
		MediaInstalledSequence objMediaInstalledSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x2000,0x00A2);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objMediaInstalledSequence = (MediaInstalledSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objMediaInstalledSequence = (MediaInstalledSequence)objDicomV3Factory.createSequence(0x2000,0x00A2, objITransferSyntax, objIDictionaryReader);

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

	/**
	 * Retrieves pre-initialized object of Other Media Available 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 OtherMediaAvailableSequence - instance of Other Media Available Sequence. 
	 */
	public OtherMediaAvailableSequence getOtherMediaAvailableSequence()
	{
		OtherMediaAvailableSequence objOtherMediaAvailableSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x2000,0x00A4);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objOtherMediaAvailableSequence = (OtherMediaAvailableSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objOtherMediaAvailableSequence = (OtherMediaAvailableSequence)objDicomV3Factory.createSequence(0x2000,0x00A4, objITransferSyntax, objIDictionaryReader);

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

	/**
	 * Retrieves pre-initialized object of Supported Image Display Formats 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 SupportedImageDisplayFormatsSequence - instance of Supported Image Display Formats Sequence. 
	 */
	public SupportedImageDisplayFormatsSequence getSupportedImageDisplayFormatsSequence()
	{
		SupportedImageDisplayFormatsSequence objSupportedImageDisplayFormatsSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x2000,0x00A8);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objSupportedImageDisplayFormatsSequence = (SupportedImageDisplayFormatsSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objSupportedImageDisplayFormatsSequence = (SupportedImageDisplayFormatsSequence)objDicomV3Factory.createSequence(0x2000,0x00A8, objITransferSyntax, objIDictionaryReader);

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

	/**
	 * Sets printer's default resolution identification. 
	 * Defined Terms are the same as Requested Resolution ID (2020,0050).
	 * @param enumDefaultPrinterResolutionID Enum value of printer's default resolution identification. 
	 */
	public void setDefaultPrinterResolutionID(EnumRequestedResolutionID enumDefaultPrinterResolutionID)
	{
		/* Accept Default Printer Resolution ID 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(0x2010,0x0054, enumDefaultPrinterResolutionID.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2010,0x0054,DicomConstants.DCM_DT_CS, enumDefaultPrinterResolutionID.getValue());

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves printer's default resolution identification. 
	 * @return String - value of  printer's default resolution identification. 
	 */
	public String getDefaultPrinterResolutionID()
	{
		Object objValue = getValue(0x2010,0x0054);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Printer's default magnification type.
	 * @param enumDefaultMagnificationType String value of printer's default Magnification Type .
	 */
	public void setDefaultMagnificationType(EnumMagnificationType enumDefaultMagnificationType)
	{
		/* Accept Default Magnification Type 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(0x2010,0x00A6, enumDefaultMagnificationType.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2010,0x00A6,DicomConstants.DCM_DT_CS, enumDefaultMagnificationType.getValue());

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Printer's default magnification type. 
	 * @return String - value of  Printer's default magnification type.
	 */
	public String getDefaultMagnificationType()
	{
		Object objValue = getValue(0x2010,0x00A6);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Other magnification types available in the printer.
	 * @param enumOtherMagnificationTypes Enum array of Other magnification types available in the printer.
	 */
	public void setOtherMagnificationTypes(EnumMagnificationType[] enumOtherMagnificationTypes)
	{
		/* Accept Other Magnification Types Available 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
		 */
		String[] arrstrOtherMagnificationTypes = new String[enumOtherMagnificationTypes.length];
		for(int i=0;i < enumOtherMagnificationTypes.length ; i++)
		{
			arrstrOtherMagnificationTypes[i] = enumOtherMagnificationTypes[i].getValue();
		}
		int iVRTransferSyntax=0;
		IDataElement objIDataElement = null;
		if(objITransferSyntax != null)
			iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
		else
		{
			//Transfer Syntax not set
		}
		if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x2010,0x00A7, arrstrOtherMagnificationTypes,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2010,0x00A7,DicomConstants.DCM_DT_CS, arrstrOtherMagnificationTypes);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Other magnification types available in the printer.
	 * @return String - value of  Other magnification types available in the printer.
	 */
	public String getOtherMagnificationTypes()
	{
		Object objValue = getValue(0x2010,0x00A7);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Printer's default smoothing type.
	 * @param strDefaultSmoothingType String value of Printer's default smoothing type. 
	 */
	public void setDefaultSmoothingType(String strDefaultSmoothingType)
	{
		/* Accept Default Magnification Type 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(0x2010,0x00A8, strDefaultSmoothingType,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2010,0x00A8,DicomConstants.DCM_DT_CS, strDefaultSmoothingType);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Printer's default smoothing type.
	 * @return String - value of Printer's default smoothing type.
	 */
	public String getDefaultSmoothingType()
	{
		Object objValue = getValue(0x2010,0x00A8);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Other smoothing types available in the printer.
	 * @param strArrOtherSmoothingTypesAvailable String array of Other smoothing types available in the printer.
	 */
	public void setOtherSmoothingTypesAvailable(String[] strArrOtherSmoothingTypesAvailable)
	{
		/* Accept Other smoothing Types Available 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(0x2010,0x00A9, strArrOtherSmoothingTypesAvailable,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2010,0x00A9,DicomConstants.DCM_DT_CS, strArrOtherSmoothingTypesAvailable);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Other smoothing types available in the printer.
	 * @return String - value of  Other smoothing types available in the printer.
	 */
	public String[] getOtherSmoothingTypesAvailable()
	{
		Object objValue = getValue(0x2010,0x00A9);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}

	/**
	 * Sets free form text description of Configuration Information (2010,0150) supported by the printer.
	 * @param strConfigurationInformationDescription String value of Configuration Information Description.
	 */
	public void setConfigurationInformationDescription(String strConfigurationInformationDescription)
	{
		/* Accept Configuration Information Description of type LT.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x2010,0x0152, strConfigurationInformationDescription,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2010,0x0152,DicomConstants.DCM_DT_LT, strConfigurationInformationDescription);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves description of Configuration Information (2010,0150) supported by the printer.
	 * @return String - value of description of Configuration Information (2010,0150) supported by the printer.
	 */
	public String getConfigurationInformationDescription()
	{
		Object objValue = getValue(0x2010,0x0152);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets The maximum number of films that can be collated for an N-ACTION of the Film Session. The value
	 * shall be 0 if N-ACTION of the Film Session is not supported.
	 * @param strMaximumCollatedFilms String value of Maximum Collated Films.
	 */
	public void setMaximumCollatedFilms(String strMaximumCollatedFilms)
	{
		/* Accept Maximum Collated Films 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(0x2010,0x0154, strMaximumCollatedFilms,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2010,0x0154,DicomConstants.DCM_DT_IS, strMaximumCollatedFilms);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves The maximum number of films that can be collated for an N-ACTION of the Film Session.
	 * @return String - value of The maximum number of films that can be collated for an N-ACTION of the Film Session.
	 */
	public String getMaximumCollatedFilms()
	{
		Object objValue = getValue(0x2010,0x0154);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Indicates whether the printer will decimate or crop image pixels if the image rows or columns is greater
	 * than the available printable pixels in an Image Box.
	 * Enumerated Values when the printer does not support Requested Decimate/Crop Behavior (2020,0040):
	 * DECIMATE = image will be decimated to fit.
	 * CROP = image will be cropped to fit.
	 * FAIL = N-SET of the Image Box will fail
	 * Enumerated Values when the printer supports Requested Decimate/Crop Behavior (2020,0040):
	 * DEF DECIMATE = image will be decimated to fit.
	 * DEF CROP = image will be cropped to fit
	 * DEF FAIL = N-SET of the Image Box will fail
	 * This value indicates the printer default if the SCU does not create or set Requested Decimate/Crop Behavior for the Image Box.
	 * @param enumDecimateCropResult Enum value of Maximum Collated Films.
	 */
	public void setDecimateCropResult(EnumDecimateCropResult enumDecimateCropResult)
	{
		/* Accept DecimateCropResult 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(0x2020,0x00A2, enumDecimateCropResult.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x2020,0x00A2,DicomConstants.DCM_DT_CS, enumDecimateCropResult.getValue());

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Decimate/Crop Result.
	 * @return String - value of Decimate/Crop Result.
	 */
	public String getDecimateCropResult()
	{
		Object objValue = getValue(0x2020,0x00A2);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Validates all the attributes in PrinterConfigurationSequenceItem that are present in the DataSet
	 * @return boolean - Success -true, Failure - false
	 * @throws InvalidItemException throws InvalidItemException Conditional element fails.
	 */
	public boolean validateForModule()  throws InvalidItemException
	{
		return true;
	}
}
