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