001/*
002 * This class is an auto-generated source file for a HAPI
003 * HL7 v2.x standard structure class.
004 *
005 * For more information, visit: http://hl7api.sourceforge.net/
006 * 
007 * The contents of this file are subject to the Mozilla Public License Version 1.1 
008 * (the "License"); you may not use this file except in compliance with the License. 
009 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
010 * Software distributed under the License is distributed on an "AS IS" basis, 
011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
012 * specific language governing rights and limitations under the License. 
013 * 
014 * The Original Code is "[file_name]".  Description: 
015 * "[one_line_description]" 
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2012.  All Rights Reserved. 
019 * 
020 * Contributor(s): ______________________________________. 
021 * 
022 * Alternatively, the contents of this file may be used under the terms of the 
023 * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
024 * applicable instead of those above.  If you wish to allow use of your version of this 
025 * file only under the terms of the GPL and not to allow others to use your version 
026 * of this file under the MPL, indicate your decision by deleting  the provisions above 
027 * and replace  them with the notice and other provisions required by the GPL License.  
028 * If you do not delete the provisions above, a recipient may use your version of 
029 * this file under either the MPL or the GPL. 
030 * 
031 */
032
033
034package ca.uhn.hl7v2.model.v26.segment;
035
036// import ca.uhn.hl7v2.model.v26.group.*;
037import ca.uhn.hl7v2.model.v26.datatype.*;
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
041import ca.uhn.hl7v2.model.AbstractMessage;
042import ca.uhn.hl7v2.model.Group;
043import ca.uhn.hl7v2.model.Type;
044import ca.uhn.hl7v2.model.AbstractSegment;
045import ca.uhn.hl7v2.model.Varies;
046
047/**
048 *<p>Represents an HL7 PMT message segment (Payment Information). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>PMT-1: Payment/Remittance Advice Number (EI) <b> </b>
052     * <li>PMT-2: Payment/Remittance Effective Date/Time (DTM) <b> </b>
053     * <li>PMT-3: Payment/Remittance Expiration Date/Time (DTM) <b> </b>
054     * <li>PMT-4: Payment Method (CWE) <b> </b>
055     * <li>PMT-5: Payment/Remittance Date/Time (DTM) <b> </b>
056     * <li>PMT-6: Payment/Remittance Amount (CP) <b> </b>
057     * <li>PMT-7: Check Number (EI) <b>optional </b>
058     * <li>PMT-8: Payee Bank Identification (XON) <b>optional </b>
059     * <li>PMT-9: Payee Transit Number (ST) <b>optional </b>
060     * <li>PMT-10: Payee Bank Account ID (CX) <b>optional </b>
061     * <li>PMT-11: Payment Organization (XON) <b> </b>
062     * <li>PMT-12: ESR-Code-Line (ST) <b>optional </b>
063 * </ul>
064 */
065@SuppressWarnings("unused")
066public class PMT extends AbstractSegment {
067
068    /** 
069     * Creates a new PMT segment
070     */
071    public PMT(Group parent, ModelClassFactory factory) {
072       super(parent, factory);
073       init(factory);
074    }
075
076    private void init(ModelClassFactory factory) {
077       try {
078                                  this.add(EI.class, true, 1, 73, new Object[]{ getMessage() }, "Payment/Remittance Advice Number");
079                                  this.add(DTM.class, true, 1, 26, new Object[]{ getMessage() }, "Payment/Remittance Effective Date/Time");
080                                  this.add(DTM.class, true, 1, 26, new Object[]{ getMessage() }, "Payment/Remittance Expiration Date/Time");
081                                  this.add(CWE.class, true, 1, 177, new Object[]{ getMessage() }, "Payment Method");
082                                  this.add(DTM.class, true, 1, 26, new Object[]{ getMessage() }, "Payment/Remittance Date/Time");
083                                  this.add(CP.class, true, 1, 254, new Object[]{ getMessage() }, "Payment/Remittance Amount");
084                                  this.add(EI.class, false, 1, 15, new Object[]{ getMessage() }, "Check Number");
085                                  this.add(XON.class, false, 1, 6, new Object[]{ getMessage() }, "Payee Bank Identification");
086                                  this.add(ST.class, false, 1, 4, new Object[]{ getMessage() }, "Payee Transit Number");
087                                  this.add(CX.class, false, 1, 20, new Object[]{ getMessage() }, "Payee Bank Account ID");
088                                  this.add(XON.class, true, 1, 183, new Object[]{ getMessage() }, "Payment Organization");
089                                  this.add(ST.class, false, 1, 100, new Object[]{ getMessage() }, "ESR-Code-Line");
090       } catch(HL7Exception e) {
091          log.error("Unexpected error creating PMT - this is probably a bug in the source code generator.", e);
092       }
093    }
094
095
096
097    /**
098     * Returns
099     * PMT-1: "Payment/Remittance Advice Number" - creates it if necessary
100     */
101    public EI getPaymentRemittanceAdviceNumber() { 
102                EI retVal = this.getTypedField(1, 0);
103                return retVal;
104    }
105    
106    /**
107     * Returns
108     * PMT-1: "Payment/Remittance Advice Number" - creates it if necessary
109     */
110    public EI getPmt1_PaymentRemittanceAdviceNumber() { 
111                EI retVal = this.getTypedField(1, 0);
112                return retVal;
113    }
114
115
116
117    /**
118     * Returns
119     * PMT-2: "Payment/Remittance Effective Date/Time" - creates it if necessary
120     */
121    public DTM getPaymentRemittanceEffectiveDateTime() { 
122                DTM retVal = this.getTypedField(2, 0);
123                return retVal;
124    }
125    
126    /**
127     * Returns
128     * PMT-2: "Payment/Remittance Effective Date/Time" - creates it if necessary
129     */
130    public DTM getPmt2_PaymentRemittanceEffectiveDateTime() { 
131                DTM retVal = this.getTypedField(2, 0);
132                return retVal;
133    }
134
135
136
137    /**
138     * Returns
139     * PMT-3: "Payment/Remittance Expiration Date/Time" - creates it if necessary
140     */
141    public DTM getPaymentRemittanceExpirationDateTime() { 
142                DTM retVal = this.getTypedField(3, 0);
143                return retVal;
144    }
145    
146    /**
147     * Returns
148     * PMT-3: "Payment/Remittance Expiration Date/Time" - creates it if necessary
149     */
150    public DTM getPmt3_PaymentRemittanceExpirationDateTime() { 
151                DTM retVal = this.getTypedField(3, 0);
152                return retVal;
153    }
154
155
156
157    /**
158     * Returns
159     * PMT-4: "Payment Method" - creates it if necessary
160     */
161    public CWE getPaymentMethod() { 
162                CWE retVal = this.getTypedField(4, 0);
163                return retVal;
164    }
165    
166    /**
167     * Returns
168     * PMT-4: "Payment Method" - creates it if necessary
169     */
170    public CWE getPmt4_PaymentMethod() { 
171                CWE retVal = this.getTypedField(4, 0);
172                return retVal;
173    }
174
175
176
177    /**
178     * Returns
179     * PMT-5: "Payment/Remittance Date/Time" - creates it if necessary
180     */
181    public DTM getPaymentRemittanceDateTime() { 
182                DTM retVal = this.getTypedField(5, 0);
183                return retVal;
184    }
185    
186    /**
187     * Returns
188     * PMT-5: "Payment/Remittance Date/Time" - creates it if necessary
189     */
190    public DTM getPmt5_PaymentRemittanceDateTime() { 
191                DTM retVal = this.getTypedField(5, 0);
192                return retVal;
193    }
194
195
196
197    /**
198     * Returns
199     * PMT-6: "Payment/Remittance Amount" - creates it if necessary
200     */
201    public CP getPaymentRemittanceAmount() { 
202                CP retVal = this.getTypedField(6, 0);
203                return retVal;
204    }
205    
206    /**
207     * Returns
208     * PMT-6: "Payment/Remittance Amount" - creates it if necessary
209     */
210    public CP getPmt6_PaymentRemittanceAmount() { 
211                CP retVal = this.getTypedField(6, 0);
212                return retVal;
213    }
214
215
216
217    /**
218     * Returns
219     * PMT-7: "Check Number" - creates it if necessary
220     */
221    public EI getCheckNumber() { 
222                EI retVal = this.getTypedField(7, 0);
223                return retVal;
224    }
225    
226    /**
227     * Returns
228     * PMT-7: "Check Number" - creates it if necessary
229     */
230    public EI getPmt7_CheckNumber() { 
231                EI retVal = this.getTypedField(7, 0);
232                return retVal;
233    }
234
235
236
237    /**
238     * Returns
239     * PMT-8: "Payee Bank Identification" - creates it if necessary
240     */
241    public XON getPayeeBankIdentification() { 
242                XON retVal = this.getTypedField(8, 0);
243                return retVal;
244    }
245    
246    /**
247     * Returns
248     * PMT-8: "Payee Bank Identification" - creates it if necessary
249     */
250    public XON getPmt8_PayeeBankIdentification() { 
251                XON retVal = this.getTypedField(8, 0);
252                return retVal;
253    }
254
255
256
257    /**
258     * Returns
259     * PMT-9: "Payee Transit Number" - creates it if necessary
260     */
261    public ST getPayeeTransitNumber() { 
262                ST retVal = this.getTypedField(9, 0);
263                return retVal;
264    }
265    
266    /**
267     * Returns
268     * PMT-9: "Payee Transit Number" - creates it if necessary
269     */
270    public ST getPmt9_PayeeTransitNumber() { 
271                ST retVal = this.getTypedField(9, 0);
272                return retVal;
273    }
274
275
276
277    /**
278     * Returns
279     * PMT-10: "Payee Bank Account ID" - creates it if necessary
280     */
281    public CX getPayeeBankAccountID() { 
282                CX retVal = this.getTypedField(10, 0);
283                return retVal;
284    }
285    
286    /**
287     * Returns
288     * PMT-10: "Payee Bank Account ID" - creates it if necessary
289     */
290    public CX getPmt10_PayeeBankAccountID() { 
291                CX retVal = this.getTypedField(10, 0);
292                return retVal;
293    }
294
295
296
297    /**
298     * Returns
299     * PMT-11: "Payment Organization" - creates it if necessary
300     */
301    public XON getPaymentOrganization() { 
302                XON retVal = this.getTypedField(11, 0);
303                return retVal;
304    }
305    
306    /**
307     * Returns
308     * PMT-11: "Payment Organization" - creates it if necessary
309     */
310    public XON getPmt11_PaymentOrganization() { 
311                XON retVal = this.getTypedField(11, 0);
312                return retVal;
313    }
314
315
316
317    /**
318     * Returns
319     * PMT-12: "ESR-Code-Line" - creates it if necessary
320     */
321    public ST getESRCodeLine() { 
322                ST retVal = this.getTypedField(12, 0);
323                return retVal;
324    }
325    
326    /**
327     * Returns
328     * PMT-12: "ESR-Code-Line" - creates it if necessary
329     */
330    public ST getPmt12_ESRCodeLine() { 
331                ST retVal = this.getTypedField(12, 0);
332                return retVal;
333    }
334
335
336
337
338
339    /** {@inheritDoc} */   
340    protected Type createNewTypeWithoutReflection(int field) {
341       switch (field) {
342          case 0: return new EI(getMessage());
343          case 1: return new DTM(getMessage());
344          case 2: return new DTM(getMessage());
345          case 3: return new CWE(getMessage());
346          case 4: return new DTM(getMessage());
347          case 5: return new CP(getMessage());
348          case 6: return new EI(getMessage());
349          case 7: return new XON(getMessage());
350          case 8: return new ST(getMessage());
351          case 9: return new CX(getMessage());
352          case 10: return new XON(getMessage());
353          case 11: return new ST(getMessage());
354          default: return null;
355       }
356   }
357
358
359}
360