/*******************************************************************************
 *  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.CP;
import cdac.medinfo.sdk.hl7282.baselibs.CWE;
import cdac.medinfo.sdk.hl7282.baselibs.CX;
import cdac.medinfo.sdk.hl7282.baselibs.DTM;
import cdac.medinfo.sdk.hl7282.baselibs.EI;
import cdac.medinfo.sdk.hl7282.baselibs.HD;
import cdac.medinfo.sdk.hl7282.baselibs.MO;
import cdac.medinfo.sdk.hl7282.baselibs.ST;
import cdac.medinfo.sdk.hl7282.baselibs.XON;
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;

/**
 * PMT - Payment Information Segment 
 * This segment contains information that describes a payment made by a Payer organization.
 * <p>Represents an HL7 PMT message segment.
 * This segment has the following fields:</p><p>
 * PMT-1 :  Payment/Remittance Advice Number   (EI) <b>Required</b><br>
 * PMT-2 :  Payment/Remittance Effective Date/Time   (DTM) <b>Required</b><br>
 * PMT-3 :  Payment/Remittance Expiration Date/Time   (DTM) <b>Required</b><br>
 * PMT-4 :  Payment Method   (CWE) <b> Required</b><br>
 * PMT-5 :  Payment/Remittance Date/Time   (DTM) <b>Required </b><br>
 * PMT-6 :  Payment/Remittance Amount   (CP) <b>Required</b><br>
 * PMT-7 :  Check Number    (EI)<b>Optional</b><br>
 * PMT-8 :  Payee Bank Identification    (XON)<b>Optional</b><br>
 * PMT-9 :  Payee Transit Number   (ST)<b>Optional</b><br>
 * PMT-10 :  Payee Bank Account ID   (CX)<b>optional</p><br>
 * PMT-11 :  Payment Organization   (XON)<b>Required</b><br>
 * PMT-12 :  ESR-Code-Line  (ST)<b>Optional</b><br>
 * 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 PMT extends Segment
{
	/**
	 * Constructs the PMT segment.
	 */
	public PMT()
	{
		super(EnumSegments.HL7_SEG_PMT);
	}
	
	/**
	 * Retrieve Payment/Remittance Advice Number (EI) 
	 * This field is Unique Payment/Remittance Advice number for the sending Network Application ID.
	 * @return EI - object of Payment/Remittance Advice Number.
	 */
	public EI getPaymentOrRemittanceAdviceNumber()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2018);
		if(objDataCollection != null) 
			return (EI)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set  Retrieve Payment/Remittance Advice Number (EI) 
	 * This field is Unique Payment/Remittance Advice number for the sending Network Application ID.
	 * @param strEntityIdentifier - string of character use to identify the entity.
	 * @param strNamespaceID - Use to identify the name space id..
	 * @param strUniversalID - Use to identify the name space identity.
	 * @param strUniversalIDType - String of characters describe Universal Id Type. 
	 */ 
	public void setPaymentOrRemittanceAdviceNumber(String strEntityIdentifier,String strNamespaceID,String strUniversalID,String strUniversalIDType)
	{
		EI objPaymentOrRemittanceAdviceNumber = (EI)getDataElement(2018);
		objPaymentOrRemittanceAdviceNumber.setEntityIdentifier(strEntityIdentifier);
		objPaymentOrRemittanceAdviceNumber.setNamespaceId(strNamespaceID);
		objPaymentOrRemittanceAdviceNumber.setUniversalId(strUniversalID);
		objPaymentOrRemittanceAdviceNumber.setUniversalIdType(strUniversalIDType);
		setPaymentOrRemittanceAdviceNumber(objPaymentOrRemittanceAdviceNumber);
	}
	
	/**
	 * Set  Retrieve Payment/Remittance Advice Number (EI) 
	 * This field is Unique Payment/Remittance Advice number for the sending Network Application ID.
	 * @param objPaymentOrRemittanceAdviceNumber - object of Payment/Remittance Advice Number.
	 */ 
	public void setPaymentOrRemittanceAdviceNumber(EI objPaymentOrRemittanceAdviceNumber)
	{
		setDataType(2018, objPaymentOrRemittanceAdviceNumber);
	}
	
	/**
	 * Retrieve Payment/Remittance Effective Date/Time   (DTM)   
	 * This field is about Date/Time for this Payment/Remittance Advice.
	 * @return DTM - object of Payment/Remittance Effective Date/Time.
	 */
	public DTM getPaymentOrRemittanceEffectiveDateOrTime()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2019);
		if(objDataCollection != null) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set Payment/Remittance Effective Date/Time   (DTM)   
	 * This field is about Date/Time for this Payment/Remittance Advice.
	 * @param strPaymentOrRemittanceEffectiveDateOrTime - string of Payment/Remittance Effective Date/Time.
	 */
	public void setPaymentOrRemittanceEffectiveDateOrTime(String strPaymentOrRemittanceEffectiveDateOrTime)
	{
		DTM objPaymentOrRemittanceEffectiveDateOrTime = (DTM)getDataElement(2019);
		objPaymentOrRemittanceEffectiveDateOrTime.setValue(strPaymentOrRemittanceEffectiveDateOrTime);
		setPaymentOrRemittanceEffectiveDateOrTime(objPaymentOrRemittanceEffectiveDateOrTime);
	}
	
	/**
	 * Set Payment/Remittance Effective Date/Time   (DTM)   
	 * This field is about Date/Time for this Payment/Remittance Advice.
	 * @param objPaymentOrRemittanceEffectiveDateOrTime - object of Payment/Remittance Effective Date/Time.
	 */
	public void setPaymentOrRemittanceEffectiveDateOrTime(DTM objPaymentOrRemittanceEffectiveDateOrTime)
	{
		setDataType(2019, objPaymentOrRemittanceEffectiveDateOrTime);
	}
	
	/**
	 * Retrieve Payment/Remittance Expiration Date/Time   (DTM)   
	 * This field is about Date/Time for this Payment/Remittance Advice.
	 * @return DTM - object of Payment/Remittance Expiration Date/Time.
	 */
	public DTM getPaymentOrRemittanceExpirationDateOrTime()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2020);
		if(objDataCollection != null) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set Payment/Remittance Expiration Date/Time   (DTM)   
	 * This field is about Date/Time for this Payment/Remittance Advice.
	 * @param strPaymentOrRemittanceExpirationDateOrTime - string of Payment/Remittance Expiration Date/Time.
	 */
	public void setPaymentOrRemittanceExpirationDateOrTime(String strPaymentOrRemittanceExpirationDateOrTime)
	{
		DTM objPaymentOrRemittanceExpirationDateOrTime = (DTM)getDataElement(2020);
		objPaymentOrRemittanceExpirationDateOrTime.setValue(strPaymentOrRemittanceExpirationDateOrTime);
		setPaymentOrRemittanceExpirationDateOrTime(objPaymentOrRemittanceExpirationDateOrTime);
	}
	
	/**
	 * Set Payment/Remittance Expiration Date/Time   (DTM)   
	 * This field is about Date/Time for this Payment/Remittance Advice.
	 * @param objPaymentOrRemittanceExpirationDateOrTime - object of Payment/Remittance Expiration Date/Time.
	 */
	public void setPaymentOrRemittanceExpirationDateOrTime(DTM objPaymentOrRemittanceExpirationDateOrTime)
	{
		setDataType(2020, objPaymentOrRemittanceExpirationDateOrTime);
	}
	
	/**
	 * retrieve Payment Method   (CWE)   
	 * This field is about Code identifying the method for the movement of payment.
	 * @return CWE - object of Payment Method.
	 */
	public CWE getPaymentMethod()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2021);
		if(objDataCollection != null) 
			return (CWE)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set Payment Method   (CWE)   
	 * This field is about Code identifying the method for the movement of payment.
	 * @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 infection. 
	 * @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 setPaymentMethod(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 objPaymentMethod  = (CWE)getDataElement(2021);
		objPaymentMethod.setIdentifier(strIdentifier);
		objPaymentMethod.setText(strText);
		objPaymentMethod.setNameOfCodingSystem(strNameOfCodingSystem);
		objPaymentMethod.setAlternateIdentifier(strAlternateIdentifier);
		objPaymentMethod.setAlternateText(strAlternateText);
		objPaymentMethod.setNameOfAlternateCodingSystem(strNameOfAlternateCodingSystem); 
		objPaymentMethod.setCodingSystemVersionID(strCodingSystemVersionID);
		objPaymentMethod.setAlternateCodingSystemVersionId(strAlternateCodingSystemVersionId);
		objPaymentMethod.setOriginalText(strOriginalText);
		objPaymentMethod.setSecondAlternateIdentifier(strSecondAlternateIdentifier);
		objPaymentMethod.setSecondAlternateText(strSecondAlternateText);
		objPaymentMethod.setNameofSecondAlternateCodingSystem(strNameofSecondAlternateCodingSystem);
		objPaymentMethod.setSecondAlternateCodingSystemVersionID(strSecondAlternateCodingSystemVersionID);
		objPaymentMethod.setCodingSystemOID(strCodingSystemOID);
		objPaymentMethod.setValueSetOID(strValueSetOID);
		objPaymentMethod.setValueSetVersionID(strValueSetVersionID);
		objPaymentMethod.setAlternateCodingSystemOID(strAlternateCodingSystemOID);
		objPaymentMethod.setAlternateValueSetOID(strAlternateValueSetOID);
		objPaymentMethod.setAlternateValueSetVersionID(strAlternateValueSetVersionID);
		objPaymentMethod.setSecondAlternateCodingSystemOID(strSecondAlternateCodingSystemOID);
		objPaymentMethod.setSecondAlternateValueSetOID(strSecondAlternateValueSetOID);
		objPaymentMethod.setSecondAlternateValueSetVersionID(strSecondAlternateValueSetVersionID); 
		setPaymentMethod(objPaymentMethod);
	}
	
	/**
	 * Set Payment Method   (CWE)   
	 * This field is about Code identifying the method for the movement of payment.
	 * @param objPaymentMethod - object of Payment Method.
	 */
	public void setPaymentMethod(CWE objPaymentMethod)
	{
		setDataType(2021, objPaymentMethod);
	}
	
	/**
	 * Retrieve Payment/Remittance  Date/Time   (DTM)   
	 * This field is about Date Payment/Remittance Advice was paid, which might not be the same as Date/Time of Message on MSH.
	 * @return DTM - object of Payment/Remittance  Date/Time.
	 */
	public DTM getPaymentOrRemittanceDateOrTime()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2022);
		if(objDataCollection != null) 
			return (DTM)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set Payment/Remittance  Date/Time   (DTM)   
	 * This field is about Date Payment/Remittance Advice was paid, which might not be the same as Date/Time of Message on MSH.
	 * @param strPaymentOrRemittanceExpirationDateOrTime - string of Payment/Remittance  Date/Time.
	 */
	public void setPaymentOrRemittanceDateOrTime(String strPaymentOrRemittanceDateOrTime)
	{
		DTM objPaymentOrRemittanceDateOrTime = (DTM)getDataElement(2022);
		objPaymentOrRemittanceDateOrTime.setValue(strPaymentOrRemittanceDateOrTime);
		setPaymentOrRemittanceDateOrTime(objPaymentOrRemittanceDateOrTime);
	}
	
	/**
	 * Set Payment/Remittance Expiration Date/Time   (DTM)   
	 * This field is about Date Payment/Remittance Advice was paid, which might not be the same as Date/Time of Message on MSH.
	 * @param objPaymentOrRemittanceExpirationDateOrTime - object of Payment/Remittance Expiration Date/Time.
	 */
	public void setPaymentOrRemittanceDateOrTime(DTM objPaymentOrRemittanceDateOrTime)
	{
		setDataType(2022, objPaymentOrRemittanceDateOrTime);
	}
	
	/**
	 * Retrieve Payment/Remittance Amount  (CP)   
	 * This field is about Sum total of all Product/Service Paid Amount on PSL for this Payment/Remittance Advice, net of any Adjustments to Payee.
	 * @return CP - object of Payment/Remittance Amount.
	 */
	public CP getPaymentOrRemittanceAmount()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2023);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CP)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set Payment/Remittance Amount  (CP)   
	 * This field is about Sum total of all Product/Service Paid Amount on PSL for this Payment/Remittance Advice, net of any Adjustments to Payee.
	 * @param objPrice - Gives information about the Price.
	 * @param strPriceType - Gives information about Type of Price.
	 * @param strFormValue - Gives information about Form Value.
	 * @param strToValue - Tell about the To value.
	 * @param objRangeUnits - Specifies about the range of the units.
	 * @param strRangeType - Specifies about the Type of range.
	 */ 
	public void setPaymentOrRemittanceAmount(MO objPrice,String strPriceType,String strFormValue,String strToValue,CWE objRangeUnits,String strRangeType)
	{
		CP objPaymentOrRemittanceAmount = (CP)getDataElement(2023);
		objPaymentOrRemittanceAmount.setPrice(objPrice);
		objPaymentOrRemittanceAmount.setPriceType(strPriceType);
		objPaymentOrRemittanceAmount.setFromValue(strFormValue);
		objPaymentOrRemittanceAmount.setToValue(strToValue);
		objPaymentOrRemittanceAmount.setRangeType(strRangeType);
		objPaymentOrRemittanceAmount.setRangeUnits(objRangeUnits);
		objPaymentOrRemittanceAmount.setRangeType(strRangeType);
		setPaymentOrRemittanceAmount(objPaymentOrRemittanceAmount);
	}
	/**
	 * Set Payment/Remittance Amount  (CP)   
	 * This field is about Sum total of all Product/Service Paid Amount on PSL for this Payment/Remittance Advice, net of any Adjustments to Payee.
	 * @param objPaymentOrRemittanceAmount - object of Payment/Remittance Amount.
	 */ 
	public void setPaymentOrRemittanceAmount(CP objPaymentOrRemittanceAmount)
	{
		setDataType(2023, objPaymentOrRemittanceAmount);
	}
	
	/**
	 * Retrieve Check Number (EI) 
	 * This field is Unique check number from the Payer's application system.
	 * @return EI - object of Check Number.
	 */
	public EI getCheckNumber()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2024);
		if(objDataCollection != null) 
			return (EI)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set  Retrieve Check Number (EI) 
	 * This field is Unique check number from the Payer's application system.
	 * @param strEntityIdentifier - string of character use to identify the entity.
	 * @param strNamespaceID - Use to identify the name space id..
	 * @param strUniversalID - Use to identify the name space identity.
	 * @param strUniversalIDType - String of characters describe Universal Id Type. 
	 */ 
	public void setCheckNumber(String strEntityIdentifier,String strNamespaceID,String strUniversalID,String strUniversalIDType)
	{
		EI objCheckNumber = (EI)getDataElement(2024);
		objCheckNumber.setEntityIdentifier(strEntityIdentifier);
		objCheckNumber.setNamespaceId(strNamespaceID);
		objCheckNumber.setUniversalId(strUniversalID);
		objCheckNumber.setUniversalIdType(strUniversalIDType);
		setCheckNumber(objCheckNumber);
	}
	
	/**
	 * Set  Retrieve Check Number (EI) 
	 * This field is Unique check number from the Payer's application system.
	 * @param objCheckNumber - object of Check Number.
	 */ 
	public void setCheckNumber(EI objCheckNumber)
	{
		setDataType(2024, objCheckNumber);
	}
	
	/**
	 * Retrieve Payee Bank Identification   (XON)
	 * This field is about Identification of Payee's financial contact, e.g., name of the bank .
	 * @return XON - object of Payee Bank Identification.
	 */
	public XON getPayeeBankIdentification()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2025);
		if(objDataCollection != null) 
			return (XON)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set Payee Bank Identification   (XON)
	 * This field is about Identification of Payee's financial contact, e.g., name of the bank .
	 * @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 setPayeeBankIdentification(String strOrganizationName, CWE objOrganizationNameTypeCode,HD objAssigningAuthority,String strIdentifierTypeCode,
			HD objAssigningFacility, String strNameRepresentationCode,String strOrganizationIdentifier)
	{
		XON objPayeeBankIdentification  = (XON)getDataElement(2025);
		objPayeeBankIdentification.setOrganizationName(strOrganizationName);
		objPayeeBankIdentification.setOrganizationNameTypeCode(objOrganizationNameTypeCode);
		objPayeeBankIdentification.setAssigningAuthority(objAssigningAuthority);
		objPayeeBankIdentification.setIdentifierTypeCode(strIdentifierTypeCode);
		objPayeeBankIdentification.setAssigningFacility(objAssigningFacility);
		objPayeeBankIdentification.setNameRepresentationCode(strNameRepresentationCode);
		objPayeeBankIdentification.setOrganizationIdentifier(strOrganizationIdentifier); 
		setPayeeBankIdentification(objPayeeBankIdentification);
	}
	
	/**
	 * Set Payee Bank Identification   (XON)
	 * This field is about Identification of Payee's financial contact, e.g., name of the bank .
	 * @param objVATRatesAppliedList - object of Payee Bank Identification.
	 */
	public void setPayeeBankIdentification(XON objPayeeBankIdentification)
	{
		setDataType(2025, objPayeeBankIdentification);
	}
	
	/**
	 * Retrieve Payee Transit Number (ST)
	 * This field is about Personal ID of the payee used in financial transaction.
	 * @return ST - object of Payee Transit Number.
	 */
	public ST getPayeeTransitNumber()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2026);
		if(objDataCollection != null) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Retrieve Payee Transit Number (ST)
	 * This field is about Personal ID of the payee used in financial transaction.
	 * @param strPayeeTransitNumber - object of Payee Transit Number.
	 */
	public void setPayeeTransitNumber(String strPayeeTransitNumber)
	{
		ST objPayeeTransitNumber = (ST)getDataElement(2026);
		objPayeeTransitNumber.setValue(strPayeeTransitNumber);
		setPayeeTransitNumber(objPayeeTransitNumber);
	}
	
	/**
	 * Retrieve Payee Transit Number (ST)
	 * This field is about Personal ID of the payee used in financial transaction.
	 * @param objPayeeTransitNumber - object of Payee Transit Number.
	 */
	public void setPayeeTransitNumber(ST objPayeeTransitNumber)
	{
		setDataType(2026, objPayeeTransitNumber);
	}
	
	/**
	 * Retrieve Payee Bank Account ID (CX) 
	 * Id of Payee's Bank account.
	 * @return CX - object of Payee Bank Account ID.  
	 */
	public CX getPayeeBankAccountID()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2027);
		if(objDataCollection != null && objDataCollection.size() != 0) 
			return (CX)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set Payee Bank Account ID (CX)
	 * Id of Payee's Bank account.
	 * @param strIDNumber Specifies the value of the identifier itself.
	 * @param strCheckDigit It is part of the identifying number used in the sending application. 
	 * @param strCheckDigitScheme Contains the code identifying the check digit scheme employed.
	 * 								Suggested Values NP,ISO,M10,M11.[Refer table No.0061].
	 * @param objAssigningAuthority The assigning authority is a unique name of the system (or organization or agency 
	 * 									or department) that creates the data. . 
	 * @param strIdentifierTypeCode Specifies a code corresponding to the type of identifier.In some cases, this code may be
	 * 								 used as a qualifier to the "Assigning authority" component.[Refer table No 0203]
	 * @param objAssigningFacility Specifies the place or location identifier where the identifier was first assigned 
	 * 									to the patient. 
	 * @param strEffectiveDate Specifies the first date, if known, on which the address is valid and active.
	 * @param strExpirationDate Specifies the last date, if known, on which the address is valid and active.
	 * @param objAssigningJurisdiction Specifies the geo-political body that assigned the identifier. 
	 * @param objAssigningAgencyOrDepartment Specifies agency or department that assigned the identifier. 
	 * @param strSecurityCheck is used to communicate the version code. 
	 * @param objSecurityCheckSCheme is used to transmit information intended to validate veracity of the supplied identifier
	 */
	public void setPayeeBankAccountID(String strIDNumber,String strCheckDigit, String strCheckDigitScheme, HD objAssigningAuthority,
			String strIdentifierTypeCode,HD objAssigningFacility,String strEffectiveDate,String strExpirationDate, 
			CWE objAssigningJurisdiction, CWE objAssigningAgencyOrDepartment, String strSecurityCheck, String strSecurityCheckScheme)
	{
		CX objPayeeBankAccountID  = (CX)getDataElement(2027);
		objPayeeBankAccountID.setIdNumber(strIDNumber);
		objPayeeBankAccountID.setCheckDigit(strCheckDigit);
		objPayeeBankAccountID.setCheckDigitScheme(strCheckDigitScheme);
		objPayeeBankAccountID.setAssigningAuthority(objAssigningAuthority);
		objPayeeBankAccountID.setIdentifierTypeCode(strIdentifierTypeCode);
		objPayeeBankAccountID.setAssigningFacility(objAssigningFacility);
		objPayeeBankAccountID.setEffectiveDate(strEffectiveDate);
		objPayeeBankAccountID.setExpirationDate(strExpirationDate);
		objPayeeBankAccountID.setAssigningJurisdiction(objAssigningJurisdiction);
		objPayeeBankAccountID.setAssigningAgencyOrDepartment(objAssigningAgencyOrDepartment); 
		objPayeeBankAccountID.setSecurityCheck(strCheckDigit);
		objPayeeBankAccountID.setSecurityCheckScheme(strSecurityCheckScheme);
		setPayeeBankAccountID(objPayeeBankAccountID);
	}
	
	/**
	 * Set Payee Bank Account ID (CX)
	 * Id of Payee's Bank account.
	 * @param objPayeeBankAccountID - object of Payee Bank Account ID.
	 */
	public void setPayeeBankAccountID(CX objPayeeBankAccountID)
	{
		setDataType(2027, objPayeeBankAccountID);
	}
	
	/**
	 * Retrieve Payment Organization   (XON)
	 * This field is about Organization identifier that made the Payment/Remittance Advice; could be a Payer, Insurance Company, TPA, Drug Company.
	 * @return XON - object of Payment Organization.
	 */
	public XON getPaymentOrganization()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2028);
		if(objDataCollection != null) 
			return (XON)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Set Payment Organization   (XON)
	 * This field is about Organization identifier that made the Payment/Remittance Advice; could be a Payer, Insurance Company, TPA, Drug Company.
	 * @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 setPaymentOrganization(String strOrganizationName, CWE objOrganizationNameTypeCode,HD objAssigningAuthority,String strIdentifierTypeCode,
			HD objAssigningFacility, String strNameRepresentationCode,String strOrganizationIdentifier)
	{
		XON objPaymentOrganization  = (XON)getDataElement(2028);
		objPaymentOrganization.setOrganizationName(strOrganizationName);
		objPaymentOrganization.setOrganizationNameTypeCode(objOrganizationNameTypeCode);
		objPaymentOrganization.setAssigningAuthority(objAssigningAuthority);
		objPaymentOrganization.setIdentifierTypeCode(strIdentifierTypeCode);
		objPaymentOrganization.setAssigningFacility(objAssigningFacility);
		objPaymentOrganization.setNameRepresentationCode(strNameRepresentationCode);
		objPaymentOrganization.setOrganizationIdentifier(strOrganizationIdentifier); 
		setPaymentOrganization(objPaymentOrganization);
	}
	
	/**
	 * Set Payment Organization   (XON)
	 * This field is about Organization identifier that made the Payment/Remittance Advice; could be a Payer, Insurance Company, TPA, Drug Company.
	 * @param objPaymentOrganization - object of Payment Organization.
	 */ 
	public void setPaymentOrganization(XON objPaymentOrganization)
	{
		setDataType(2028, objPaymentOrganization);
	}
	
	/**
	 * Retrieve ESR-Code-Line (ST)
	 * This field is about Invoice Reference used with electronic banking methods.
	 * @return ST - object of ESR-Code-Line.
	 */
	public ST getESR_Code_Line()
	{
		ISingleCollection<IDataType> objDataCollection =getDataType(2029);
		if(objDataCollection != null) 
			return (ST)objDataCollection.elementAt(0);
		else
			return null;
	}
	
	/**
	 * Retrieve ESR-Code-Line (ST)
	 * This field is about Invoice Reference used with electronic banking methods.
	 * @param strESR_Code_Line - object of ESR-Code-Line.
	 */
	public void setESR_Code_Line(String strESR_Code_Line)
	{
		ST objESR_Code_Line = (ST)getDataElement(2029);
		objESR_Code_Line.setValue(strESR_Code_Line);
		setESR_Code_Line(objESR_Code_Line);
	}
	
	/**
	 * Retrieve ESR-Code-Line (ST)
	 * This field is about Invoice Reference used with electronic banking methods.
	 * @param objESR_Code_Line - object of ESR-Code-Line.
	 */
	public void setESR_Code_Line(ST objESR_Code_Line)
	{
		setDataType(2029, objESR_Code_Line);
	}
	
	/**
	 * Validates HL7 Message objects .
	 * Validate method checks for validation each and every segments in side the Message object against specified message Structure. 
	 * Validation checks include optionality of segment or group.
	 * It also verifies the number of times segment or group is repeated in message.
	 * e.g 
	 * {PMT} while parsing PMT segment validate method will check for its mandatory presence.
	 * [PMT] in this case validate will throw exception if one tries to enter more than one PMT segment.
	 * @return boolean - true or false.
	 * @throws InvalidSegmentException Throws when Segment Validation fails.
	 */
	public boolean validate() throws InvalidSegmentException
	{
		try
		{
			super.validate();
			return true;
		}
		catch(FieldMissingException ex)
		{
			throw new InvalidSegmentException(enumSegments.getValue(),ex);
		}
	}
}
