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