View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v281.segment;
35  
36  // import ca.uhn.hl7v2.model.v281.group.*;
37  import ca.uhn.hl7v2.model.v281.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 GP2 message segment (Grouping/Reimbursement - Procedure Line Item). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>GP2-1: Revenue Code (CWE) <b>optional </b>
53       * <li>GP2-2: Number of Service Units (NM) <b>optional </b>
54       * <li>GP2-3: Charge (CP) <b>optional </b>
55       * <li>GP2-4: Reimbursement Action Code (CWE) <b>optional </b>
56       * <li>GP2-5: Denial or Rejection Code (CWE) <b>optional </b>
57       * <li>GP2-6: OCE Edit Code (CWE) <b>optional repeating</b>
58       * <li>GP2-7: Ambulatory Payment Classification Code (CWE) <b>optional </b>
59       * <li>GP2-8: Modifier Edit Code (CWE) <b>optional repeating</b>
60       * <li>GP2-9: Payment Adjustment Code (CWE) <b>optional </b>
61       * <li>GP2-10: Packaging Status Code (CWE) <b>optional </b>
62       * <li>GP2-11: Expected CMS Payment Amount (CP) <b>optional </b>
63       * <li>GP2-12: Reimbursement Type Code (CWE) <b>optional </b>
64       * <li>GP2-13: Co-Pay Amount (CP) <b>optional </b>
65       * <li>GP2-14: Pay Rate per Service Unit (NM) <b>optional </b>
66   * </ul>
67   */
68  @SuppressWarnings("unused")
69  public class GP2 extends AbstractSegment {
70  
71      /** 
72       * Creates a new GP2 segment
73       */
74      public GP2(Group parent, ModelClassFactory factory) {
75         super(parent, factory);
76         init(factory);
77      }
78  
79      private void init(ModelClassFactory factory) {
80         try {
81                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Revenue Code");
82                                    this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Number of Service Units");
83                                    this.add(CP.class, false, 1, 0, new Object[]{ getMessage() }, "Charge");
84                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Reimbursement Action Code");
85                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Denial or Rejection Code");
86                                    this.add(CWE.class, false, 0, 0, new Object[]{ getMessage() }, "OCE Edit Code");
87                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Ambulatory Payment Classification Code");
88                                    this.add(CWE.class, false, 0, 0, new Object[]{ getMessage() }, "Modifier Edit Code");
89                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Payment Adjustment Code");
90                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Packaging Status Code");
91                                    this.add(CP.class, false, 1, 0, new Object[]{ getMessage() }, "Expected CMS Payment Amount");
92                                    this.add(CWE.class, false, 1, 0, new Object[]{ getMessage() }, "Reimbursement Type Code");
93                                    this.add(CP.class, false, 1, 0, new Object[]{ getMessage() }, "Co-Pay Amount");
94                                    this.add(NM.class, false, 1, 0, new Object[]{ getMessage() }, "Pay Rate per Service Unit");
95         } catch(HL7Exception e) {
96            log.error("Unexpected error creating GP2 - this is probably a bug in the source code generator.", e);
97         }
98      }
99  
100 
101 
102     /**
103      * Returns
104      * GP2-1: "Revenue Code" - creates it if necessary
105      */
106     public CWE getRevenueCode() { 
107 		CWE retVal = this.getTypedField(1, 0);
108 		return retVal;
109     }
110     
111     /**
112      * Returns
113      * GP2-1: "Revenue Code" - creates it if necessary
114      */
115     public CWE getGp21_RevenueCode() { 
116 		CWE retVal = this.getTypedField(1, 0);
117 		return retVal;
118     }
119 
120 
121 
122     /**
123      * Returns
124      * GP2-2: "Number of Service Units" - creates it if necessary
125      */
126     public NM getNumberOfServiceUnits() { 
127 		NM retVal = this.getTypedField(2, 0);
128 		return retVal;
129     }
130     
131     /**
132      * Returns
133      * GP2-2: "Number of Service Units" - creates it if necessary
134      */
135     public NM getGp22_NumberOfServiceUnits() { 
136 		NM retVal = this.getTypedField(2, 0);
137 		return retVal;
138     }
139 
140 
141 
142     /**
143      * Returns
144      * GP2-3: "Charge" - creates it if necessary
145      */
146     public CP getCharge() { 
147 		CP retVal = this.getTypedField(3, 0);
148 		return retVal;
149     }
150     
151     /**
152      * Returns
153      * GP2-3: "Charge" - creates it if necessary
154      */
155     public CP getGp23_Charge() { 
156 		CP retVal = this.getTypedField(3, 0);
157 		return retVal;
158     }
159 
160 
161 
162     /**
163      * Returns
164      * GP2-4: "Reimbursement Action Code" - creates it if necessary
165      */
166     public CWE getReimbursementActionCode() { 
167 		CWE retVal = this.getTypedField(4, 0);
168 		return retVal;
169     }
170     
171     /**
172      * Returns
173      * GP2-4: "Reimbursement Action Code" - creates it if necessary
174      */
175     public CWE getGp24_ReimbursementActionCode() { 
176 		CWE retVal = this.getTypedField(4, 0);
177 		return retVal;
178     }
179 
180 
181 
182     /**
183      * Returns
184      * GP2-5: "Denial or Rejection Code" - creates it if necessary
185      */
186     public CWE getDenialOrRejectionCode() { 
187 		CWE retVal = this.getTypedField(5, 0);
188 		return retVal;
189     }
190     
191     /**
192      * Returns
193      * GP2-5: "Denial or Rejection Code" - creates it if necessary
194      */
195     public CWE getGp25_DenialOrRejectionCode() { 
196 		CWE retVal = this.getTypedField(5, 0);
197 		return retVal;
198     }
199 
200 
201     /**
202      * Returns all repetitions of OCE Edit Code (GP2-6).
203      */
204     public CWE[] getOCEEditCode() {
205     	CWE[] retVal = this.getTypedField(6, new CWE[0]);
206     	return retVal;
207     }
208 
209 
210     /**
211      * Returns all repetitions of OCE Edit Code (GP2-6).
212      */
213     public CWE[] getGp26_OCEEditCode() {
214     	CWE[] retVal = this.getTypedField(6, new CWE[0]);
215     	return retVal;
216     }
217 
218 
219     /**
220      * Returns a count of the current number of repetitions of OCE Edit Code (GP2-6).
221      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
222      * it will return zero.
223      */
224     public int getOCEEditCodeReps() {
225     	return this.getReps(6);
226     }
227 
228 
229     /**
230      * Returns a specific repetition of
231      * GP2-6: "OCE Edit Code" - creates it if necessary
232      *
233      * @param rep The repetition index (0-indexed)
234      */
235     public CWE getOCEEditCode(int rep) { 
236 		CWE retVal = this.getTypedField(6, rep);
237 		return retVal;
238     }
239 
240     /**
241      * Returns a specific repetition of
242      * GP2-6: "OCE Edit Code" - creates it if necessary
243      *
244      * @param rep The repetition index (0-indexed)
245      */
246     public CWE getGp26_OCEEditCode(int rep) { 
247 		CWE retVal = this.getTypedField(6, rep);
248 		return retVal;
249     }
250 
251     /**
252      * Returns a count of the current number of repetitions of OCE Edit Code (GP2-6).
253      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
254      * it will return zero.
255      */
256     public int getGp26_OCEEditCodeReps() {
257     	return this.getReps(6);
258     }
259 
260 
261     /**
262      * Inserts a repetition of
263      * GP2-6: "OCE Edit Code" at a specific index
264      *
265      * @param rep The repetition index (0-indexed)
266      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
267      */
268     public CWE insertOCEEditCode(int rep) throws HL7Exception { 
269         return (CWE) super.insertRepetition(6, rep);
270     }
271 
272 
273     /**
274      * Inserts a repetition of
275      * GP2-6: "OCE Edit Code" at a specific index
276      *
277      * @param rep The repetition index (0-indexed)
278      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
279      */
280     public CWE insertGp26_OCEEditCode(int rep) throws HL7Exception { 
281         return (CWE) super.insertRepetition(6, rep);
282     }
283 
284 
285     /**
286      * Removes a repetition of
287      * GP2-6: "OCE Edit Code" at a specific index
288      *
289      * @param rep The repetition index (0-indexed)
290      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
291      */
292     public CWE removeOCEEditCode(int rep) throws HL7Exception { 
293         return (CWE) super.removeRepetition(6, rep);
294     }
295 
296 
297     /**
298      * Removes a repetition of
299      * GP2-6: "OCE Edit Code" at a specific index
300      *
301      * @param rep The repetition index (0-indexed)
302      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
303      */
304     public CWE removeGp26_OCEEditCode(int rep) throws HL7Exception { 
305         return (CWE) super.removeRepetition(6, rep);
306     }
307 
308 
309 
310 
311     /**
312      * Returns
313      * GP2-7: "Ambulatory Payment Classification Code" - creates it if necessary
314      */
315     public CWE getAmbulatoryPaymentClassificationCode() { 
316 		CWE retVal = this.getTypedField(7, 0);
317 		return retVal;
318     }
319     
320     /**
321      * Returns
322      * GP2-7: "Ambulatory Payment Classification Code" - creates it if necessary
323      */
324     public CWE getGp27_AmbulatoryPaymentClassificationCode() { 
325 		CWE retVal = this.getTypedField(7, 0);
326 		return retVal;
327     }
328 
329 
330     /**
331      * Returns all repetitions of Modifier Edit Code (GP2-8).
332      */
333     public CWE[] getModifierEditCode() {
334     	CWE[] retVal = this.getTypedField(8, new CWE[0]);
335     	return retVal;
336     }
337 
338 
339     /**
340      * Returns all repetitions of Modifier Edit Code (GP2-8).
341      */
342     public CWE[] getGp28_ModifierEditCode() {
343     	CWE[] retVal = this.getTypedField(8, new CWE[0]);
344     	return retVal;
345     }
346 
347 
348     /**
349      * Returns a count of the current number of repetitions of Modifier Edit Code (GP2-8).
350      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
351      * it will return zero.
352      */
353     public int getModifierEditCodeReps() {
354     	return this.getReps(8);
355     }
356 
357 
358     /**
359      * Returns a specific repetition of
360      * GP2-8: "Modifier Edit Code" - creates it if necessary
361      *
362      * @param rep The repetition index (0-indexed)
363      */
364     public CWE getModifierEditCode(int rep) { 
365 		CWE retVal = this.getTypedField(8, rep);
366 		return retVal;
367     }
368 
369     /**
370      * Returns a specific repetition of
371      * GP2-8: "Modifier Edit Code" - creates it if necessary
372      *
373      * @param rep The repetition index (0-indexed)
374      */
375     public CWE getGp28_ModifierEditCode(int rep) { 
376 		CWE retVal = this.getTypedField(8, rep);
377 		return retVal;
378     }
379 
380     /**
381      * Returns a count of the current number of repetitions of Modifier Edit Code (GP2-8).
382      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
383      * it will return zero.
384      */
385     public int getGp28_ModifierEditCodeReps() {
386     	return this.getReps(8);
387     }
388 
389 
390     /**
391      * Inserts a repetition of
392      * GP2-8: "Modifier Edit Code" at a specific index
393      *
394      * @param rep The repetition index (0-indexed)
395      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
396      */
397     public CWE insertModifierEditCode(int rep) throws HL7Exception { 
398         return (CWE) super.insertRepetition(8, rep);
399     }
400 
401 
402     /**
403      * Inserts a repetition of
404      * GP2-8: "Modifier Edit Code" at a specific index
405      *
406      * @param rep The repetition index (0-indexed)
407      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
408      */
409     public CWE insertGp28_ModifierEditCode(int rep) throws HL7Exception { 
410         return (CWE) super.insertRepetition(8, rep);
411     }
412 
413 
414     /**
415      * Removes a repetition of
416      * GP2-8: "Modifier Edit Code" at a specific index
417      *
418      * @param rep The repetition index (0-indexed)
419      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
420      */
421     public CWE removeModifierEditCode(int rep) throws HL7Exception { 
422         return (CWE) super.removeRepetition(8, rep);
423     }
424 
425 
426     /**
427      * Removes a repetition of
428      * GP2-8: "Modifier Edit Code" at a specific index
429      *
430      * @param rep The repetition index (0-indexed)
431      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
432      */
433     public CWE removeGp28_ModifierEditCode(int rep) throws HL7Exception { 
434         return (CWE) super.removeRepetition(8, rep);
435     }
436 
437 
438 
439 
440     /**
441      * Returns
442      * GP2-9: "Payment Adjustment Code" - creates it if necessary
443      */
444     public CWE getPaymentAdjustmentCode() { 
445 		CWE retVal = this.getTypedField(9, 0);
446 		return retVal;
447     }
448     
449     /**
450      * Returns
451      * GP2-9: "Payment Adjustment Code" - creates it if necessary
452      */
453     public CWE getGp29_PaymentAdjustmentCode() { 
454 		CWE retVal = this.getTypedField(9, 0);
455 		return retVal;
456     }
457 
458 
459 
460     /**
461      * Returns
462      * GP2-10: "Packaging Status Code" - creates it if necessary
463      */
464     public CWE getPackagingStatusCode() { 
465 		CWE retVal = this.getTypedField(10, 0);
466 		return retVal;
467     }
468     
469     /**
470      * Returns
471      * GP2-10: "Packaging Status Code" - creates it if necessary
472      */
473     public CWE getGp210_PackagingStatusCode() { 
474 		CWE retVal = this.getTypedField(10, 0);
475 		return retVal;
476     }
477 
478 
479 
480     /**
481      * Returns
482      * GP2-11: "Expected CMS Payment Amount" - creates it if necessary
483      */
484     public CP getExpectedCMSPaymentAmount() { 
485 		CP retVal = this.getTypedField(11, 0);
486 		return retVal;
487     }
488     
489     /**
490      * Returns
491      * GP2-11: "Expected CMS Payment Amount" - creates it if necessary
492      */
493     public CP getGp211_ExpectedCMSPaymentAmount() { 
494 		CP retVal = this.getTypedField(11, 0);
495 		return retVal;
496     }
497 
498 
499 
500     /**
501      * Returns
502      * GP2-12: "Reimbursement Type Code" - creates it if necessary
503      */
504     public CWE getReimbursementTypeCode() { 
505 		CWE retVal = this.getTypedField(12, 0);
506 		return retVal;
507     }
508     
509     /**
510      * Returns
511      * GP2-12: "Reimbursement Type Code" - creates it if necessary
512      */
513     public CWE getGp212_ReimbursementTypeCode() { 
514 		CWE retVal = this.getTypedField(12, 0);
515 		return retVal;
516     }
517 
518 
519 
520     /**
521      * Returns
522      * GP2-13: "Co-Pay Amount" - creates it if necessary
523      */
524     public CP getCoPayAmount() { 
525 		CP retVal = this.getTypedField(13, 0);
526 		return retVal;
527     }
528     
529     /**
530      * Returns
531      * GP2-13: "Co-Pay Amount" - creates it if necessary
532      */
533     public CP getGp213_CoPayAmount() { 
534 		CP retVal = this.getTypedField(13, 0);
535 		return retVal;
536     }
537 
538 
539 
540     /**
541      * Returns
542      * GP2-14: "Pay Rate per Service Unit" - creates it if necessary
543      */
544     public NM getPayRatePerServiceUnit() { 
545 		NM retVal = this.getTypedField(14, 0);
546 		return retVal;
547     }
548     
549     /**
550      * Returns
551      * GP2-14: "Pay Rate per Service Unit" - creates it if necessary
552      */
553     public NM getGp214_PayRatePerServiceUnit() { 
554 		NM retVal = this.getTypedField(14, 0);
555 		return retVal;
556     }
557 
558 
559 
560 
561 
562     /** {@inheritDoc} */   
563     protected Type createNewTypeWithoutReflection(int field) {
564        switch (field) {
565           case 0: return new CWE(getMessage());
566           case 1: return new NM(getMessage());
567           case 2: return new CP(getMessage());
568           case 3: return new CWE(getMessage());
569           case 4: return new CWE(getMessage());
570           case 5: return new CWE(getMessage());
571           case 6: return new CWE(getMessage());
572           case 7: return new CWE(getMessage());
573           case 8: return new CWE(getMessage());
574           case 9: return new CWE(getMessage());
575           case 10: return new CP(getMessage());
576           case 11: return new CWE(getMessage());
577           case 12: return new CP(getMessage());
578           case 13: return new NM(getMessage());
579           default: return null;
580        }
581    }
582 
583 
584 }
585