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