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 UB2 message segment (UB92 Data). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>UB2-1: Set ID - UB2 (SI) <b>optional </b>
027         * <li>UB2-2: Co-Insurance Days (9) (ST) <b>optional </b>
028         * <li>UB2-3: Condition Code (24-30) (IS) <b>optional repeating</b>
029         * <li>UB2-4: Covered Days (7) (ST) <b>optional </b>
030         * <li>UB2-5: Non-Covered Days (8) (ST) <b>optional </b>
031         * <li>UB2-6: Value Amount & Code (UVC) <b>optional repeating</b>
032         * <li>UB2-7: Occurrence Code & Date (32-35) (OCD) <b>optional repeating</b>
033         * <li>UB2-8: Occurrence Span Code/Dates (36) (OSP) <b>optional repeating</b>
034         * <li>UB2-9: UB92 Locator 2 (State) (ST) <b>optional repeating</b>
035         * <li>UB2-10: UB92 Locator 11 (State) (ST) <b>optional repeating</b>
036         * <li>UB2-11: UB92 Locator 31 (National) (ST) <b>optional </b>
037         * <li>UB2-12: Document Control Number (ST) <b>optional repeating</b>
038         * <li>UB2-13: UB92 Locator 49 (National) (ST) <b>optional repeating</b>
039         * <li>UB2-14: UB92 Locator 56 (State) (ST) <b>optional repeating</b>
040         * <li>UB2-15: UB92 Locator 57 (National) (ST) <b>optional </b>
041         * <li>UB2-16: UB92 Locator 78 (State) (ST) <b>optional repeating</b>
042         * <li>UB2-17: Special Visit Count (NM) <b>optional </b>
043     * </ul>
044     */
045    public class UB2 extends AbstractSegment {
046    
047        /** 
048         * Creates a new UB2 segment
049         */
050        public UB2(Group parent, ModelClassFactory factory) {
051           super(parent, factory);
052           init(factory);
053        }
054    
055        private void init(ModelClassFactory factory) {
056           try {
057                                      this.add(SI.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Set ID - UB2");
058                                      this.add(ST.class, false, 1, 3, new Object[]{ getMessage(), new Integer(0) }, "Co-Insurance Days (9)");
059                                      this.add(IS.class, false, 7, 2, new Object[]{ getMessage() }, "Condition Code (24-30)");
060                                      this.add(ST.class, false, 1, 3, new Object[]{ getMessage(), new Integer(0) }, "Covered Days (7)");
061                                      this.add(ST.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Non-Covered Days (8)");
062                                      this.add(UVC.class, false, 12, 11, new Object[]{ getMessage(), new Integer(153) }, "Value Amount & Code");
063                                      this.add(OCD.class, false, 8, 11, new Object[]{ getMessage(), new Integer(350) }, "Occurrence Code & Date (32-35)");
064                                      this.add(OSP.class, false, 2, 28, new Object[]{ getMessage(), new Integer(351) }, "Occurrence Span Code/Dates (36)");
065                                      this.add(ST.class, false, 2, 29, new Object[]{ getMessage(), new Integer(0) }, "UB92 Locator 2 (State)");
066                                      this.add(ST.class, false, 2, 12, new Object[]{ getMessage(), new Integer(0) }, "UB92 Locator 11 (State)");
067                                      this.add(ST.class, false, 1, 5, new Object[]{ getMessage(), new Integer(0) }, "UB92 Locator 31 (National)");
068                                      this.add(ST.class, false, 3, 23, new Object[]{ getMessage(), new Integer(0) }, "Document Control Number");
069                                      this.add(ST.class, false, 23, 4, new Object[]{ getMessage(), new Integer(0) }, "UB92 Locator 49 (National)");
070                                      this.add(ST.class, false, 5, 14, new Object[]{ getMessage(), new Integer(0) }, "UB92 Locator 56 (State)");
071                                      this.add(ST.class, false, 1, 27, new Object[]{ getMessage(), new Integer(0) }, "UB92 Locator 57 (National)");
072                                      this.add(ST.class, false, 2, 2, new Object[]{ getMessage(), new Integer(0) }, "UB92 Locator 78 (State)");
073                                      this.add(NM.class, false, 1, 3, new Object[]{ getMessage(), new Integer(0) }, "Special Visit Count");
074           } catch(HL7Exception e) {
075              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating UB2 - this is probably a bug in the source code generator.", e);
076           }
077        }
078    
079    
080    
081        /**
082         * Returns
083         * UB2-1: "Set ID - UB2" - creates it if necessary
084         */
085        public SI getSetIDUB2() { 
086            SI ret = null;
087            try {
088                Type t = this.getField(1, 0);
089                ret = (SI)t;
090            } catch (ClassCastException cce) {
091                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
092                throw new RuntimeException(cce);
093            } catch (HL7Exception he) {
094                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
095                throw new RuntimeException(he);
096            }
097            return ret;
098        }
099    
100    
101        /**
102         * Returns
103         * UB2-1: "Set ID - UB2" - creates it if necessary
104         */
105        public SI getUb21_SetIDUB2() { 
106            SI ret = null;
107            try {
108                Type t = this.getField(1, 0);
109                ret = (SI)t;
110            } catch (ClassCastException cce) {
111                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
112                throw new RuntimeException(cce);
113            } catch (HL7Exception he) {
114                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
115                throw new RuntimeException(he);
116            }
117            return ret;
118        }
119    
120    
121    
122        /**
123         * Returns
124         * UB2-2: "Co-Insurance Days (9)" - creates it if necessary
125         */
126        public ST getCoInsuranceDays9() { 
127            ST ret = null;
128            try {
129                Type t = this.getField(2, 0);
130                ret = (ST)t;
131            } catch (ClassCastException cce) {
132                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
133                throw new RuntimeException(cce);
134            } catch (HL7Exception he) {
135                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
136                throw new RuntimeException(he);
137            }
138            return ret;
139        }
140    
141    
142        /**
143         * Returns
144         * UB2-2: "Co-Insurance Days (9)" - creates it if necessary
145         */
146        public ST getUb22_CoInsuranceDays9() { 
147            ST ret = null;
148            try {
149                Type t = this.getField(2, 0);
150                ret = (ST)t;
151            } catch (ClassCastException cce) {
152                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
153                throw new RuntimeException(cce);
154            } catch (HL7Exception he) {
155                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
156                throw new RuntimeException(he);
157            }
158            return ret;
159        }
160    
161    
162        /**
163         * Returns all repetitions of Condition Code (24-30) (UB2-3).
164         */
165        public IS[] getConditionCode2430() {
166            IS[] ret = null;
167            try {
168                Type[] t = this.getField(3);  
169                ret = new IS[t.length];
170                for (int i = 0; i < ret.length; i++) {
171                    ret[i] = (IS)t[i];
172                }
173            } catch (ClassCastException cce) {
174                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
175                throw new RuntimeException(cce);
176            } catch (HL7Exception he) {
177                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
178                throw new RuntimeException(he);
179            }
180            return ret;
181        }
182    
183    
184        /**
185         * Returns a count of the current number of repetitions of Condition Code (24-30) (UB2-3).
186         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
187         * it will return zero.
188         */
189        public int getConditionCode2430Reps() {
190            IS[] ret = null;
191            try {
192                Type[] t = this.getField(3);
193                return t.length;  
194            } catch (ClassCastException cce) {
195                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
196                throw new RuntimeException(cce);
197            } catch (HL7Exception he) {
198                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
199                throw new RuntimeException(he);
200            }
201        }
202    
203    
204        /**
205         * Returns a specific repetition of
206         * UB2-3: "Condition Code (24-30)" - creates it if necessary
207         *
208         * @param rep The repetition index (0-indexed)
209         */
210        public IS getConditionCode2430(int rep) { 
211            IS ret = null;
212            try {
213                Type t = this.getField(3, rep);
214                ret = (IS)t;
215            } catch (ClassCastException cce) {
216                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
217                throw new RuntimeException(cce);
218            } catch (HL7Exception he) {
219                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
220                throw new RuntimeException(he);
221            }
222            return ret;
223        }
224    
225        /**
226         * Returns a specific repetition of
227         * UB2-3: "Condition Code (24-30)" - creates it if necessary
228         *
229         * @param rep The repetition index (0-indexed)
230         */
231        public IS getUb23_ConditionCode2430(int rep) { 
232            IS ret = null;
233            try {
234                Type t = this.getField(3, rep);
235                ret = (IS)t;
236            } catch (ClassCastException cce) {
237                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
238                throw new RuntimeException(cce);
239            } catch (HL7Exception he) {
240                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
241                throw new RuntimeException(he);
242            }
243            return ret;
244        }
245    
246    
247        /**
248         * Returns a count of the current number of repetitions of Condition Code (24-30) (UB2-3).
249         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
250         * it will return zero.
251         */
252        public int getUb23_ConditionCode2430Reps() {
253            IS[] ret = null;
254            try {
255                Type[] t = this.getField(3);
256                return t.length;  
257            } catch (ClassCastException cce) {
258                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
259                throw new RuntimeException(cce);
260            } catch (HL7Exception he) {
261                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
262                throw new RuntimeException(he);
263            }
264        }
265    
266    
267    
268        /**
269         * Inserts a repetition of
270         * UB2-3: "Condition Code (24-30)" at a specific index
271         *
272         * @param rep The repetition index (0-indexed)
273         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
274         */
275        public IS insertConditionCode2430(int rep) throws HL7Exception { 
276            return (IS) super.insertRepetition(3, rep);
277        }
278    
279    
280    
281        /**
282         * Inserts a repetition of
283         * UB2-3: "Condition Code (24-30)" at a specific index
284         *
285         * @param rep The repetition index (0-indexed)
286         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
287         */
288        public IS insertUb23_ConditionCode2430(int rep) throws HL7Exception { 
289            return (IS) super.insertRepetition(3, rep);
290        }
291    
292    
293        /**
294         * Removes a repetition of
295         * UB2-3: "Condition Code (24-30)" at a specific index
296         *
297         * @param rep The repetition index (0-indexed)
298         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
299         */
300        public IS removeConditionCode2430(int rep) throws HL7Exception { 
301            return (IS) super.removeRepetition(3, rep);
302        }
303    
304    
305        /**
306         * Removes a repetition of
307         * UB2-3: "Condition Code (24-30)" at a specific index
308         *
309         * @param rep The repetition index (0-indexed)
310         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
311         */
312        public IS removeUb23_ConditionCode2430(int rep) throws HL7Exception { 
313            return (IS) super.removeRepetition(3, rep);
314        }
315    
316    
317    
318    
319        /**
320         * Returns
321         * UB2-4: "Covered Days (7)" - creates it if necessary
322         */
323        public ST getCoveredDays7() { 
324            ST ret = null;
325            try {
326                Type t = this.getField(4, 0);
327                ret = (ST)t;
328            } catch (ClassCastException cce) {
329                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
330                throw new RuntimeException(cce);
331            } catch (HL7Exception he) {
332                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
333                throw new RuntimeException(he);
334            }
335            return ret;
336        }
337    
338    
339        /**
340         * Returns
341         * UB2-4: "Covered Days (7)" - creates it if necessary
342         */
343        public ST getUb24_CoveredDays7() { 
344            ST ret = null;
345            try {
346                Type t = this.getField(4, 0);
347                ret = (ST)t;
348            } catch (ClassCastException cce) {
349                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
350                throw new RuntimeException(cce);
351            } catch (HL7Exception he) {
352                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
353                throw new RuntimeException(he);
354            }
355            return ret;
356        }
357    
358    
359    
360        /**
361         * Returns
362         * UB2-5: "Non-Covered Days (8)" - creates it if necessary
363         */
364        public ST getNonCoveredDays8() { 
365            ST ret = null;
366            try {
367                Type t = this.getField(5, 0);
368                ret = (ST)t;
369            } catch (ClassCastException cce) {
370                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
371                throw new RuntimeException(cce);
372            } catch (HL7Exception he) {
373                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
374                throw new RuntimeException(he);
375            }
376            return ret;
377        }
378    
379    
380        /**
381         * Returns
382         * UB2-5: "Non-Covered Days (8)" - creates it if necessary
383         */
384        public ST getUb25_NonCoveredDays8() { 
385            ST ret = null;
386            try {
387                Type t = this.getField(5, 0);
388                ret = (ST)t;
389            } catch (ClassCastException cce) {
390                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
391                throw new RuntimeException(cce);
392            } catch (HL7Exception he) {
393                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
394                throw new RuntimeException(he);
395            }
396            return ret;
397        }
398    
399    
400        /**
401         * Returns all repetitions of Value Amount & Code (UB2-6).
402         */
403        public UVC[] getValueAmountCode() {
404            UVC[] ret = null;
405            try {
406                Type[] t = this.getField(6);  
407                ret = new UVC[t.length];
408                for (int i = 0; i < ret.length; i++) {
409                    ret[i] = (UVC)t[i];
410                }
411            } catch (ClassCastException cce) {
412                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
413                throw new RuntimeException(cce);
414            } catch (HL7Exception he) {
415                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
416                throw new RuntimeException(he);
417            }
418            return ret;
419        }
420    
421    
422        /**
423         * Returns a count of the current number of repetitions of Value Amount & Code (UB2-6).
424         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
425         * it will return zero.
426         */
427        public int getValueAmountCodeReps() {
428            UVC[] ret = null;
429            try {
430                Type[] t = this.getField(6);
431                return t.length;  
432            } catch (ClassCastException cce) {
433                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
434                throw new RuntimeException(cce);
435            } catch (HL7Exception he) {
436                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
437                throw new RuntimeException(he);
438            }
439        }
440    
441    
442        /**
443         * Returns a specific repetition of
444         * UB2-6: "Value Amount & Code" - creates it if necessary
445         *
446         * @param rep The repetition index (0-indexed)
447         */
448        public UVC getValueAmountCode(int rep) { 
449            UVC ret = null;
450            try {
451                Type t = this.getField(6, rep);
452                ret = (UVC)t;
453            } catch (ClassCastException cce) {
454                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
455                throw new RuntimeException(cce);
456            } catch (HL7Exception he) {
457                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
458                throw new RuntimeException(he);
459            }
460            return ret;
461        }
462    
463        /**
464         * Returns a specific repetition of
465         * UB2-6: "Value Amount & Code" - creates it if necessary
466         *
467         * @param rep The repetition index (0-indexed)
468         */
469        public UVC getUb26_ValueAmountCode(int rep) { 
470            UVC ret = null;
471            try {
472                Type t = this.getField(6, rep);
473                ret = (UVC)t;
474            } catch (ClassCastException cce) {
475                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
476                throw new RuntimeException(cce);
477            } catch (HL7Exception he) {
478                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
479                throw new RuntimeException(he);
480            }
481            return ret;
482        }
483    
484    
485        /**
486         * Returns a count of the current number of repetitions of Value Amount & Code (UB2-6).
487         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
488         * it will return zero.
489         */
490        public int getUb26_ValueAmountCodeReps() {
491            UVC[] ret = null;
492            try {
493                Type[] t = this.getField(6);
494                return t.length;  
495            } catch (ClassCastException cce) {
496                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
497                throw new RuntimeException(cce);
498            } catch (HL7Exception he) {
499                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
500                throw new RuntimeException(he);
501            }
502        }
503    
504    
505    
506        /**
507         * Inserts a repetition of
508         * UB2-6: "Value Amount & Code" at a specific index
509         *
510         * @param rep The repetition index (0-indexed)
511         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
512         */
513        public UVC insertValueAmountCode(int rep) throws HL7Exception { 
514            return (UVC) super.insertRepetition(6, rep);
515        }
516    
517    
518    
519        /**
520         * Inserts a repetition of
521         * UB2-6: "Value Amount & Code" at a specific index
522         *
523         * @param rep The repetition index (0-indexed)
524         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
525         */
526        public UVC insertUb26_ValueAmountCode(int rep) throws HL7Exception { 
527            return (UVC) super.insertRepetition(6, rep);
528        }
529    
530    
531        /**
532         * Removes a repetition of
533         * UB2-6: "Value Amount & Code" at a specific index
534         *
535         * @param rep The repetition index (0-indexed)
536         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
537         */
538        public UVC removeValueAmountCode(int rep) throws HL7Exception { 
539            return (UVC) super.removeRepetition(6, rep);
540        }
541    
542    
543        /**
544         * Removes a repetition of
545         * UB2-6: "Value Amount & Code" at a specific index
546         *
547         * @param rep The repetition index (0-indexed)
548         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
549         */
550        public UVC removeUb26_ValueAmountCode(int rep) throws HL7Exception { 
551            return (UVC) super.removeRepetition(6, rep);
552        }
553    
554    
555    
556        /**
557         * Returns all repetitions of Occurrence Code & Date (32-35) (UB2-7).
558         */
559        public OCD[] getOccurrenceCodeDate3235() {
560            OCD[] ret = null;
561            try {
562                Type[] t = this.getField(7);  
563                ret = new OCD[t.length];
564                for (int i = 0; i < ret.length; i++) {
565                    ret[i] = (OCD)t[i];
566                }
567            } catch (ClassCastException cce) {
568                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
569                throw new RuntimeException(cce);
570            } catch (HL7Exception he) {
571                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
572                throw new RuntimeException(he);
573            }
574            return ret;
575        }
576    
577    
578        /**
579         * Returns a count of the current number of repetitions of Occurrence Code & Date (32-35) (UB2-7).
580         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
581         * it will return zero.
582         */
583        public int getOccurrenceCodeDate3235Reps() {
584            OCD[] ret = null;
585            try {
586                Type[] t = this.getField(7);
587                return t.length;  
588            } catch (ClassCastException cce) {
589                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
590                throw new RuntimeException(cce);
591            } catch (HL7Exception he) {
592                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
593                throw new RuntimeException(he);
594            }
595        }
596    
597    
598        /**
599         * Returns a specific repetition of
600         * UB2-7: "Occurrence Code & Date (32-35)" - creates it if necessary
601         *
602         * @param rep The repetition index (0-indexed)
603         */
604        public OCD getOccurrenceCodeDate3235(int rep) { 
605            OCD ret = null;
606            try {
607                Type t = this.getField(7, rep);
608                ret = (OCD)t;
609            } catch (ClassCastException cce) {
610                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
611                throw new RuntimeException(cce);
612            } catch (HL7Exception he) {
613                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
614                throw new RuntimeException(he);
615            }
616            return ret;
617        }
618    
619        /**
620         * Returns a specific repetition of
621         * UB2-7: "Occurrence Code & Date (32-35)" - creates it if necessary
622         *
623         * @param rep The repetition index (0-indexed)
624         */
625        public OCD getUb27_OccurrenceCodeDate3235(int rep) { 
626            OCD ret = null;
627            try {
628                Type t = this.getField(7, rep);
629                ret = (OCD)t;
630            } catch (ClassCastException cce) {
631                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
632                throw new RuntimeException(cce);
633            } catch (HL7Exception he) {
634                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
635                throw new RuntimeException(he);
636            }
637            return ret;
638        }
639    
640    
641        /**
642         * Returns a count of the current number of repetitions of Occurrence Code & Date (32-35) (UB2-7).
643         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
644         * it will return zero.
645         */
646        public int getUb27_OccurrenceCodeDate3235Reps() {
647            OCD[] ret = null;
648            try {
649                Type[] t = this.getField(7);
650                return t.length;  
651            } catch (ClassCastException cce) {
652                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
653                throw new RuntimeException(cce);
654            } catch (HL7Exception he) {
655                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
656                throw new RuntimeException(he);
657            }
658        }
659    
660    
661    
662        /**
663         * Inserts a repetition of
664         * UB2-7: "Occurrence Code & Date (32-35)" at a specific index
665         *
666         * @param rep The repetition index (0-indexed)
667         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
668         */
669        public OCD insertOccurrenceCodeDate3235(int rep) throws HL7Exception { 
670            return (OCD) super.insertRepetition(7, rep);
671        }
672    
673    
674    
675        /**
676         * Inserts a repetition of
677         * UB2-7: "Occurrence Code & Date (32-35)" at a specific index
678         *
679         * @param rep The repetition index (0-indexed)
680         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
681         */
682        public OCD insertUb27_OccurrenceCodeDate3235(int rep) throws HL7Exception { 
683            return (OCD) super.insertRepetition(7, rep);
684        }
685    
686    
687        /**
688         * Removes a repetition of
689         * UB2-7: "Occurrence Code & Date (32-35)" at a specific index
690         *
691         * @param rep The repetition index (0-indexed)
692         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
693         */
694        public OCD removeOccurrenceCodeDate3235(int rep) throws HL7Exception { 
695            return (OCD) super.removeRepetition(7, rep);
696        }
697    
698    
699        /**
700         * Removes a repetition of
701         * UB2-7: "Occurrence Code & Date (32-35)" at a specific index
702         *
703         * @param rep The repetition index (0-indexed)
704         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
705         */
706        public OCD removeUb27_OccurrenceCodeDate3235(int rep) throws HL7Exception { 
707            return (OCD) super.removeRepetition(7, rep);
708        }
709    
710    
711    
712        /**
713         * Returns all repetitions of Occurrence Span Code/Dates (36) (UB2-8).
714         */
715        public OSP[] getOccurrenceSpanCodeDates() {
716            OSP[] ret = null;
717            try {
718                Type[] t = this.getField(8);  
719                ret = new OSP[t.length];
720                for (int i = 0; i < ret.length; i++) {
721                    ret[i] = (OSP)t[i];
722                }
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 a count of the current number of repetitions of Occurrence Span Code/Dates (36) (UB2-8).
736         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
737         * it will return zero.
738         */
739        public int getOccurrenceSpanCodeDatesReps() {
740            OSP[] ret = null;
741            try {
742                Type[] t = this.getField(8);
743                return t.length;  
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        }
752    
753    
754        /**
755         * Returns a specific repetition of
756         * UB2-8: "Occurrence Span Code/Dates (36)" - creates it if necessary
757         *
758         * @param rep The repetition index (0-indexed)
759         */
760        public OSP getOccurrenceSpanCodeDates(int rep) { 
761            OSP ret = null;
762            try {
763                Type t = this.getField(8, rep);
764                ret = (OSP)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         * Returns a specific repetition of
777         * UB2-8: "Occurrence Span Code/Dates (36)" - creates it if necessary
778         *
779         * @param rep The repetition index (0-indexed)
780         */
781        public OSP getUb28_OccurrenceSpanCodeDates(int rep) { 
782            OSP ret = null;
783            try {
784                Type t = this.getField(8, rep);
785                ret = (OSP)t;
786            } catch (ClassCastException cce) {
787                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
788                throw new RuntimeException(cce);
789            } catch (HL7Exception he) {
790                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
791                throw new RuntimeException(he);
792            }
793            return ret;
794        }
795    
796    
797        /**
798         * Returns a count of the current number of repetitions of Occurrence Span Code/Dates (36) (UB2-8).
799         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
800         * it will return zero.
801         */
802        public int getUb28_OccurrenceSpanCodeDatesReps() {
803            OSP[] ret = null;
804            try {
805                Type[] t = this.getField(8);
806                return t.length;  
807            } catch (ClassCastException cce) {
808                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
809                throw new RuntimeException(cce);
810            } catch (HL7Exception he) {
811                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
812                throw new RuntimeException(he);
813            }
814        }
815    
816    
817    
818        /**
819         * Inserts a repetition of
820         * UB2-8: "Occurrence Span Code/Dates (36)" at a specific index
821         *
822         * @param rep The repetition index (0-indexed)
823         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
824         */
825        public OSP insertOccurrenceSpanCodeDates(int rep) throws HL7Exception { 
826            return (OSP) super.insertRepetition(8, rep);
827        }
828    
829    
830    
831        /**
832         * Inserts a repetition of
833         * UB2-8: "Occurrence Span Code/Dates (36)" at a specific index
834         *
835         * @param rep The repetition index (0-indexed)
836         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
837         */
838        public OSP insertUb28_OccurrenceSpanCodeDates(int rep) throws HL7Exception { 
839            return (OSP) super.insertRepetition(8, rep);
840        }
841    
842    
843        /**
844         * Removes a repetition of
845         * UB2-8: "Occurrence Span Code/Dates (36)" at a specific index
846         *
847         * @param rep The repetition index (0-indexed)
848         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
849         */
850        public OSP removeOccurrenceSpanCodeDates(int rep) throws HL7Exception { 
851            return (OSP) super.removeRepetition(8, rep);
852        }
853    
854    
855        /**
856         * Removes a repetition of
857         * UB2-8: "Occurrence Span Code/Dates (36)" at a specific index
858         *
859         * @param rep The repetition index (0-indexed)
860         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
861         */
862        public OSP removeUb28_OccurrenceSpanCodeDates(int rep) throws HL7Exception { 
863            return (OSP) super.removeRepetition(8, rep);
864        }
865    
866    
867    
868        /**
869         * Returns all repetitions of UB92 Locator 2 (State) (UB2-9).
870         */
871        public ST[] getUB92Locator2State() {
872            ST[] ret = null;
873            try {
874                Type[] t = this.getField(9);  
875                ret = new ST[t.length];
876                for (int i = 0; i < ret.length; i++) {
877                    ret[i] = (ST)t[i];
878                }
879            } catch (ClassCastException cce) {
880                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
881                throw new RuntimeException(cce);
882            } catch (HL7Exception he) {
883                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
884                throw new RuntimeException(he);
885            }
886            return ret;
887        }
888    
889    
890        /**
891         * Returns a count of the current number of repetitions of UB92 Locator 2 (State) (UB2-9).
892         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
893         * it will return zero.
894         */
895        public int getUB92Locator2StateReps() {
896            ST[] ret = null;
897            try {
898                Type[] t = this.getField(9);
899                return t.length;  
900            } catch (ClassCastException cce) {
901                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
902                throw new RuntimeException(cce);
903            } catch (HL7Exception he) {
904                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
905                throw new RuntimeException(he);
906            }
907        }
908    
909    
910        /**
911         * Returns a specific repetition of
912         * UB2-9: "UB92 Locator 2 (State)" - creates it if necessary
913         *
914         * @param rep The repetition index (0-indexed)
915         */
916        public ST getUB92Locator2State(int rep) { 
917            ST ret = null;
918            try {
919                Type t = this.getField(9, rep);
920                ret = (ST)t;
921            } catch (ClassCastException cce) {
922                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
923                throw new RuntimeException(cce);
924            } catch (HL7Exception he) {
925                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
926                throw new RuntimeException(he);
927            }
928            return ret;
929        }
930    
931        /**
932         * Returns a specific repetition of
933         * UB2-9: "UB92 Locator 2 (State)" - creates it if necessary
934         *
935         * @param rep The repetition index (0-indexed)
936         */
937        public ST getUb29_UB92Locator2State(int rep) { 
938            ST ret = null;
939            try {
940                Type t = this.getField(9, rep);
941                ret = (ST)t;
942            } catch (ClassCastException cce) {
943                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
944                throw new RuntimeException(cce);
945            } catch (HL7Exception he) {
946                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
947                throw new RuntimeException(he);
948            }
949            return ret;
950        }
951    
952    
953        /**
954         * Returns a count of the current number of repetitions of UB92 Locator 2 (State) (UB2-9).
955         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
956         * it will return zero.
957         */
958        public int getUb29_UB92Locator2StateReps() {
959            ST[] ret = null;
960            try {
961                Type[] t = this.getField(9);
962                return t.length;  
963            } catch (ClassCastException cce) {
964                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
965                throw new RuntimeException(cce);
966            } catch (HL7Exception he) {
967                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
968                throw new RuntimeException(he);
969            }
970        }
971    
972    
973    
974        /**
975         * Inserts a repetition of
976         * UB2-9: "UB92 Locator 2 (State)" at a specific index
977         *
978         * @param rep The repetition index (0-indexed)
979         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
980         */
981        public ST insertUB92Locator2State(int rep) throws HL7Exception { 
982            return (ST) super.insertRepetition(9, rep);
983        }
984    
985    
986    
987        /**
988         * Inserts a repetition of
989         * UB2-9: "UB92 Locator 2 (State)" at a specific index
990         *
991         * @param rep The repetition index (0-indexed)
992         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
993         */
994        public ST insertUb29_UB92Locator2State(int rep) throws HL7Exception { 
995            return (ST) super.insertRepetition(9, rep);
996        }
997    
998    
999        /**
1000         * Removes a repetition of
1001         * UB2-9: "UB92 Locator 2 (State)" at a specific index
1002         *
1003         * @param rep The repetition index (0-indexed)
1004         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1005         */
1006        public ST removeUB92Locator2State(int rep) throws HL7Exception { 
1007            return (ST) super.removeRepetition(9, rep);
1008        }
1009    
1010    
1011        /**
1012         * Removes a repetition of
1013         * UB2-9: "UB92 Locator 2 (State)" at a specific index
1014         *
1015         * @param rep The repetition index (0-indexed)
1016         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1017         */
1018        public ST removeUb29_UB92Locator2State(int rep) throws HL7Exception { 
1019            return (ST) super.removeRepetition(9, rep);
1020        }
1021    
1022    
1023    
1024        /**
1025         * Returns all repetitions of UB92 Locator 11 (State) (UB2-10).
1026         */
1027        public ST[] getUB92Locator11State() {
1028            ST[] ret = null;
1029            try {
1030                Type[] t = this.getField(10);  
1031                ret = new ST[t.length];
1032                for (int i = 0; i < ret.length; i++) {
1033                    ret[i] = (ST)t[i];
1034                }
1035            } catch (ClassCastException cce) {
1036                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1037                throw new RuntimeException(cce);
1038            } catch (HL7Exception he) {
1039                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1040                throw new RuntimeException(he);
1041            }
1042            return ret;
1043        }
1044    
1045    
1046        /**
1047         * Returns a count of the current number of repetitions of UB92 Locator 11 (State) (UB2-10).
1048         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1049         * it will return zero.
1050         */
1051        public int getUB92Locator11StateReps() {
1052            ST[] ret = null;
1053            try {
1054                Type[] t = this.getField(10);
1055                return t.length;  
1056            } catch (ClassCastException cce) {
1057                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1058                throw new RuntimeException(cce);
1059            } catch (HL7Exception he) {
1060                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1061                throw new RuntimeException(he);
1062            }
1063        }
1064    
1065    
1066        /**
1067         * Returns a specific repetition of
1068         * UB2-10: "UB92 Locator 11 (State)" - creates it if necessary
1069         *
1070         * @param rep The repetition index (0-indexed)
1071         */
1072        public ST getUB92Locator11State(int rep) { 
1073            ST ret = null;
1074            try {
1075                Type t = this.getField(10, rep);
1076                ret = (ST)t;
1077            } catch (ClassCastException cce) {
1078                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1079                throw new RuntimeException(cce);
1080            } catch (HL7Exception he) {
1081                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1082                throw new RuntimeException(he);
1083            }
1084            return ret;
1085        }
1086    
1087        /**
1088         * Returns a specific repetition of
1089         * UB2-10: "UB92 Locator 11 (State)" - creates it if necessary
1090         *
1091         * @param rep The repetition index (0-indexed)
1092         */
1093        public ST getUb210_UB92Locator11State(int rep) { 
1094            ST ret = null;
1095            try {
1096                Type t = this.getField(10, rep);
1097                ret = (ST)t;
1098            } catch (ClassCastException cce) {
1099                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1100                throw new RuntimeException(cce);
1101            } catch (HL7Exception he) {
1102                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1103                throw new RuntimeException(he);
1104            }
1105            return ret;
1106        }
1107    
1108    
1109        /**
1110         * Returns a count of the current number of repetitions of UB92 Locator 11 (State) (UB2-10).
1111         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1112         * it will return zero.
1113         */
1114        public int getUb210_UB92Locator11StateReps() {
1115            ST[] ret = null;
1116            try {
1117                Type[] t = this.getField(10);
1118                return t.length;  
1119            } catch (ClassCastException cce) {
1120                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1121                throw new RuntimeException(cce);
1122            } catch (HL7Exception he) {
1123                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1124                throw new RuntimeException(he);
1125            }
1126        }
1127    
1128    
1129    
1130        /**
1131         * Inserts a repetition of
1132         * UB2-10: "UB92 Locator 11 (State)" at a specific index
1133         *
1134         * @param rep The repetition index (0-indexed)
1135         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1136         */
1137        public ST insertUB92Locator11State(int rep) throws HL7Exception { 
1138            return (ST) super.insertRepetition(10, rep);
1139        }
1140    
1141    
1142    
1143        /**
1144         * Inserts a repetition of
1145         * UB2-10: "UB92 Locator 11 (State)" at a specific index
1146         *
1147         * @param rep The repetition index (0-indexed)
1148         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1149         */
1150        public ST insertUb210_UB92Locator11State(int rep) throws HL7Exception { 
1151            return (ST) super.insertRepetition(10, rep);
1152        }
1153    
1154    
1155        /**
1156         * Removes a repetition of
1157         * UB2-10: "UB92 Locator 11 (State)" at a specific index
1158         *
1159         * @param rep The repetition index (0-indexed)
1160         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1161         */
1162        public ST removeUB92Locator11State(int rep) throws HL7Exception { 
1163            return (ST) super.removeRepetition(10, rep);
1164        }
1165    
1166    
1167        /**
1168         * Removes a repetition of
1169         * UB2-10: "UB92 Locator 11 (State)" at a specific index
1170         *
1171         * @param rep The repetition index (0-indexed)
1172         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1173         */
1174        public ST removeUb210_UB92Locator11State(int rep) throws HL7Exception { 
1175            return (ST) super.removeRepetition(10, rep);
1176        }
1177    
1178    
1179    
1180    
1181        /**
1182         * Returns
1183         * UB2-11: "UB92 Locator 31 (National)" - creates it if necessary
1184         */
1185        public ST getUB92Locator31National() { 
1186            ST ret = null;
1187            try {
1188                Type t = this.getField(11, 0);
1189                ret = (ST)t;
1190            } catch (ClassCastException cce) {
1191                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1192                throw new RuntimeException(cce);
1193            } catch (HL7Exception he) {
1194                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1195                throw new RuntimeException(he);
1196            }
1197            return ret;
1198        }
1199    
1200    
1201        /**
1202         * Returns
1203         * UB2-11: "UB92 Locator 31 (National)" - creates it if necessary
1204         */
1205        public ST getUb211_UB92Locator31National() { 
1206            ST ret = null;
1207            try {
1208                Type t = this.getField(11, 0);
1209                ret = (ST)t;
1210            } catch (ClassCastException cce) {
1211                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1212                throw new RuntimeException(cce);
1213            } catch (HL7Exception he) {
1214                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1215                throw new RuntimeException(he);
1216            }
1217            return ret;
1218        }
1219    
1220    
1221        /**
1222         * Returns all repetitions of Document Control Number (UB2-12).
1223         */
1224        public ST[] getDocumentControlNumber() {
1225            ST[] ret = null;
1226            try {
1227                Type[] t = this.getField(12);  
1228                ret = new ST[t.length];
1229                for (int i = 0; i < ret.length; i++) {
1230                    ret[i] = (ST)t[i];
1231                }
1232            } catch (ClassCastException cce) {
1233                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1234                throw new RuntimeException(cce);
1235            } catch (HL7Exception he) {
1236                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1237                throw new RuntimeException(he);
1238            }
1239            return ret;
1240        }
1241    
1242    
1243        /**
1244         * Returns a count of the current number of repetitions of Document Control Number (UB2-12).
1245         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1246         * it will return zero.
1247         */
1248        public int getDocumentControlNumberReps() {
1249            ST[] ret = null;
1250            try {
1251                Type[] t = this.getField(12);
1252                return t.length;  
1253            } catch (ClassCastException cce) {
1254                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1255                throw new RuntimeException(cce);
1256            } catch (HL7Exception he) {
1257                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1258                throw new RuntimeException(he);
1259            }
1260        }
1261    
1262    
1263        /**
1264         * Returns a specific repetition of
1265         * UB2-12: "Document Control Number" - creates it if necessary
1266         *
1267         * @param rep The repetition index (0-indexed)
1268         */
1269        public ST getDocumentControlNumber(int rep) { 
1270            ST ret = null;
1271            try {
1272                Type t = this.getField(12, rep);
1273                ret = (ST)t;
1274            } catch (ClassCastException cce) {
1275                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1276                throw new RuntimeException(cce);
1277            } catch (HL7Exception he) {
1278                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1279                throw new RuntimeException(he);
1280            }
1281            return ret;
1282        }
1283    
1284        /**
1285         * Returns a specific repetition of
1286         * UB2-12: "Document Control Number" - creates it if necessary
1287         *
1288         * @param rep The repetition index (0-indexed)
1289         */
1290        public ST getUb212_DocumentControlNumber(int rep) { 
1291            ST ret = null;
1292            try {
1293                Type t = this.getField(12, rep);
1294                ret = (ST)t;
1295            } catch (ClassCastException cce) {
1296                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1297                throw new RuntimeException(cce);
1298            } catch (HL7Exception he) {
1299                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1300                throw new RuntimeException(he);
1301            }
1302            return ret;
1303        }
1304    
1305    
1306        /**
1307         * Returns a count of the current number of repetitions of Document Control Number (UB2-12).
1308         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1309         * it will return zero.
1310         */
1311        public int getUb212_DocumentControlNumberReps() {
1312            ST[] ret = null;
1313            try {
1314                Type[] t = this.getField(12);
1315                return t.length;  
1316            } catch (ClassCastException cce) {
1317                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1318                throw new RuntimeException(cce);
1319            } catch (HL7Exception he) {
1320                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1321                throw new RuntimeException(he);
1322            }
1323        }
1324    
1325    
1326    
1327        /**
1328         * Inserts a repetition of
1329         * UB2-12: "Document Control Number" at a specific index
1330         *
1331         * @param rep The repetition index (0-indexed)
1332         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1333         */
1334        public ST insertDocumentControlNumber(int rep) throws HL7Exception { 
1335            return (ST) super.insertRepetition(12, rep);
1336        }
1337    
1338    
1339    
1340        /**
1341         * Inserts a repetition of
1342         * UB2-12: "Document Control Number" at a specific index
1343         *
1344         * @param rep The repetition index (0-indexed)
1345         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1346         */
1347        public ST insertUb212_DocumentControlNumber(int rep) throws HL7Exception { 
1348            return (ST) super.insertRepetition(12, rep);
1349        }
1350    
1351    
1352        /**
1353         * Removes a repetition of
1354         * UB2-12: "Document Control Number" at a specific index
1355         *
1356         * @param rep The repetition index (0-indexed)
1357         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1358         */
1359        public ST removeDocumentControlNumber(int rep) throws HL7Exception { 
1360            return (ST) super.removeRepetition(12, rep);
1361        }
1362    
1363    
1364        /**
1365         * Removes a repetition of
1366         * UB2-12: "Document Control Number" at a specific index
1367         *
1368         * @param rep The repetition index (0-indexed)
1369         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1370         */
1371        public ST removeUb212_DocumentControlNumber(int rep) throws HL7Exception { 
1372            return (ST) super.removeRepetition(12, rep);
1373        }
1374    
1375    
1376    
1377        /**
1378         * Returns all repetitions of UB92 Locator 49 (National) (UB2-13).
1379         */
1380        public ST[] getUB92Locator49National() {
1381            ST[] ret = null;
1382            try {
1383                Type[] t = this.getField(13);  
1384                ret = new ST[t.length];
1385                for (int i = 0; i < ret.length; i++) {
1386                    ret[i] = (ST)t[i];
1387                }
1388            } catch (ClassCastException cce) {
1389                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1390                throw new RuntimeException(cce);
1391            } catch (HL7Exception he) {
1392                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1393                throw new RuntimeException(he);
1394            }
1395            return ret;
1396        }
1397    
1398    
1399        /**
1400         * Returns a count of the current number of repetitions of UB92 Locator 49 (National) (UB2-13).
1401         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1402         * it will return zero.
1403         */
1404        public int getUB92Locator49NationalReps() {
1405            ST[] ret = null;
1406            try {
1407                Type[] t = this.getField(13);
1408                return t.length;  
1409            } catch (ClassCastException cce) {
1410                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1411                throw new RuntimeException(cce);
1412            } catch (HL7Exception he) {
1413                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1414                throw new RuntimeException(he);
1415            }
1416        }
1417    
1418    
1419        /**
1420         * Returns a specific repetition of
1421         * UB2-13: "UB92 Locator 49 (National)" - creates it if necessary
1422         *
1423         * @param rep The repetition index (0-indexed)
1424         */
1425        public ST getUB92Locator49National(int rep) { 
1426            ST ret = null;
1427            try {
1428                Type t = this.getField(13, rep);
1429                ret = (ST)t;
1430            } catch (ClassCastException cce) {
1431                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1432                throw new RuntimeException(cce);
1433            } catch (HL7Exception he) {
1434                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1435                throw new RuntimeException(he);
1436            }
1437            return ret;
1438        }
1439    
1440        /**
1441         * Returns a specific repetition of
1442         * UB2-13: "UB92 Locator 49 (National)" - creates it if necessary
1443         *
1444         * @param rep The repetition index (0-indexed)
1445         */
1446        public ST getUb213_UB92Locator49National(int rep) { 
1447            ST ret = null;
1448            try {
1449                Type t = this.getField(13, rep);
1450                ret = (ST)t;
1451            } catch (ClassCastException cce) {
1452                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1453                throw new RuntimeException(cce);
1454            } catch (HL7Exception he) {
1455                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1456                throw new RuntimeException(he);
1457            }
1458            return ret;
1459        }
1460    
1461    
1462        /**
1463         * Returns a count of the current number of repetitions of UB92 Locator 49 (National) (UB2-13).
1464         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1465         * it will return zero.
1466         */
1467        public int getUb213_UB92Locator49NationalReps() {
1468            ST[] ret = null;
1469            try {
1470                Type[] t = this.getField(13);
1471                return t.length;  
1472            } catch (ClassCastException cce) {
1473                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1474                throw new RuntimeException(cce);
1475            } catch (HL7Exception he) {
1476                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1477                throw new RuntimeException(he);
1478            }
1479        }
1480    
1481    
1482    
1483        /**
1484         * Inserts a repetition of
1485         * UB2-13: "UB92 Locator 49 (National)" at a specific index
1486         *
1487         * @param rep The repetition index (0-indexed)
1488         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1489         */
1490        public ST insertUB92Locator49National(int rep) throws HL7Exception { 
1491            return (ST) super.insertRepetition(13, rep);
1492        }
1493    
1494    
1495    
1496        /**
1497         * Inserts a repetition of
1498         * UB2-13: "UB92 Locator 49 (National)" at a specific index
1499         *
1500         * @param rep The repetition index (0-indexed)
1501         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1502         */
1503        public ST insertUb213_UB92Locator49National(int rep) throws HL7Exception { 
1504            return (ST) super.insertRepetition(13, rep);
1505        }
1506    
1507    
1508        /**
1509         * Removes a repetition of
1510         * UB2-13: "UB92 Locator 49 (National)" at a specific index
1511         *
1512         * @param rep The repetition index (0-indexed)
1513         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1514         */
1515        public ST removeUB92Locator49National(int rep) throws HL7Exception { 
1516            return (ST) super.removeRepetition(13, rep);
1517        }
1518    
1519    
1520        /**
1521         * Removes a repetition of
1522         * UB2-13: "UB92 Locator 49 (National)" at a specific index
1523         *
1524         * @param rep The repetition index (0-indexed)
1525         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1526         */
1527        public ST removeUb213_UB92Locator49National(int rep) throws HL7Exception { 
1528            return (ST) super.removeRepetition(13, rep);
1529        }
1530    
1531    
1532    
1533        /**
1534         * Returns all repetitions of UB92 Locator 56 (State) (UB2-14).
1535         */
1536        public ST[] getUB92Locator56State() {
1537            ST[] ret = null;
1538            try {
1539                Type[] t = this.getField(14);  
1540                ret = new ST[t.length];
1541                for (int i = 0; i < ret.length; i++) {
1542                    ret[i] = (ST)t[i];
1543                }
1544            } catch (ClassCastException cce) {
1545                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1546                throw new RuntimeException(cce);
1547            } catch (HL7Exception he) {
1548                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1549                throw new RuntimeException(he);
1550            }
1551            return ret;
1552        }
1553    
1554    
1555        /**
1556         * Returns a count of the current number of repetitions of UB92 Locator 56 (State) (UB2-14).
1557         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1558         * it will return zero.
1559         */
1560        public int getUB92Locator56StateReps() {
1561            ST[] ret = null;
1562            try {
1563                Type[] t = this.getField(14);
1564                return t.length;  
1565            } catch (ClassCastException cce) {
1566                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1567                throw new RuntimeException(cce);
1568            } catch (HL7Exception he) {
1569                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1570                throw new RuntimeException(he);
1571            }
1572        }
1573    
1574    
1575        /**
1576         * Returns a specific repetition of
1577         * UB2-14: "UB92 Locator 56 (State)" - creates it if necessary
1578         *
1579         * @param rep The repetition index (0-indexed)
1580         */
1581        public ST getUB92Locator56State(int rep) { 
1582            ST ret = null;
1583            try {
1584                Type t = this.getField(14, rep);
1585                ret = (ST)t;
1586            } catch (ClassCastException cce) {
1587                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1588                throw new RuntimeException(cce);
1589            } catch (HL7Exception he) {
1590                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1591                throw new RuntimeException(he);
1592            }
1593            return ret;
1594        }
1595    
1596        /**
1597         * Returns a specific repetition of
1598         * UB2-14: "UB92 Locator 56 (State)" - creates it if necessary
1599         *
1600         * @param rep The repetition index (0-indexed)
1601         */
1602        public ST getUb214_UB92Locator56State(int rep) { 
1603            ST ret = null;
1604            try {
1605                Type t = this.getField(14, rep);
1606                ret = (ST)t;
1607            } catch (ClassCastException cce) {
1608                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1609                throw new RuntimeException(cce);
1610            } catch (HL7Exception he) {
1611                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1612                throw new RuntimeException(he);
1613            }
1614            return ret;
1615        }
1616    
1617    
1618        /**
1619         * Returns a count of the current number of repetitions of UB92 Locator 56 (State) (UB2-14).
1620         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1621         * it will return zero.
1622         */
1623        public int getUb214_UB92Locator56StateReps() {
1624            ST[] ret = null;
1625            try {
1626                Type[] t = this.getField(14);
1627                return t.length;  
1628            } catch (ClassCastException cce) {
1629                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1630                throw new RuntimeException(cce);
1631            } catch (HL7Exception he) {
1632                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1633                throw new RuntimeException(he);
1634            }
1635        }
1636    
1637    
1638    
1639        /**
1640         * Inserts a repetition of
1641         * UB2-14: "UB92 Locator 56 (State)" at a specific index
1642         *
1643         * @param rep The repetition index (0-indexed)
1644         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1645         */
1646        public ST insertUB92Locator56State(int rep) throws HL7Exception { 
1647            return (ST) super.insertRepetition(14, rep);
1648        }
1649    
1650    
1651    
1652        /**
1653         * Inserts a repetition of
1654         * UB2-14: "UB92 Locator 56 (State)" at a specific index
1655         *
1656         * @param rep The repetition index (0-indexed)
1657         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1658         */
1659        public ST insertUb214_UB92Locator56State(int rep) throws HL7Exception { 
1660            return (ST) super.insertRepetition(14, rep);
1661        }
1662    
1663    
1664        /**
1665         * Removes a repetition of
1666         * UB2-14: "UB92 Locator 56 (State)" at a specific index
1667         *
1668         * @param rep The repetition index (0-indexed)
1669         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1670         */
1671        public ST removeUB92Locator56State(int rep) throws HL7Exception { 
1672            return (ST) super.removeRepetition(14, rep);
1673        }
1674    
1675    
1676        /**
1677         * Removes a repetition of
1678         * UB2-14: "UB92 Locator 56 (State)" at a specific index
1679         *
1680         * @param rep The repetition index (0-indexed)
1681         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1682         */
1683        public ST removeUb214_UB92Locator56State(int rep) throws HL7Exception { 
1684            return (ST) super.removeRepetition(14, rep);
1685        }
1686    
1687    
1688    
1689    
1690        /**
1691         * Returns
1692         * UB2-15: "UB92 Locator 57 (National)" - creates it if necessary
1693         */
1694        public ST getUB92Locator57National() { 
1695            ST ret = null;
1696            try {
1697                Type t = this.getField(15, 0);
1698                ret = (ST)t;
1699            } catch (ClassCastException cce) {
1700                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1701                throw new RuntimeException(cce);
1702            } catch (HL7Exception he) {
1703                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1704                throw new RuntimeException(he);
1705            }
1706            return ret;
1707        }
1708    
1709    
1710        /**
1711         * Returns
1712         * UB2-15: "UB92 Locator 57 (National)" - creates it if necessary
1713         */
1714        public ST getUb215_UB92Locator57National() { 
1715            ST ret = null;
1716            try {
1717                Type t = this.getField(15, 0);
1718                ret = (ST)t;
1719            } catch (ClassCastException cce) {
1720                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1721                throw new RuntimeException(cce);
1722            } catch (HL7Exception he) {
1723                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1724                throw new RuntimeException(he);
1725            }
1726            return ret;
1727        }
1728    
1729    
1730        /**
1731         * Returns all repetitions of UB92 Locator 78 (State) (UB2-16).
1732         */
1733        public ST[] getUB92Locator78State() {
1734            ST[] ret = null;
1735            try {
1736                Type[] t = this.getField(16);  
1737                ret = new ST[t.length];
1738                for (int i = 0; i < ret.length; i++) {
1739                    ret[i] = (ST)t[i];
1740                }
1741            } catch (ClassCastException cce) {
1742                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1743                throw new RuntimeException(cce);
1744            } catch (HL7Exception he) {
1745                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1746                throw new RuntimeException(he);
1747            }
1748            return ret;
1749        }
1750    
1751    
1752        /**
1753         * Returns a count of the current number of repetitions of UB92 Locator 78 (State) (UB2-16).
1754         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1755         * it will return zero.
1756         */
1757        public int getUB92Locator78StateReps() {
1758            ST[] ret = null;
1759            try {
1760                Type[] t = this.getField(16);
1761                return t.length;  
1762            } catch (ClassCastException cce) {
1763                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1764                throw new RuntimeException(cce);
1765            } catch (HL7Exception he) {
1766                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1767                throw new RuntimeException(he);
1768            }
1769        }
1770    
1771    
1772        /**
1773         * Returns a specific repetition of
1774         * UB2-16: "UB92 Locator 78 (State)" - creates it if necessary
1775         *
1776         * @param rep The repetition index (0-indexed)
1777         */
1778        public ST getUB92Locator78State(int rep) { 
1779            ST ret = null;
1780            try {
1781                Type t = this.getField(16, rep);
1782                ret = (ST)t;
1783            } catch (ClassCastException cce) {
1784                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1785                throw new RuntimeException(cce);
1786            } catch (HL7Exception he) {
1787                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1788                throw new RuntimeException(he);
1789            }
1790            return ret;
1791        }
1792    
1793        /**
1794         * Returns a specific repetition of
1795         * UB2-16: "UB92 Locator 78 (State)" - creates it if necessary
1796         *
1797         * @param rep The repetition index (0-indexed)
1798         */
1799        public ST getUb216_UB92Locator78State(int rep) { 
1800            ST ret = null;
1801            try {
1802                Type t = this.getField(16, rep);
1803                ret = (ST)t;
1804            } catch (ClassCastException cce) {
1805                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1806                throw new RuntimeException(cce);
1807            } catch (HL7Exception he) {
1808                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1809                throw new RuntimeException(he);
1810            }
1811            return ret;
1812        }
1813    
1814    
1815        /**
1816         * Returns a count of the current number of repetitions of UB92 Locator 78 (State) (UB2-16).
1817         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1818         * it will return zero.
1819         */
1820        public int getUb216_UB92Locator78StateReps() {
1821            ST[] ret = null;
1822            try {
1823                Type[] t = this.getField(16);
1824                return t.length;  
1825            } catch (ClassCastException cce) {
1826                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1827                throw new RuntimeException(cce);
1828            } catch (HL7Exception he) {
1829                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1830                throw new RuntimeException(he);
1831            }
1832        }
1833    
1834    
1835    
1836        /**
1837         * Inserts a repetition of
1838         * UB2-16: "UB92 Locator 78 (State)" at a specific index
1839         *
1840         * @param rep The repetition index (0-indexed)
1841         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1842         */
1843        public ST insertUB92Locator78State(int rep) throws HL7Exception { 
1844            return (ST) super.insertRepetition(16, rep);
1845        }
1846    
1847    
1848    
1849        /**
1850         * Inserts a repetition of
1851         * UB2-16: "UB92 Locator 78 (State)" at a specific index
1852         *
1853         * @param rep The repetition index (0-indexed)
1854         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1855         */
1856        public ST insertUb216_UB92Locator78State(int rep) throws HL7Exception { 
1857            return (ST) super.insertRepetition(16, rep);
1858        }
1859    
1860    
1861        /**
1862         * Removes a repetition of
1863         * UB2-16: "UB92 Locator 78 (State)" at a specific index
1864         *
1865         * @param rep The repetition index (0-indexed)
1866         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1867         */
1868        public ST removeUB92Locator78State(int rep) throws HL7Exception { 
1869            return (ST) super.removeRepetition(16, rep);
1870        }
1871    
1872    
1873        /**
1874         * Removes a repetition of
1875         * UB2-16: "UB92 Locator 78 (State)" at a specific index
1876         *
1877         * @param rep The repetition index (0-indexed)
1878         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1879         */
1880        public ST removeUb216_UB92Locator78State(int rep) throws HL7Exception { 
1881            return (ST) super.removeRepetition(16, rep);
1882        }
1883    
1884    
1885    
1886    
1887        /**
1888         * Returns
1889         * UB2-17: "Special Visit Count" - creates it if necessary
1890         */
1891        public NM getSpecialVisitCount() { 
1892            NM ret = null;
1893            try {
1894                Type t = this.getField(17, 0);
1895                ret = (NM)t;
1896            } catch (ClassCastException cce) {
1897                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1898                throw new RuntimeException(cce);
1899            } catch (HL7Exception he) {
1900                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1901                throw new RuntimeException(he);
1902            }
1903            return ret;
1904        }
1905    
1906    
1907        /**
1908         * Returns
1909         * UB2-17: "Special Visit Count" - creates it if necessary
1910         */
1911        public NM getUb217_SpecialVisitCount() { 
1912            NM ret = null;
1913            try {
1914                Type t = this.getField(17, 0);
1915                ret = (NM)t;
1916            } catch (ClassCastException cce) {
1917                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1918                throw new RuntimeException(cce);
1919            } catch (HL7Exception he) {
1920                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1921                throw new RuntimeException(he);
1922            }
1923            return ret;
1924        }
1925    
1926    
1927    
1928    
1929    
1930        /** {@inheritDoc} */   
1931        protected Type createNewTypeWithoutReflection(int field) {
1932           switch (field) {
1933              case 0: return new SI(getMessage());
1934              case 1: return new ST(getMessage());
1935              case 2: return new IS(getMessage(), new Integer( 43 ));
1936              case 3: return new ST(getMessage());
1937              case 4: return new ST(getMessage());
1938              case 5: return new UVC(getMessage());
1939              case 6: return new OCD(getMessage());
1940              case 7: return new OSP(getMessage());
1941              case 8: return new ST(getMessage());
1942              case 9: return new ST(getMessage());
1943              case 10: return new ST(getMessage());
1944              case 11: return new ST(getMessage());
1945              case 12: return new ST(getMessage());
1946              case 13: return new ST(getMessage());
1947              case 14: return new ST(getMessage());
1948              case 15: return new ST(getMessage());
1949              case 16: return new NM(getMessage());
1950              default: return null;
1951           }
1952       }
1953    
1954    
1955    }
1956