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