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    
008    package ca.uhn.hl7v2.model.v24.segment;
009    
010    // import ca.uhn.hl7v2.model.v24.group.*;
011    import ca.uhn.hl7v2.model.v24.datatype.*;
012    import ca.uhn.log.HapiLogFactory;
013    import ca.uhn.hl7v2.HL7Exception;
014    import ca.uhn.hl7v2.parser.ModelClassFactory;
015    import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
016    import ca.uhn.hl7v2.model.AbstractMessage;
017    import ca.uhn.hl7v2.model.Group;
018    import ca.uhn.hl7v2.model.Type;
019    import ca.uhn.hl7v2.model.AbstractSegment;
020    import ca.uhn.hl7v2.model.Varies;
021    
022    /**
023     *<p>Represents an HL7 GP2 message segment (Grouping/Reimbursement - Procedure Line Item). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>GP2-1: Revenue Code (IS) <b>optional </b>
027         * <li>GP2-2: Number of Service Units (NM) <b>optional </b>
028         * <li>GP2-3: Charge (CP) <b>optional </b>
029         * <li>GP2-4: Reimbursement Action Code (IS) <b>optional </b>
030         * <li>GP2-5: Denial or Rejection Code (IS) <b>optional </b>
031         * <li>GP2-6: OCE Edit Code (IS) <b>optional repeating</b>
032         * <li>GP2-7: Ambulatory Payment Classification Code (CE) <b>optional </b>
033         * <li>GP2-8: Modifier Edit Code (IS) <b>optional repeating</b>
034         * <li>GP2-9: Payment Adjustment Code (IS) <b>optional </b>
035         * <li>GP2-10: Packaging Status Code (IS) <b>optional </b>
036         * <li>GP2-11: Expected HCFA Payment Amount (CP) <b>optional </b>
037         * <li>GP2-12: Reimbursement Type Code (IS) <b>optional </b>
038         * <li>GP2-13: Co-Pay Amount (CP) <b>optional </b>
039         * <li>GP2-14: Pay Rate per Unit (NM) <b>optional </b>
040     * </ul>
041     */
042    public class GP2 extends AbstractSegment {
043    
044        /** 
045         * Creates a new GP2 segment
046         */
047        public GP2(Group parent, ModelClassFactory factory) {
048           super(parent, factory);
049           init(factory);
050        }
051    
052        private void init(ModelClassFactory factory) {
053           try {
054                                      this.add(IS.class, false, 1, 3, new Object[]{ getMessage() }, "Revenue Code");
055                                      this.add(NM.class, false, 1, 7, new Object[]{ getMessage(), new Integer(0) }, "Number of Service Units");
056                                      this.add(CP.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Charge");
057                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Reimbursement Action Code");
058                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Denial or Rejection Code");
059                                      this.add(IS.class, false, 0, 3, new Object[]{ getMessage() }, "OCE Edit Code");
060                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(466) }, "Ambulatory Payment Classification Code");
061                                      this.add(IS.class, false, 0, 1, new Object[]{ getMessage() }, "Modifier Edit Code");
062                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Payment Adjustment Code");
063                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Packaging Status Code");
064                                      this.add(CP.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Expected HCFA Payment Amount");
065                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Reimbursement Type Code");
066                                      this.add(CP.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Co-Pay Amount");
067                                      this.add(NM.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Pay Rate per Unit");
068           } catch(HL7Exception e) {
069              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating GP2 - this is probably a bug in the source code generator.", e);
070           }
071        }
072    
073    
074    
075        /**
076         * Returns
077         * GP2-1: "Revenue Code" - creates it if necessary
078         */
079        public IS getRevenueCode() { 
080            IS ret = null;
081            try {
082                Type t = this.getField(1, 0);
083                ret = (IS)t;
084            } catch (ClassCastException cce) {
085                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
086                throw new RuntimeException(cce);
087            } catch (HL7Exception he) {
088                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
089                throw new RuntimeException(he);
090            }
091            return ret;
092        }
093    
094    
095        /**
096         * Returns
097         * GP2-1: "Revenue Code" - creates it if necessary
098         */
099        public IS getGp21_RevenueCode() { 
100            IS ret = null;
101            try {
102                Type t = this.getField(1, 0);
103                ret = (IS)t;
104            } catch (ClassCastException cce) {
105                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
106                throw new RuntimeException(cce);
107            } catch (HL7Exception he) {
108                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
109                throw new RuntimeException(he);
110            }
111            return ret;
112        }
113    
114    
115    
116        /**
117         * Returns
118         * GP2-2: "Number of Service Units" - creates it if necessary
119         */
120        public NM getNumberOfServiceUnits() { 
121            NM ret = null;
122            try {
123                Type t = this.getField(2, 0);
124                ret = (NM)t;
125            } catch (ClassCastException cce) {
126                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
127                throw new RuntimeException(cce);
128            } catch (HL7Exception he) {
129                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
130                throw new RuntimeException(he);
131            }
132            return ret;
133        }
134    
135    
136        /**
137         * Returns
138         * GP2-2: "Number of Service Units" - creates it if necessary
139         */
140        public NM getGp22_NumberOfServiceUnits() { 
141            NM ret = null;
142            try {
143                Type t = this.getField(2, 0);
144                ret = (NM)t;
145            } catch (ClassCastException cce) {
146                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
147                throw new RuntimeException(cce);
148            } catch (HL7Exception he) {
149                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
150                throw new RuntimeException(he);
151            }
152            return ret;
153        }
154    
155    
156    
157        /**
158         * Returns
159         * GP2-3: "Charge" - creates it if necessary
160         */
161        public CP getCharge() { 
162            CP ret = null;
163            try {
164                Type t = this.getField(3, 0);
165                ret = (CP)t;
166            } catch (ClassCastException cce) {
167                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
168                throw new RuntimeException(cce);
169            } catch (HL7Exception he) {
170                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
171                throw new RuntimeException(he);
172            }
173            return ret;
174        }
175    
176    
177        /**
178         * Returns
179         * GP2-3: "Charge" - creates it if necessary
180         */
181        public CP getGp23_Charge() { 
182            CP ret = null;
183            try {
184                Type t = this.getField(3, 0);
185                ret = (CP)t;
186            } catch (ClassCastException cce) {
187                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
188                throw new RuntimeException(cce);
189            } catch (HL7Exception he) {
190                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
191                throw new RuntimeException(he);
192            }
193            return ret;
194        }
195    
196    
197    
198        /**
199         * Returns
200         * GP2-4: "Reimbursement Action Code" - creates it if necessary
201         */
202        public IS getReimbursementActionCode() { 
203            IS ret = null;
204            try {
205                Type t = this.getField(4, 0);
206                ret = (IS)t;
207            } catch (ClassCastException cce) {
208                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
209                throw new RuntimeException(cce);
210            } catch (HL7Exception he) {
211                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
212                throw new RuntimeException(he);
213            }
214            return ret;
215        }
216    
217    
218        /**
219         * Returns
220         * GP2-4: "Reimbursement Action Code" - creates it if necessary
221         */
222        public IS getGp24_ReimbursementActionCode() { 
223            IS ret = null;
224            try {
225                Type t = this.getField(4, 0);
226                ret = (IS)t;
227            } catch (ClassCastException cce) {
228                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
229                throw new RuntimeException(cce);
230            } catch (HL7Exception he) {
231                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
232                throw new RuntimeException(he);
233            }
234            return ret;
235        }
236    
237    
238    
239        /**
240         * Returns
241         * GP2-5: "Denial or Rejection Code" - creates it if necessary
242         */
243        public IS getDenialOrRejectionCode() { 
244            IS ret = null;
245            try {
246                Type t = this.getField(5, 0);
247                ret = (IS)t;
248            } catch (ClassCastException cce) {
249                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
250                throw new RuntimeException(cce);
251            } catch (HL7Exception he) {
252                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
253                throw new RuntimeException(he);
254            }
255            return ret;
256        }
257    
258    
259        /**
260         * Returns
261         * GP2-5: "Denial or Rejection Code" - creates it if necessary
262         */
263        public IS getGp25_DenialOrRejectionCode() { 
264            IS ret = null;
265            try {
266                Type t = this.getField(5, 0);
267                ret = (IS)t;
268            } catch (ClassCastException cce) {
269                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
270                throw new RuntimeException(cce);
271            } catch (HL7Exception he) {
272                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
273                throw new RuntimeException(he);
274            }
275            return ret;
276        }
277    
278    
279        /**
280         * Returns all repetitions of OCE Edit Code (GP2-6).
281         */
282        public IS[] getOCEEditCode() {
283            IS[] ret = null;
284            try {
285                Type[] t = this.getField(6);  
286                ret = new IS[t.length];
287                for (int i = 0; i < ret.length; i++) {
288                    ret[i] = (IS)t[i];
289                }
290            } catch (ClassCastException cce) {
291                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
292                throw new RuntimeException(cce);
293            } catch (HL7Exception he) {
294                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
295                throw new RuntimeException(he);
296            }
297            return ret;
298        }
299    
300    
301        /**
302         * Returns a count of the current number of repetitions of OCE Edit Code (GP2-6).
303         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
304         * it will return zero.
305         */
306        public int getOCEEditCodeReps() {
307            IS[] ret = null;
308            try {
309                Type[] t = this.getField(6);
310                return t.length;  
311            } catch (ClassCastException cce) {
312                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
313                throw new RuntimeException(cce);
314            } catch (HL7Exception he) {
315                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
316                throw new RuntimeException(he);
317            }
318        }
319    
320    
321        /**
322         * Returns a specific repetition of
323         * GP2-6: "OCE Edit Code" - creates it if necessary
324         *
325         * @param rep The repetition index (0-indexed)
326         */
327        public IS getOCEEditCode(int rep) { 
328            IS ret = null;
329            try {
330                Type t = this.getField(6, rep);
331                ret = (IS)t;
332            } catch (ClassCastException cce) {
333                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
334                throw new RuntimeException(cce);
335            } catch (HL7Exception he) {
336                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
337                throw new RuntimeException(he);
338            }
339            return ret;
340        }
341    
342        /**
343         * Returns a specific repetition of
344         * GP2-6: "OCE Edit Code" - creates it if necessary
345         *
346         * @param rep The repetition index (0-indexed)
347         */
348        public IS getGp26_OCEEditCode(int rep) { 
349            IS ret = null;
350            try {
351                Type t = this.getField(6, rep);
352                ret = (IS)t;
353            } catch (ClassCastException cce) {
354                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
355                throw new RuntimeException(cce);
356            } catch (HL7Exception he) {
357                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
358                throw new RuntimeException(he);
359            }
360            return ret;
361        }
362    
363    
364        /**
365         * Returns a count of the current number of repetitions of OCE Edit Code (GP2-6).
366         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
367         * it will return zero.
368         */
369        public int getGp26_OCEEditCodeReps() {
370            IS[] ret = null;
371            try {
372                Type[] t = this.getField(6);
373                return t.length;  
374            } catch (ClassCastException cce) {
375                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
376                throw new RuntimeException(cce);
377            } catch (HL7Exception he) {
378                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
379                throw new RuntimeException(he);
380            }
381        }
382    
383    
384    
385        /**
386         * Inserts a repetition of
387         * GP2-6: "OCE Edit Code" at a specific index
388         *
389         * @param rep The repetition index (0-indexed)
390         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
391         */
392        public IS insertOCEEditCode(int rep) throws HL7Exception { 
393            return (IS) super.insertRepetition(6, rep);
394        }
395    
396    
397    
398        /**
399         * Inserts a repetition of
400         * GP2-6: "OCE Edit Code" at a specific index
401         *
402         * @param rep The repetition index (0-indexed)
403         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
404         */
405        public IS insertGp26_OCEEditCode(int rep) throws HL7Exception { 
406            return (IS) super.insertRepetition(6, rep);
407        }
408    
409    
410        /**
411         * Removes a repetition of
412         * GP2-6: "OCE Edit Code" at a specific index
413         *
414         * @param rep The repetition index (0-indexed)
415         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
416         */
417        public IS removeOCEEditCode(int rep) throws HL7Exception { 
418            return (IS) super.removeRepetition(6, rep);
419        }
420    
421    
422        /**
423         * Removes a repetition of
424         * GP2-6: "OCE Edit Code" at a specific index
425         *
426         * @param rep The repetition index (0-indexed)
427         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
428         */
429        public IS removeGp26_OCEEditCode(int rep) throws HL7Exception { 
430            return (IS) super.removeRepetition(6, rep);
431        }
432    
433    
434    
435    
436        /**
437         * Returns
438         * GP2-7: "Ambulatory Payment Classification Code" - creates it if necessary
439         */
440        public CE getAmbulatoryPaymentClassificationCode() { 
441            CE ret = null;
442            try {
443                Type t = this.getField(7, 0);
444                ret = (CE)t;
445            } catch (ClassCastException cce) {
446                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
447                throw new RuntimeException(cce);
448            } catch (HL7Exception he) {
449                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
450                throw new RuntimeException(he);
451            }
452            return ret;
453        }
454    
455    
456        /**
457         * Returns
458         * GP2-7: "Ambulatory Payment Classification Code" - creates it if necessary
459         */
460        public CE getGp27_AmbulatoryPaymentClassificationCode() { 
461            CE ret = null;
462            try {
463                Type t = this.getField(7, 0);
464                ret = (CE)t;
465            } catch (ClassCastException cce) {
466                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
467                throw new RuntimeException(cce);
468            } catch (HL7Exception he) {
469                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
470                throw new RuntimeException(he);
471            }
472            return ret;
473        }
474    
475    
476        /**
477         * Returns all repetitions of Modifier Edit Code (GP2-8).
478         */
479        public IS[] getModifierEditCode() {
480            IS[] ret = null;
481            try {
482                Type[] t = this.getField(8);  
483                ret = new IS[t.length];
484                for (int i = 0; i < ret.length; i++) {
485                    ret[i] = (IS)t[i];
486                }
487            } catch (ClassCastException cce) {
488                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
489                throw new RuntimeException(cce);
490            } catch (HL7Exception he) {
491                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
492                throw new RuntimeException(he);
493            }
494            return ret;
495        }
496    
497    
498        /**
499         * Returns a count of the current number of repetitions of Modifier Edit Code (GP2-8).
500         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
501         * it will return zero.
502         */
503        public int getModifierEditCodeReps() {
504            IS[] ret = null;
505            try {
506                Type[] t = this.getField(8);
507                return t.length;  
508            } catch (ClassCastException cce) {
509                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
510                throw new RuntimeException(cce);
511            } catch (HL7Exception he) {
512                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
513                throw new RuntimeException(he);
514            }
515        }
516    
517    
518        /**
519         * Returns a specific repetition of
520         * GP2-8: "Modifier Edit Code" - creates it if necessary
521         *
522         * @param rep The repetition index (0-indexed)
523         */
524        public IS getModifierEditCode(int rep) { 
525            IS ret = null;
526            try {
527                Type t = this.getField(8, rep);
528                ret = (IS)t;
529            } catch (ClassCastException cce) {
530                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
531                throw new RuntimeException(cce);
532            } catch (HL7Exception he) {
533                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
534                throw new RuntimeException(he);
535            }
536            return ret;
537        }
538    
539        /**
540         * Returns a specific repetition of
541         * GP2-8: "Modifier Edit Code" - creates it if necessary
542         *
543         * @param rep The repetition index (0-indexed)
544         */
545        public IS getGp28_ModifierEditCode(int rep) { 
546            IS ret = null;
547            try {
548                Type t = this.getField(8, rep);
549                ret = (IS)t;
550            } catch (ClassCastException cce) {
551                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
552                throw new RuntimeException(cce);
553            } catch (HL7Exception he) {
554                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
555                throw new RuntimeException(he);
556            }
557            return ret;
558        }
559    
560    
561        /**
562         * Returns a count of the current number of repetitions of Modifier Edit Code (GP2-8).
563         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
564         * it will return zero.
565         */
566        public int getGp28_ModifierEditCodeReps() {
567            IS[] ret = null;
568            try {
569                Type[] t = this.getField(8);
570                return t.length;  
571            } catch (ClassCastException cce) {
572                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
573                throw new RuntimeException(cce);
574            } catch (HL7Exception he) {
575                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
576                throw new RuntimeException(he);
577            }
578        }
579    
580    
581    
582        /**
583         * Inserts a repetition of
584         * GP2-8: "Modifier Edit Code" at a specific index
585         *
586         * @param rep The repetition index (0-indexed)
587         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
588         */
589        public IS insertModifierEditCode(int rep) throws HL7Exception { 
590            return (IS) super.insertRepetition(8, rep);
591        }
592    
593    
594    
595        /**
596         * Inserts a repetition of
597         * GP2-8: "Modifier Edit Code" at a specific index
598         *
599         * @param rep The repetition index (0-indexed)
600         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
601         */
602        public IS insertGp28_ModifierEditCode(int rep) throws HL7Exception { 
603            return (IS) super.insertRepetition(8, rep);
604        }
605    
606    
607        /**
608         * Removes a repetition of
609         * GP2-8: "Modifier Edit Code" at a specific index
610         *
611         * @param rep The repetition index (0-indexed)
612         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
613         */
614        public IS removeModifierEditCode(int rep) throws HL7Exception { 
615            return (IS) super.removeRepetition(8, rep);
616        }
617    
618    
619        /**
620         * Removes a repetition of
621         * GP2-8: "Modifier Edit Code" at a specific index
622         *
623         * @param rep The repetition index (0-indexed)
624         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
625         */
626        public IS removeGp28_ModifierEditCode(int rep) throws HL7Exception { 
627            return (IS) super.removeRepetition(8, rep);
628        }
629    
630    
631    
632    
633        /**
634         * Returns
635         * GP2-9: "Payment Adjustment Code" - creates it if necessary
636         */
637        public IS getPaymentAdjustmentCode() { 
638            IS ret = null;
639            try {
640                Type t = this.getField(9, 0);
641                ret = (IS)t;
642            } catch (ClassCastException cce) {
643                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
644                throw new RuntimeException(cce);
645            } catch (HL7Exception he) {
646                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
647                throw new RuntimeException(he);
648            }
649            return ret;
650        }
651    
652    
653        /**
654         * Returns
655         * GP2-9: "Payment Adjustment Code" - creates it if necessary
656         */
657        public IS getGp29_PaymentAdjustmentCode() { 
658            IS ret = null;
659            try {
660                Type t = this.getField(9, 0);
661                ret = (IS)t;
662            } catch (ClassCastException cce) {
663                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
664                throw new RuntimeException(cce);
665            } catch (HL7Exception he) {
666                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
667                throw new RuntimeException(he);
668            }
669            return ret;
670        }
671    
672    
673    
674        /**
675         * Returns
676         * GP2-10: "Packaging Status Code" - creates it if necessary
677         */
678        public IS getPackagingStatusCode() { 
679            IS ret = null;
680            try {
681                Type t = this.getField(10, 0);
682                ret = (IS)t;
683            } catch (ClassCastException cce) {
684                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
685                throw new RuntimeException(cce);
686            } catch (HL7Exception he) {
687                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
688                throw new RuntimeException(he);
689            }
690            return ret;
691        }
692    
693    
694        /**
695         * Returns
696         * GP2-10: "Packaging Status Code" - creates it if necessary
697         */
698        public IS getGp210_PackagingStatusCode() { 
699            IS ret = null;
700            try {
701                Type t = this.getField(10, 0);
702                ret = (IS)t;
703            } catch (ClassCastException cce) {
704                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
705                throw new RuntimeException(cce);
706            } catch (HL7Exception he) {
707                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
708                throw new RuntimeException(he);
709            }
710            return ret;
711        }
712    
713    
714    
715        /**
716         * Returns
717         * GP2-11: "Expected HCFA Payment Amount" - creates it if necessary
718         */
719        public CP getExpectedHCFAPaymentAmount() { 
720            CP ret = null;
721            try {
722                Type t = this.getField(11, 0);
723                ret = (CP)t;
724            } catch (ClassCastException cce) {
725                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
726                throw new RuntimeException(cce);
727            } catch (HL7Exception he) {
728                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
729                throw new RuntimeException(he);
730            }
731            return ret;
732        }
733    
734    
735        /**
736         * Returns
737         * GP2-11: "Expected HCFA Payment Amount" - creates it if necessary
738         */
739        public CP getGp211_ExpectedHCFAPaymentAmount() { 
740            CP ret = null;
741            try {
742                Type t = this.getField(11, 0);
743                ret = (CP)t;
744            } catch (ClassCastException cce) {
745                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
746                throw new RuntimeException(cce);
747            } catch (HL7Exception he) {
748                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
749                throw new RuntimeException(he);
750            }
751            return ret;
752        }
753    
754    
755    
756        /**
757         * Returns
758         * GP2-12: "Reimbursement Type Code" - creates it if necessary
759         */
760        public IS getReimbursementTypeCode() { 
761            IS ret = null;
762            try {
763                Type t = this.getField(12, 0);
764                ret = (IS)t;
765            } catch (ClassCastException cce) {
766                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
767                throw new RuntimeException(cce);
768            } catch (HL7Exception he) {
769                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
770                throw new RuntimeException(he);
771            }
772            return ret;
773        }
774    
775    
776        /**
777         * Returns
778         * GP2-12: "Reimbursement Type Code" - creates it if necessary
779         */
780        public IS getGp212_ReimbursementTypeCode() { 
781            IS ret = null;
782            try {
783                Type t = this.getField(12, 0);
784                ret = (IS)t;
785            } catch (ClassCastException cce) {
786                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
787                throw new RuntimeException(cce);
788            } catch (HL7Exception he) {
789                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
790                throw new RuntimeException(he);
791            }
792            return ret;
793        }
794    
795    
796    
797        /**
798         * Returns
799         * GP2-13: "Co-Pay Amount" - creates it if necessary
800         */
801        public CP getCoPayAmount() { 
802            CP ret = null;
803            try {
804                Type t = this.getField(13, 0);
805                ret = (CP)t;
806            } catch (ClassCastException cce) {
807                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
808                throw new RuntimeException(cce);
809            } catch (HL7Exception he) {
810                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
811                throw new RuntimeException(he);
812            }
813            return ret;
814        }
815    
816    
817        /**
818         * Returns
819         * GP2-13: "Co-Pay Amount" - creates it if necessary
820         */
821        public CP getGp213_CoPayAmount() { 
822            CP ret = null;
823            try {
824                Type t = this.getField(13, 0);
825                ret = (CP)t;
826            } catch (ClassCastException cce) {
827                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
828                throw new RuntimeException(cce);
829            } catch (HL7Exception he) {
830                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
831                throw new RuntimeException(he);
832            }
833            return ret;
834        }
835    
836    
837    
838        /**
839         * Returns
840         * GP2-14: "Pay Rate per Unit" - creates it if necessary
841         */
842        public NM getPayRatePerUnit() { 
843            NM ret = null;
844            try {
845                Type t = this.getField(14, 0);
846                ret = (NM)t;
847            } catch (ClassCastException cce) {
848                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
849                throw new RuntimeException(cce);
850            } catch (HL7Exception he) {
851                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
852                throw new RuntimeException(he);
853            }
854            return ret;
855        }
856    
857    
858        /**
859         * Returns
860         * GP2-14: "Pay Rate per Unit" - creates it if necessary
861         */
862        public NM getGp214_PayRatePerUnit() { 
863            NM ret = null;
864            try {
865                Type t = this.getField(14, 0);
866                ret = (NM)t;
867            } catch (ClassCastException cce) {
868                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
869                throw new RuntimeException(cce);
870            } catch (HL7Exception he) {
871                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
872                throw new RuntimeException(he);
873            }
874            return ret;
875        }
876    
877    
878    
879    
880    
881        /** {@inheritDoc} */   
882        protected Type createNewTypeWithoutReflection(int field) {
883           switch (field) {
884              case 0: return new IS(getMessage(), new Integer( 456 ));
885              case 1: return new NM(getMessage());
886              case 2: return new CP(getMessage());
887              case 3: return new IS(getMessage(), new Integer( 459 ));
888              case 4: return new IS(getMessage(), new Integer( 460 ));
889              case 5: return new IS(getMessage(), new Integer( 458 ));
890              case 6: return new CE(getMessage());
891              case 7: return new IS(getMessage(), new Integer( 467 ));
892              case 8: return new IS(getMessage(), new Integer( 468 ));
893              case 9: return new IS(getMessage(), new Integer( 469 ));
894              case 10: return new CP(getMessage());
895              case 11: return new IS(getMessage(), new Integer( 470 ));
896              case 12: return new CP(getMessage());
897              case 13: return new NM(getMessage());
898              default: return null;
899           }
900       }
901    
902    
903    }
904