/*******************************************************************************
 *  Copyright 2017 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.hl7282.baselibs.segments;

import cdac.medinfo.sdk.hl7282.baselibs.CWE;
import cdac.medinfo.sdk.hl7282.baselibs.DTM;
import cdac.medinfo.sdk.hl7282.baselibs.EI;
import cdac.medinfo.sdk.hl7282.baselibs.FN;
import cdac.medinfo.sdk.hl7282.baselibs.HD;
import cdac.medinfo.sdk.hl7282.baselibs.PL;
import cdac.medinfo.sdk.hl7282.baselibs.PLN;
import cdac.medinfo.sdk.hl7282.baselibs.SAD;
import cdac.medinfo.sdk.hl7282.baselibs.XAD;
import cdac.medinfo.sdk.hl7282.baselibs.XON;
import cdac.medinfo.sdk.hl7282.baselibs.XPN;
import cdac.medinfo.sdk.hl7282.baselibs.XTN;
import cdac.medinfo.sdk.hl7282.commoninterface.IDataType;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.exceptions.FieldMissingException;
import cdac.medinfo.sdk.hl7282.exceptions.InvalidSegmentException;
import cdac.medinfo.sdk.hl7282.utils.EnumSegments;
import cdac.medinfo.sdk.hl7282.utils.SingleCollection;

/**
 * PRD - provider data segment<p>
 * This segment will be employed as part of a patient referral message and its related transactions. 
 * The PRD segment contains data specifically focused on a referral, and it is inter-enterprise in nature
 * <p>Represents an HL7 PRD message segment. 
 * This segment has the following fields:</p><p>
 * PRD-1: Provider Role (CWE)<b>Required</b><br> 
 * PRD-2: Provider Name (XPN)<b>Optional</b><br> 
 * PRD-3: Provider Address (XAD)<b>Optional</b><br> 
 * PRD-4: Provider Location (PL)<b>Optional</b><br> 
 * PRD-5: Provider Communication Information (XTN)<b>Optional</b><br> 
 * PRD-6: Preferred Method of Contact (CWE)<b>Optional</b><br> 
 * PRD-7: Provider Identifiers (PLN)<b>Optional</b><br> 
 * PRD-8: Effective Start Date of Provider Role (DTM)<b>Optional</b><br> 
 * PRD-9: Effective End Date of Provider Role (DTM)<b>Optional</b><br>
 * PRD-10: Provider Organization Name and Identifier (XON)<b>Optional</b><br> 
 * PRD-11: Provider Organization Address (XAD)<b>Optional</b><br> 
 * PRD-12: Provider Organization Location Information (PL)<b>Optional</b><br> 
 * PRD-13: Provider Organization Communication Information (XTN)<b>Optional</b><br> 
 * PRD-14: Provider Organization Method of Contact (CWE)<b>Optional</b><br><p>
 * This class provides mechanism to validate message against HL7 v 2.8.2 standard.
 * The class provides accessors & mutators for the elements mentioned above.
 * The class has validate method which validates Message against HL7 v 2.8.2 standard.
 *
 * <p>User can also create Segment through {@link SegmentFactory}
 */
 public class PRD extends Segment    
{
	





	/**
	 * Constucts the PRD segment.
	 */
	public PRD()
	{super(EnumSegments.HL7_SEG_PRD);
	}

	/**
	 * Retrieves the Effective End Date of Provider Role.
	 * @return DTM - effectiveEndDateofProviderRole
	 */
	public DTM getEffectiveEndDateofProviderRole() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1164);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Effective Start Date of Provider Role.
	 * @return DTM - effectiveStartDateofProviderRole
	 */
	public DTM getEffectiveStartDateofProviderRole() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1163);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Preferred Method of Contact.
	 * This field contains the preferred method to use when communicating with the provider.  
	 * @return CWE - preferredMethodofContact
	 */
	public CWE getPreferredMethodofContact() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(684);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Provider Address.
	 * This field contains the mailing address of the provider identify in this segment.  
	 * @return ISingleCollection<XAD> - providerAddress
	 */
	public ISingleCollection<XAD> getProviderAddress() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1157);
		ISingleCollection<XAD> objDataList = new SingleCollection<XAD>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XAD objXAD = (XAD)objDataType;
				objDataList.add(objXAD);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Provider Communication Information.
	 * This field contains information, such as the phone number or electronic mail address, 
	 * used to communicate with the provider or organization.
	 * @return ISingleCollection<XTN> - providerCommunicationInformation
	 */
	public ISingleCollection<XTN> getProviderCommunicationInformation() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1159);
		ISingleCollection<XTN> objDataList = new SingleCollection<XTN>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XTN objXTN = (XTN)objDataType;
				objDataList.add(objXTN);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Provider Identifiers.
	 * This field contains the provider's unique identifiers such as UPIN, Medicare and Medicaid numbers.
	 * @return ISingleCollection<PLN> - providerIdentifiers
	 */
	public ISingleCollection<PLN> getProviderIdentifiers() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1162);
		ISingleCollection<PLN> objDataList = new SingleCollection<PLN>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				PLN objPLN = (PLN)objDataType;
				objDataList.add(objPLN);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Provider Location.
	 * This field contains the location of the provider. 
	 * @return PL - providerLocation
	 */
	public PL getProviderLocation() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1158);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (PL)objDataCollection.elementAt(0);
		else
			return null;
	}

	/**
	 * Retrieves the Provider Name.
	 * This field contains the name of the provider identified in this segment. 
	 * @return ISingleCollection<XPN> - providerName
	 */
	public ISingleCollection<XPN> getProviderName() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1156);
		ISingleCollection<XPN> objDataList = new SingleCollection<XPN>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XPN objXPN = (XPN)objDataType;
				objDataList.add(objXPN);
			}
		}
		return objDataList;
	}

	/**
	 * Retrieves the Provider Role.
	 * This field contains the contact role that defines the relationship of the person describ
	 * in this segment to the patient being referred.
	 * @return ISingleCollection<CWE> - providerRole
	 */
	public ISingleCollection<CWE> getProviderRole() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(1155);
		ISingleCollection<CWE> objDataList = new SingleCollection<CWE>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				CWE objCWE = (CWE)objDataType;
				objDataList.add(objCWE);
			}
		}
		return objDataList;
	}

	/**
	 * Set the Effective End Date of Provider Role.
	 * @param strTime Specifies a point in time using a 24-hour clock notation. 
	 */ 
	public void setEffectiveEndDateofProviderRole (String strTime) 
	{
		DTM effectiveEndDateofProviderRole  = (DTM)getDataElement(1164);
		effectiveEndDateofProviderRole.setValue(strTime);
		setEffectiveEndDateofProviderRole(effectiveEndDateofProviderRole);

	} 

	/** Set the Effective End Date of Provider Role.
	 * @param objeffectiveEndDateofProviderRole object of Effective End Date of Provider Role.
	 */ 
	public void setEffectiveEndDateofProviderRole(DTM objeffectiveEndDateofProviderRole)
	{
		setDataType(1164,objeffectiveEndDateofProviderRole);
	}
	/**
	 * Set the Effective Start Date of Provider Role.
	 * @param strTime Specifies a point in time using a 24-hour clock notation. 
	 */ 
	public void setEffectiveStartDateofProviderRole (String strTime) 
	{
		DTM effectiveStartDateofProviderRole  = (DTM)getDataElement(1163);
		effectiveStartDateofProviderRole.setValue(strTime);
		setEffectiveStartDateofProviderRole(effectiveStartDateofProviderRole);

	} 

	/** Set the Effective Start Date of Provider Role.
	 * @param objeffectiveStartDateofProviderRole object of Effective Start Date of Provider Role.
	 */ 
	public void setEffectiveStartDateofProviderRole(DTM objeffectiveStartDateofProviderRole)
	{
		setDataType(1163,objeffectiveStartDateofProviderRole);
	}
	/**
	 * Set the Preferred Method of Contact.
	 * This field contains the preferred method to use when communicating with the provider.  
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */
	public void setPreferredMethodofContact (String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(684);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setPreferredMethodofContact (cwe);

	} 

	/** Set the Preferred Method of Contact.
	 * This field contains the preferred method to use when communicating with the provider.  
	 * @param objpreferredMethodofContact object of Preferred Method of Contact.
	 */ 
	public void setPreferredMethodofContact(CWE objpreferredMethodofContact)
	{
		setDataType(684,objpreferredMethodofContact);
	}
	/**
	 * Set the Provider Address.
	 * This field contains the mailing address of the provider identify in this segment.  
	 * @param objStreetAddress Specifies the street address.
	 * @param strOtherDesignation Specifies the Second line of address. 
	 * @param strCity The city, or district or place where the addressee is located. 
	 * @param strStateOrProvince Specifies the state or province where the addressee is located.
	 * @param strZipOrPostalCode Specifies the zip or postal code where the addressee is located. 
	 * @param strCountry Specifies the country where the addressee is located.
	 * @param strAddressType Specifies the kind or type of address.
	 * @param strOtherGeographicDesignation Specifies any other geographic designation. 
	 * @param objCountyParishCode Specifies a code that represents the county in which the specified address resides. 
	 * @param objCensusTract Specifies a code that represents the census tract in which the specified address resides. 
	 * @param strAddressRepresentationCode Specifies representations of the same name/address Suggested values are I,A,P [Refer table 0465]
	 * @param objEffectiveDate It is The first date, if known, on which the address is valid and active.
	 * @param objExpirationDate It is The last date, if known, on which the address is valid and active.
	 * @param objExpirationReason indicates why this address was marked as ended.
	 * @param strTemporaryIndicator indicates whether address is considered temporary .
	 * @param strBadAddressIndicator indicates whether it is possible to contact the owning entity.
	 * @param strAddressUsage indicates how the address is intended to be used.
	 * @param strAddressee indicates the name of the person whose address is intended to be used.
	 * @param strComment indicated descriptive information
	 * @param strPreferenceOrder preference order
	 * @param objProtectionCode indicates that an address need to be protected
	 * @param objAddressIdentifier indicates a unique identifier for address
	 */ 
	public void addProviderAddress (SAD objStreetAddress,String strOtherDesignation,String strCity,
			String strStateOrProvince,String strZipOrPostalCode,String strCountry,String strAddressType,
			String strOtherGeographicDesignation,CWE objCountyParishCode,CWE objCensusTract,
			String strAddressRepresentationCode,DTM objEffectiveDate,
			DTM objExpirationDate, CWE objEXpirationReason, String strTemporaryIndicator,
			String strBadAddressIndicator, String strAddressUsage, String strAddressee, String strComment,
			String strPreferenceOrder, CWE objProtectionCode, EI objAddressIdentifier)
	{
		XAD xad = (XAD)getDataElement(1157);
		xad.setStreetAddress(objStreetAddress);
		xad.setOtherDesignation(strOtherDesignation);
		xad.setCity(strCity);
		xad.setStateOrProvince(strStateOrProvince);
		xad.setZipOrPostalCode(strZipOrPostalCode);
		xad.setCountry(strCountry);
		xad.setAddressType(strAddressType);
		xad.setOtherGeographicDesignation(strOtherGeographicDesignation);
		xad.setCountyParishCode(objCountyParishCode);
		xad.setCensusTract(objCensusTract);
		xad.setAddressRepresentationCode(strAddressRepresentationCode);
 
		xad.setEffectiveDate(objEffectiveDate);
		xad.setExpirationDate(objExpirationDate); 
		xad.setExpirationReason(objEXpirationReason);
		xad.setTemporaryIndicator(strTemporaryIndicator);
		xad.setBadAddressIndicator(strBadAddressIndicator);
		xad.setAddressUsage(strAddressUsage);
		xad.setAddressee(strAddressee);
		xad.setComment(strComment);
		xad.setPreferenceOrder(strPreferenceOrder);
		xad.setProtectionCode(objProtectionCode);
		xad.setAddressIdentifier(objAddressIdentifier);
		addProviderAddress(xad);

	} 

	/**Sets the Provider Address. 
	 * @param objtempProviderAddress object of ProviderAddress.
	 */ 
	public void addProviderAddress(XAD objtempProviderAddress)
	{
		addDataType(1157,objtempProviderAddress);
	}	
	/**
	 * Set the Provider Address.
	 * @param objProviderAddressList List of Provider Address
	 */	
	@SuppressWarnings("unchecked")
	public void setProviderAddress(ISingleCollection<XAD> objProviderAddressList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objProviderAddressList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1157,objCollection);
	}

	/**
	 * Set the Provider Communication Information.
	 * This field contains information, such as the phone number or electronic mail address, 
	 * used to communicate with the provider or organization.
	 * address, used to communicate with the provider or organization.
	 * @param strTeleCommunicationUseCode Specifies a code that represents a specific use of a telecommunication number.
	 										Suggested values are PRN,ORN,WPN,VHN,ASN,EMR,NET,BPN  [Refer table 0201.]
	 * @param strTeleCommunicationEquipmentType Specifies a code that represents the type of telecommunication equipment.
	 * 											  Suggested values are PH,FX,MD,CP,BP,Internet,X.400,TDD,TTY  [Refer table 0202.]
	 * @param strCommuinicationAddress Specifies Email address.
	 * @param strCountryCode Specifies the Country code.
	 * @param strAreaCityCode Specifies the area /City Code.
	 * @param strLocalNumber Specifies an Local Number.
	 * @param strExtension Specifies an Extension.
	 * @param strAnyText Contains comments with respect to the telephone number.
	 * @param strExtensionPrefix Specifies the characters established within a company's 
	 * 							   internal telephone system network used as a prefix to the Extension component for internal dialing. 
	 * @param strSpeedDialCode Specifies The characters established within a 
	 * 							 company's internal telephone system used in place of the (external) telephone number.
	 * @param strUnformattedTelephoneNumber Specifies an expression of the telephone number as an unparsible string.
	 * @param strEffectiveStartDate Specifies start date.
	 * @param strExpirationDate Specifies expiration date.
	 * @param objExpirationReason Specifies reason why this contact is marked as ended.
	 * @param objProtectionCode Specifies reason why this information is sensitive or protected.
	 * @param objSharedTelecommunicationIdentifier Specifies a unique phone number phone telephone number or email-id.
	 * @param strPreferenceOrder Specifies the preference order for an entity..
	 */ 
	public void addProviderCommunicationInformation (String strTeleCommunicationUseCode,String strTeleCommunicationEquipmentType
			,String strCommuinicationAddress,String strCountryCode,String strAreaCityCode,String strLocalNumber,String strExtension,String strAnyText,
			String strExtensionPrefix,String strSpeedDialCode,String strUnformattedTelephoneNumber, String strEffectiveStartDate, String strExpirationDate,
			CWE objExpirationReason, CWE objProtectionCode, EI objSharedTelecommunicationIdentifier, String strPreferenceOrder)
	{
		XTN xtn  = (XTN)getDataElement(1159);
//		xtn.setTelephoneNumber(strTelephoneNumber);
		xtn.setTelecommunicationUseCode(strTeleCommunicationUseCode);
		xtn.setTelecommunicationEquipmentType(strTeleCommunicationEquipmentType);
		xtn.setCommuinicationAddress(strCommuinicationAddress);
		xtn.setCountryCode(strCountryCode);
		xtn.setAreaCityCode(strAreaCityCode);
		xtn.setLocalNumber(strLocalNumber);
		xtn.setExtension(strExtension);
		xtn.setAnyText(strAnyText);
		xtn.setExtensionPrefix(strExtensionPrefix);
		xtn.setSpeedDialCode(strSpeedDialCode);
		xtn.setUnformattedTelephonenumber(strUnformattedTelephoneNumber); 
		xtn.setEffectiveStartDate(strEffectiveStartDate);
		xtn.setExpirationDate(strExpirationDate);
		xtn.setExpirationReason(objExpirationReason);
		xtn.setProtectionCode(objProtectionCode);
		xtn.setSharedTelecommunicationIdentifier(objSharedTelecommunicationIdentifier);
		xtn.setPreferenceOrder(strPreferenceOrder);
		addProviderCommunicationInformation(xtn);

	} 

	/**Sets the Provider Communication Information.
	 * @param objtempProviderCommunicationInformation object of Provider Communication Information.
	 */ 
	public void addProviderCommunicationInformation(XTN objtempProviderCommunicationInformation)
	{
		addDataType(1159,objtempProviderCommunicationInformation);
	}	
	/**
	 * Set the Provider Communication Information list.
	 * @param objProviderCommunicationInformationList List of Provider Communication Information.
	 */	
	@SuppressWarnings("unchecked")
	public void setProviderCommunicationInformation(ISingleCollection<XTN> objProviderCommunicationInformationList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objProviderCommunicationInformationList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1159,objCollection);
	}

	/**
	 * Set the Provider Identifiers.
	 * This field contains the provider's unique identifiers such as UPIN, Medicare and Medicaid numbers.
	 * @param strIdNumber Specifies the license number or other ID number such as UPIN, Medicare and Medicaid number.
	 * @param objTypeOfIdNumber Specifies the type of number.
	 * @param strStateOtherQualifyingInfo Specifies the state or province in which the license or ID is valid
	 * @param strExpirationDate Specifies the date when the license or ID is no longer valid.
	 */ 
	public void addProviderIdentifiers (String strIdNumber,CWE objTypeOfIdNumber,String strStateOtherQualifyingInfo,String strExpirationDate)
	{
		PLN tempProviderIdentifiers  = (PLN)getDataElement(1162);
		tempProviderIdentifiers.setIdNumber(strIdNumber);
		tempProviderIdentifiers.setTypeOfIdNumber(objTypeOfIdNumber);
		tempProviderIdentifiers.setStateOtherQualifyingInformation(strStateOtherQualifyingInfo);
		tempProviderIdentifiers.setExpirationDate(strExpirationDate); 
		addProviderIdentifiers(tempProviderIdentifiers);
	} 

	/** Set the Provider Identifiers.
	 * This field contains the provider's unique identifiers such as UPIN, Medicare and Medicaid numbers.
	 * @param objtempProviderIdentifiers object of Provider Identifiers.
	 */ 
	public void addProviderIdentifiers(PLN objtempProviderIdentifiers)
	{
		addDataType(1162,objtempProviderIdentifiers);
	}	/**
	 * Set the Provider Identifiers list.
	 * @param objProviderIdentifiersList List of Provider Identifiers.
	 */	
	@SuppressWarnings("unchecked")
	public void setProviderIdentifiers(ISingleCollection<PLN> objProviderIdentifiersList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objProviderIdentifiersList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1162,objCollection);
	}
	/**
	 * Set the Provider Location.
	 * This field contains the location of the provider.
	 * @param objPointOfCare Specifies the code for the point where patient care is administered.
	 * @param objRoom Specifies the code for the patient's room. 
	 * @param objBed Specifies the code for the patient's bed. 
	 * @param objFacility Specifies to site interpretation but generally describes 
	 * 							the highest level physical designation of an institution, 
	 * 							medical center or enterprise. 
	 * @param strLocationStatus Specifies the code for the status or availability of the location. 
	 * @param strPersonLocationType Specifies the categorization of the person's location defined by 
	 * 									facility, building, floor, point of care, room or bed. 
	 * @param objBuilding Specifies code for the building where the person is located. 
	 * @param objFloor Specifies the code for the floor where the person is located.
	 * @param strLocationDescription Specifies describes the location in free text.
	 * @param objComprehensiveLocationIdentifier Specifies represents the physical location as 
	 *													a whole without regard for the individual components. 
	 * @param objAssigningAuthorityForLocation Specifies the entity that creates the data for the individual physical location components. 
	 */  
	public void setProviderLocation (HD objPointOfCare, HD objRoom, HD objBed, HD objFacility,
			String strLocationStatus, String strPersonLocationType, HD objBuilding, HD objFloor, 
			String strLocationDescription, EI objComprehensiveLocationIdentifier, HD objAssigningAuthorityForLocation)
	{
		PL pl  = (PL)getDataElement(1158);
		pl.setPointOfCare(objPointOfCare);
		pl.setRoom(objRoom);
		pl.setBed(objBed);
		pl.setFacility(objFacility);
		pl.setLocationStatus(strLocationStatus);
		pl.setPersonLocationType(strPersonLocationType);
		pl.setBuilding(objBuilding);
		pl.setFloor(objFloor);
		pl.setLocationDescription(strLocationDescription);
		pl.setComprehensiveLocationIdentifier(objComprehensiveLocationIdentifier);
		pl.setAssigningAuthorityForLocation(objAssigningAuthorityForLocation); 
		setProviderLocation(pl);
	} 

	/**Sets the Provider Location.
	 * @param objproviderLocation object of Provider Location.
	 */ 
	public void setProviderLocation(PL objproviderLocation)
	{
		setDataType(1158,objproviderLocation);
	}
	/**
	 * Set the Provider Name.
	 * This field contains the name of the provider identified in this segment.
	 * @param objFamilyName Specifies the surname of a person. 
	 * @param strGivenName Specifies First name.
	 * @param strSecondAndFurtherGivenNamesOrInitialsThereof Specifies multiple middle names that may be included by separating them with spaces.
	 * @param strSuffix Used to specify a name suffix (e.g., Jr. or III).
	 * @param strPrefix Used to specify a name prefix (e.g., Dr.).
	 * @param strNameTypeCode Specifies a code that represents the type of name. Suggested values are A,B,C,D,I,L,M,N,P,R,S,T,U...[Refer table 0200.]
	 * @param strNameRepresentationCode Specifies representations of the same name/address Suggested values are I,A,P [Refer table 0465] 
	 * @param objNameContext Designates the context in which a name is used. [Refer User-defined Table 0448 ]
	 * @param strNameAssemblyOrder Specifies a code that represents the preferred display order of the components of this person name. Suggested values are G,F[Refer table 0444.]
	 * @param objEffectiveDate Specifies the first date, if known, on which the address is valid and active.
	 * @param objExpirationDate Specifies the last date, if known, on which the address is valid and active.
	 * @param strProfessionalSuffix Used to specify an abbreviation, or a string of abbreviations, denoting qualifications that support the person's profession, (e.g., licenses). 
	 * @param strCalledBy Used to specify the called name.
	 */  
	public void addProviderName (FN objFamilyName, String strGivenName, String strSecondAndFurtherGivenNamesOrInitialsThereof, 
			String strSuffix, String strPrefix, String strNameTypeCode, String strNameRepresentationCode, 
			CWE objNameContext, String strNameAssemblyOrder, DTM objEffectiveDate,
			DTM objExpirationDate, String strProfessionalSuffix, String strCalledBy)
	{
		XPN xpn = (XPN)getDataElement(1156);
		xpn.setFamilyName(objFamilyName);
		xpn.setGivenName(strGivenName);
		xpn.setSecondNameOrInitials(strSecondAndFurtherGivenNamesOrInitialsThereof);
		xpn.setSuffix(strSuffix);
		xpn.setPrefix(strPrefix);
//		xpn.setDegree(strDegree);
		xpn.setNameTypeCode(strNameTypeCode);
		xpn.setNameRepresentationCode(strNameRepresentationCode);
		xpn.setNameContext(objNameContext);
//		xpn.setNameValidityRange(objNameValidityRange);
		xpn.setNameAssemblyOrder(strNameAssemblyOrder);
		xpn.setEffectiveDate(objEffectiveDate);
		xpn.setExpirationDate(objExpirationDate);
		xpn.setProfessionalSuffix(strProfessionalSuffix); 
		xpn.setCalledBy(strCalledBy);
		addProviderName(xpn);
	} 

	/**Sets the Provider Name.
	 * @param objtempProviderName object of Provider Name.
	 */ 
	public void addProviderName(XPN objtempProviderName)
	{
		addDataType(1156,objtempProviderName);
	}	
	/**
	 * Set the Provider Name list.
	 * @param objProviderNameList List of Provider Name
	 */	
	@SuppressWarnings("unchecked")
	public void setProviderName(ISingleCollection<XPN> objProviderNameList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objProviderNameList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1156,objCollection);
	}

	/**
	 * Set the Provider Role.
	 * This field contains the contact role that defines the relationship of the person describ
	 * in this segment to the patient being referred.
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */ 
	public void addProviderRole (String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(1155);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		addProviderRole(cwe);
	} 

	/** Set the Provider Role.
	 * This field contains the contact role that defines the relationship of the person describ
	 * in this segment to the patient being referred.
	 * @param objtempProviderRole object of Provider Role.
	 */ 
	public void addProviderRole(CWE objtempProviderRole)
	{
		addDataType(1155,objtempProviderRole);
	}	
	/**
	 * Set the Provider Role list.
	 * @param objProviderRoleList List of Provider Role
	 */	
	@SuppressWarnings("unchecked")
	public void setProviderRole(ISingleCollection<CWE> objProviderRoleList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objProviderRoleList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(1155,objCollection);
	}
	
	/**
	 * Retrieves the Provider Organization Name and Identifier.
	 * This field contains the name of the provider where the provider is an organization.
	 * @return XON - ProviderOrganizationNameAndIdentifier
	 */
	public XON getProviderOrganizationNameAndIdentifier() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2256);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (XON)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set the Provider Organization Name and Identifier.
	 * This field contains the name of the provider where the provider is an organization.
	 * @param strOrganizationName Specifies name of the specified organization.
	 * @param strOrganizationNameTypeCode Specifies a code that represents the type of name i.e., legal name, display name.
	 * 										Suggested Values A,L,D,SL.[Refer to table No.0204]  
	 * @param objAssigningAuthority Specifies The assigning authority is a unique identifier of the system 
	 * 									(or organization or agency or department) that creates the data. 
	 * @param strIdentifierTypeCode Specifies a code corresponding to the type of identifier. 
	 * @param objAssigningFacility Specifies The place or location identifier where the identifier was first assigned to the person. 
	 * @param strNameRepresentationCode Specifies representations of the same name/address Suggested values are I,A,P [Refer table 0465] 
	 * @param strOrganizationIdentifier This component contains the sequence of characters (the code) that uniquely 
	 * 									  identifies the item being referenced by XON.1 Organization Name. 
	 * 									  This component replaces XON.3 ID Number as of v 2.8.2.
	 */ 
	public void setProviderOrganizationNameAndIdentifier (String strOrganizationName, CWE objOrganizationNameTypeCode,
			 HD objAssigningAuthority,
			String strIdentifierTypeCode, HD objAssigningFacility, String strNameRepresentationCode,
			String strOrganizationIdentifier)
	{
		XON ProviderOrganizationNameAndIdentifier  = (XON)getDataElement(2256);
		ProviderOrganizationNameAndIdentifier.setOrganizationName(strOrganizationName);
		ProviderOrganizationNameAndIdentifier.setOrganizationNameTypeCode(objOrganizationNameTypeCode);
		ProviderOrganizationNameAndIdentifier.setAssigningAuthority(objAssigningAuthority);
		ProviderOrganizationNameAndIdentifier.setIdentifierTypeCode(strIdentifierTypeCode);
		ProviderOrganizationNameAndIdentifier.setAssigningFacility(objAssigningFacility);
		ProviderOrganizationNameAndIdentifier.setNameRepresentationCode(strNameRepresentationCode);
		ProviderOrganizationNameAndIdentifier.setOrganizationIdentifier(strOrganizationIdentifier); 
		setProviderOrganizationNameAndIdentifier(ProviderOrganizationNameAndIdentifier);


	} 

	/**
	 * Ses the Provider Organization Name and Identifier.
	 * This field contains the name of the provider where the provider is an organization.
	 * @param objProviderOrganizationNameAndIdentifier object of Provider Organization Name and Identifier. 
	 */ 
	public void setProviderOrganizationNameAndIdentifier(XON objProviderOrganizationNameAndIdentifier)
	{
		setDataType(2256,objProviderOrganizationNameAndIdentifier);
	}
	
	/**
	 * Retrieves the Provider Organization Address.
	 * This field contains the address of the provider if it is an organization.  
	 * @return ISingleCollection<XAD> - ProviderOrganizationAddress
	 */
	public ISingleCollection<XAD> getProviderOrganizationAddress() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2257);
		ISingleCollection<XAD> objDataList = new SingleCollection<XAD>();
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XAD objXAD = (XAD)objDataType;
				objDataList.add(objXAD);
			}
		}

		return objDataList;
	}
	
	/**
	 * Set the Provider Organization Address.
	 * This field contains the address of the provider if it is an organization.
	 * @param objStreetAddress Specifies the street address.
	 * @param strOtherDesignation Specifies the Second line of address. 
	 * @param strCity The city, or district or place where the addressee is located. 
	 * @param strStateOrProvince Specifies the state or province where the addressee is located.
	 * @param strZipOrPostalCode Specifies the zip or postal code where the addressee is located. 
	 * @param strCountry Specifies the country where the addressee is located.
	 * @param strAddressType Specifies the kind or type of address.
	 * @param strOtherGeographicDesignation Specifies any other geographic designation. 
	 * @param objCountyParishCode Specifies a code that represents the county in which the specified address resides. 
	 * @param objCensusTract Specifies a code that represents the census tract in which the specified address resides. 
	 * @param strAddressRepresentationCode Specifies representations of the same name/address Suggested values are I,A,P [Refer table 0465]
	 * @param objEffectiveDate It is The first date, if known, on which the address is valid and active.
	 * @param objExpirationDate It is The last date, if known, on which the address is valid and active.
	 * @param objExpirationReason indicates why this address was marked as ended.
	 * @param strTemporaryIndicator indicates whether address is considered temporary .
	 * @param strBadAddressIndicator indicates whether it is possible to contact the owning entity.
	 * @param strAddressUsage indicates how the address is intended to be used.
	 * @param strAddressee indicates the name of the person whose address is intended to be used.
	 * @param strComment indicated descriptive information
	 * @param strPreferenceOrder preference order
	 * @param objProtectionCode indicates that an address need to be protected
	 * @param objAdressIdentifier indicates a unique identifier for address
	 */ 	
	public void addProviderOrganizationAddress (SAD objStreetAddress,String strOtherDesignation,String strCity,
			String strStateOrProvince,String strZipOrPostalCode,String strCountry,String strAddressType,
			String strOtherGeographicDesignation,CWE objCountyParishCode,CWE objCensusTract,
			String strAddressRepresentationCode,DTM objEffectiveDate,
			DTM objExpirationDate, CWE objEXpirationReason, String strTemporaryIndicator,
			String strBadAddressIndicator, String strAddressUsage, String strAddressee, String strComment,
			String strPreferenceOrder, CWE objProtectionCode, EI objAddressIdentifier)
	{
		XAD xad = (XAD)getDataElement(2257);
		xad.setOtherDesignation(strOtherDesignation);
		xad.setCity(strCity);
		xad.setStateOrProvince(strStateOrProvince);
		xad.setZipOrPostalCode(strZipOrPostalCode);
		xad.setCountry(strCountry);
		xad.setAddressType(strAddressType);
		xad.setOtherGeographicDesignation(strOtherGeographicDesignation);
		xad.setCountyParishCode(objCountyParishCode);
		xad.setCensusTract(objCensusTract);
		xad.setAddressRepresentationCode(strAddressRepresentationCode);
 
		xad.setEffectiveDate(objEffectiveDate);
		xad.setExpirationDate(objExpirationDate); 
		xad.setExpirationReason(objEXpirationReason);
		xad.setTemporaryIndicator(strTemporaryIndicator);
		xad.setBadAddressIndicator(strBadAddressIndicator);
		xad.setAddressUsage(strAddressUsage);
		xad.setAddressee(strAddressee);
		xad.setComment(strComment);
		xad.setPreferenceOrder(strPreferenceOrder);
		xad.setProtectionCode(objProtectionCode);
		xad.setAddressIdentifier(objAddressIdentifier);
		addProviderOrganizationAddress(xad);
	}

	/**
	 * Set the Provider Organization Address.
	 * This field contains the address of the provider if it is an organization.
	 * @param ProviderOrganizationAddress Provider Organization Address.
	 */	
	public void addProviderOrganizationAddress(XAD ProviderOrganizationAddress)
	{
		addDataType(2257,ProviderOrganizationAddress);
	}


	/**
	 * Set the Provider Organization Address list.
	 * @param objProviderOrganizationAddressList List of Diagnosing Clinician
	 */	
	@SuppressWarnings("unchecked")
	public void setProviderOrganizationAddress(ISingleCollection<XAD> objProviderOrganizationAddressList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objProviderOrganizationAddressList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(2257,objCollection);
	}
	
	/**
	 * Retrieves the Provider Organization Location Information.
	 * This field contains the location details of the provider if it is an organization.
	 * @return ISingleCollection<PL> - ProviderOrganizationLocationInformation
	 */
	public ISingleCollection<PL> getProviderOrganizationLocationInformation() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2258);
		ISingleCollection<PL> objDataList = new SingleCollection<PL>(); 
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				PL objPL = (PL)objDataType;
				objDataList.add(objPL);
			}
		}
		return objDataList;
	}
	
	/**
	 * Add the Provider Organization Location Information.
	 * This field contains the location details of the provider if it is an organization.
	 * @param strPointOfCare Use as PointOfCare.
	 * @param strRoom Use as Room.
	 * @param strBed Use as Bed.
	 * @param objFacility Use as Facility.
	 * @param strLocationStatus Use as LocationStatus.
	 * @param strPersonLocationType Use as PersonLocationType.
	 * @param strBuilding Use as Building.
	 * @param strFloor Use as Floor.
	 * @param strLocationDescription Use as LocationDescription.
	 * @param objComprehensiveLocationIdentifier Use as ComprehensiveLocationIdentifier.
	 * @param objAssigningAuthorityForLocation Use as AssigningAuthorityForLocation.
	 */ 	
	public void addProviderOrganizationLocationInformation(HD objPointOfCare, HD objRoom, HD objBed, HD objFacility,
			String strLocationStatus, String strPersonLocationType, HD objBuilding, HD objFloor, 
			String strLocationDescription, EI objComprehensiveLocationIdentifier, HD objAssigningAuthorityForLocation)
	{
		PL pl  = (PL)getDataElement(2258);
		pl.setPointOfCare(objPointOfCare);
		pl.setRoom(objRoom);
		pl.setBed(objBed);
		pl.setFacility(objFacility);
		pl.setLocationStatus(strLocationStatus);
		pl.setPersonLocationType(strPersonLocationType);
		pl.setBuilding(objBuilding);
		pl.setFloor(objFloor);
		pl.setLocationDescription(strLocationDescription);
		pl.setComprehensiveLocationIdentifier(objComprehensiveLocationIdentifier);
		pl.setAssigningAuthorityForLocation(objAssigningAuthorityForLocation); 
		addProviderOrganizationLocationInformation(pl);
	}

	/**
	 * Add the Provider Organization Location Information.
	 * This field contains the location details of the provider if it is an organization.
	 * @param objProviderOrganizationLocationInformation Object of Provider Organization Location Information.
	 */
	public void addProviderOrganizationLocationInformation(PL objProviderOrganizationLocationInformation)
	{
		addDataType(2258,objProviderOrganizationLocationInformation);
	}

	/**
	 * Set the Provider Organization Location Information.
	 * This field contains the location details of the provider if it is an organization.
	 * @param objProviderOrganizationLocationInformationList List of Provider Organization Location Information.
	 */
	@SuppressWarnings("unchecked")
	public void setProviderOrganizationLocationInformation(ISingleCollection<PL> objProviderOrganizationLocationInformationList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objProviderOrganizationLocationInformationList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(2258,objCollection);
	}
	
	/**
	 * Retrieves the Provider Organization Communication Information.
	 * This field contains information, such as the phone number or electronic mail address, used to communicate with the provider if it is an organization. 
	 * @return ISingleCollection<XTN> - ProviderOrganizationCommunicationInformation
	 */
	public ISingleCollection<XTN> getProviderOrganizationCommunicationInformation() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2259);
		ISingleCollection<XTN> objDataList = new SingleCollection<XTN>();
		if(objDataCollection != null && objDataCollection.size() != 0)
		{
			for(IDataType objDataType : objDataCollection)
			{
				XTN objXTN = (XTN)objDataType;
				objDataList.add(objXTN);
			}
		}

		return objDataList;
	}
	
	/**
	 * Set the Provider Organization Communication Information.
	 * This field contains information, such as the phone number or electronic mail address, used to communicate with the provider if it is an organization. 
	 * @param strTeleCommunicationUseCode Specifies a code that represents a specific use of a telecommunication number.
	 										Suggested values are PRN,ORN,WPN,VHN,ASN,EMR,NET,BPN  [Refer table 0201.]
	 * @param strTeleCommunicationEquipmentType Specifies a code that represents the type of telecommunication equipment.
	 * 											  Suggested values are PH,FX,MD,CP,BP,Internet,X.400,TDD,TTY  [Refer table 0202.]
	 * @param strCommuinicationAddress Specifies Email address.
	 * @param strCountryCode Specifies the Country code.
	 * @param strAreaCityCode Specifies the area /City Code.
	 * @param strLocalNumber Specifies an Local Number.
	 * @param strExtension Specifies an Extension.
	 * @param strAnyText Contains comments with respect to the telephone number.
	 * @param strExtensionPrefix Specifies the characters established within a company's 
	 * 							   internal telephone system network used as a prefix to the Extension component for internal dialing. 
	 * @param strSpeedDialCode Specifies The characters established within a 
	 * 							 company's internal telephone system used in place of the (external) telephone number.
	 * @param strUnformattedTelephoneNumber Specifies an expression of the telephone number as an unparsible string.
	 * @param strEffectiveStartDate Specifies start date.
	 * @param strExpirationDate Specifies expiration date.
	 * @param objExpirationReason Specifies reason why this contact is marked as ended.
	 * @param objProtectionCode Specifies reason why this information is sensitive or protected.
	 * @param objSharedTelecommunicationIdentifier Specifies a unique phone number phone telephone number or email-id.
	 * @param strPreferenceOrder Specifies the preference order for an entity..
	 */	
	public void addProviderOrganizationCommunicationInformation (String strTeleCommunicationUseCode,String strTeleCommunicationEquipmentType
			,String strCommuinicationAddress,String strCountryCode,String strAreaCityCode,String strLocalNumber,String strExtension,String strAnyText,
			String strExtensionPrefix,String strSpeedDialCode,String strUnformattedTelephoneNumber, String strEffectiveStartDate, String strExpirationDate,
			CWE objExpirationReason, CWE objProtectionCode, EI objSharedTelecommunicationIdentifier, String strPreferenceOrder)
	{
		XTN xtn  = (XTN)getDataElement(2259);
//		xtn.setTelephoneNumber(strTelephoneNumber);
		xtn.setTelecommunicationUseCode(strTeleCommunicationUseCode);
		xtn.setTelecommunicationEquipmentType(strTeleCommunicationEquipmentType);
		xtn.setCommuinicationAddress(strCommuinicationAddress);
		xtn.setCountryCode(strCountryCode);
		xtn.setAreaCityCode(strAreaCityCode);
		xtn.setLocalNumber(strLocalNumber);
		xtn.setExtension(strExtension);
		xtn.setAnyText(strAnyText);
		xtn.setExtensionPrefix(strExtensionPrefix);
		xtn.setSpeedDialCode(strSpeedDialCode);
		xtn.setUnformattedTelephonenumber(strUnformattedTelephoneNumber); 
		xtn.setEffectiveStartDate(strEffectiveStartDate);
		xtn.setExpirationDate(strExpirationDate);
		xtn.setExpirationReason(objExpirationReason);
		xtn.setProtectionCode(objProtectionCode);
		xtn.setSharedTelecommunicationIdentifier(objSharedTelecommunicationIdentifier);
		xtn.setPreferenceOrder(strPreferenceOrder);
		addProviderOrganizationCommunicationInformation(xtn);
	}

	/**
	 * Set the Provider Organization Communication Information.
	 * This field contains information, such as the phone number or electronic mail address, used to communicate with the provider if it is an organization. 
	 * @param ProviderOrganizationCommunicationInformation Provider Organization Communication Information.
	 */	
	public void addProviderOrganizationCommunicationInformation(XTN ProviderOrganizationCommunicationInformation)
	{
		addDataType(2259,ProviderOrganizationCommunicationInformation);
	}

	/**
	 * Set the Provider Organization Communication Information list.
	 * @param objProviderOrganizationCommunicationInformationList List of Diagnosing Clinician
	 */	
	@SuppressWarnings("unchecked")
	public void setProviderOrganizationCommunicationInformation(ISingleCollection<XTN> objProviderOrganizationCommunicationInformationList)
	{
		ISingleCollection<IDataType> objCollection = null;
		ISingleCollection<?> objUnknownCollection = (ISingleCollection<?>)objProviderOrganizationCommunicationInformationList;
		objCollection = (ISingleCollection<IDataType>)objUnknownCollection;
		setDataType(2259,objCollection);
	}
	
	/**
	 * Retrieves the Provider Organization Method of Contact.
	 * This field contains the preferred method to use when communicating with the provider if provider is an organization.  
	 * @return CWE - ProviderOrganizationMethodOfContact
	 */
	public CWE getProviderOrganizationMethodOfContact() 
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2260);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set the Provider Organization Method of Contact.
	 * This field contains the preferred method to use when communicating with the provider if provider is an organization.  
	 * @param strIdentifier Specifies of characters (the code) that uniquely identifies the item being referenced. 
	 * @param strText Specifies The descriptive or textual name of the identifier, e.g., myocardial infarction. 
	 * @param strNameOfCodingSystem Identifies the coding scheme being used in the identifier component.
	 * @param strAlternateIdentifier Specifies an alternate sequence of characters (the code) that uniquely identifies the item being referenced.
	 * @param strAlternateText Specifies the descriptive or textual name of the alternate identifier. See usage note in section introduction.
	 * @param strNameOfAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component. 
	 * @param strCodingSystemVersionID A sequence of characters that uniquely identifies a second alternate code.
	 * @param strAlternateCodingSystemVersionId This component carries the version for the coding system identified by components 4-6.
	 * @param strOriginalText The text as seen and/or selected by the user who entered the data.
	 * @param strSecondAlternateIdentifier A sequence of characters that uniquely identifies a second alternate code.
	 * @param strSecondAlternateText The descriptive or textual name of the alternate identifier.
	 * @param strNameofSecondAlternateCodingSystem Identifies the coding scheme being used in the alternate identifier component.
	 * @param strSecondAlternateCodingSystemVersionID This component carries the version for the coding system identified by components 10-12.
	 * @param strCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3.
	 * @param strValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained.
	 * @param strValueSetVersionID This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.
	 * @param strAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6.
	 * @param strAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained.
	 * @param strAlternateValueSetVersionID This component carries the version for the value set identified by CWE.18. The version is a date.
	 * @param strSecondAlternateCodingSystemOID This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12.
	 * @param strSecondAlternateValueSetOID This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained.
	 * @param strSecondAlternateValueSetVersionID This component carries the version for the value set identified by CWE.21. The version is a date.
	 */	
	public void setProviderOrganizationMethodOfContact(String strIdentifier,String strText,String strNameOfCodingSystem,
			String strAlternateIdentifier,String strAlternateText,String strNameOfAlternateCodingSystem, String strCodingSystemVersionID, String 				strAlternateCodingSystemVersionId,
			String strOriginalText, String  strSecondAlternateIdentifier, String strSecondAlternateText, 
			String strNameofSecondAlternateCodingSystem, String strSecondAlternateCodingSystemVersionID, String strCodingSystemOID, String strValueSetOID,
			String strValueSetVersionID, String strAlternateCodingSystemOID, String strAlternateValueSetOID, String strAlternateValueSetVersionID,
			String  strSecondAlternateCodingSystemOID, String strSecondAlternateValueSetOID, String strSecondAlternateValueSetVersionID)
	{
		CWE cwe  = (CWE)getDataElement(2260);
		cwe.setIdentifier(strIdentifier);
		cwe.setText(strText);
		cwe.setNameOfCodingSystem(strNameOfCodingSystem);
		cwe.setAlternateIdentifier(strAlternateIdentifier);
		cwe.setAlternateText(strAlternateText);
		cwe.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		cwe.setCodingSystemVersionID(strCodingSystemVersionID);
		cwe.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		cwe.setOriginalText(strOriginalText);
		cwe.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		cwe.setSecondAlternateText(strSecondAlternateText);
		cwe.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		cwe.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		cwe.setCodingSystemOID(strCodingSystemOID);
		cwe.setValueSetOID(strValueSetOID);
		cwe.setValueSetVersionID(strValueSetVersionID);
		cwe.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		cwe.setAlternateValueSetOID(strAlternateValueSetOID);
		cwe.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		cwe.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		cwe.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		cwe.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID);
		setProviderOrganizationMethodOfContact(cwe);
	}

	/**
	 * Set the Provider Organization Method of Contact.
	 * This field contains the preferred method to use when communicating with the provider if provider is an organization.  
	 * @param ProviderOrganizationMethodOfContact Provider Organization Method of Contact.
	 */	
	public void setProviderOrganizationMethodOfContact(CWE ProviderOrganizationMethodOfContact)
	{
		setDataType(2260,ProviderOrganizationMethodOfContact);
	}

	/**
	 * Validates HL7 Message objects .
	 * Validate method checks for validation each and every segments in side the Message object against specified message Structure. 
	 * Validation chcecks include optionality of segment or group.
	 * It also verifies the number of times segment or group is repeated in message.
	 * e.g 
	 * {PSH} while parsing PSH segment validate method will check for its mandatory presence.
	 * [PSH] in this case validate will throw exception if one tries to enter more than one PSH segment.
	 * @return boolean - true or false.
	 * @throws InvalidSegmentException Throws when Segment Validation fails.
	 */	
	@Override
	public boolean validate() throws InvalidSegmentException 
	{
		/*
		 * Provider Role is required fields.
		 */
		try 
		{
			super.validate();
			return true;		
		}
		catch(FieldMissingException ex)
		{
			throw new InvalidSegmentException(enumSegments.getValue(),ex);
		}
	}
}