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 FT1 message segment (Financial Transaction). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>FT1-1: Set ID - FT1 (SI) <b>optional </b>
027         * <li>FT1-2: Transaction ID (ST) <b>optional </b>
028         * <li>FT1-3: Transaction Batch ID (ST) <b>optional </b>
029         * <li>FT1-4: Transaction Date (TS) <b> </b>
030         * <li>FT1-5: Transaction Posting Date (TS) <b>optional </b>
031         * <li>FT1-6: Transaction Type (IS) <b> </b>
032         * <li>FT1-7: Transaction Code (CE) <b> </b>
033         * <li>FT1-8: Transaction Description (ST) <b>optional </b>
034         * <li>FT1-9: Transaction Description - Alt (ST) <b>optional </b>
035         * <li>FT1-10: Transaction Quantity (NM) <b>optional </b>
036         * <li>FT1-11: Transaction Amount - Extended (CP) <b>optional </b>
037         * <li>FT1-12: Transaction Amount - Unit (CP) <b>optional </b>
038         * <li>FT1-13: Department Code (CE) <b>optional </b>
039         * <li>FT1-14: Insurance Plan ID (CE) <b>optional </b>
040         * <li>FT1-15: Insurance Amount (CP) <b>optional </b>
041         * <li>FT1-16: Assigned Patient Location (PL) <b>optional </b>
042         * <li>FT1-17: Fee Schedule (IS) <b>optional </b>
043         * <li>FT1-18: Patient Type (IS) <b>optional </b>
044         * <li>FT1-19: Diagnosis Code - FT1 (CE) <b>optional repeating</b>
045         * <li>FT1-20: Performed By Code (XCN) <b>optional repeating</b>
046         * <li>FT1-21: Ordered By Code (XCN) <b>optional repeating</b>
047         * <li>FT1-22: Unit Cost (CP) <b>optional </b>
048         * <li>FT1-23: Filler Order Number (EI) <b>optional </b>
049         * <li>FT1-24: Entered By Code (XCN) <b>optional repeating</b>
050         * <li>FT1-25: Procedure Code (CE) <b>optional </b>
051         * <li>FT1-26: Procedure Code Modifier (CE) <b>optional repeating</b>
052     * </ul>
053     */
054    public class FT1 extends AbstractSegment {
055    
056        /** 
057         * Creates a new FT1 segment
058         */
059        public FT1(Group parent, ModelClassFactory factory) {
060           super(parent, factory);
061           init(factory);
062        }
063    
064        private void init(ModelClassFactory factory) {
065           try {
066                                      this.add(SI.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Set ID - FT1");
067                                      this.add(ST.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Transaction ID");
068                                      this.add(ST.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "Transaction Batch ID");
069                                      this.add(TS.class, true, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Transaction Date");
070                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Transaction Posting Date");
071                                      this.add(IS.class, true, 1, 8, new Object[]{ getMessage() }, "Transaction Type");
072                                      this.add(CE.class, true, 1, 250, new Object[]{ getMessage(), new Integer(132) }, "Transaction Code");
073                                      this.add(ST.class, false, 1, 40, new Object[]{ getMessage(), new Integer(0) }, "Transaction Description");
074                                      this.add(ST.class, false, 1, 40, new Object[]{ getMessage(), new Integer(0) }, "Transaction Description - Alt");
075                                      this.add(NM.class, false, 1, 6, new Object[]{ getMessage(), new Integer(0) }, "Transaction Quantity");
076                                      this.add(CP.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Transaction Amount - Extended");
077                                      this.add(CP.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Transaction Amount - Unit");
078                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(49) }, "Department Code");
079                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(72) }, "Insurance Plan ID");
080                                      this.add(CP.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Insurance Amount");
081                                      this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "Assigned Patient Location");
082                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Fee Schedule");
083                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Patient Type");
084                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(51) }, "Diagnosis Code - FT1");
085                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(84) }, "Performed By Code");
086                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Ordered By Code");
087                                      this.add(CP.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Unit Cost");
088                                      this.add(EI.class, false, 1, 22, new Object[]{ getMessage(), new Integer(0) }, "Filler Order Number");
089                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Entered By Code");
090                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(88) }, "Procedure Code");
091                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(340) }, "Procedure Code Modifier");
092           } catch(HL7Exception e) {
093              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating FT1 - this is probably a bug in the source code generator.", e);
094           }
095        }
096    
097    
098    
099        /**
100         * Returns
101         * FT1-1: "Set ID - FT1" - creates it if necessary
102         */
103        public SI getSetIDFT1() { 
104            SI ret = null;
105            try {
106                Type t = this.getField(1, 0);
107                ret = (SI)t;
108            } catch (ClassCastException cce) {
109                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
110                throw new RuntimeException(cce);
111            } catch (HL7Exception he) {
112                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
113                throw new RuntimeException(he);
114            }
115            return ret;
116        }
117    
118    
119        /**
120         * Returns
121         * FT1-1: "Set ID - FT1" - creates it if necessary
122         */
123        public SI getFt11_SetIDFT1() { 
124            SI ret = null;
125            try {
126                Type t = this.getField(1, 0);
127                ret = (SI)t;
128            } catch (ClassCastException cce) {
129                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
130                throw new RuntimeException(cce);
131            } catch (HL7Exception he) {
132                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
133                throw new RuntimeException(he);
134            }
135            return ret;
136        }
137    
138    
139    
140        /**
141         * Returns
142         * FT1-2: "Transaction ID" - creates it if necessary
143         */
144        public ST getTransactionID() { 
145            ST ret = null;
146            try {
147                Type t = this.getField(2, 0);
148                ret = (ST)t;
149            } catch (ClassCastException cce) {
150                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
151                throw new RuntimeException(cce);
152            } catch (HL7Exception he) {
153                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
154                throw new RuntimeException(he);
155            }
156            return ret;
157        }
158    
159    
160        /**
161         * Returns
162         * FT1-2: "Transaction ID" - creates it if necessary
163         */
164        public ST getFt12_TransactionID() { 
165            ST ret = null;
166            try {
167                Type t = this.getField(2, 0);
168                ret = (ST)t;
169            } catch (ClassCastException cce) {
170                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
171                throw new RuntimeException(cce);
172            } catch (HL7Exception he) {
173                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
174                throw new RuntimeException(he);
175            }
176            return ret;
177        }
178    
179    
180    
181        /**
182         * Returns
183         * FT1-3: "Transaction Batch ID" - creates it if necessary
184         */
185        public ST getTransactionBatchID() { 
186            ST ret = null;
187            try {
188                Type t = this.getField(3, 0);
189                ret = (ST)t;
190            } catch (ClassCastException cce) {
191                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
192                throw new RuntimeException(cce);
193            } catch (HL7Exception he) {
194                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
195                throw new RuntimeException(he);
196            }
197            return ret;
198        }
199    
200    
201        /**
202         * Returns
203         * FT1-3: "Transaction Batch ID" - creates it if necessary
204         */
205        public ST getFt13_TransactionBatchID() { 
206            ST ret = null;
207            try {
208                Type t = this.getField(3, 0);
209                ret = (ST)t;
210            } catch (ClassCastException cce) {
211                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
212                throw new RuntimeException(cce);
213            } catch (HL7Exception he) {
214                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
215                throw new RuntimeException(he);
216            }
217            return ret;
218        }
219    
220    
221    
222        /**
223         * Returns
224         * FT1-4: "Transaction Date" - creates it if necessary
225         */
226        public TS getTransactionDate() { 
227            TS ret = null;
228            try {
229                Type t = this.getField(4, 0);
230                ret = (TS)t;
231            } catch (ClassCastException cce) {
232                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
233                throw new RuntimeException(cce);
234            } catch (HL7Exception he) {
235                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
236                throw new RuntimeException(he);
237            }
238            return ret;
239        }
240    
241    
242        /**
243         * Returns
244         * FT1-4: "Transaction Date" - creates it if necessary
245         */
246        public TS getFt14_TransactionDate() { 
247            TS ret = null;
248            try {
249                Type t = this.getField(4, 0);
250                ret = (TS)t;
251            } catch (ClassCastException cce) {
252                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
253                throw new RuntimeException(cce);
254            } catch (HL7Exception he) {
255                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
256                throw new RuntimeException(he);
257            }
258            return ret;
259        }
260    
261    
262    
263        /**
264         * Returns
265         * FT1-5: "Transaction Posting Date" - creates it if necessary
266         */
267        public TS getTransactionPostingDate() { 
268            TS ret = null;
269            try {
270                Type t = this.getField(5, 0);
271                ret = (TS)t;
272            } catch (ClassCastException cce) {
273                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
274                throw new RuntimeException(cce);
275            } catch (HL7Exception he) {
276                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
277                throw new RuntimeException(he);
278            }
279            return ret;
280        }
281    
282    
283        /**
284         * Returns
285         * FT1-5: "Transaction Posting Date" - creates it if necessary
286         */
287        public TS getFt15_TransactionPostingDate() { 
288            TS ret = null;
289            try {
290                Type t = this.getField(5, 0);
291                ret = (TS)t;
292            } catch (ClassCastException cce) {
293                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
294                throw new RuntimeException(cce);
295            } catch (HL7Exception he) {
296                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
297                throw new RuntimeException(he);
298            }
299            return ret;
300        }
301    
302    
303    
304        /**
305         * Returns
306         * FT1-6: "Transaction Type" - creates it if necessary
307         */
308        public IS getTransactionType() { 
309            IS ret = null;
310            try {
311                Type t = this.getField(6, 0);
312                ret = (IS)t;
313            } catch (ClassCastException cce) {
314                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
315                throw new RuntimeException(cce);
316            } catch (HL7Exception he) {
317                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
318                throw new RuntimeException(he);
319            }
320            return ret;
321        }
322    
323    
324        /**
325         * Returns
326         * FT1-6: "Transaction Type" - creates it if necessary
327         */
328        public IS getFt16_TransactionType() { 
329            IS ret = null;
330            try {
331                Type t = this.getField(6, 0);
332                ret = (IS)t;
333            } catch (ClassCastException cce) {
334                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
335                throw new RuntimeException(cce);
336            } catch (HL7Exception he) {
337                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
338                throw new RuntimeException(he);
339            }
340            return ret;
341        }
342    
343    
344    
345        /**
346         * Returns
347         * FT1-7: "Transaction Code" - creates it if necessary
348         */
349        public CE getTransactionCode() { 
350            CE ret = null;
351            try {
352                Type t = this.getField(7, 0);
353                ret = (CE)t;
354            } catch (ClassCastException cce) {
355                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
356                throw new RuntimeException(cce);
357            } catch (HL7Exception he) {
358                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
359                throw new RuntimeException(he);
360            }
361            return ret;
362        }
363    
364    
365        /**
366         * Returns
367         * FT1-7: "Transaction Code" - creates it if necessary
368         */
369        public CE getFt17_TransactionCode() { 
370            CE ret = null;
371            try {
372                Type t = this.getField(7, 0);
373                ret = (CE)t;
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            return ret;
382        }
383    
384    
385    
386        /**
387         * Returns
388         * FT1-8: "Transaction Description" - creates it if necessary
389         */
390        public ST getTransactionDescription() { 
391            ST ret = null;
392            try {
393                Type t = this.getField(8, 0);
394                ret = (ST)t;
395            } catch (ClassCastException cce) {
396                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
397                throw new RuntimeException(cce);
398            } catch (HL7Exception he) {
399                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
400                throw new RuntimeException(he);
401            }
402            return ret;
403        }
404    
405    
406        /**
407         * Returns
408         * FT1-8: "Transaction Description" - creates it if necessary
409         */
410        public ST getFt18_TransactionDescription() { 
411            ST ret = null;
412            try {
413                Type t = this.getField(8, 0);
414                ret = (ST)t;
415            } catch (ClassCastException cce) {
416                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
417                throw new RuntimeException(cce);
418            } catch (HL7Exception he) {
419                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
420                throw new RuntimeException(he);
421            }
422            return ret;
423        }
424    
425    
426    
427        /**
428         * Returns
429         * FT1-9: "Transaction Description - Alt" - creates it if necessary
430         */
431        public ST getTransactionDescriptionAlt() { 
432            ST ret = null;
433            try {
434                Type t = this.getField(9, 0);
435                ret = (ST)t;
436            } catch (ClassCastException cce) {
437                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
438                throw new RuntimeException(cce);
439            } catch (HL7Exception he) {
440                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
441                throw new RuntimeException(he);
442            }
443            return ret;
444        }
445    
446    
447        /**
448         * Returns
449         * FT1-9: "Transaction Description - Alt" - creates it if necessary
450         */
451        public ST getFt19_TransactionDescriptionAlt() { 
452            ST ret = null;
453            try {
454                Type t = this.getField(9, 0);
455                ret = (ST)t;
456            } catch (ClassCastException cce) {
457                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
458                throw new RuntimeException(cce);
459            } catch (HL7Exception he) {
460                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
461                throw new RuntimeException(he);
462            }
463            return ret;
464        }
465    
466    
467    
468        /**
469         * Returns
470         * FT1-10: "Transaction Quantity" - creates it if necessary
471         */
472        public NM getTransactionQuantity() { 
473            NM ret = null;
474            try {
475                Type t = this.getField(10, 0);
476                ret = (NM)t;
477            } catch (ClassCastException cce) {
478                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
479                throw new RuntimeException(cce);
480            } catch (HL7Exception he) {
481                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
482                throw new RuntimeException(he);
483            }
484            return ret;
485        }
486    
487    
488        /**
489         * Returns
490         * FT1-10: "Transaction Quantity" - creates it if necessary
491         */
492        public NM getFt110_TransactionQuantity() { 
493            NM ret = null;
494            try {
495                Type t = this.getField(10, 0);
496                ret = (NM)t;
497            } catch (ClassCastException cce) {
498                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
499                throw new RuntimeException(cce);
500            } catch (HL7Exception he) {
501                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
502                throw new RuntimeException(he);
503            }
504            return ret;
505        }
506    
507    
508    
509        /**
510         * Returns
511         * FT1-11: "Transaction Amount - Extended" - creates it if necessary
512         */
513        public CP getTransactionAmountExtended() { 
514            CP ret = null;
515            try {
516                Type t = this.getField(11, 0);
517                ret = (CP)t;
518            } catch (ClassCastException cce) {
519                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
520                throw new RuntimeException(cce);
521            } catch (HL7Exception he) {
522                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
523                throw new RuntimeException(he);
524            }
525            return ret;
526        }
527    
528    
529        /**
530         * Returns
531         * FT1-11: "Transaction Amount - Extended" - creates it if necessary
532         */
533        public CP getFt111_TransactionAmountExtended() { 
534            CP ret = null;
535            try {
536                Type t = this.getField(11, 0);
537                ret = (CP)t;
538            } catch (ClassCastException cce) {
539                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
540                throw new RuntimeException(cce);
541            } catch (HL7Exception he) {
542                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
543                throw new RuntimeException(he);
544            }
545            return ret;
546        }
547    
548    
549    
550        /**
551         * Returns
552         * FT1-12: "Transaction Amount - Unit" - creates it if necessary
553         */
554        public CP getTransactionAmountUnit() { 
555            CP ret = null;
556            try {
557                Type t = this.getField(12, 0);
558                ret = (CP)t;
559            } catch (ClassCastException cce) {
560                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
561                throw new RuntimeException(cce);
562            } catch (HL7Exception he) {
563                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
564                throw new RuntimeException(he);
565            }
566            return ret;
567        }
568    
569    
570        /**
571         * Returns
572         * FT1-12: "Transaction Amount - Unit" - creates it if necessary
573         */
574        public CP getFt112_TransactionAmountUnit() { 
575            CP ret = null;
576            try {
577                Type t = this.getField(12, 0);
578                ret = (CP)t;
579            } catch (ClassCastException cce) {
580                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
581                throw new RuntimeException(cce);
582            } catch (HL7Exception he) {
583                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
584                throw new RuntimeException(he);
585            }
586            return ret;
587        }
588    
589    
590    
591        /**
592         * Returns
593         * FT1-13: "Department Code" - creates it if necessary
594         */
595        public CE getDepartmentCode() { 
596            CE ret = null;
597            try {
598                Type t = this.getField(13, 0);
599                ret = (CE)t;
600            } catch (ClassCastException cce) {
601                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
602                throw new RuntimeException(cce);
603            } catch (HL7Exception he) {
604                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
605                throw new RuntimeException(he);
606            }
607            return ret;
608        }
609    
610    
611        /**
612         * Returns
613         * FT1-13: "Department Code" - creates it if necessary
614         */
615        public CE getFt113_DepartmentCode() { 
616            CE ret = null;
617            try {
618                Type t = this.getField(13, 0);
619                ret = (CE)t;
620            } catch (ClassCastException cce) {
621                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
622                throw new RuntimeException(cce);
623            } catch (HL7Exception he) {
624                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
625                throw new RuntimeException(he);
626            }
627            return ret;
628        }
629    
630    
631    
632        /**
633         * Returns
634         * FT1-14: "Insurance Plan ID" - creates it if necessary
635         */
636        public CE getInsurancePlanID() { 
637            CE ret = null;
638            try {
639                Type t = this.getField(14, 0);
640                ret = (CE)t;
641            } catch (ClassCastException cce) {
642                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
643                throw new RuntimeException(cce);
644            } catch (HL7Exception he) {
645                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
646                throw new RuntimeException(he);
647            }
648            return ret;
649        }
650    
651    
652        /**
653         * Returns
654         * FT1-14: "Insurance Plan ID" - creates it if necessary
655         */
656        public CE getFt114_InsurancePlanID() { 
657            CE ret = null;
658            try {
659                Type t = this.getField(14, 0);
660                ret = (CE)t;
661            } catch (ClassCastException cce) {
662                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
663                throw new RuntimeException(cce);
664            } catch (HL7Exception he) {
665                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
666                throw new RuntimeException(he);
667            }
668            return ret;
669        }
670    
671    
672    
673        /**
674         * Returns
675         * FT1-15: "Insurance Amount" - creates it if necessary
676         */
677        public CP getInsuranceAmount() { 
678            CP ret = null;
679            try {
680                Type t = this.getField(15, 0);
681                ret = (CP)t;
682            } catch (ClassCastException cce) {
683                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
684                throw new RuntimeException(cce);
685            } catch (HL7Exception he) {
686                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
687                throw new RuntimeException(he);
688            }
689            return ret;
690        }
691    
692    
693        /**
694         * Returns
695         * FT1-15: "Insurance Amount" - creates it if necessary
696         */
697        public CP getFt115_InsuranceAmount() { 
698            CP ret = null;
699            try {
700                Type t = this.getField(15, 0);
701                ret = (CP)t;
702            } catch (ClassCastException cce) {
703                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
704                throw new RuntimeException(cce);
705            } catch (HL7Exception he) {
706                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
707                throw new RuntimeException(he);
708            }
709            return ret;
710        }
711    
712    
713    
714        /**
715         * Returns
716         * FT1-16: "Assigned Patient Location" - creates it if necessary
717         */
718        public PL getAssignedPatientLocation() { 
719            PL ret = null;
720            try {
721                Type t = this.getField(16, 0);
722                ret = (PL)t;
723            } catch (ClassCastException cce) {
724                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
725                throw new RuntimeException(cce);
726            } catch (HL7Exception he) {
727                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
728                throw new RuntimeException(he);
729            }
730            return ret;
731        }
732    
733    
734        /**
735         * Returns
736         * FT1-16: "Assigned Patient Location" - creates it if necessary
737         */
738        public PL getFt116_AssignedPatientLocation() { 
739            PL ret = null;
740            try {
741                Type t = this.getField(16, 0);
742                ret = (PL)t;
743            } catch (ClassCastException cce) {
744                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
745                throw new RuntimeException(cce);
746            } catch (HL7Exception he) {
747                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
748                throw new RuntimeException(he);
749            }
750            return ret;
751        }
752    
753    
754    
755        /**
756         * Returns
757         * FT1-17: "Fee Schedule" - creates it if necessary
758         */
759        public IS getFeeSchedule() { 
760            IS ret = null;
761            try {
762                Type t = this.getField(17, 0);
763                ret = (IS)t;
764            } catch (ClassCastException cce) {
765                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
766                throw new RuntimeException(cce);
767            } catch (HL7Exception he) {
768                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
769                throw new RuntimeException(he);
770            }
771            return ret;
772        }
773    
774    
775        /**
776         * Returns
777         * FT1-17: "Fee Schedule" - creates it if necessary
778         */
779        public IS getFt117_FeeSchedule() { 
780            IS ret = null;
781            try {
782                Type t = this.getField(17, 0);
783                ret = (IS)t;
784            } catch (ClassCastException cce) {
785                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
786                throw new RuntimeException(cce);
787            } catch (HL7Exception he) {
788                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
789                throw new RuntimeException(he);
790            }
791            return ret;
792        }
793    
794    
795    
796        /**
797         * Returns
798         * FT1-18: "Patient Type" - creates it if necessary
799         */
800        public IS getPatientType() { 
801            IS ret = null;
802            try {
803                Type t = this.getField(18, 0);
804                ret = (IS)t;
805            } catch (ClassCastException cce) {
806                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
807                throw new RuntimeException(cce);
808            } catch (HL7Exception he) {
809                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
810                throw new RuntimeException(he);
811            }
812            return ret;
813        }
814    
815    
816        /**
817         * Returns
818         * FT1-18: "Patient Type" - creates it if necessary
819         */
820        public IS getFt118_PatientType() { 
821            IS ret = null;
822            try {
823                Type t = this.getField(18, 0);
824                ret = (IS)t;
825            } catch (ClassCastException cce) {
826                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
827                throw new RuntimeException(cce);
828            } catch (HL7Exception he) {
829                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
830                throw new RuntimeException(he);
831            }
832            return ret;
833        }
834    
835    
836        /**
837         * Returns all repetitions of Diagnosis Code - FT1 (FT1-19).
838         */
839        public CE[] getDiagnosisCodeFT1() {
840            CE[] ret = null;
841            try {
842                Type[] t = this.getField(19);  
843                ret = new CE[t.length];
844                for (int i = 0; i < ret.length; i++) {
845                    ret[i] = (CE)t[i];
846                }
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 a count of the current number of repetitions of Diagnosis Code - FT1 (FT1-19).
860         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
861         * it will return zero.
862         */
863        public int getDiagnosisCodeFT1Reps() {
864            CE[] ret = null;
865            try {
866                Type[] t = this.getField(19);
867                return t.length;  
868            } catch (ClassCastException cce) {
869                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
870                throw new RuntimeException(cce);
871            } catch (HL7Exception he) {
872                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
873                throw new RuntimeException(he);
874            }
875        }
876    
877    
878        /**
879         * Returns a specific repetition of
880         * FT1-19: "Diagnosis Code - FT1" - creates it if necessary
881         *
882         * @param rep The repetition index (0-indexed)
883         */
884        public CE getDiagnosisCodeFT1(int rep) { 
885            CE ret = null;
886            try {
887                Type t = this.getField(19, rep);
888                ret = (CE)t;
889            } catch (ClassCastException cce) {
890                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
891                throw new RuntimeException(cce);
892            } catch (HL7Exception he) {
893                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
894                throw new RuntimeException(he);
895            }
896            return ret;
897        }
898    
899        /**
900         * Returns a specific repetition of
901         * FT1-19: "Diagnosis Code - FT1" - creates it if necessary
902         *
903         * @param rep The repetition index (0-indexed)
904         */
905        public CE getFt119_DiagnosisCodeFT1(int rep) { 
906            CE ret = null;
907            try {
908                Type t = this.getField(19, rep);
909                ret = (CE)t;
910            } catch (ClassCastException cce) {
911                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
912                throw new RuntimeException(cce);
913            } catch (HL7Exception he) {
914                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
915                throw new RuntimeException(he);
916            }
917            return ret;
918        }
919    
920    
921        /**
922         * Returns a count of the current number of repetitions of Diagnosis Code - FT1 (FT1-19).
923         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
924         * it will return zero.
925         */
926        public int getFt119_DiagnosisCodeFT1Reps() {
927            CE[] ret = null;
928            try {
929                Type[] t = this.getField(19);
930                return t.length;  
931            } catch (ClassCastException cce) {
932                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
933                throw new RuntimeException(cce);
934            } catch (HL7Exception he) {
935                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
936                throw new RuntimeException(he);
937            }
938        }
939    
940    
941    
942        /**
943         * Inserts a repetition of
944         * FT1-19: "Diagnosis Code - FT1" at a specific index
945         *
946         * @param rep The repetition index (0-indexed)
947         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
948         */
949        public CE insertDiagnosisCodeFT1(int rep) throws HL7Exception { 
950            return (CE) super.insertRepetition(19, rep);
951        }
952    
953    
954    
955        /**
956         * Inserts a repetition of
957         * FT1-19: "Diagnosis Code - FT1" at a specific index
958         *
959         * @param rep The repetition index (0-indexed)
960         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
961         */
962        public CE insertFt119_DiagnosisCodeFT1(int rep) throws HL7Exception { 
963            return (CE) super.insertRepetition(19, rep);
964        }
965    
966    
967        /**
968         * Removes a repetition of
969         * FT1-19: "Diagnosis Code - FT1" at a specific index
970         *
971         * @param rep The repetition index (0-indexed)
972         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
973         */
974        public CE removeDiagnosisCodeFT1(int rep) throws HL7Exception { 
975            return (CE) super.removeRepetition(19, rep);
976        }
977    
978    
979        /**
980         * Removes a repetition of
981         * FT1-19: "Diagnosis Code - FT1" at a specific index
982         *
983         * @param rep The repetition index (0-indexed)
984         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
985         */
986        public CE removeFt119_DiagnosisCodeFT1(int rep) throws HL7Exception { 
987            return (CE) super.removeRepetition(19, rep);
988        }
989    
990    
991    
992        /**
993         * Returns all repetitions of Performed By Code (FT1-20).
994         */
995        public XCN[] getPerformedByCode() {
996            XCN[] ret = null;
997            try {
998                Type[] t = this.getField(20);  
999                ret = new XCN[t.length];
1000                for (int i = 0; i < ret.length; i++) {
1001                    ret[i] = (XCN)t[i];
1002                }
1003            } catch (ClassCastException cce) {
1004                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1005                throw new RuntimeException(cce);
1006            } catch (HL7Exception he) {
1007                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1008                throw new RuntimeException(he);
1009            }
1010            return ret;
1011        }
1012    
1013    
1014        /**
1015         * Returns a count of the current number of repetitions of Performed By Code (FT1-20).
1016         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1017         * it will return zero.
1018         */
1019        public int getPerformedByCodeReps() {
1020            XCN[] ret = null;
1021            try {
1022                Type[] t = this.getField(20);
1023                return t.length;  
1024            } catch (ClassCastException cce) {
1025                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1026                throw new RuntimeException(cce);
1027            } catch (HL7Exception he) {
1028                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1029                throw new RuntimeException(he);
1030            }
1031        }
1032    
1033    
1034        /**
1035         * Returns a specific repetition of
1036         * FT1-20: "Performed By Code" - creates it if necessary
1037         *
1038         * @param rep The repetition index (0-indexed)
1039         */
1040        public XCN getPerformedByCode(int rep) { 
1041            XCN ret = null;
1042            try {
1043                Type t = this.getField(20, rep);
1044                ret = (XCN)t;
1045            } catch (ClassCastException cce) {
1046                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1047                throw new RuntimeException(cce);
1048            } catch (HL7Exception he) {
1049                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1050                throw new RuntimeException(he);
1051            }
1052            return ret;
1053        }
1054    
1055        /**
1056         * Returns a specific repetition of
1057         * FT1-20: "Performed By Code" - creates it if necessary
1058         *
1059         * @param rep The repetition index (0-indexed)
1060         */
1061        public XCN getFt120_PerformedByCode(int rep) { 
1062            XCN ret = null;
1063            try {
1064                Type t = this.getField(20, rep);
1065                ret = (XCN)t;
1066            } catch (ClassCastException cce) {
1067                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1068                throw new RuntimeException(cce);
1069            } catch (HL7Exception he) {
1070                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1071                throw new RuntimeException(he);
1072            }
1073            return ret;
1074        }
1075    
1076    
1077        /**
1078         * Returns a count of the current number of repetitions of Performed By Code (FT1-20).
1079         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1080         * it will return zero.
1081         */
1082        public int getFt120_PerformedByCodeReps() {
1083            XCN[] ret = null;
1084            try {
1085                Type[] t = this.getField(20);
1086                return t.length;  
1087            } catch (ClassCastException cce) {
1088                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1089                throw new RuntimeException(cce);
1090            } catch (HL7Exception he) {
1091                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1092                throw new RuntimeException(he);
1093            }
1094        }
1095    
1096    
1097    
1098        /**
1099         * Inserts a repetition of
1100         * FT1-20: "Performed By Code" at a specific index
1101         *
1102         * @param rep The repetition index (0-indexed)
1103         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1104         */
1105        public XCN insertPerformedByCode(int rep) throws HL7Exception { 
1106            return (XCN) super.insertRepetition(20, rep);
1107        }
1108    
1109    
1110    
1111        /**
1112         * Inserts a repetition of
1113         * FT1-20: "Performed By Code" at a specific index
1114         *
1115         * @param rep The repetition index (0-indexed)
1116         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1117         */
1118        public XCN insertFt120_PerformedByCode(int rep) throws HL7Exception { 
1119            return (XCN) super.insertRepetition(20, rep);
1120        }
1121    
1122    
1123        /**
1124         * Removes a repetition of
1125         * FT1-20: "Performed By Code" at a specific index
1126         *
1127         * @param rep The repetition index (0-indexed)
1128         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1129         */
1130        public XCN removePerformedByCode(int rep) throws HL7Exception { 
1131            return (XCN) super.removeRepetition(20, rep);
1132        }
1133    
1134    
1135        /**
1136         * Removes a repetition of
1137         * FT1-20: "Performed By Code" at a specific index
1138         *
1139         * @param rep The repetition index (0-indexed)
1140         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1141         */
1142        public XCN removeFt120_PerformedByCode(int rep) throws HL7Exception { 
1143            return (XCN) super.removeRepetition(20, rep);
1144        }
1145    
1146    
1147    
1148        /**
1149         * Returns all repetitions of Ordered By Code (FT1-21).
1150         */
1151        public XCN[] getOrderedByCode() {
1152            XCN[] ret = null;
1153            try {
1154                Type[] t = this.getField(21);  
1155                ret = new XCN[t.length];
1156                for (int i = 0; i < ret.length; i++) {
1157                    ret[i] = (XCN)t[i];
1158                }
1159            } catch (ClassCastException cce) {
1160                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1161                throw new RuntimeException(cce);
1162            } catch (HL7Exception he) {
1163                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1164                throw new RuntimeException(he);
1165            }
1166            return ret;
1167        }
1168    
1169    
1170        /**
1171         * Returns a count of the current number of repetitions of Ordered By Code (FT1-21).
1172         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1173         * it will return zero.
1174         */
1175        public int getOrderedByCodeReps() {
1176            XCN[] ret = null;
1177            try {
1178                Type[] t = this.getField(21);
1179                return t.length;  
1180            } catch (ClassCastException cce) {
1181                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1182                throw new RuntimeException(cce);
1183            } catch (HL7Exception he) {
1184                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1185                throw new RuntimeException(he);
1186            }
1187        }
1188    
1189    
1190        /**
1191         * Returns a specific repetition of
1192         * FT1-21: "Ordered By Code" - creates it if necessary
1193         *
1194         * @param rep The repetition index (0-indexed)
1195         */
1196        public XCN getOrderedByCode(int rep) { 
1197            XCN ret = null;
1198            try {
1199                Type t = this.getField(21, rep);
1200                ret = (XCN)t;
1201            } catch (ClassCastException cce) {
1202                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1203                throw new RuntimeException(cce);
1204            } catch (HL7Exception he) {
1205                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1206                throw new RuntimeException(he);
1207            }
1208            return ret;
1209        }
1210    
1211        /**
1212         * Returns a specific repetition of
1213         * FT1-21: "Ordered By Code" - creates it if necessary
1214         *
1215         * @param rep The repetition index (0-indexed)
1216         */
1217        public XCN getFt121_OrderedByCode(int rep) { 
1218            XCN ret = null;
1219            try {
1220                Type t = this.getField(21, rep);
1221                ret = (XCN)t;
1222            } catch (ClassCastException cce) {
1223                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1224                throw new RuntimeException(cce);
1225            } catch (HL7Exception he) {
1226                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1227                throw new RuntimeException(he);
1228            }
1229            return ret;
1230        }
1231    
1232    
1233        /**
1234         * Returns a count of the current number of repetitions of Ordered By Code (FT1-21).
1235         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1236         * it will return zero.
1237         */
1238        public int getFt121_OrderedByCodeReps() {
1239            XCN[] ret = null;
1240            try {
1241                Type[] t = this.getField(21);
1242                return t.length;  
1243            } catch (ClassCastException cce) {
1244                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1245                throw new RuntimeException(cce);
1246            } catch (HL7Exception he) {
1247                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1248                throw new RuntimeException(he);
1249            }
1250        }
1251    
1252    
1253    
1254        /**
1255         * Inserts a repetition of
1256         * FT1-21: "Ordered By Code" at a specific index
1257         *
1258         * @param rep The repetition index (0-indexed)
1259         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1260         */
1261        public XCN insertOrderedByCode(int rep) throws HL7Exception { 
1262            return (XCN) super.insertRepetition(21, rep);
1263        }
1264    
1265    
1266    
1267        /**
1268         * Inserts a repetition of
1269         * FT1-21: "Ordered By Code" at a specific index
1270         *
1271         * @param rep The repetition index (0-indexed)
1272         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1273         */
1274        public XCN insertFt121_OrderedByCode(int rep) throws HL7Exception { 
1275            return (XCN) super.insertRepetition(21, rep);
1276        }
1277    
1278    
1279        /**
1280         * Removes a repetition of
1281         * FT1-21: "Ordered By Code" at a specific index
1282         *
1283         * @param rep The repetition index (0-indexed)
1284         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1285         */
1286        public XCN removeOrderedByCode(int rep) throws HL7Exception { 
1287            return (XCN) super.removeRepetition(21, rep);
1288        }
1289    
1290    
1291        /**
1292         * Removes a repetition of
1293         * FT1-21: "Ordered By Code" at a specific index
1294         *
1295         * @param rep The repetition index (0-indexed)
1296         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1297         */
1298        public XCN removeFt121_OrderedByCode(int rep) throws HL7Exception { 
1299            return (XCN) super.removeRepetition(21, rep);
1300        }
1301    
1302    
1303    
1304    
1305        /**
1306         * Returns
1307         * FT1-22: "Unit Cost" - creates it if necessary
1308         */
1309        public CP getUnitCost() { 
1310            CP ret = null;
1311            try {
1312                Type t = this.getField(22, 0);
1313                ret = (CP)t;
1314            } catch (ClassCastException cce) {
1315                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1316                throw new RuntimeException(cce);
1317            } catch (HL7Exception he) {
1318                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1319                throw new RuntimeException(he);
1320            }
1321            return ret;
1322        }
1323    
1324    
1325        /**
1326         * Returns
1327         * FT1-22: "Unit Cost" - creates it if necessary
1328         */
1329        public CP getFt122_UnitCost() { 
1330            CP ret = null;
1331            try {
1332                Type t = this.getField(22, 0);
1333                ret = (CP)t;
1334            } catch (ClassCastException cce) {
1335                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1336                throw new RuntimeException(cce);
1337            } catch (HL7Exception he) {
1338                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1339                throw new RuntimeException(he);
1340            }
1341            return ret;
1342        }
1343    
1344    
1345    
1346        /**
1347         * Returns
1348         * FT1-23: "Filler Order Number" - creates it if necessary
1349         */
1350        public EI getFillerOrderNumber() { 
1351            EI ret = null;
1352            try {
1353                Type t = this.getField(23, 0);
1354                ret = (EI)t;
1355            } catch (ClassCastException cce) {
1356                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1357                throw new RuntimeException(cce);
1358            } catch (HL7Exception he) {
1359                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1360                throw new RuntimeException(he);
1361            }
1362            return ret;
1363        }
1364    
1365    
1366        /**
1367         * Returns
1368         * FT1-23: "Filler Order Number" - creates it if necessary
1369         */
1370        public EI getFt123_FillerOrderNumber() { 
1371            EI ret = null;
1372            try {
1373                Type t = this.getField(23, 0);
1374                ret = (EI)t;
1375            } catch (ClassCastException cce) {
1376                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1377                throw new RuntimeException(cce);
1378            } catch (HL7Exception he) {
1379                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1380                throw new RuntimeException(he);
1381            }
1382            return ret;
1383        }
1384    
1385    
1386        /**
1387         * Returns all repetitions of Entered By Code (FT1-24).
1388         */
1389        public XCN[] getEnteredByCode() {
1390            XCN[] ret = null;
1391            try {
1392                Type[] t = this.getField(24);  
1393                ret = new XCN[t.length];
1394                for (int i = 0; i < ret.length; i++) {
1395                    ret[i] = (XCN)t[i];
1396                }
1397            } catch (ClassCastException cce) {
1398                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1399                throw new RuntimeException(cce);
1400            } catch (HL7Exception he) {
1401                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1402                throw new RuntimeException(he);
1403            }
1404            return ret;
1405        }
1406    
1407    
1408        /**
1409         * Returns a count of the current number of repetitions of Entered By Code (FT1-24).
1410         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1411         * it will return zero.
1412         */
1413        public int getEnteredByCodeReps() {
1414            XCN[] ret = null;
1415            try {
1416                Type[] t = this.getField(24);
1417                return t.length;  
1418            } catch (ClassCastException cce) {
1419                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1420                throw new RuntimeException(cce);
1421            } catch (HL7Exception he) {
1422                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1423                throw new RuntimeException(he);
1424            }
1425        }
1426    
1427    
1428        /**
1429         * Returns a specific repetition of
1430         * FT1-24: "Entered By Code" - creates it if necessary
1431         *
1432         * @param rep The repetition index (0-indexed)
1433         */
1434        public XCN getEnteredByCode(int rep) { 
1435            XCN ret = null;
1436            try {
1437                Type t = this.getField(24, rep);
1438                ret = (XCN)t;
1439            } catch (ClassCastException cce) {
1440                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1441                throw new RuntimeException(cce);
1442            } catch (HL7Exception he) {
1443                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1444                throw new RuntimeException(he);
1445            }
1446            return ret;
1447        }
1448    
1449        /**
1450         * Returns a specific repetition of
1451         * FT1-24: "Entered By Code" - creates it if necessary
1452         *
1453         * @param rep The repetition index (0-indexed)
1454         */
1455        public XCN getFt124_EnteredByCode(int rep) { 
1456            XCN ret = null;
1457            try {
1458                Type t = this.getField(24, rep);
1459                ret = (XCN)t;
1460            } catch (ClassCastException cce) {
1461                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1462                throw new RuntimeException(cce);
1463            } catch (HL7Exception he) {
1464                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1465                throw new RuntimeException(he);
1466            }
1467            return ret;
1468        }
1469    
1470    
1471        /**
1472         * Returns a count of the current number of repetitions of Entered By Code (FT1-24).
1473         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1474         * it will return zero.
1475         */
1476        public int getFt124_EnteredByCodeReps() {
1477            XCN[] ret = null;
1478            try {
1479                Type[] t = this.getField(24);
1480                return t.length;  
1481            } catch (ClassCastException cce) {
1482                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1483                throw new RuntimeException(cce);
1484            } catch (HL7Exception he) {
1485                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1486                throw new RuntimeException(he);
1487            }
1488        }
1489    
1490    
1491    
1492        /**
1493         * Inserts a repetition of
1494         * FT1-24: "Entered By Code" at a specific index
1495         *
1496         * @param rep The repetition index (0-indexed)
1497         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1498         */
1499        public XCN insertEnteredByCode(int rep) throws HL7Exception { 
1500            return (XCN) super.insertRepetition(24, rep);
1501        }
1502    
1503    
1504    
1505        /**
1506         * Inserts a repetition of
1507         * FT1-24: "Entered By Code" at a specific index
1508         *
1509         * @param rep The repetition index (0-indexed)
1510         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1511         */
1512        public XCN insertFt124_EnteredByCode(int rep) throws HL7Exception { 
1513            return (XCN) super.insertRepetition(24, rep);
1514        }
1515    
1516    
1517        /**
1518         * Removes a repetition of
1519         * FT1-24: "Entered By Code" at a specific index
1520         *
1521         * @param rep The repetition index (0-indexed)
1522         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1523         */
1524        public XCN removeEnteredByCode(int rep) throws HL7Exception { 
1525            return (XCN) super.removeRepetition(24, rep);
1526        }
1527    
1528    
1529        /**
1530         * Removes a repetition of
1531         * FT1-24: "Entered By Code" at a specific index
1532         *
1533         * @param rep The repetition index (0-indexed)
1534         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1535         */
1536        public XCN removeFt124_EnteredByCode(int rep) throws HL7Exception { 
1537            return (XCN) super.removeRepetition(24, rep);
1538        }
1539    
1540    
1541    
1542    
1543        /**
1544         * Returns
1545         * FT1-25: "Procedure Code" - creates it if necessary
1546         */
1547        public CE getProcedureCode() { 
1548            CE ret = null;
1549            try {
1550                Type t = this.getField(25, 0);
1551                ret = (CE)t;
1552            } catch (ClassCastException cce) {
1553                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1554                throw new RuntimeException(cce);
1555            } catch (HL7Exception he) {
1556                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1557                throw new RuntimeException(he);
1558            }
1559            return ret;
1560        }
1561    
1562    
1563        /**
1564         * Returns
1565         * FT1-25: "Procedure Code" - creates it if necessary
1566         */
1567        public CE getFt125_ProcedureCode() { 
1568            CE ret = null;
1569            try {
1570                Type t = this.getField(25, 0);
1571                ret = (CE)t;
1572            } catch (ClassCastException cce) {
1573                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1574                throw new RuntimeException(cce);
1575            } catch (HL7Exception he) {
1576                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1577                throw new RuntimeException(he);
1578            }
1579            return ret;
1580        }
1581    
1582    
1583        /**
1584         * Returns all repetitions of Procedure Code Modifier (FT1-26).
1585         */
1586        public CE[] getProcedureCodeModifier() {
1587            CE[] ret = null;
1588            try {
1589                Type[] t = this.getField(26);  
1590                ret = new CE[t.length];
1591                for (int i = 0; i < ret.length; i++) {
1592                    ret[i] = (CE)t[i];
1593                }
1594            } catch (ClassCastException cce) {
1595                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1596                throw new RuntimeException(cce);
1597            } catch (HL7Exception he) {
1598                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1599                throw new RuntimeException(he);
1600            }
1601            return ret;
1602        }
1603    
1604    
1605        /**
1606         * Returns a count of the current number of repetitions of Procedure Code Modifier (FT1-26).
1607         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1608         * it will return zero.
1609         */
1610        public int getProcedureCodeModifierReps() {
1611            CE[] ret = null;
1612            try {
1613                Type[] t = this.getField(26);
1614                return t.length;  
1615            } catch (ClassCastException cce) {
1616                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1617                throw new RuntimeException(cce);
1618            } catch (HL7Exception he) {
1619                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1620                throw new RuntimeException(he);
1621            }
1622        }
1623    
1624    
1625        /**
1626         * Returns a specific repetition of
1627         * FT1-26: "Procedure Code Modifier" - creates it if necessary
1628         *
1629         * @param rep The repetition index (0-indexed)
1630         */
1631        public CE getProcedureCodeModifier(int rep) { 
1632            CE ret = null;
1633            try {
1634                Type t = this.getField(26, rep);
1635                ret = (CE)t;
1636            } catch (ClassCastException cce) {
1637                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1638                throw new RuntimeException(cce);
1639            } catch (HL7Exception he) {
1640                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1641                throw new RuntimeException(he);
1642            }
1643            return ret;
1644        }
1645    
1646        /**
1647         * Returns a specific repetition of
1648         * FT1-26: "Procedure Code Modifier" - creates it if necessary
1649         *
1650         * @param rep The repetition index (0-indexed)
1651         */
1652        public CE getFt126_ProcedureCodeModifier(int rep) { 
1653            CE ret = null;
1654            try {
1655                Type t = this.getField(26, rep);
1656                ret = (CE)t;
1657            } catch (ClassCastException cce) {
1658                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1659                throw new RuntimeException(cce);
1660            } catch (HL7Exception he) {
1661                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1662                throw new RuntimeException(he);
1663            }
1664            return ret;
1665        }
1666    
1667    
1668        /**
1669         * Returns a count of the current number of repetitions of Procedure Code Modifier (FT1-26).
1670         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1671         * it will return zero.
1672         */
1673        public int getFt126_ProcedureCodeModifierReps() {
1674            CE[] ret = null;
1675            try {
1676                Type[] t = this.getField(26);
1677                return t.length;  
1678            } catch (ClassCastException cce) {
1679                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1680                throw new RuntimeException(cce);
1681            } catch (HL7Exception he) {
1682                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1683                throw new RuntimeException(he);
1684            }
1685        }
1686    
1687    
1688    
1689        /**
1690         * Inserts a repetition of
1691         * FT1-26: "Procedure Code Modifier" at a specific index
1692         *
1693         * @param rep The repetition index (0-indexed)
1694         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1695         */
1696        public CE insertProcedureCodeModifier(int rep) throws HL7Exception { 
1697            return (CE) super.insertRepetition(26, rep);
1698        }
1699    
1700    
1701    
1702        /**
1703         * Inserts a repetition of
1704         * FT1-26: "Procedure Code Modifier" at a specific index
1705         *
1706         * @param rep The repetition index (0-indexed)
1707         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1708         */
1709        public CE insertFt126_ProcedureCodeModifier(int rep) throws HL7Exception { 
1710            return (CE) super.insertRepetition(26, rep);
1711        }
1712    
1713    
1714        /**
1715         * Removes a repetition of
1716         * FT1-26: "Procedure Code Modifier" at a specific index
1717         *
1718         * @param rep The repetition index (0-indexed)
1719         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1720         */
1721        public CE removeProcedureCodeModifier(int rep) throws HL7Exception { 
1722            return (CE) super.removeRepetition(26, rep);
1723        }
1724    
1725    
1726        /**
1727         * Removes a repetition of
1728         * FT1-26: "Procedure Code Modifier" at a specific index
1729         *
1730         * @param rep The repetition index (0-indexed)
1731         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1732         */
1733        public CE removeFt126_ProcedureCodeModifier(int rep) throws HL7Exception { 
1734            return (CE) super.removeRepetition(26, rep);
1735        }
1736    
1737    
1738    
1739    
1740    
1741    
1742        /** {@inheritDoc} */   
1743        protected Type createNewTypeWithoutReflection(int field) {
1744           switch (field) {
1745              case 0: return new SI(getMessage());
1746              case 1: return new ST(getMessage());
1747              case 2: return new ST(getMessage());
1748              case 3: return new TS(getMessage());
1749              case 4: return new TS(getMessage());
1750              case 5: return new IS(getMessage(), new Integer( 17 ));
1751              case 6: return new CE(getMessage());
1752              case 7: return new ST(getMessage());
1753              case 8: return new ST(getMessage());
1754              case 9: return new NM(getMessage());
1755              case 10: return new CP(getMessage());
1756              case 11: return new CP(getMessage());
1757              case 12: return new CE(getMessage());
1758              case 13: return new CE(getMessage());
1759              case 14: return new CP(getMessage());
1760              case 15: return new PL(getMessage());
1761              case 16: return new IS(getMessage(), new Integer( 24 ));
1762              case 17: return new IS(getMessage(), new Integer( 18 ));
1763              case 18: return new CE(getMessage());
1764              case 19: return new XCN(getMessage());
1765              case 20: return new XCN(getMessage());
1766              case 21: return new CP(getMessage());
1767              case 22: return new EI(getMessage());
1768              case 23: return new XCN(getMessage());
1769              case 24: return new CE(getMessage());
1770              case 25: return new CE(getMessage());
1771              default: return null;
1772           }
1773       }
1774    
1775    
1776    }
1777