/*******************************************************************************
 *  Copyright 2017-2018 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.dcm30_04.dicommodel.modules;



import cdac.medinfo.sdk.dcm30_04.baselibs.DicomV3Factory;
import cdac.medinfo.sdk.dcm30_04.baselibs.FailedSOPSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.ReferencedSOPSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.ReferencedStorageMediaSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.Tag;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataSet;
import cdac.medinfo.sdk.dcm30_04.commoninterface.ITag;
import cdac.medinfo.sdk.dcm30_04.enums.EnumAllowLossyCompression;
import cdac.medinfo.sdk.dcm30_04.enums.EnumAllowMediaSplitting;
import cdac.medinfo.sdk.dcm30_04.enums.EnumExecutionStatus;
import cdac.medinfo.sdk.dcm30_04.enums.EnumExecutionStatusInfo;
import cdac.medinfo.sdk.dcm30_04.enums.EnumIncludeDisplayApplication;
import cdac.medinfo.sdk.dcm30_04.enums.EnumIncludeNonDICOMObjects;
import cdac.medinfo.sdk.dcm30_04.enums.EnumLabelUsingInformationExtractedFromInstances;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPreserveCompositeInstancesAfterMediaCreation;
import cdac.medinfo.sdk.dcm30_04.enums.EnumRequestPriority;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidModuleException;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConstants;
import cdac.medinfo.sdk.dcm30_04.utils.ISingleCollection;
import cdac.medinfo.sdk.dcm30_04.utils.SingleCollection;

// TODO: Auto-generated Javadoc
/**
 \* This module specifies the Attributes used for Media Creation Management.
 */
public class MediaCreationManagementModule extends Module  
{

 
 /**
  * The obj single collection.
  */
 public static ISingleCollection<ITag> objSingleCollection = null;
	 

	/**
	 * Instantiates a new media creation management module.
	 * 
	 * @param objIDataSet the obj i data set
	 */
	public MediaCreationManagementModule(IDataSet objIDataSet)
	{
		super(objIDataSet);
	}

	static
	{
		objSingleCollection = new SingleCollection<ITag>();
		objSingleCollection.add(new Tag(0x0008,0x1198));
		objSingleCollection.add(new Tag(0x0008,0x1199));
		objSingleCollection.add(new Tag(0x0088,0x0130));
		objSingleCollection.add(new Tag(0x0088,0x0140));
		objSingleCollection.add(new Tag(0x2000,0x0010));
		objSingleCollection.add(new Tag(0x2100,0x0020));
		objSingleCollection.add(new Tag(0x2100,0x0030));
		objSingleCollection.add(new Tag(0x2200,0x0001));
		objSingleCollection.add(new Tag(0x2200,0x0002));
		objSingleCollection.add(new Tag(0x2200,0x0003));
		objSingleCollection.add(new Tag(0x2200,0x0004));
		objSingleCollection.add(new Tag(0x2200,0x0005));
		objSingleCollection.add(new Tag(0x2200,0x0006));
		objSingleCollection.add(new Tag(0x2200,0x0007));
		objSingleCollection.add(new Tag(0x2200,0x0008));
		objSingleCollection.add(new Tag(0x2200,0x0009));
		objSingleCollection.add(new Tag(0x2200,0x000A));
		objSingleCollection.add(new Tag(0x2200,0x000B));
		objSingleCollection.add(new Tag(0x2200,0x000D));
		objSingleCollection.add(new Tag(0x2200,0x000F));
		objSingleCollection.add(new Tag(0x2200,0x0020));
	}
	
	/**
	 * This method validates each Attribute in the Module according to the Type
	 * of the Attribute.Attributes are of 5 types.
	 * Type 1,Type 2 are Mandatory:
	 * Mandatory Attributes have to present in the Module.
	 * Type 1C,2C are Conditional:
	 * Conditional Attributes' presence depend on a condition.
	 * If the condition is satisfied the Attribute has to be present.
	 * Type 3 are Optional
	 * Optional Attributes can be added as and when required.
	 * 
	 * @return true, if validate module
	 * 
	 * @throws InvalidModuleException - If validation of Module fails
	 */
	public boolean validateModule() throws InvalidModuleException
	{
		return true;
	}
	
	/**
	 * The user or implementation specific human readable identifier that identifies a Storage Media on which this SOP Instance resides.
	 * 
	 * @param strStorageMediaFileSetID String value of Storage Media File-Set ID.
	 */
	public void setStorageMediaFileSetID(String strStorageMediaFileSetID)
	{
		/* Accept the Storage Media File-Set ID 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
		 */
		addDataElement(0x0088, 0x0130, DicomConstants.DCM_DT_SH, strStorageMediaFileSetID);
	}

	/**
	 * Retrieves  The user or implementation specific human readable identifier that identifies a Storage Media on which this SOP Instance resides.
	 * 
	 * @return String - String value of Storage Media File-Set ID.
	 */
	public String getStorageMediaFileSetID()
	{
		Object objValue = getValue(0x0088,0x0130);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Uniquely identifies a Storage Media on which this SOP Instance resides.
	 * 
	 * @param strStorageMediaFileSetID the str storage media file set id
	 */
	public void setStorageMediaFileSetUID(String strStorageMediaFileSetID)
	{
		/* Accept the Storage Media File-Set UID 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
		 */
		addDataElement(0x0088, 0x0140, DicomConstants.DCM_DT_UI, strStorageMediaFileSetID);
	}

	/**
	 * Retrieves a Unique ID that identifies a Storage Media on which this SOP Instance resides.
	 * 
	 * @return String - String value of Storage Media File-Set UID.
	 */
	public String getStorageMediaFileSetUID()
	{
		Object objValue = getValue(0x0088,0x0140);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets number of copies to be printed for each film of the film session.
	 * 
	 * @param strNumberOfCopies String value of Number Of Copies.
	 */
	public void setNumberOfCopies(String strNumberOfCopies)
	{
		/* Accept Number Of Copies 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 Hash Map
		 */
		addDataElement(0x2000,0x0010, DicomConstants.DCM_DT_IS, strNumberOfCopies);
	}

	/**
	 * Return number of copies to be printed for each film of the film session.
	 * 
	 * @return String - String value of Number Of Copies.
	 */
	public String getNumberOfCopies()
	{
		Object objValue = getValue(0x2000,0x0010);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets the priority of the request.
	 * 
	 * @param enumRequestPriority Enum value of RequestPriority.
	 */
	public void setRequestPriority(EnumRequestPriority enumRequestPriority)
	{
		/* Accept RequestPriority 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
		 */
		addDataElement(0x2200,0x0020, DicomConstants.DCM_DT_CS, enumRequestPriority.getValue());
	}

	/**
	 * Retrieves the priority of the request.
	 * 
	 * @return String - String value of RequestPriority.
	 */
	public String getRequestPriority()
	{
		Object objValue = getValue(0x2200,0x0020);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets the Specification whether or not to extract label information from the instances.
	 * 
	 * @param enumLabelUsingInformationExtractedFromInstances Enum value of Specification.
	 */
	public void setLabelUsingInformationExtractedFromInstances(EnumLabelUsingInformationExtractedFromInstances enumLabelUsingInformationExtractedFromInstances)
	{
		/* Accept LabelUsingInformationExtractedFromInstances 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
		 */
		addDataElement(0x2200,0x0001, DicomConstants.DCM_DT_CS, enumLabelUsingInformationExtractedFromInstances.getValue());
	}

	/**
	 * Retrieves the Specification whether or not to extract label information from the instances.
	 * 
	 * @return String - String value of Specification.
	 */
	public String getLabelUsingInformationExtractedFromInstances()
	{
		Object objValue = getValue(0x2200,0x0001);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Unformatted free text to include in the label instead of or in addition to information extracted from the instances.
	 * 
	 * @param strLabelText String value of LabelText.
	 */
	public void setLabelText(String strLabelText)
	{
		/* Accept LabelText in String format of type UT.
		 * 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
		 */
		addDataElement(0x2200,0x0002, DicomConstants.DCM_DT_UT, strLabelText);
	}

	/**
	 * Return Unformatted free text to include in the label instead of or in addition to information extracted from the instances.
	 * 
	 * @return String - String value of LabelText.
	 */
	public String getLabelText()
	{
		Object objValue = getValue(0x2200,0x0002);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Unformatted free text to include in the label instead of or in addition to information extracted from the instances.
	 * 
	 * @param strLabelStyleSelection String value of Unformatted free text.
	 */
	public void setLabelStyleSelection(String strLabelStyleSelection)
	{
		/* Accept LabelStyleSelection 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
		 */
		addDataElement(0x2200,0x0003, DicomConstants.DCM_DT_CS, strLabelStyleSelection);
	}

	/**
	 * Return Unformatted free text to include in the label instead of or in addition to information extracted from the instances.
	 * 
	 * @return String - String value of Unformatted free text.
	 */
	public String getLabelStyleSelection()
	{
		Object objValue = getValue(0x2200,0x0003);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Unstructured text that describes where and to whom the media is to be sent.
	 * 
	 * @param strMediaDisposition String value of Unstructured text.
	 */
	public void setMediaDisposition(String strMediaDisposition)
	{
		/* Accept MediaDisposition in String format 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 Hash Map
		 */
		addDataElement(0x2200,0x0004, DicomConstants.DCM_DT_LT, strMediaDisposition);
	}

	/**
	 * Return Unstructured text that describes where and to whom the media is to be sent.
	 * 
	 * @return String - String value of Unstructured text.
	 */
	public String getMediaDisposition()
	{
		Object objValue = getValue(0x2200,0x0004);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets String that describes the bar code value to be printed on the media label.
	 * 
	 * @param strBarcodeValue String Barcode Value.
	 */
	public void setBarcodeValue(String strBarcodeValue)
	{
		/* Accept BarcodeValue in String format 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 Hash Map
		 */
		addDataElement(0x2200,0x0005, DicomConstants.DCM_DT_LT, strBarcodeValue);
	}

	/**
	 * Return String that describes the bar code value to be printed on the media label.
	 * 
	 * @return String - String Barcode Value.
	 */
	public String getBarcodeValue()
	{
		Object objValue = getValue(0x2200,0x0005);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Code string that describes the bar code symbology that shall be used for printing the Barcode Value.
	 * 
	 * @param strBarcodeSymbology String bar code symbology.
	 */
	public void setBarcodeSymbology(String strBarcodeSymbology)
	{
		/* Accept BarcodeSymbology 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
		 */
		addDataElement(0x2200,0x0006, DicomConstants.DCM_DT_CS, strBarcodeSymbology);
	}

	/**
	 * Return Code string that describes the bar code symbology that shall be used for printing the Barcode Value.
	 * 
	 * @return String - String bar code symbology.
	 */
	public String getBarcodeSymbology()
	{
		Object objValue = getValue(0x2200,0x0006);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets A flag indicating if the SCP is allowed to split this request over more than one piece of media.
	 * 
	 * @param enumAllowMediaSplitting Enum value of flag.
	 */
	public void setAllowMediaSplitting(EnumAllowMediaSplitting enumAllowMediaSplitting)
	{
		/* Accept AllowMediaSplitting 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
		 */
		addDataElement(0x2200,0x0007, DicomConstants.DCM_DT_CS, enumAllowMediaSplitting.getValue());
	}

	/**
	 * Retrieves A flag indicating if the SCP is allowed to split this request over more than one piece of media.
	 * 
	 * @return String - String value of flag.
	 */
	public String getAllowMediaSplitting()
	{
		Object objValue = getValue(0x2200,0x0007);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets A flag indicating if the SCP is allowed to perform lossy compression.
	 * 
	 * @param enumAllowLossyCompression Enum value of flag.
	 */
	public void setAllowLossyCompression(EnumAllowLossyCompression enumAllowLossyCompression)
	{
		/* Accept AllowLossyCompression 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
		 */
		addDataElement(0x2200,0x000F, DicomConstants.DCM_DT_CS, enumAllowLossyCompression.getValue());
	}

	/**
	 * Retrieves A flag indicating if the SCP is allowed to perform lossy compression.
	 * 
	 * @return String - String value of flag.
	 */
	public String getAllowLossyCompression()
	{
		Object objValue = getValue(0x2200,0x000F);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets A flag indicating if the SCP should include in the media additional Non-DICOM information/objects.
	 * 
	 * @param enumIncludeNonDICOMObjects Enum value of flag.
	 */
	public void setIncludeNonDICOMObjects(EnumIncludeNonDICOMObjects enumIncludeNonDICOMObjects)
	{
		/* Accept IncludeNonDICOMObjects 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
		 */
		addDataElement(0x2200,0x0008, DicomConstants.DCM_DT_CS, enumIncludeNonDICOMObjects.getValue());
	}

	/**
	 * Retrieves A flag indicating if the SCP should include in the media additional Non-DICOM information/objects.
	 * 
	 * @return String - String value of flag.
	 */
	public String getIncludeNonDICOMObjects()
	{
		Object objValue = getValue(0x2200,0x0008);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets A flag indicating if the SCP should include on the media a DICOM Instance Display Application.
	 * 
	 * @param enumIncludeDisplayApplication Enum value of flag.
	 */
	public void setIncludeDisplayApplication(EnumIncludeDisplayApplication enumIncludeDisplayApplication)
	{
		/* Accept IncludeDisplayApplication 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
		 */
		addDataElement(0x2200,0x0009, DicomConstants.DCM_DT_CS, enumIncludeDisplayApplication.getValue());
	}

	/**
	 * Retrieves A flag indicating if the SCP should include on the media a DICOM Instance Display Application.
	 * 
	 * @return String - String value of flag.
	 */
	public String getIncludeDisplayApplication()
	{
		Object objValue = getValue(0x2200,0x0009);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets A flag indicating if the SCP should include on the media a DICOM Instance Display Application.
	 * 
	 * @param enumPreserveCompositeInstancesAfterMediaCreation Enum value of flag.
	 */
	public void setPreserveCompositeInstancesAfterMediaCreation(EnumPreserveCompositeInstancesAfterMediaCreation enumPreserveCompositeInstancesAfterMediaCreation)
	{
		/* Accept PreserveCompositeInstancesAfterMediaCreation 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
		 */
		addDataElement(0x2200,0x000A, DicomConstants.DCM_DT_CS, enumPreserveCompositeInstancesAfterMediaCreation.getValue());
	}

	/**
	 * Retrieves A flag indicating if the SCP should include on the media a DICOM Instance Display Application.
	 * 
	 * @return String - String value of flag.
	 */
	public String getPreserveCompositeInstancesAfterMediaCreation()
	{
		Object objValue = getValue(0x2200,0x000A);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Execution status of a request.
	 * 
	 * @param enumExecutionStatus Enum value of Execution status.
	 */
	public void setExecutionStatus(EnumExecutionStatus enumExecutionStatus)
	{
		/* Accept ExecutionStatus 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
		 */
		addDataElement(0x2100,0x0020, DicomConstants.DCM_DT_CS, enumExecutionStatus.getValue());
	}

	/**
	 * Retrieves Execution status of a request.
	 * 
	 * @return String - String value of Execution status
	 */
	public String getExecutionStatus()
	{
		Object objValue = getValue(0x2100,0x0020);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Additional information about Execution Status.
	 * 
	 * @param enumExecutionStatusInfo Enum value of Additional information
	 */
	public void setExecutionStatusInfo(EnumExecutionStatusInfo enumExecutionStatusInfo)
	{
		/* Accept ExecutionStatusInfo 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
		 */
		addDataElement(0x2100,0x0030, DicomConstants.DCM_DT_CS, enumExecutionStatusInfo.getValue());
	}

	/**
	 * Retrieves Additional information about Execution Status.
	 * 
	 * @return String - String value of Additional information
	 */
	public String getExecutionStatusInfo()
	{
		Object objValue = getValue(0x2100,0x0030);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Number of pieces of media that have been successfully created, in order to store all copies of the requested file-set.
	 * 
	 * @param shTotalNumberofPiecesofMediaCreated short value of Number of pieces
	 */
	public void setTotalNumberofPiecesofMediaCreated(short shTotalNumberofPiecesofMediaCreated)
	{
		/* Accept TotalNumberofPiecesofMediaCreated in short 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
		 */
		addDataElement(0x2200,0x000B, DicomConstants.DCM_DT_US, shTotalNumberofPiecesofMediaCreated);
	}

	/**
	 * Retrieves Number of pieces of media that have been successfully created, in order to store all copies of the requested file-set.
	 * 
	 * @return short - short value of Number of pieces
	 */
	public short getTotalNumberofPiecesofMediaCreated()
	{
		Object objValue = getValue(0x2200,0x000B);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	
	/**
	 * Retrieves pre-initialized object of ReferencedSOPSequence.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 ReferencedSOPSequence - instance of ReferencedSOPSequence.
	 */
	public ReferencedSOPSequence getReferencedSOPSequence()
	{
		ReferencedSOPSequence objReferencedSOPSequence = (ReferencedSOPSequence)getDicomValue(0x0008,0x1199);
		if(objReferencedSOPSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objReferencedSOPSequence = (ReferencedSOPSequence)objDicomV3Factory.createSequence(0x0008,0x1199, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0008,0x1199, DicomConstants.DCM_DT_SQ, objReferencedSOPSequence.getValue());
		}
		return objReferencedSOPSequence;
	}
	
	/**
	 * Retrieves pre-initialized object of FailedSOPSequence.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 FailedSOPSequence - instance of FailedSOPSequence.
	 */
	public FailedSOPSequence getFailedSOPSequence()
	{
		FailedSOPSequence objFailedSOPSequence = (FailedSOPSequence)getDicomValue(0x0008,0x1198);
		if(objFailedSOPSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objFailedSOPSequence = (FailedSOPSequence)objDicomV3Factory.createSequence(0x0008,0x1198, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0008,0x1198, DicomConstants.DCM_DT_SQ, objFailedSOPSequence.getValue());
		}
		return objFailedSOPSequence;
	}
	
	/**
	 * Retrieves pre-initialized object of ReferencedStorageMediaSequence.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 ReferencedStorageMediaSequence - instance of ReferencedStorageMediaSequence.
	 */
	public ReferencedStorageMediaSequence getReferencedStorageMediaSequence()
	{
		ReferencedStorageMediaSequence objReferencedStorageMediaSequence = (ReferencedStorageMediaSequence)getDicomValue(0x2200,0x000D);
		if(objReferencedStorageMediaSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objReferencedStorageMediaSequence = (ReferencedStorageMediaSequence)objDicomV3Factory.createSequence(0x2200,0x000D, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x2200,0x000D, DicomConstants.DCM_DT_SQ, objReferencedStorageMediaSequence.getValue());
		}
		return objReferencedStorageMediaSequence;
	}
	
	/**
	 * This method returns the vector of keys representing the DataElements that belong to this module.
	 * 
	 * @return vector of Tags - returns the vector containing the collection of tags
	 */
	public ISingleCollection<ITag> getVectorOfKeys()
	{
		return objSingleCollection;
	}
	
}
