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.v231.group;
009    
010    import ca.uhn.hl7v2.model.v231.segment.*;
011    
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.AbstractGroup;
019    import ca.uhn.hl7v2.model.GenericSegment;
020    
021    /**
022     * <p>Represents a ADR_A19_EVNPIDPD1NK1PV1PV2DB1OBXAL1DG1DRGPR1ROLGT1IN1IN2IN3ACCUB1UB2 group structure (a Group object).
023     * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
024     * This Group contains the following elements:  
025     * </p>
026     * <ul>
027                     * <li>1: EVN (EVN - event type segment) <b>optional </b></li>
028                     * <li>2: PID (PID - patient identification segment) <b> </b></li>
029                     * <li>3: PD1 (PD1 - patient additional demographic segment) <b>optional </b></li>
030                     * <li>4: NK1 (NK1 - next of kin / associated parties segment-) <b>optional repeating</b></li>
031                     * <li>5: PV1 (PV1 - patient visit segment-) <b> </b></li>
032                     * <li>6: PV2 (PV2 - patient visit - additional information segment) <b>optional </b></li>
033                     * <li>7: DB1 (DB1 - Disability segment) <b>optional repeating</b></li>
034                     * <li>8: OBX (OBX - observation/result segment) <b>optional repeating</b></li>
035                     * <li>9: AL1 (AL1 - patient allergy information segment) <b>optional repeating</b></li>
036                     * <li>10: DG1 (DG1 - diagnosis segment) <b>optional repeating</b></li>
037                     * <li>11: DRG (DRG - diagnosis related group segment) <b>optional </b></li>
038                     * <li>12: ADR_A19_PR1ROL (a Group object) <b>optional repeating</b></li>
039                     * <li>13: GT1 (GT1 - guarantor segment) <b>optional repeating</b></li>
040                     * <li>14: ADR_A19_IN1IN2IN3 (a Group object) <b>optional repeating</b></li>
041                     * <li>15: ACC (ACC - accident segment) <b>optional </b></li>
042                     * <li>16: UB1 (UB1 - UB82 data segment) <b>optional </b></li>
043                     * <li>17: UB2 (UB2 - UB92 data segment) <b>optional </b></li>
044     * </ul>
045     */
046    public class ADR_A19_EVNPIDPD1NK1PV1PV2DB1OBXAL1DG1DRGPR1ROLGT1IN1IN2IN3ACCUB1UB2 extends AbstractGroup {
047    
048        /** 
049         * Creates a new ADR_A19_EVNPIDPD1NK1PV1PV2DB1OBXAL1DG1DRGPR1ROLGT1IN1IN2IN3ACCUB1UB2 group
050         */
051        public ADR_A19_EVNPIDPD1NK1PV1PV2DB1OBXAL1DG1DRGPR1ROLGT1IN1IN2IN3ACCUB1UB2(Group parent, ModelClassFactory factory) {
052           super(parent, factory);
053           init(factory);
054        }
055    
056        private void init(ModelClassFactory factory) {
057           try {
058                              this.add(EVN.class, false, false);
059                              this.add(PID.class, true, false);
060                              this.add(PD1.class, false, false);
061                              this.add(NK1.class, false, true);
062                              this.add(PV1.class, true, false);
063                              this.add(PV2.class, false, false);
064                              this.add(DB1.class, false, true);
065                              this.add(OBX.class, false, true);
066                              this.add(AL1.class, false, true);
067                              this.add(DG1.class, false, true);
068                              this.add(DRG.class, false, false);
069                              this.add(ADR_A19_PR1ROL.class, false, true);
070                              this.add(GT1.class, false, true);
071                              this.add(ADR_A19_IN1IN2IN3.class, false, true);
072                              this.add(ACC.class, false, false);
073                              this.add(UB1.class, false, false);
074                              this.add(UB2.class, false, false);
075           } catch(HL7Exception e) {
076              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating ADR_A19_EVNPIDPD1NK1PV1PV2DB1OBXAL1DG1DRGPR1ROLGT1IN1IN2IN3ACCUB1UB2 - this is probably a bug in the source code generator.", e);
077           }
078        }
079    
080        /** 
081         * Returns "2.3.1"
082         */
083        public String getVersion() {
084           return "2.3.1";
085        }
086    
087    
088    
089        /**
090         * Returns
091         * EVN (EVN - event type segment) - creates it if necessary
092         */
093        public EVN getEVN() { 
094           EVN ret = null;
095           try {
096              ret = (EVN)this.get("EVN");
097           } catch(HL7Exception e) {
098              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
099              throw new RuntimeException(e);
100           }
101           return ret;
102        }
103    
104    
105    
106    
107        /**
108         * Returns
109         * PID (PID - patient identification segment) - creates it if necessary
110         */
111        public PID getPID() { 
112           PID ret = null;
113           try {
114              ret = (PID)this.get("PID");
115           } catch(HL7Exception e) {
116              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
117              throw new RuntimeException(e);
118           }
119           return ret;
120        }
121    
122    
123    
124    
125        /**
126         * Returns
127         * PD1 (PD1 - patient additional demographic segment) - creates it if necessary
128         */
129        public PD1 getPD1() { 
130           PD1 ret = null;
131           try {
132              ret = (PD1)this.get("PD1");
133           } catch(HL7Exception e) {
134              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
135              throw new RuntimeException(e);
136           }
137           return ret;
138        }
139    
140    
141    
142    
143        /**
144         * Returns
145         * the first repetition of 
146         * NK1 (NK1 - next of kin / associated parties segment-) - creates it if necessary
147         */
148        public NK1 getNK1() { 
149           NK1 ret = null;
150           try {
151              ret = (NK1)this.get("NK1");
152           } catch(HL7Exception e) {
153              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
154              throw new RuntimeException(e);
155           }
156           return ret;
157        }
158    
159    
160        /**
161         * Returns a specific repetition of
162         * NK1 (NK1 - next of kin / associated parties segment-) - creates it if necessary
163         *
164         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
165         * @throws HL7Exception if the repetition requested is more than one 
166         *     greater than the number of existing repetitions.
167         */
168        public NK1 getNK1(int rep) { 
169           NK1 ret = null;
170           try {
171              ret = (NK1)this.get("NK1", rep);
172           } catch(HL7Exception e) {
173              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
174              throw new RuntimeException(e);
175           }
176           return ret;
177        }
178    
179        /** 
180         * Returns the number of existing repetitions of NK1 
181         */ 
182        public int getNK1Reps() { 
183            int reps = -1; 
184            try { 
185                reps = this.getAll("NK1").length; 
186            } catch (HL7Exception e) { 
187                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
188                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
189                throw new RuntimeException(message);
190            } 
191            return reps; 
192        } 
193    
194        /**
195         * Inserts a specific repetition of NK1 (NK1 - next of kin / associated parties segment-)
196         * @see AbstractGroup#insertRepetition(Structure, int) 
197         */
198        public void insertNK1(NK1 structure, int rep) throws HL7Exception { 
199           super.insertRepetition("NK1", structure, rep);
200        }
201    
202    
203        /**
204         * Inserts a specific repetition of NK1 (NK1 - next of kin / associated parties segment-)
205         * @see AbstractGroup#insertRepetition(Structure, int) 
206         */
207        public NK1 insertNK1(int rep) throws HL7Exception { 
208           return (NK1)super.insertRepetition("NK1", rep);
209        }
210    
211    
212        /**
213         * Removes a specific repetition of NK1 (NK1 - next of kin / associated parties segment-)
214         * @see AbstractGroup#removeRepetition(String, int) 
215         */
216        public NK1 removeNK1(int rep) throws HL7Exception { 
217           return (NK1)super.removeRepetition("NK1", rep);
218        }
219    
220    
221    
222        /**
223         * Returns
224         * PV1 (PV1 - patient visit segment-) - creates it if necessary
225         */
226        public PV1 getPV1() { 
227           PV1 ret = null;
228           try {
229              ret = (PV1)this.get("PV1");
230           } catch(HL7Exception e) {
231              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
232              throw new RuntimeException(e);
233           }
234           return ret;
235        }
236    
237    
238    
239    
240        /**
241         * Returns
242         * PV2 (PV2 - patient visit - additional information segment) - creates it if necessary
243         */
244        public PV2 getPV2() { 
245           PV2 ret = null;
246           try {
247              ret = (PV2)this.get("PV2");
248           } catch(HL7Exception e) {
249              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
250              throw new RuntimeException(e);
251           }
252           return ret;
253        }
254    
255    
256    
257    
258        /**
259         * Returns
260         * the first repetition of 
261         * DB1 (DB1 - Disability segment) - creates it if necessary
262         */
263        public DB1 getDB1() { 
264           DB1 ret = null;
265           try {
266              ret = (DB1)this.get("DB1");
267           } catch(HL7Exception e) {
268              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
269              throw new RuntimeException(e);
270           }
271           return ret;
272        }
273    
274    
275        /**
276         * Returns a specific repetition of
277         * DB1 (DB1 - Disability segment) - creates it if necessary
278         *
279         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
280         * @throws HL7Exception if the repetition requested is more than one 
281         *     greater than the number of existing repetitions.
282         */
283        public DB1 getDB1(int rep) { 
284           DB1 ret = null;
285           try {
286              ret = (DB1)this.get("DB1", rep);
287           } catch(HL7Exception e) {
288              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
289              throw new RuntimeException(e);
290           }
291           return ret;
292        }
293    
294        /** 
295         * Returns the number of existing repetitions of DB1 
296         */ 
297        public int getDB1Reps() { 
298            int reps = -1; 
299            try { 
300                reps = this.getAll("DB1").length; 
301            } catch (HL7Exception e) { 
302                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
303                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
304                throw new RuntimeException(message);
305            } 
306            return reps; 
307        } 
308    
309        /**
310         * Inserts a specific repetition of DB1 (DB1 - Disability segment)
311         * @see AbstractGroup#insertRepetition(Structure, int) 
312         */
313        public void insertDB1(DB1 structure, int rep) throws HL7Exception { 
314           super.insertRepetition("DB1", structure, rep);
315        }
316    
317    
318        /**
319         * Inserts a specific repetition of DB1 (DB1 - Disability segment)
320         * @see AbstractGroup#insertRepetition(Structure, int) 
321         */
322        public DB1 insertDB1(int rep) throws HL7Exception { 
323           return (DB1)super.insertRepetition("DB1", rep);
324        }
325    
326    
327        /**
328         * Removes a specific repetition of DB1 (DB1 - Disability segment)
329         * @see AbstractGroup#removeRepetition(String, int) 
330         */
331        public DB1 removeDB1(int rep) throws HL7Exception { 
332           return (DB1)super.removeRepetition("DB1", rep);
333        }
334    
335    
336    
337        /**
338         * Returns
339         * the first repetition of 
340         * OBX (OBX - observation/result segment) - creates it if necessary
341         */
342        public OBX getOBX() { 
343           OBX ret = null;
344           try {
345              ret = (OBX)this.get("OBX");
346           } catch(HL7Exception e) {
347              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
348              throw new RuntimeException(e);
349           }
350           return ret;
351        }
352    
353    
354        /**
355         * Returns a specific repetition of
356         * OBX (OBX - observation/result segment) - creates it if necessary
357         *
358         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
359         * @throws HL7Exception if the repetition requested is more than one 
360         *     greater than the number of existing repetitions.
361         */
362        public OBX getOBX(int rep) { 
363           OBX ret = null;
364           try {
365              ret = (OBX)this.get("OBX", rep);
366           } catch(HL7Exception e) {
367              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
368              throw new RuntimeException(e);
369           }
370           return ret;
371        }
372    
373        /** 
374         * Returns the number of existing repetitions of OBX 
375         */ 
376        public int getOBXReps() { 
377            int reps = -1; 
378            try { 
379                reps = this.getAll("OBX").length; 
380            } catch (HL7Exception e) { 
381                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
382                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
383                throw new RuntimeException(message);
384            } 
385            return reps; 
386        } 
387    
388        /**
389         * Inserts a specific repetition of OBX (OBX - observation/result segment)
390         * @see AbstractGroup#insertRepetition(Structure, int) 
391         */
392        public void insertOBX(OBX structure, int rep) throws HL7Exception { 
393           super.insertRepetition("OBX", structure, rep);
394        }
395    
396    
397        /**
398         * Inserts a specific repetition of OBX (OBX - observation/result segment)
399         * @see AbstractGroup#insertRepetition(Structure, int) 
400         */
401        public OBX insertOBX(int rep) throws HL7Exception { 
402           return (OBX)super.insertRepetition("OBX", rep);
403        }
404    
405    
406        /**
407         * Removes a specific repetition of OBX (OBX - observation/result segment)
408         * @see AbstractGroup#removeRepetition(String, int) 
409         */
410        public OBX removeOBX(int rep) throws HL7Exception { 
411           return (OBX)super.removeRepetition("OBX", rep);
412        }
413    
414    
415    
416        /**
417         * Returns
418         * the first repetition of 
419         * AL1 (AL1 - patient allergy information segment) - creates it if necessary
420         */
421        public AL1 getAL1() { 
422           AL1 ret = null;
423           try {
424              ret = (AL1)this.get("AL1");
425           } catch(HL7Exception e) {
426              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
427              throw new RuntimeException(e);
428           }
429           return ret;
430        }
431    
432    
433        /**
434         * Returns a specific repetition of
435         * AL1 (AL1 - patient allergy information segment) - creates it if necessary
436         *
437         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
438         * @throws HL7Exception if the repetition requested is more than one 
439         *     greater than the number of existing repetitions.
440         */
441        public AL1 getAL1(int rep) { 
442           AL1 ret = null;
443           try {
444              ret = (AL1)this.get("AL1", rep);
445           } catch(HL7Exception e) {
446              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
447              throw new RuntimeException(e);
448           }
449           return ret;
450        }
451    
452        /** 
453         * Returns the number of existing repetitions of AL1 
454         */ 
455        public int getAL1Reps() { 
456            int reps = -1; 
457            try { 
458                reps = this.getAll("AL1").length; 
459            } catch (HL7Exception e) { 
460                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
461                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
462                throw new RuntimeException(message);
463            } 
464            return reps; 
465        } 
466    
467        /**
468         * Inserts a specific repetition of AL1 (AL1 - patient allergy information segment)
469         * @see AbstractGroup#insertRepetition(Structure, int) 
470         */
471        public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
472           super.insertRepetition("AL1", structure, rep);
473        }
474    
475    
476        /**
477         * Inserts a specific repetition of AL1 (AL1 - patient allergy information segment)
478         * @see AbstractGroup#insertRepetition(Structure, int) 
479         */
480        public AL1 insertAL1(int rep) throws HL7Exception { 
481           return (AL1)super.insertRepetition("AL1", rep);
482        }
483    
484    
485        /**
486         * Removes a specific repetition of AL1 (AL1 - patient allergy information segment)
487         * @see AbstractGroup#removeRepetition(String, int) 
488         */
489        public AL1 removeAL1(int rep) throws HL7Exception { 
490           return (AL1)super.removeRepetition("AL1", rep);
491        }
492    
493    
494    
495        /**
496         * Returns
497         * the first repetition of 
498         * DG1 (DG1 - diagnosis segment) - creates it if necessary
499         */
500        public DG1 getDG1() { 
501           DG1 ret = null;
502           try {
503              ret = (DG1)this.get("DG1");
504           } catch(HL7Exception e) {
505              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
506              throw new RuntimeException(e);
507           }
508           return ret;
509        }
510    
511    
512        /**
513         * Returns a specific repetition of
514         * DG1 (DG1 - diagnosis segment) - creates it if necessary
515         *
516         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
517         * @throws HL7Exception if the repetition requested is more than one 
518         *     greater than the number of existing repetitions.
519         */
520        public DG1 getDG1(int rep) { 
521           DG1 ret = null;
522           try {
523              ret = (DG1)this.get("DG1", rep);
524           } catch(HL7Exception e) {
525              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
526              throw new RuntimeException(e);
527           }
528           return ret;
529        }
530    
531        /** 
532         * Returns the number of existing repetitions of DG1 
533         */ 
534        public int getDG1Reps() { 
535            int reps = -1; 
536            try { 
537                reps = this.getAll("DG1").length; 
538            } catch (HL7Exception e) { 
539                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
540                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
541                throw new RuntimeException(message);
542            } 
543            return reps; 
544        } 
545    
546        /**
547         * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
548         * @see AbstractGroup#insertRepetition(Structure, int) 
549         */
550        public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
551           super.insertRepetition("DG1", structure, rep);
552        }
553    
554    
555        /**
556         * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
557         * @see AbstractGroup#insertRepetition(Structure, int) 
558         */
559        public DG1 insertDG1(int rep) throws HL7Exception { 
560           return (DG1)super.insertRepetition("DG1", rep);
561        }
562    
563    
564        /**
565         * Removes a specific repetition of DG1 (DG1 - diagnosis segment)
566         * @see AbstractGroup#removeRepetition(String, int) 
567         */
568        public DG1 removeDG1(int rep) throws HL7Exception { 
569           return (DG1)super.removeRepetition("DG1", rep);
570        }
571    
572    
573    
574        /**
575         * Returns
576         * DRG (DRG - diagnosis related group segment) - creates it if necessary
577         */
578        public DRG getDRG() { 
579           DRG ret = null;
580           try {
581              ret = (DRG)this.get("DRG");
582           } catch(HL7Exception e) {
583              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
584              throw new RuntimeException(e);
585           }
586           return ret;
587        }
588    
589    
590    
591    
592        /**
593         * Returns
594         * the first repetition of 
595         * PR1ROL (a Group object) - creates it if necessary
596         */
597        public ADR_A19_PR1ROL getPR1ROL() { 
598           ADR_A19_PR1ROL ret = null;
599           try {
600              ret = (ADR_A19_PR1ROL)this.get("PR1ROL");
601           } catch(HL7Exception e) {
602              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
603              throw new RuntimeException(e);
604           }
605           return ret;
606        }
607    
608    
609        /**
610         * Returns a specific repetition of
611         * PR1ROL (a Group object) - creates it if necessary
612         *
613         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
614         * @throws HL7Exception if the repetition requested is more than one 
615         *     greater than the number of existing repetitions.
616         */
617        public ADR_A19_PR1ROL getPR1ROL(int rep) { 
618           ADR_A19_PR1ROL ret = null;
619           try {
620              ret = (ADR_A19_PR1ROL)this.get("PR1ROL", rep);
621           } catch(HL7Exception e) {
622              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
623              throw new RuntimeException(e);
624           }
625           return ret;
626        }
627    
628        /** 
629         * Returns the number of existing repetitions of PR1ROL 
630         */ 
631        public int getPR1ROLReps() { 
632            int reps = -1; 
633            try { 
634                reps = this.getAll("PR1ROL").length; 
635            } catch (HL7Exception e) { 
636                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
637                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
638                throw new RuntimeException(message);
639            } 
640            return reps; 
641        } 
642    
643        /**
644         * Inserts a specific repetition of PR1ROL (a Group object)
645         * @see AbstractGroup#insertRepetition(Structure, int) 
646         */
647        public void insertPR1ROL(ADR_A19_PR1ROL structure, int rep) throws HL7Exception { 
648           super.insertRepetition("PR1ROL", structure, rep);
649        }
650    
651    
652        /**
653         * Inserts a specific repetition of PR1ROL (a Group object)
654         * @see AbstractGroup#insertRepetition(Structure, int) 
655         */
656        public ADR_A19_PR1ROL insertPR1ROL(int rep) throws HL7Exception { 
657           return (ADR_A19_PR1ROL)super.insertRepetition("PR1ROL", rep);
658        }
659    
660    
661        /**
662         * Removes a specific repetition of PR1ROL (a Group object)
663         * @see AbstractGroup#removeRepetition(String, int) 
664         */
665        public ADR_A19_PR1ROL removePR1ROL(int rep) throws HL7Exception { 
666           return (ADR_A19_PR1ROL)super.removeRepetition("PR1ROL", rep);
667        }
668    
669    
670    
671        /**
672         * Returns
673         * the first repetition of 
674         * GT1 (GT1 - guarantor segment) - creates it if necessary
675         */
676        public GT1 getGT1() { 
677           GT1 ret = null;
678           try {
679              ret = (GT1)this.get("GT1");
680           } catch(HL7Exception e) {
681              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
682              throw new RuntimeException(e);
683           }
684           return ret;
685        }
686    
687    
688        /**
689         * Returns a specific repetition of
690         * GT1 (GT1 - guarantor segment) - creates it if necessary
691         *
692         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
693         * @throws HL7Exception if the repetition requested is more than one 
694         *     greater than the number of existing repetitions.
695         */
696        public GT1 getGT1(int rep) { 
697           GT1 ret = null;
698           try {
699              ret = (GT1)this.get("GT1", rep);
700           } catch(HL7Exception e) {
701              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
702              throw new RuntimeException(e);
703           }
704           return ret;
705        }
706    
707        /** 
708         * Returns the number of existing repetitions of GT1 
709         */ 
710        public int getGT1Reps() { 
711            int reps = -1; 
712            try { 
713                reps = this.getAll("GT1").length; 
714            } catch (HL7Exception e) { 
715                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
716                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
717                throw new RuntimeException(message);
718            } 
719            return reps; 
720        } 
721    
722        /**
723         * Inserts a specific repetition of GT1 (GT1 - guarantor segment)
724         * @see AbstractGroup#insertRepetition(Structure, int) 
725         */
726        public void insertGT1(GT1 structure, int rep) throws HL7Exception { 
727           super.insertRepetition("GT1", structure, rep);
728        }
729    
730    
731        /**
732         * Inserts a specific repetition of GT1 (GT1 - guarantor segment)
733         * @see AbstractGroup#insertRepetition(Structure, int) 
734         */
735        public GT1 insertGT1(int rep) throws HL7Exception { 
736           return (GT1)super.insertRepetition("GT1", rep);
737        }
738    
739    
740        /**
741         * Removes a specific repetition of GT1 (GT1 - guarantor segment)
742         * @see AbstractGroup#removeRepetition(String, int) 
743         */
744        public GT1 removeGT1(int rep) throws HL7Exception { 
745           return (GT1)super.removeRepetition("GT1", rep);
746        }
747    
748    
749    
750        /**
751         * Returns
752         * the first repetition of 
753         * IN1IN2IN3 (a Group object) - creates it if necessary
754         */
755        public ADR_A19_IN1IN2IN3 getIN1IN2IN3() { 
756           ADR_A19_IN1IN2IN3 ret = null;
757           try {
758              ret = (ADR_A19_IN1IN2IN3)this.get("IN1IN2IN3");
759           } catch(HL7Exception e) {
760              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
761              throw new RuntimeException(e);
762           }
763           return ret;
764        }
765    
766    
767        /**
768         * Returns a specific repetition of
769         * IN1IN2IN3 (a Group object) - creates it if necessary
770         *
771         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
772         * @throws HL7Exception if the repetition requested is more than one 
773         *     greater than the number of existing repetitions.
774         */
775        public ADR_A19_IN1IN2IN3 getIN1IN2IN3(int rep) { 
776           ADR_A19_IN1IN2IN3 ret = null;
777           try {
778              ret = (ADR_A19_IN1IN2IN3)this.get("IN1IN2IN3", rep);
779           } catch(HL7Exception e) {
780              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
781              throw new RuntimeException(e);
782           }
783           return ret;
784        }
785    
786        /** 
787         * Returns the number of existing repetitions of IN1IN2IN3 
788         */ 
789        public int getIN1IN2IN3Reps() { 
790            int reps = -1; 
791            try { 
792                reps = this.getAll("IN1IN2IN3").length; 
793            } catch (HL7Exception e) { 
794                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
795                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
796                throw new RuntimeException(message);
797            } 
798            return reps; 
799        } 
800    
801        /**
802         * Inserts a specific repetition of IN1IN2IN3 (a Group object)
803         * @see AbstractGroup#insertRepetition(Structure, int) 
804         */
805        public void insertIN1IN2IN3(ADR_A19_IN1IN2IN3 structure, int rep) throws HL7Exception { 
806           super.insertRepetition("IN1IN2IN3", structure, rep);
807        }
808    
809    
810        /**
811         * Inserts a specific repetition of IN1IN2IN3 (a Group object)
812         * @see AbstractGroup#insertRepetition(Structure, int) 
813         */
814        public ADR_A19_IN1IN2IN3 insertIN1IN2IN3(int rep) throws HL7Exception { 
815           return (ADR_A19_IN1IN2IN3)super.insertRepetition("IN1IN2IN3", rep);
816        }
817    
818    
819        /**
820         * Removes a specific repetition of IN1IN2IN3 (a Group object)
821         * @see AbstractGroup#removeRepetition(String, int) 
822         */
823        public ADR_A19_IN1IN2IN3 removeIN1IN2IN3(int rep) throws HL7Exception { 
824           return (ADR_A19_IN1IN2IN3)super.removeRepetition("IN1IN2IN3", rep);
825        }
826    
827    
828    
829        /**
830         * Returns
831         * ACC (ACC - accident segment) - creates it if necessary
832         */
833        public ACC getACC() { 
834           ACC ret = null;
835           try {
836              ret = (ACC)this.get("ACC");
837           } catch(HL7Exception e) {
838              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
839              throw new RuntimeException(e);
840           }
841           return ret;
842        }
843    
844    
845    
846    
847        /**
848         * Returns
849         * UB1 (UB1 - UB82 data segment) - creates it if necessary
850         */
851        public UB1 getUB1() { 
852           UB1 ret = null;
853           try {
854              ret = (UB1)this.get("UB1");
855           } catch(HL7Exception e) {
856              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
857              throw new RuntimeException(e);
858           }
859           return ret;
860        }
861    
862    
863    
864    
865        /**
866         * Returns
867         * UB2 (UB2 - UB92 data segment) - creates it if necessary
868         */
869        public UB2 getUB2() { 
870           UB2 ret = null;
871           try {
872              ret = (UB2)this.get("UB2");
873           } catch(HL7Exception e) {
874              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
875              throw new RuntimeException(e);
876           }
877           return ret;
878        }
879    
880    
881    
882    
883    }
884