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



import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataElement;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDictionaryReader;
import cdac.medinfo.sdk.dcm30_04.commoninterface.ITransferSyntax;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPatientsSex;
import cdac.medinfo.sdk.dcm30_04.exceptions.ValidationException;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConstants;




/**
 * This item class provides methods to validate, set and get the attributes in {@link ProposedStudySequence}.
 */
public class ProposedStudySequenceItem extends Item  
{
	


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

	/**
	 * This constructor creates the item and with default TransferSyntax 
	 */
	ProposedStudySequenceItem()
	{
		super();
	}

	/**
	 * This constructor creates the item with default TransferSyntax.
	 * @param objTransferSyntax specifies the DICOM Standard defined TransfeSyntax   
	 */
	ProposedStudySequenceItem(ITransferSyntax objITransferSyntax)
	{
		super(objITransferSyntax);
	}

	/**
	 * This constructor creates the item and internal code sequence macro with default TransferSyntax 
	 * and default DictionaryReader
	 * @param objTransferSyntax specifies the DICOM Standard defined TransfeSyntax
	 * @param objDictionaryReader specifies the DICOM Dictionary reader to be used 
	 */
	ProposedStudySequenceItem(ITransferSyntax objTransferSyntax, IDictionaryReader objDictionaryReader)
	{
		super(objTransferSyntax,objDictionaryReader);
	}

	/**
	 * Validates all the attributes in Proposed Study Sequence that are present in the DataSet
	 * @return boolean - Success -true, Failure - false
	 * @throws ValidationException throws ValidationException If Mandatory or Conditional element fails.
	 */
	public boolean validateForModule() throws ValidationException
	{
		return true;
	}

	/**
	 * Sets the Patient Name in Patient Module.
	 * @param strPatientName String value of Patient's full name.
	 */
	public void setPatientName(String strPatientName)
	{
		/*Accept the Patient Name 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(0x0010, 0x0010, strPatientName,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x0010,DicomConstants.DCM_DT_PN, strPatientName);
		addDataElement(objIDataElement);
	}

	/**
	 * Return the String value of the attribute Patient Name.
	 * @return String - value of Patient'n full name.
	 */
	public String getPatientName()
	{
		Object objValue = getValue(0x0010, 0x0010);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Primary hospital identification number or code for the patient in Patient Module.
	 * @param strPatientID String value of Patient ID.
	 */	
	public void setPatientID(String strPatientID)
	{
		/*Accept the Patient ID 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0010, 0x0020, strPatientID,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x0020, DicomConstants.DCM_DT_LO, strPatientID);
		addDataElement(objIDataElement);
	}

	/**
	 * Return Primary hospital identification number or code for the patient.
	 * @return String - value of Patient ID.
	 */
	public String getPatientID()
	{
		Object objValue = getValue(0x0010, 0x0020);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Patient Birth Date in Patient Module.
	 * @param strPatientBirthDate String value of Birth date of the patient.
	 */	
	public void setPatientBirthDate(String strPatientBirthDate)
	{
		/*Accept the Patient BirthDate value in String format of type DA.
		 * 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(0x0010, 0x0030, strPatientBirthDate,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x0030, DicomConstants.DCM_DT_DA, strPatientBirthDate);		
		if(objIDataElement != null)
			addDataElement(objIDataElement);
	}

	/**
	 * Return the Patient's Birth Date.
	 * @return String - value of the birth date of the patient.
	 */
	public String getPatientBirthDate()
	{
		Object objValue = getValue(0x0010, 0x0030);
		if(objValue != null)
			return objValue.toString();
		return null;
	}


	/**
	 * Sets the Patient Sex in Patient Module.
	 * @param enumPatientSex Enum value of sex of the patient.
	 */	
	public void setPatientSex(EnumPatientsSex enumPatientSex)
	{
		/*Accept the Patient Sex value in String format of type CS.
		 * 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(0x0010, 0x0040, enumPatientSex.getValue(),objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x0040, DicomConstants.DCM_DT_CS, enumPatientSex.getValue());
		if(objIDataElement != null)
			addDataElement(objIDataElement);
	}	

	/**
	 * Return the Patient Sex in Patient Module.
	 * @return String value of sex of the patient.
	 */
	public String getPatientSex()
	{
		Object objValue = getValue(0x0010, 0x0040);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Patient Birth Time in Patient Module.
	 * @param strPatientBirthTime String value of Birth time of the Patient.
	 */	
	public void setPatientBirthTime(String strPatientBirthTime)
	{
		/*Accept the Patient Birth Time value in String format of type CS.
		 * 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(0x0010, 0x0032, strPatientBirthTime,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x0032, DicomConstants.DCM_DT_TM, strPatientBirthTime);	

		addDataElement(objIDataElement);
	}

	/**
	 * Return Patient's Birth Time.
	 * @return String - value of Birth time of the patient.
	 */
	public String getPatientBirthTime()
	{
		Object objValue = getValue(0x0010, 0x0032);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Other Patient IDs in Patient Module.
	 * @param arrStrOtherPatientIDs Other identification numbers or codes used to identify the patient.
	 */	
	public void setOtherPatientIDs(String[] arrStrOtherPatientIDs)
	{
		/*Accept the Other Patient IDs value in String Array format of type CS.
		 * 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(0x0010, 0x1000, arrStrOtherPatientIDs,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x1000, DicomConstants.DCM_DT_LO, arrStrOtherPatientIDs);

		addDataElement(objIDataElement);
	}

	/**
	 * Return the Array of String values of the attribute Other Patient IDs.
	 * @return String[] - returns the collection of other patient IDs.
	 */
	public String[] getOtherPatientIDs()
	{
		Object objValue = getValue(0x0010, 0x1000);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}

	/**
	 * Sets the Other Patient Names in Patient Module.
	 * @param arrStrOtherPatientNames String array of Other names used to identify the patient.
	 */	
	public void setOtherPatientNames(String[] arrStrOtherPatientNames)
	{
		/*Accept the Other Patient Names value in String Array format of type CS.
		 * 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(0x0010, 0x1001, arrStrOtherPatientNames,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x1001, DicomConstants.DCM_DT_PN, arrStrOtherPatientNames);

		addDataElement(objIDataElement);
	}

	/**
	 * Return the Array of String values of the attribute Other Patient Names.
	 * @return String[] - returns the collection of other patient names.
	 */
	public String[] getOtherPatientNames()
	{
		Object objValue = getValue(0x0010, 0x1001);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}

	/**
	 * This method is used to set the Ethnic Group in Patient Module.
	 * The function accepts a String Value as the  Ethnic Group and creates the 
	 * DE based on the transfer syntax and populates the DE with right values.
	 * This De is then added to the Module HashMap
	 * @param strEthnicGroup Ethnic group or race of the patient.
	 */	
	public void setEthnicGroup(String strEthnicGroup)
	{
		/*Accept the Other Patient Names value in String format of type CS.
		 * 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(0x0010, 0x2160, strEthnicGroup,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x2160, DicomConstants.DCM_DT_SH, strEthnicGroup);

		addDataElement(objIDataElement);
	}	

	/**
	 * Return the String value of the attribute Ethnic Group
	 * @return String - returns the ethnic group of the patient
	 */
	public String getEthnicGroup()
	{
		Object objValue = getValue(0x0010, 0x2160);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Patient Comments in Patient Module.
	 * @param strPatientComments User-defined additional information about the patient.
	 */	
	public void setPatientComments(String strPatientComments)
	{
		/*Accept the Other Patient Names value in String format of type CS.
		 * 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(0x0010, 0x4000, strPatientComments,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x4000, DicomConstants.DCM_DT_LT, strPatientComments);	

		addDataElement(objIDataElement);
	}	

	/**
	 * Return the String value of the attribute Patient Comments
	 * @return String - returns the patient comments
	 */
	public String getPatientComments()
	{
		Object objValue = getValue(0x0010, 0x4000);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Unique identifier for the Study.
	 * @param strStudyInstanceUID String value of Unique identifier for the Study.
	 */
	public void setStudyInstanceUID(String strStudyInstanceUID)
	{
		/*Accept Unique identifier for the Study 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0020, 0x000D,strStudyInstanceUID,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0020, 0x000D, DicomConstants.DCM_DT_UI,strStudyInstanceUID);

		addDataElement(objIDataElement);
	}

	/**
	 * Returns Unique identifier for the Study.
	 * @return strStudyInstanceUID - String value of Unique identifier for the Study.
	 */
	public String getStudyInstanceUID()
	{
		Object objValue = getValue(0x0020, 0x000D);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets date on which the Study started.
	 * @param strStudyDate String value of the Date on which the Study started.
	 */
	public void setStudyDate(String strStudyDate)
	{
		/*Accept Date on which the Study started in String format of type DA.
		 * 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, 0x0020,strStudyDate,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008, 0x0020, DicomConstants.DCM_DT_DA,strStudyDate);

		addDataElement(objIDataElement);
	}
	/**
	 * Returns date on which the Study started.
	 * @return strStudyDate - String value of the Date on which the Study started.
	 */
	public String getStudyDate()
	{
		Object objValue = getValue(0x0008, 0x0020);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets time on which the Study started.
	 * @param strStudyTime String value of time on which the Study started.
	 */
	public void setStudyTime(String strStudyTime)
	{
		/*Accept Time on which the Study 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, 0x0030,strStudyTime,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008, 0x0030, DicomConstants.DCM_DT_TM,strStudyTime);

		addDataElement(objIDataElement);
	}
	/**
	 * Returns time on which the Study started.
	 * @return strStudyTime - String value of time on which the Study started.
	 */
	public String getStudyTime()
	{
		Object objValue = getValue(0x0008, 0x0030);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Name of the patient's referring physician.
	 * @param strReferringPhysicianName String value of the patient's referring physician.
	 */
	public void setReferringPhysicianName(String strReferringPhysicianName)
	{
		/*Accept Name of the patient's referring physician 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0008, 0x0090,strReferringPhysicianName,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008, 0x0090, DicomConstants.DCM_DT_PN,strReferringPhysicianName);

		addDataElement(objIDataElement);
	}

	/**
	 * Returns name of the patient's referring physician.
	 * @return String - value of the patient's referring physician.
	 */
	public String getReferringPhysicianName()
	{
		Object objValue = getValue(0x0008, 0x0090);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets User or equipment generated Study identifier.
	 * @param strStudyID String value of the Study ID.
	 */
	public void setStudyID(String strStudyID)
	{
		/*Accept User or equipment generated Study identifier 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0020, 0x0010,strStudyID,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0020, 0x0010, DicomConstants.DCM_DT_SH,strStudyID);

		addDataElement(objIDataElement);
	}

	/**
	 * Returns User or equipment generated Study identifier.
	 * @return String - value of the Study ID.
	 */
	public String getStudyID()
	{
		Object objValue = getValue(0x0020, 0x0010);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets a RIS generated number that identifies the order for the Study
	 * @param strAccessionNumber String valueof Accession Number.
	 */
	public void setAccessionNumber(String strAccessionNumber)
	{
		/*Accept A RIS generated number that identifies the order for the Study 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0008, 0x0050,strAccessionNumber,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008, 0x0050, DicomConstants.DCM_DT_SH,strAccessionNumber);

		addDataElement(objIDataElement);
	}

	/**
	 * Returns a RIS generated number that identifies the order for the Study.
	 * @return strAccessionNumber String valueof Accession Number.
	 */
	public String getAccessionNumber()
	{
		Object objValue = getValue(0x0008, 0x0050);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Institution-generated description or classification of the Study performed.
	 * @param strStudyDescription String value of Institution-generated description.
	 */
	public void setStudyDescription(String strStudyDescription)
	{
		/*Accept Institution-generated description or classification of the Study (component) performed 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 Hash Map
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0008, 0x1030,strStudyDescription,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008, 0x1030, DicomConstants.DCM_DT_LO,strStudyDescription);

		addDataElement(objIDataElement);
	}
	/**
	 * Returns Institution-generated description or classification of the Study performed.
	 * @return String - value of Institution-generated description.
	 */
	public String getStudyDescription()
	{
		Object objValue = getValue(0x0008, 0x1030);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Names of the physician(s) who are reading the Study. 
	 * @param arrStrNameOfPhysicianReadingStudy Names of the physician(s)
	 */	
	public void setNameOfPhysicianReadingStudy(String[] arrStrNameOfPhysicianReadingStudy)
	{
		/*Accept  Names of the physician(s) who are reading the Study. 
		 * in String Array format of type PN.
		 * 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(0x0008, 0x1060,arrStrNameOfPhysicianReadingStudy,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008, 0x1060, DicomConstants.DCM_DT_PN,arrStrNameOfPhysicianReadingStudy);

		addDataElement(objIDataElement);
	}

	/**
	 * Returns  Names of the physician(s) who are reading the Study.
	 * @return String[] - String array of Name Of Physician Reading Study.
	 */
	public String[] getNameOfPhysicianReadingStudy()
	{
		Object objValue = getValue(0x0008, 0x1060);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}

	/**
	 * Sets the Description of the admitting diagnosis (diagnoses).
	 * @param arrStrAdmittingDiagnosesDescription Description of the admitting diagnosis (diagnoses)
	 */	
	public void setAdmittingDiagnosesDescription(String[] arrStrAdmittingDiagnosesDescription)
	{
		/*Accept Admitting Diagnoses Description in String Array format of type CS.
		 * 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 Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0008, 0x1080,arrStrAdmittingDiagnosesDescription,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0008, 0x1080,DicomConstants.DCM_DT_LO,arrStrAdmittingDiagnosesDescription);

		addDataElement(objIDataElement);
	}

	/**
	 * Return Description of the admitting diagnosis(diagnoses).
	 * @return String[] - String values of Description of the admitting diagnosis(diagnoses).
	 */
	public String[] getAdmittingDiagnosesDescription()
	{
		Object objValue = getValue(0x0008, 0x1080);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}

	/**
	 * Sets the Age of the Patient.
	 * @param strPatientAge String value of age of the Patient.
	 */
	public void setPatientAge(String strPatientAge)
	{
		/*Accept the Patient Age in String format of type AS.
		 * 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(0x0010, 0x1010,strPatientAge,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x1010,DicomConstants.DCM_DT_AS,strPatientAge);
		addDataElement(objIDataElement);	
	}

	/**
	 * Returns the String value of the attribute Patient Age.
	 * @return String - value of Patient Age.
	 */
	public String getPatientAge()
	{
		Object objValue = getValue(0x0010, 0x1010);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Patient Size.
	 * @param strPatientSize String value of Length or size of the Patient, in meters.
	 */
	public void setPatientSize(String strPatientSize)
	{
		/*Accept the Patient Size in String format of type DS.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0010, 0x1020,strPatientSize,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x1020,DicomConstants.DCM_DT_DS,strPatientSize);

		addDataElement(objIDataElement);		
	}

	/**
	 * Return the String value of the attribute Patient Size.
	 * @return String - value of Patient Size.
	 */
	public String getPatientSize()
	{
		Object objValue = getValue(0x0010, 0x1020);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Patient Weight.
	 * @param strPatientWeight String value of Weight of the Patient, in kilograms.
	 */
	public void setPatientWeight(String strPatientWeight)
	{
		/*Accept the Patient Weight in String format of type DS.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0010, 0x1030,strPatientWeight,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x1030,DicomConstants.DCM_DT_DS,strPatientWeight);

		addDataElement(objIDataElement);	
	}

	/**
	 * Return the String value of the attribute Patient Weight.
	 * @return String - value of Patient Weight.
	 */
	public String getPatientWeight()
	{
		Object objValue = getValue(0x0010, 0x1030);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Patient's Occupation.
	 * @param strOccupation String value of Occupation of the Patient's Occupation.
	 */
	public void setOccupation(String strOccupation)
	{
		/*Accept the Patient Occupation in String format of type DS.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0010, 0x2180,strOccupation,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x2180,DicomConstants.DCM_DT_SH,strOccupation);

		addDataElement(objIDataElement);
	}

	/**
	 * Return Patient's Occupation.
	 * @return String - value Patient Occupation.
	 */
	public String getOccupation()
	{
		Object objValue = getValue(0x0010, 0x2180);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Additional Patient History in Patient Study Module.
	 * @param strAdditionalPatientHistory Additional information about the Patient's medical history.
	 */
	public void setAdditionalPatientHistory(String strAdditionalPatientHistory)
	{
		/*Accept the Additional Patient History in String format of type DS.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0010, 0x21B0,strAdditionalPatientHistory,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0010, 0x21B0,DicomConstants.DCM_DT_LT,strAdditionalPatientHistory);

		addDataElement(objIDataElement);	
	}

	/**
	 * Return Patient's additional history.
	 * @return String - value of Patient's additional history.
	 */
	public String getAdditionalPatientHistory()
	{
		Object objValue = getValue(0x0010, 0x21B0);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets the Series Number in General Series Module.
	 * @param strSeriesNumber String value of Series Number.
	 */	
	public void setSeriesNumber(String strSeriesNumber)
	{
		/*Accept the Series Number value 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
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0020, 0x0011,strSeriesNumber,objIDictionaryReader);
		else
			objIDataElement = new ExplicitDE(0x0020, 0x0011, DicomConstants.DCM_DT_IS,strSeriesNumber);

		addDataElement(objIDataElement);
	}

	/**
	 * Retruns the Series Number in General Series Module.
	 * @return String - value of Series Number.
	 */
	public String getSeriesNumber()
	{
		Object objValue = getValue(0x0020, 0x0011);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
}
