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