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