001    /*
002     * This class is an auto-generated source file for a HAPI
003     * HL7 v2.x standard structure class.
004     *
005     * For more information, visit: http://hl7api.sourceforge.net/
006     */
007    
008    package ca.uhn.hl7v2.model.v24.group;
009    
010    import ca.uhn.hl7v2.model.v24.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_P05_VISIT 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 (Patient visit) <b>optional </b></li>
028                     * <li>2: PV2 (Patient visit - additional information) <b>optional </b></li>
029                     * <li>3: ROL (Role) <b>optional repeating</b></li>
030                     * <li>4: DB1 (Disability) <b>optional repeating</b></li>
031                     * <li>5: OBX (Observation/Result) <b>optional repeating</b></li>
032                     * <li>6: AL1 (Patient allergy information) <b>optional repeating</b></li>
033                     * <li>7: DG1 (Diagnosis) <b>optional repeating</b></li>
034                     * <li>8: DRG (Diagnosis Related Group) <b>optional </b></li>
035                     * <li>9: BAR_P05_PROCEDURE (a Group object) <b>optional repeating</b></li>
036                     * <li>10: GT1 (Guarantor) <b>optional repeating</b></li>
037                     * <li>11: NK1 (Next of kin / associated parties) <b>optional repeating</b></li>
038                     * <li>12: BAR_P05_INSURANCE (a Group object) <b>optional repeating</b></li>
039                     * <li>13: ACC (Accident) <b>optional </b></li>
040                     * <li>14: UB1 (UB82) <b>optional </b></li>
041                     * <li>15: UB2 (UB92 Data) <b>optional </b></li>
042                     * <li>16: ABS (Abstract) <b>optional </b></li>
043                     * <li>17: BLC (Blood Code) <b>optional repeating</b></li>
044                     * <li>18: RMI (Risk Management Incident) <b>optional </b></li>
045     * </ul>
046     */
047    public class BAR_P05_VISIT extends AbstractGroup {
048    
049        /** 
050         * Creates a new BAR_P05_VISIT group
051         */
052        public BAR_P05_VISIT(Group parent, ModelClassFactory factory) {
053           super(parent, factory);
054           init(factory);
055        }
056    
057        private void init(ModelClassFactory factory) {
058           try {
059                              this.add(PV1.class, false, false);
060                              this.add(PV2.class, false, false);
061                              this.add(ROL.class, false, true);
062                              this.add(DB1.class, false, true);
063                              this.add(OBX.class, false, true);
064                              this.add(AL1.class, false, true);
065                              this.add(DG1.class, false, true);
066                              this.add(DRG.class, false, false);
067                              this.add(BAR_P05_PROCEDURE.class, false, true);
068                              this.add(GT1.class, false, true);
069                              this.add(NK1.class, false, true);
070                              this.add(BAR_P05_INSURANCE.class, false, true);
071                              this.add(ACC.class, false, false);
072                              this.add(UB1.class, false, false);
073                              this.add(UB2.class, false, false);
074                              this.add(ABS.class, false, false);
075                              this.add(BLC.class, false, true);
076                              this.add(RMI.class, false, false);
077           } catch(HL7Exception e) {
078              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating BAR_P05_VISIT - this is probably a bug in the source code generator.", e);
079           }
080        }
081    
082        /** 
083         * Returns "2.4"
084         */
085        public String getVersion() {
086           return "2.4";
087        }
088    
089    
090    
091        /**
092         * Returns
093         * PV1 (Patient visit) - creates it if necessary
094         */
095        public PV1 getPV1() { 
096           PV1 ret = null;
097           try {
098              ret = (PV1)this.get("PV1");
099           } catch(HL7Exception e) {
100              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
101              throw new RuntimeException(e);
102           }
103           return ret;
104        }
105    
106    
107    
108    
109        /**
110         * Returns
111         * PV2 (Patient visit - additional information) - creates it if necessary
112         */
113        public PV2 getPV2() { 
114           PV2 ret = null;
115           try {
116              ret = (PV2)this.get("PV2");
117           } catch(HL7Exception e) {
118              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
119              throw new RuntimeException(e);
120           }
121           return ret;
122        }
123    
124    
125    
126    
127        /**
128         * Returns
129         * the first repetition of 
130         * ROL (Role) - creates it if necessary
131         */
132        public ROL getROL() { 
133           ROL ret = null;
134           try {
135              ret = (ROL)this.get("ROL");
136           } catch(HL7Exception e) {
137              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
138              throw new RuntimeException(e);
139           }
140           return ret;
141        }
142    
143    
144        /**
145         * Returns a specific repetition of
146         * ROL (Role) - creates it if necessary
147         *
148         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
149         * @throws HL7Exception if the repetition requested is more than one 
150         *     greater than the number of existing repetitions.
151         */
152        public ROL getROL(int rep) { 
153           ROL ret = null;
154           try {
155              ret = (ROL)this.get("ROL", rep);
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         * Returns the number of existing repetitions of ROL 
165         */ 
166        public int getROLReps() { 
167            int reps = -1; 
168            try { 
169                reps = this.getAll("ROL").length; 
170            } catch (HL7Exception e) { 
171                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
172                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
173                throw new RuntimeException(message);
174            } 
175            return reps; 
176        } 
177    
178        /**
179         * Inserts a specific repetition of ROL (Role)
180         * @see AbstractGroup#insertRepetition(Structure, int) 
181         */
182        public void insertROL(ROL structure, int rep) throws HL7Exception { 
183           super.insertRepetition("ROL", structure, rep);
184        }
185    
186    
187        /**
188         * Inserts a specific repetition of ROL (Role)
189         * @see AbstractGroup#insertRepetition(Structure, int) 
190         */
191        public ROL insertROL(int rep) throws HL7Exception { 
192           return (ROL)super.insertRepetition("ROL", rep);
193        }
194    
195    
196        /**
197         * Removes a specific repetition of ROL (Role)
198         * @see AbstractGroup#removeRepetition(String, int) 
199         */
200        public ROL removeROL(int rep) throws HL7Exception { 
201           return (ROL)super.removeRepetition("ROL", rep);
202        }
203    
204    
205    
206        /**
207         * Returns
208         * the first repetition of 
209         * DB1 (Disability) - creates it if necessary
210         */
211        public DB1 getDB1() { 
212           DB1 ret = null;
213           try {
214              ret = (DB1)this.get("DB1");
215           } catch(HL7Exception e) {
216              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
217              throw new RuntimeException(e);
218           }
219           return ret;
220        }
221    
222    
223        /**
224         * Returns a specific repetition of
225         * DB1 (Disability) - creates it if necessary
226         *
227         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
228         * @throws HL7Exception if the repetition requested is more than one 
229         *     greater than the number of existing repetitions.
230         */
231        public DB1 getDB1(int rep) { 
232           DB1 ret = null;
233           try {
234              ret = (DB1)this.get("DB1", rep);
235           } catch(HL7Exception e) {
236              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
237              throw new RuntimeException(e);
238           }
239           return ret;
240        }
241    
242        /** 
243         * Returns the number of existing repetitions of DB1 
244         */ 
245        public int getDB1Reps() { 
246            int reps = -1; 
247            try { 
248                reps = this.getAll("DB1").length; 
249            } catch (HL7Exception e) { 
250                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
251                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
252                throw new RuntimeException(message);
253            } 
254            return reps; 
255        } 
256    
257        /**
258         * Inserts a specific repetition of DB1 (Disability)
259         * @see AbstractGroup#insertRepetition(Structure, int) 
260         */
261        public void insertDB1(DB1 structure, int rep) throws HL7Exception { 
262           super.insertRepetition("DB1", structure, rep);
263        }
264    
265    
266        /**
267         * Inserts a specific repetition of DB1 (Disability)
268         * @see AbstractGroup#insertRepetition(Structure, int) 
269         */
270        public DB1 insertDB1(int rep) throws HL7Exception { 
271           return (DB1)super.insertRepetition("DB1", rep);
272        }
273    
274    
275        /**
276         * Removes a specific repetition of DB1 (Disability)
277         * @see AbstractGroup#removeRepetition(String, int) 
278         */
279        public DB1 removeDB1(int rep) throws HL7Exception { 
280           return (DB1)super.removeRepetition("DB1", rep);
281        }
282    
283    
284    
285        /**
286         * Returns
287         * the first repetition of 
288         * OBX (Observation/Result) - creates it if necessary
289         */
290        public OBX getOBX() { 
291           OBX ret = null;
292           try {
293              ret = (OBX)this.get("OBX");
294           } catch(HL7Exception e) {
295              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
296              throw new RuntimeException(e);
297           }
298           return ret;
299        }
300    
301    
302        /**
303         * Returns a specific repetition of
304         * OBX (Observation/Result) - creates it if necessary
305         *
306         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
307         * @throws HL7Exception if the repetition requested is more than one 
308         *     greater than the number of existing repetitions.
309         */
310        public OBX getOBX(int rep) { 
311           OBX ret = null;
312           try {
313              ret = (OBX)this.get("OBX", rep);
314           } catch(HL7Exception e) {
315              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
316              throw new RuntimeException(e);
317           }
318           return ret;
319        }
320    
321        /** 
322         * Returns the number of existing repetitions of OBX 
323         */ 
324        public int getOBXReps() { 
325            int reps = -1; 
326            try { 
327                reps = this.getAll("OBX").length; 
328            } catch (HL7Exception e) { 
329                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
330                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
331                throw new RuntimeException(message);
332            } 
333            return reps; 
334        } 
335    
336        /**
337         * Inserts a specific repetition of OBX (Observation/Result)
338         * @see AbstractGroup#insertRepetition(Structure, int) 
339         */
340        public void insertOBX(OBX structure, int rep) throws HL7Exception { 
341           super.insertRepetition("OBX", structure, rep);
342        }
343    
344    
345        /**
346         * Inserts a specific repetition of OBX (Observation/Result)
347         * @see AbstractGroup#insertRepetition(Structure, int) 
348         */
349        public OBX insertOBX(int rep) throws HL7Exception { 
350           return (OBX)super.insertRepetition("OBX", rep);
351        }
352    
353    
354        /**
355         * Removes a specific repetition of OBX (Observation/Result)
356         * @see AbstractGroup#removeRepetition(String, int) 
357         */
358        public OBX removeOBX(int rep) throws HL7Exception { 
359           return (OBX)super.removeRepetition("OBX", rep);
360        }
361    
362    
363    
364        /**
365         * Returns
366         * the first repetition of 
367         * AL1 (Patient allergy information) - creates it if necessary
368         */
369        public AL1 getAL1() { 
370           AL1 ret = null;
371           try {
372              ret = (AL1)this.get("AL1");
373           } catch(HL7Exception e) {
374              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
375              throw new RuntimeException(e);
376           }
377           return ret;
378        }
379    
380    
381        /**
382         * Returns a specific repetition of
383         * AL1 (Patient allergy information) - creates it if necessary
384         *
385         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
386         * @throws HL7Exception if the repetition requested is more than one 
387         *     greater than the number of existing repetitions.
388         */
389        public AL1 getAL1(int rep) { 
390           AL1 ret = null;
391           try {
392              ret = (AL1)this.get("AL1", rep);
393           } catch(HL7Exception e) {
394              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
395              throw new RuntimeException(e);
396           }
397           return ret;
398        }
399    
400        /** 
401         * Returns the number of existing repetitions of AL1 
402         */ 
403        public int getAL1Reps() { 
404            int reps = -1; 
405            try { 
406                reps = this.getAll("AL1").length; 
407            } catch (HL7Exception e) { 
408                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
409                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
410                throw new RuntimeException(message);
411            } 
412            return reps; 
413        } 
414    
415        /**
416         * Inserts a specific repetition of AL1 (Patient allergy information)
417         * @see AbstractGroup#insertRepetition(Structure, int) 
418         */
419        public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
420           super.insertRepetition("AL1", structure, rep);
421        }
422    
423    
424        /**
425         * Inserts a specific repetition of AL1 (Patient allergy information)
426         * @see AbstractGroup#insertRepetition(Structure, int) 
427         */
428        public AL1 insertAL1(int rep) throws HL7Exception { 
429           return (AL1)super.insertRepetition("AL1", rep);
430        }
431    
432    
433        /**
434         * Removes a specific repetition of AL1 (Patient allergy information)
435         * @see AbstractGroup#removeRepetition(String, int) 
436         */
437        public AL1 removeAL1(int rep) throws HL7Exception { 
438           return (AL1)super.removeRepetition("AL1", rep);
439        }
440    
441    
442    
443        /**
444         * Returns
445         * the first repetition of 
446         * DG1 (Diagnosis) - creates it if necessary
447         */
448        public DG1 getDG1() { 
449           DG1 ret = null;
450           try {
451              ret = (DG1)this.get("DG1");
452           } catch(HL7Exception e) {
453              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
454              throw new RuntimeException(e);
455           }
456           return ret;
457        }
458    
459    
460        /**
461         * Returns a specific repetition of
462         * DG1 (Diagnosis) - creates it if necessary
463         *
464         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
465         * @throws HL7Exception if the repetition requested is more than one 
466         *     greater than the number of existing repetitions.
467         */
468        public DG1 getDG1(int rep) { 
469           DG1 ret = null;
470           try {
471              ret = (DG1)this.get("DG1", rep);
472           } catch(HL7Exception e) {
473              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
474              throw new RuntimeException(e);
475           }
476           return ret;
477        }
478    
479        /** 
480         * Returns the number of existing repetitions of DG1 
481         */ 
482        public int getDG1Reps() { 
483            int reps = -1; 
484            try { 
485                reps = this.getAll("DG1").length; 
486            } catch (HL7Exception e) { 
487                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
488                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
489                throw new RuntimeException(message);
490            } 
491            return reps; 
492        } 
493    
494        /**
495         * Inserts a specific repetition of DG1 (Diagnosis)
496         * @see AbstractGroup#insertRepetition(Structure, int) 
497         */
498        public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
499           super.insertRepetition("DG1", structure, rep);
500        }
501    
502    
503        /**
504         * Inserts a specific repetition of DG1 (Diagnosis)
505         * @see AbstractGroup#insertRepetition(Structure, int) 
506         */
507        public DG1 insertDG1(int rep) throws HL7Exception { 
508           return (DG1)super.insertRepetition("DG1", rep);
509        }
510    
511    
512        /**
513         * Removes a specific repetition of DG1 (Diagnosis)
514         * @see AbstractGroup#removeRepetition(String, int) 
515         */
516        public DG1 removeDG1(int rep) throws HL7Exception { 
517           return (DG1)super.removeRepetition("DG1", rep);
518        }
519    
520    
521    
522        /**
523         * Returns
524         * DRG (Diagnosis Related Group) - creates it if necessary
525         */
526        public DRG getDRG() { 
527           DRG ret = null;
528           try {
529              ret = (DRG)this.get("DRG");
530           } catch(HL7Exception e) {
531              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
532              throw new RuntimeException(e);
533           }
534           return ret;
535        }
536    
537    
538    
539    
540        /**
541         * Returns
542         * the first repetition of 
543         * PROCEDURE (a Group object) - creates it if necessary
544         */
545        public BAR_P05_PROCEDURE getPROCEDURE() { 
546           BAR_P05_PROCEDURE ret = null;
547           try {
548              ret = (BAR_P05_PROCEDURE)this.get("PROCEDURE");
549           } catch(HL7Exception e) {
550              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
551              throw new RuntimeException(e);
552           }
553           return ret;
554        }
555    
556    
557        /**
558         * Returns a specific repetition of
559         * PROCEDURE (a Group object) - creates it if necessary
560         *
561         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
562         * @throws HL7Exception if the repetition requested is more than one 
563         *     greater than the number of existing repetitions.
564         */
565        public BAR_P05_PROCEDURE getPROCEDURE(int rep) { 
566           BAR_P05_PROCEDURE ret = null;
567           try {
568              ret = (BAR_P05_PROCEDURE)this.get("PROCEDURE", rep);
569           } catch(HL7Exception e) {
570              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
571              throw new RuntimeException(e);
572           }
573           return ret;
574        }
575    
576        /** 
577         * Returns the number of existing repetitions of PROCEDURE 
578         */ 
579        public int getPROCEDUREReps() { 
580            int reps = -1; 
581            try { 
582                reps = this.getAll("PROCEDURE").length; 
583            } catch (HL7Exception e) { 
584                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
585                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
586                throw new RuntimeException(message);
587            } 
588            return reps; 
589        } 
590    
591        /**
592         * Inserts a specific repetition of PROCEDURE (a Group object)
593         * @see AbstractGroup#insertRepetition(Structure, int) 
594         */
595        public void insertPROCEDURE(BAR_P05_PROCEDURE structure, int rep) throws HL7Exception { 
596           super.insertRepetition("PROCEDURE", structure, rep);
597        }
598    
599    
600        /**
601         * Inserts a specific repetition of PROCEDURE (a Group object)
602         * @see AbstractGroup#insertRepetition(Structure, int) 
603         */
604        public BAR_P05_PROCEDURE insertPROCEDURE(int rep) throws HL7Exception { 
605           return (BAR_P05_PROCEDURE)super.insertRepetition("PROCEDURE", rep);
606        }
607    
608    
609        /**
610         * Removes a specific repetition of PROCEDURE (a Group object)
611         * @see AbstractGroup#removeRepetition(String, int) 
612         */
613        public BAR_P05_PROCEDURE removePROCEDURE(int rep) throws HL7Exception { 
614           return (BAR_P05_PROCEDURE)super.removeRepetition("PROCEDURE", rep);
615        }
616    
617    
618    
619        /**
620         * Returns
621         * the first repetition of 
622         * GT1 (Guarantor) - creates it if necessary
623         */
624        public GT1 getGT1() { 
625           GT1 ret = null;
626           try {
627              ret = (GT1)this.get("GT1");
628           } catch(HL7Exception e) {
629              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
630              throw new RuntimeException(e);
631           }
632           return ret;
633        }
634    
635    
636        /**
637         * Returns a specific repetition of
638         * GT1 (Guarantor) - creates it if necessary
639         *
640         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
641         * @throws HL7Exception if the repetition requested is more than one 
642         *     greater than the number of existing repetitions.
643         */
644        public GT1 getGT1(int rep) { 
645           GT1 ret = null;
646           try {
647              ret = (GT1)this.get("GT1", rep);
648           } catch(HL7Exception e) {
649              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
650              throw new RuntimeException(e);
651           }
652           return ret;
653        }
654    
655        /** 
656         * Returns the number of existing repetitions of GT1 
657         */ 
658        public int getGT1Reps() { 
659            int reps = -1; 
660            try { 
661                reps = this.getAll("GT1").length; 
662            } catch (HL7Exception e) { 
663                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
664                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
665                throw new RuntimeException(message);
666            } 
667            return reps; 
668        } 
669    
670        /**
671         * Inserts a specific repetition of GT1 (Guarantor)
672         * @see AbstractGroup#insertRepetition(Structure, int) 
673         */
674        public void insertGT1(GT1 structure, int rep) throws HL7Exception { 
675           super.insertRepetition("GT1", structure, rep);
676        }
677    
678    
679        /**
680         * Inserts a specific repetition of GT1 (Guarantor)
681         * @see AbstractGroup#insertRepetition(Structure, int) 
682         */
683        public GT1 insertGT1(int rep) throws HL7Exception { 
684           return (GT1)super.insertRepetition("GT1", rep);
685        }
686    
687    
688        /**
689         * Removes a specific repetition of GT1 (Guarantor)
690         * @see AbstractGroup#removeRepetition(String, int) 
691         */
692        public GT1 removeGT1(int rep) throws HL7Exception { 
693           return (GT1)super.removeRepetition("GT1", rep);
694        }
695    
696    
697    
698        /**
699         * Returns
700         * the first repetition of 
701         * NK1 (Next of kin / associated parties) - creates it if necessary
702         */
703        public NK1 getNK1() { 
704           NK1 ret = null;
705           try {
706              ret = (NK1)this.get("NK1");
707           } catch(HL7Exception e) {
708              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
709              throw new RuntimeException(e);
710           }
711           return ret;
712        }
713    
714    
715        /**
716         * Returns a specific repetition of
717         * NK1 (Next of kin / associated parties) - creates it if necessary
718         *
719         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
720         * @throws HL7Exception if the repetition requested is more than one 
721         *     greater than the number of existing repetitions.
722         */
723        public NK1 getNK1(int rep) { 
724           NK1 ret = null;
725           try {
726              ret = (NK1)this.get("NK1", rep);
727           } catch(HL7Exception e) {
728              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
729              throw new RuntimeException(e);
730           }
731           return ret;
732        }
733    
734        /** 
735         * Returns the number of existing repetitions of NK1 
736         */ 
737        public int getNK1Reps() { 
738            int reps = -1; 
739            try { 
740                reps = this.getAll("NK1").length; 
741            } catch (HL7Exception e) { 
742                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
743                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
744                throw new RuntimeException(message);
745            } 
746            return reps; 
747        } 
748    
749        /**
750         * Inserts a specific repetition of NK1 (Next of kin / associated parties)
751         * @see AbstractGroup#insertRepetition(Structure, int) 
752         */
753        public void insertNK1(NK1 structure, int rep) throws HL7Exception { 
754           super.insertRepetition("NK1", structure, rep);
755        }
756    
757    
758        /**
759         * Inserts a specific repetition of NK1 (Next of kin / associated parties)
760         * @see AbstractGroup#insertRepetition(Structure, int) 
761         */
762        public NK1 insertNK1(int rep) throws HL7Exception { 
763           return (NK1)super.insertRepetition("NK1", rep);
764        }
765    
766    
767        /**
768         * Removes a specific repetition of NK1 (Next of kin / associated parties)
769         * @see AbstractGroup#removeRepetition(String, int) 
770         */
771        public NK1 removeNK1(int rep) throws HL7Exception { 
772           return (NK1)super.removeRepetition("NK1", rep);
773        }
774    
775    
776    
777        /**
778         * Returns
779         * the first repetition of 
780         * INSURANCE (a Group object) - creates it if necessary
781         */
782        public BAR_P05_INSURANCE getINSURANCE() { 
783           BAR_P05_INSURANCE ret = null;
784           try {
785              ret = (BAR_P05_INSURANCE)this.get("INSURANCE");
786           } catch(HL7Exception e) {
787              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
788              throw new RuntimeException(e);
789           }
790           return ret;
791        }
792    
793    
794        /**
795         * Returns a specific repetition of
796         * INSURANCE (a Group object) - creates it if necessary
797         *
798         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
799         * @throws HL7Exception if the repetition requested is more than one 
800         *     greater than the number of existing repetitions.
801         */
802        public BAR_P05_INSURANCE getINSURANCE(int rep) { 
803           BAR_P05_INSURANCE ret = null;
804           try {
805              ret = (BAR_P05_INSURANCE)this.get("INSURANCE", rep);
806           } catch(HL7Exception e) {
807              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
808              throw new RuntimeException(e);
809           }
810           return ret;
811        }
812    
813        /** 
814         * Returns the number of existing repetitions of INSURANCE 
815         */ 
816        public int getINSURANCEReps() { 
817            int reps = -1; 
818            try { 
819                reps = this.getAll("INSURANCE").length; 
820            } catch (HL7Exception e) { 
821                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
822                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
823                throw new RuntimeException(message);
824            } 
825            return reps; 
826        } 
827    
828        /**
829         * Inserts a specific repetition of INSURANCE (a Group object)
830         * @see AbstractGroup#insertRepetition(Structure, int) 
831         */
832        public void insertINSURANCE(BAR_P05_INSURANCE structure, int rep) throws HL7Exception { 
833           super.insertRepetition("INSURANCE", structure, rep);
834        }
835    
836    
837        /**
838         * Inserts a specific repetition of INSURANCE (a Group object)
839         * @see AbstractGroup#insertRepetition(Structure, int) 
840         */
841        public BAR_P05_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 
842           return (BAR_P05_INSURANCE)super.insertRepetition("INSURANCE", rep);
843        }
844    
845    
846        /**
847         * Removes a specific repetition of INSURANCE (a Group object)
848         * @see AbstractGroup#removeRepetition(String, int) 
849         */
850        public BAR_P05_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 
851           return (BAR_P05_INSURANCE)super.removeRepetition("INSURANCE", rep);
852        }
853    
854    
855    
856        /**
857         * Returns
858         * ACC (Accident) - creates it if necessary
859         */
860        public ACC getACC() { 
861           ACC ret = null;
862           try {
863              ret = (ACC)this.get("ACC");
864           } catch(HL7Exception e) {
865              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
866              throw new RuntimeException(e);
867           }
868           return ret;
869        }
870    
871    
872    
873    
874        /**
875         * Returns
876         * UB1 (UB82) - creates it if necessary
877         */
878        public UB1 getUB1() { 
879           UB1 ret = null;
880           try {
881              ret = (UB1)this.get("UB1");
882           } catch(HL7Exception e) {
883              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
884              throw new RuntimeException(e);
885           }
886           return ret;
887        }
888    
889    
890    
891    
892        /**
893         * Returns
894         * UB2 (UB92 Data) - creates it if necessary
895         */
896        public UB2 getUB2() { 
897           UB2 ret = null;
898           try {
899              ret = (UB2)this.get("UB2");
900           } catch(HL7Exception e) {
901              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
902              throw new RuntimeException(e);
903           }
904           return ret;
905        }
906    
907    
908    
909    
910        /**
911         * Returns
912         * ABS (Abstract) - creates it if necessary
913         */
914        public ABS getABS() { 
915           ABS ret = null;
916           try {
917              ret = (ABS)this.get("ABS");
918           } catch(HL7Exception e) {
919              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
920              throw new RuntimeException(e);
921           }
922           return ret;
923        }
924    
925    
926    
927    
928        /**
929         * Returns
930         * the first repetition of 
931         * BLC (Blood Code) - creates it if necessary
932         */
933        public BLC getBLC() { 
934           BLC ret = null;
935           try {
936              ret = (BLC)this.get("BLC");
937           } catch(HL7Exception e) {
938              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
939              throw new RuntimeException(e);
940           }
941           return ret;
942        }
943    
944    
945        /**
946         * Returns a specific repetition of
947         * BLC (Blood Code) - creates it if necessary
948         *
949         * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
950         * @throws HL7Exception if the repetition requested is more than one 
951         *     greater than the number of existing repetitions.
952         */
953        public BLC getBLC(int rep) { 
954           BLC ret = null;
955           try {
956              ret = (BLC)this.get("BLC", rep);
957           } catch(HL7Exception e) {
958              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
959              throw new RuntimeException(e);
960           }
961           return ret;
962        }
963    
964        /** 
965         * Returns the number of existing repetitions of BLC 
966         */ 
967        public int getBLCReps() { 
968            int reps = -1; 
969            try { 
970                reps = this.getAll("BLC").length; 
971            } catch (HL7Exception e) { 
972                String message = "Unexpected error accessing data - this is probably a bug in the source code generator."; 
973                HapiLogFactory.getHapiLog(this.getClass()).error(message, e); 
974                throw new RuntimeException(message);
975            } 
976            return reps; 
977        } 
978    
979        /**
980         * Inserts a specific repetition of BLC (Blood Code)
981         * @see AbstractGroup#insertRepetition(Structure, int) 
982         */
983        public void insertBLC(BLC structure, int rep) throws HL7Exception { 
984           super.insertRepetition("BLC", structure, rep);
985        }
986    
987    
988        /**
989         * Inserts a specific repetition of BLC (Blood Code)
990         * @see AbstractGroup#insertRepetition(Structure, int) 
991         */
992        public BLC insertBLC(int rep) throws HL7Exception { 
993           return (BLC)super.insertRepetition("BLC", rep);
994        }
995    
996    
997        /**
998         * Removes a specific repetition of BLC (Blood Code)
999         * @see AbstractGroup#removeRepetition(String, int) 
1000         */
1001        public BLC removeBLC(int rep) throws HL7Exception { 
1002           return (BLC)super.removeRepetition("BLC", rep);
1003        }
1004    
1005    
1006    
1007        /**
1008         * Returns
1009         * RMI (Risk Management Incident) - creates it if necessary
1010         */
1011        public RMI getRMI() { 
1012           RMI ret = null;
1013           try {
1014              ret = (RMI)this.get("RMI");
1015           } catch(HL7Exception e) {
1016              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
1017              throw new RuntimeException(e);
1018           }
1019           return ret;
1020        }
1021    
1022    
1023    
1024    
1025    }
1026