/*******************************************************************************
 *  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.IDataSet;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDicomValue;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDictionaryReader;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IItem;
import cdac.medinfo.sdk.dcm30_04.exceptions.ConditionFailedException;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidMacroException;
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 class contains the Macro that contains IOD Attributes that describe the general characteristics of the contributing sources used to create a new SOPInstance.
 */
public class GeneralContributingSourcesMacro extends Macro   
{
	

	private static final long serialVersionUID = 1L;

	/**
	 * This constructor constructs a Macro with specified DataSet.
	 * @param objDataSet Collection of DataElements 
	 */
	public GeneralContributingSourcesMacro(IDataSet objDataSet)
	{
		super(objDataSet);
	}

	/**
	 * This constructor constructs a Macro with specified DataSet and DictionaryReader
	 * @param objDataSet specifies the DataSet
	 * @param objDictionaryReader specifies the DICOM Dictionary reader to be used 
	 */
	public GeneralContributingSourcesMacro(IDataSet objDataSet,IDictionaryReader objDictionaryReader)
	{
		super(objDataSet,objDictionaryReader);
	}

	/**
	 * This constructor constructs a Macro with the specified Item
	 * @param objItem specifies instance of Item class
	 */
	public GeneralContributingSourcesMacro(IItem objItem)
	{
		super(objItem);
	}

	/**
	 * This constructor constructs a Macro with the specified Item and DictionaryReader
	 * @param objItem specifies instance of Item class
	 * @param objDictionaryReader specifies the DICOM Dictionary reader to be used 
	 */
	public GeneralContributingSourcesMacro(IItem objItem,IDictionaryReader objDictionaryReader)
	{
		super(objItem, objDictionaryReader);
	}

	/**
	 * Validates all the attributes in GeneralContributingSourcesMacro
	 * @return boolean - Success -true, Failure -false.
	 * @throws InvalidMacroException throws InvalidMacroException If Mandatory or Conditional element fails.
	 */
	public boolean validate() throws InvalidMacroException
	{
		if(iMacroLevel == DicomConstants.DCM_MODULE_LEVEL_MACRO)
			return validate(objIDataSet);
		else if(iMacroLevel == DicomConstants.DCM_ITEM_LEVEL_MACRO)
			return validate(objIItem);
		return false;
	}

	/**
	 * Validates all the attributes in GeneralContributingSourcesMacro that are present in the DataSet
	 * @param objIDataSet collection of DataElements
	 * @return boolean - Success -true, Failure - false
	 * @throws InvalidMacroException throws InvalidMacroException If Mandatory or Conditional element fails.
	 */
	public static boolean validate(IDataSet objIDataSet) throws InvalidMacroException
	{
		try
		{ 

			//validate condition here
			if(!objIDataSet.isPresent(0x0020,0x9529))
				throw new MandatoryMissingException("0020,9529");
			if(!objIDataSet.isPresent(0x0008,0x0070))
				throw new MandatoryMissingException("0008,0070");
			if(!objIDataSet.isPresent(0x0008,0x1090))
				throw new ConditionFailedException("0008,1090");
			if(!objIDataSet.isPresent(0x0018,0x1000))
				throw new ConditionFailedException("0018,1000");
			if(!objIDataSet.isPresent(0x0018,0x1020))
				throw new ConditionFailedException("0008,1020");
			if(!objIDataSet.isPresent(0x0008,0x002A))
				throw new ConditionFailedException("0008,002A");
			if(!objIDataSet.isPresent(0x0008,0x1010))
				throw new ConditionFailedException("0008,1010");
			if(!objIDataSet.isPresent(0x0008,0x1072))
				throw new ConditionFailedException("0008,1072");
			if(!objIDataSet.isPresent(0x0018,0x1030))
				throw new ConditionFailedException("0018,1030");
			if(!objIDataSet.isPresent(0x0040,0x0260))
				throw new ConditionFailedException("0040,0260");
			if(!objIDataSet.isPresent(0x0018,0x9423))
				throw new ConditionFailedException("0018,9423");
		}
		catch( ConditionFailedException ce)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(ce.getMessage());
			}
			throw new InvalidMacroException( KeratometricMeasurementsMacro.class.getSimpleName() ,ce); 
		}
		catch( MandatoryMissingException me)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(me.getMessage());
			}
			throw new InvalidMacroException(KeratometricMeasurementsMacro.class.getSimpleName() ,me);
		}
		return true;
	}

	/**
	 * Validates all the attributes in GeneralContributingSourcesMacro that are present in the DataSet
	 * @param objIItem collection of DataElements in a sequence
	 * @return boolean - Success -true, Failure - false
	 * @throws InvalidMacroException throws InvalidMacroException If Mandatory or Conditional element fails.
	 */
	public static boolean validate(IItem objIItem) throws InvalidMacroException
	{
		try
		{  
			//validate condition here
			if(!objIItem.contains(0x0020,0x9529))
				throw new MandatoryMissingException("0020,9529");
			if(!objIItem.contains(0x0008,0x0070))
				throw new MandatoryMissingException("0008,0070");
			if(!objIItem.contains(0x0008,0x1090))
				throw new ConditionFailedException("0008,1090");
			if(!objIItem.contains(0x0018,0x1000))
				throw new ConditionFailedException("0018,1000");
			if(!objIItem.contains(0x0018,0x1020))
				throw new ConditionFailedException("0008,1020");
			if(!objIItem.contains(0x0008,0x002A))
				throw new ConditionFailedException("0008,002A");
			if(!objIItem.contains(0x0008,0x1010))
				throw new ConditionFailedException("0008,1010");
			if(!objIItem.contains(0x0008,0x1070))
				throw new ConditionFailedException("0008,1070");
			if(!objIItem.contains(0x0008,0x1072))
				throw new ConditionFailedException("0008,1072");
			if(!objIItem.contains(0x0018,0x1030))
				throw new ConditionFailedException("0018,1030");
			if(!objIItem.contains(0x0040,0x0260))
				throw new ConditionFailedException("0040,0260");
			if(!objIItem.contains(0x0018,0x9423))
				throw new ConditionFailedException("0018,9423");
		}
		catch( ConditionFailedException ce)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(ce.getMessage());
			}
			throw new InvalidMacroException(GeneralContributingSourcesMacro.class.getSimpleName(),ce); 
		}
		catch( MandatoryMissingException me)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(me.getMessage());
			}
			throw new InvalidMacroException(GeneralContributingSourcesMacro.class.getSimpleName(),me);
		}
		return true;
	}
	/**
	 * Retrieves pre-initialized object of Contributing SOP InstancesReference 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 ContributingSOPInstancesReferenceSequence - instance of ContributingSOPInstancesReferenceSequence. 
	 */
	public ContributingSOPInstancesReferenceSequence getContributingSOPInstancesReferenceSequence()
	{
		ContributingSOPInstancesReferenceSequence objContributingSOPInstancesReferenceSequence = null;
		IDataElement objIDataElement =  getDataElement(0x0020,0x9529); 
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objContributingSOPInstancesReferenceSequence = (ContributingSOPInstancesReferenceSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objContributingSOPInstancesReferenceSequence = (ContributingSOPInstancesReferenceSequence)objDicomV3Factory.createSequence(0x0020,0x9529, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x0020,0x9529, objContributingSOPInstancesReferenceSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x0020,0x9529, DicomConstants.DCM_DT_SQ, objContributingSOPInstancesReferenceSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objContributingSOPInstancesReferenceSequence;
	}
	/**
	 * Sets the Manufacturer of the equipment used for beam delivery..
	 * @param strManufacturer String value of Manufacturer .
	 */
	public void setManufacturer(String strManufacturer)
	{
		/*Accept the Manufacturer in String format of type LO.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0008,0x0070, strManufacturer,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008,0x0070,DicomConstants.DCM_DT_LO, strManufacturer);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Manufacturer of the equipment used for beam delivery.
	 * @return String - value of Manufacturer.
	 */
	public String getManufacturer()
	{
		Object objValue = getValue(0x0008,0x0070);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/*
	 * Sets Manufacturer's model name of the equipment used for beam delivery.
	 * @param strManufacturersModelName String value of Manufacturers Model Name .
	 */
	public void setManufacturersModelName(String strManufacturersModelName)
	{
		/*Accept the ManufacturersModelName in String format of type LO.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0008,0x1090, strManufacturersModelName,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008,0x1090,DicomConstants.DCM_DT_LO, strManufacturersModelName);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Manufacturer's model name of the equipment used for beam delivery.
	 * @return String - value of Manufacturers Model Name.
	 */
	public String getManufacturersModelName()
	{
		Object objValue = getValue(0x0008,0x1090);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets Manufacturer's serial number of the equipment used for beam delivery.
	 * @param strDeviceSerialNumber  String value of Device Serial Number.
	 */
	public void setDeviceSerialNumber(String strDeviceSerialNumber)
	{
		/*Accept the DeviceSerialNumber in String format of type LO.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0018,0x1000, strDeviceSerialNumber,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0018,0x1000,DicomConstants.DCM_DT_LO, strDeviceSerialNumber);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Manufacturer's serial number of the equipment used for beam delivery.
	 * @return String - value of Device Serial Number.
	 */
	public String getDeviceSerialNumber()
	{
		Object objValue = getValue(0x0018,0x1000);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Manufacturer�s designation of the software version of the equipment that contributed to the composite instance.
	 * @param strSoftwareVersions String Array  of Software Versions.
	 */
	public void setSoftwareVersions(String[] strSoftwareVersions)
	{
		/*Accept the Software Versions in String format of type LO.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018, 0x1000, strSoftwareVersions,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0018, 0x1000,DicomConstants.DCM_DT_LO, strSoftwareVersions);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Manufacturer�s designation of the software version of the equipment that contributed to the composite instance.
	 * @return String[] - String Array  of Software Versions.
	 */
	public String[] getSoftwareVersions()
	{
		Object objValue = getValue(0x0018,0x1000);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}
	/**
	 * Sets the date and time the acquisition of data that resulted in this image started.
	 * @param strAcquisitionDatetime String value of Acquisition Date and Time.
	 */
	public void setAcquisitionDatetime(String strAcquisitionDatetime)
	{
		/*Accept The Date and Time the acquisition of data that resulted in this image started in String format of type TM.
		 * 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(0x0008, 0x002A,strAcquisitionDatetime,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008, 0x002A, DicomConstants.DCM_DT_DT,strAcquisitionDatetime);

		objIDataSet.addDataElement(objIDataElement);
	}

	/**
	 * Retrieves the Date and Time of Acquisition
	 * @return String - returns the Date and Time of Acquisition
	 */
	public String getAcquisitionDatetime()
	{
		Object objValue = getValue(0x0008, 0x002A);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets User defined name identifying the machine that contributed to the composite instance.
	 * @param strStationName String value of Station Name. 
	 */
	public void setStationName(String strStationName)
	{
		/*Accept the Station Name in String format of type SH.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0008, 0x1010, strStationName,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008, 0x1010,DicomConstants.DCM_DT_SH, strStationName);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves User defined name identifying the machine that contributed to the composite instance.
	 * @return String - value of Station Name. 
	 */
	public String getStationName()
	{
		Object objValue = getValue(0x0008,0x1010);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets the Name of operator.
	 * Name(s) of the operator(s) of the contributing equipment.
	 * @param arrStrOperatorsName String array  of Operators Name .
	 */
	public void setOperatorsName(String[] arrStrOperatorsName)
	{
		/*Accept the Value Type in String format of type PN.
		 * 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,0x1070, arrStrOperatorsName,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008,0x1070,DicomConstants.DCM_DT_PN, arrStrOperatorsName);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves  Name of operator.
	 * Name(s) of the operator(s) of the contributing equipment.
	 * @return String - array  of Operators Name.
	 */
	public String[]  getOperatorsName()
	{
		Object objValue = getValue(0x0008,0x1070);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}
	
	/**
	 * Retrieves pre-initialized object of Operator Identification 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 OperatorIdentificationSequence - instance of OperatorIdentificationSequence. 
	 */
	public OperatorIdentificationSequence getOperatorIdentificationSequence()
	{
		OperatorIdentificationSequence objOperatorIdentificationSequence = null;
		IDataElement objIDataElement =  getDataElement(0x0008, 0x1072);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objOperatorIdentificationSequence = (OperatorIdentificationSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objOperatorIdentificationSequence = (OperatorIdentificationSequence)objDicomV3Factory.createSequence(0x0008, 0x1072, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x0008, 0x1072, objOperatorIdentificationSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x0008, 0x1072, DicomConstants.DCM_DT_SQ, objOperatorIdentificationSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objOperatorIdentificationSequence;
	}
	/**
	 * Sets attribute identifies User-defined description of the conditions under which the Series was performed.
	 * @param StrProtocolName String User-defined description 
	 */	
	public void setProtocolName(String StrProtocolName)
	{
		/*Accept Procol Nmae in String format of type LO.
		 * Read the Transfer Syntax and check to create ImplicitDE or ExplicitDE .
		 * 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(0x0018,0x1030,StrProtocolName,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0018,0x1030, DicomConstants.DCM_DT_LO,StrProtocolName);
		addDataElement(objIDataElement);
	}

	/**
	 * Return User-defined description of the conditions under which the Series was performed.
	 * @return String - User-defined description.
	 */
	public String getProtocolName()
	{
		Object objValue = getValue(0x0018,0x1030);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Retrieves pre-initialized object of Performed Protocol Code 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 PerformedProtocolCodeSequence - instance of PerformedProtocolCodeSequence. 
	 */
	public PerformedProtocolCodeSequence getPerformedProtocolCodeSequence()
	{
		PerformedProtocolCodeSequence objPerformedProtocolCodeSequence = null;
		IDataElement objIDataElement =  getDataElement(0x0040, 0x0260); 
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objPerformedProtocolCodeSequence = (PerformedProtocolCodeSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objPerformedProtocolCodeSequence = (PerformedProtocolCodeSequence)objDicomV3Factory.createSequence(0x0040, 0x0260, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x0040, 0x0260, objPerformedProtocolCodeSequence.getValue(), objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x0040, 0x0260, DicomConstants.DCM_DT_SQ, objPerformedProtocolCodeSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objPerformedProtocolCodeSequence;
	}
	/**
	 * Sets Acquisition  Protocol Name.
	 * @param strAcquisitionProtocolName String value of AcquisitionProtocolName.
	 */
	public void setAcquisitionProtocolName(String strAcquisitionProtocolName)
	{
		/* Accept the AcquisitionProtocolName in String format of type LO.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x9423, strAcquisitionProtocolName,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0018,0x9423,DicomConstants.DCM_DT_LO, strAcquisitionProtocolName);

		addDataElement(objIDataElement);
	}

	/**
	 * Return user-defined label identifier for AcquisitionProtocolName.
	 * @return String - value of AcquisitionProtocolName.
	 */
	public String getAcquisitionProtocolName()
	{
		Object objValue = getValue(0x0018,0x9423);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
}
