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 * The contents of this file are subject to the Mozilla Public License Version 1.1 
008 * (the "License"); you may not use this file except in compliance with the License. 
009 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
010 * Software distributed under the License is distributed on an "AS IS" basis, 
011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
012 * specific language governing rights and limitations under the License. 
013 * 
014 * The Original Code is "[file_name]".  Description: 
015 * "[one_line_description]" 
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2012.  All Rights Reserved. 
019 * 
020 * Contributor(s): ______________________________________. 
021 * 
022 * Alternatively, the contents of this file may be used under the terms of the 
023 * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
024 * applicable instead of those above.  If you wish to allow use of your version of this 
025 * file only under the terms of the GPL and not to allow others to use your version 
026 * of this file under the MPL, indicate your decision by deleting  the provisions above 
027 * and replace  them with the notice and other provisions required by the GPL License.  
028 * If you do not delete the provisions above, a recipient may use your version of 
029 * this file under either the MPL or the GPL. 
030 * 
031 */
032
033
034package ca.uhn.hl7v2.model.v23.message;
035
036import ca.uhn.hl7v2.model.v23.group.*;
037import ca.uhn.hl7v2.model.v23.segment.*;
038
039import java.util.List;
040
041import ca.uhn.hl7v2.HL7Exception;
042import ca.uhn.hl7v2.parser.ModelClassFactory;
043import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
044import ca.uhn.hl7v2.model.AbstractMessage;
045
046/**
047 * <p>Represents a REF_I12 message structure (see chapter ?). This structure contains the 
048 * following elements: </p>
049 * <ul>
050                 * <li>1: MSH (Message header segment) <b> </b></li>
051                 * <li>2: RF1 (Referral Information Segment) <b>optional </b></li>
052                 * <li>3: REF_I12_AUTHORIZATION (a Group object) <b>optional </b></li>
053                 * <li>4: REF_I12_PROVIDER (a Group object) <b> repeating</b></li>
054                 * <li>5: PID (Patient Identification) <b> </b></li>
055                 * <li>6: NK1 (Next of kin) <b>optional repeating</b></li>
056                 * <li>7: GT1 (Guarantor) <b>optional repeating</b></li>
057                 * <li>8: REF_I12_INSURANCE (a Group object) <b>optional repeating</b></li>
058                 * <li>9: ACC (Accident) <b>optional </b></li>
059                 * <li>10: DG1 (Diagnosis) <b>optional repeating</b></li>
060                 * <li>11: DRG (Diagnosis Related Group) <b>optional repeating</b></li>
061                 * <li>12: AL1 (Patient allergy information) <b>optional repeating</b></li>
062                 * <li>13: REF_I12_PROCEDURE (a Group object) <b>optional repeating</b></li>
063                 * <li>14: REF_I12_RESULTS (a Group object) <b>optional repeating</b></li>
064                 * <li>15: REF_I12_VISIT (a Group object) <b>optional </b></li>
065                 * <li>16: NTE (Notes and comments segment) <b>optional repeating</b></li>
066 * </ul>
067 */
068@SuppressWarnings("unused")
069public class REF_I12 extends AbstractMessage  {
070
071    /**
072     * Creates a new REF_I12 message with DefaultModelClassFactory. 
073     */ 
074    public REF_I12() { 
075       this(new DefaultModelClassFactory());
076    }
077
078    /** 
079     * Creates a new REF_I12 message with custom ModelClassFactory.
080     */
081    public REF_I12(ModelClassFactory factory) {
082       super(factory);
083       init(factory);
084    }
085
086    private void init(ModelClassFactory factory) {
087       try {
088                          this.add(MSH.class, true, false);
089                          this.add(RF1.class, false, false);
090                          this.add(REF_I12_AUTHORIZATION.class, false, false);
091                          this.add(REF_I12_PROVIDER.class, true, true);
092                          this.add(PID.class, true, false);
093                          this.add(NK1.class, false, true);
094                          this.add(GT1.class, false, true);
095                          this.add(REF_I12_INSURANCE.class, false, true);
096                          this.add(ACC.class, false, false);
097                          this.add(DG1.class, false, true);
098                          this.add(DRG.class, false, true);
099                          this.add(AL1.class, false, true);
100                          this.add(REF_I12_PROCEDURE.class, false, true);
101                          this.add(REF_I12_RESULTS.class, false, true);
102                          this.add(REF_I12_VISIT.class, false, false);
103                          this.add(NTE.class, false, true);
104       } catch(HL7Exception e) {
105          log.error("Unexpected error creating REF_I12 - this is probably a bug in the source code generator.", e);
106       }
107    }
108
109    /** 
110     * Returns "2.3"
111     */
112    public String getVersion() {
113       return "2.3";
114    }
115
116
117
118    /**
119     * Returns
120     * MSH (Message header segment) - creates it if necessary
121     */
122    public MSH getMSH() { 
123       return getTyped("MSH", MSH.class);
124    }
125
126
127
128
129    /**
130     * Returns
131     * RF1 (Referral Information Segment) - creates it if necessary
132     */
133    public RF1 getRF1() { 
134       return getTyped("RF1", RF1.class);
135    }
136
137
138
139
140    /**
141     * Returns
142     * AUTHORIZATION (a Group object) - creates it if necessary
143     */
144    public REF_I12_AUTHORIZATION getAUTHORIZATION() { 
145       return getTyped("AUTHORIZATION", REF_I12_AUTHORIZATION.class);
146    }
147
148
149
150
151    /**
152     * Returns
153     * the first repetition of 
154     * PROVIDER (a Group object) - creates it if necessary
155     */
156    public REF_I12_PROVIDER getPROVIDER() { 
157       return getTyped("PROVIDER", REF_I12_PROVIDER.class);
158    }
159
160
161    /**
162     * Returns a specific repetition of
163     * PROVIDER (a Group object) - creates it if necessary
164     *
165     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
166     * @throws HL7Exception if the repetition requested is more than one 
167     *     greater than the number of existing repetitions.
168     */
169    public REF_I12_PROVIDER getPROVIDER(int rep) { 
170       return getTyped("PROVIDER", rep, REF_I12_PROVIDER.class);
171    }
172
173    /** 
174     * Returns the number of existing repetitions of PROVIDER 
175     */ 
176    public int getPROVIDERReps() { 
177        return getReps("PROVIDER");
178    } 
179
180    /** 
181     * <p>
182     * Returns a non-modifiable List containing all current existing repetitions of PROVIDER.
183     * <p>
184     * <p>
185     * Note that unlike {@link #getPROVIDER()}, this method will not create any reps
186     * if none are already present, so an empty list may be returned.
187     * </p>
188     */ 
189    public List<REF_I12_PROVIDER> getPROVIDERAll() throws HL7Exception {
190        return getAllAsList("PROVIDER", REF_I12_PROVIDER.class);
191    } 
192
193    /**
194     * Inserts a specific repetition of PROVIDER (a Group object)
195     * @see AbstractGroup#insertRepetition(Structure, int) 
196     */
197    public void insertPROVIDER(REF_I12_PROVIDER structure, int rep) throws HL7Exception { 
198       super.insertRepetition( "PROVIDER", structure, rep);
199    }
200
201
202    /**
203     * Inserts a specific repetition of PROVIDER (a Group object)
204     * @see AbstractGroup#insertRepetition(Structure, int) 
205     */
206    public REF_I12_PROVIDER insertPROVIDER(int rep) throws HL7Exception { 
207       return (REF_I12_PROVIDER)super.insertRepetition("PROVIDER", rep);
208    }
209
210
211    /**
212     * Removes a specific repetition of PROVIDER (a Group object)
213     * @see AbstractGroup#removeRepetition(String, int) 
214     */
215    public REF_I12_PROVIDER removePROVIDER(int rep) throws HL7Exception { 
216       return (REF_I12_PROVIDER)super.removeRepetition("PROVIDER", rep);
217    }
218
219
220
221    /**
222     * Returns
223     * PID (Patient Identification) - creates it if necessary
224     */
225    public PID getPID() { 
226       return getTyped("PID", PID.class);
227    }
228
229
230
231
232    /**
233     * Returns
234     * the first repetition of 
235     * NK1 (Next of kin) - creates it if necessary
236     */
237    public NK1 getNK1() { 
238       return getTyped("NK1", NK1.class);
239    }
240
241
242    /**
243     * Returns a specific repetition of
244     * NK1 (Next of kin) - creates it if necessary
245     *
246     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
247     * @throws HL7Exception if the repetition requested is more than one 
248     *     greater than the number of existing repetitions.
249     */
250    public NK1 getNK1(int rep) { 
251       return getTyped("NK1", rep, NK1.class);
252    }
253
254    /** 
255     * Returns the number of existing repetitions of NK1 
256     */ 
257    public int getNK1Reps() { 
258        return getReps("NK1");
259    } 
260
261    /** 
262     * <p>
263     * Returns a non-modifiable List containing all current existing repetitions of NK1.
264     * <p>
265     * <p>
266     * Note that unlike {@link #getNK1()}, this method will not create any reps
267     * if none are already present, so an empty list may be returned.
268     * </p>
269     */ 
270    public List<NK1> getNK1All() throws HL7Exception {
271        return getAllAsList("NK1", NK1.class);
272    } 
273
274    /**
275     * Inserts a specific repetition of NK1 (Next of kin)
276     * @see AbstractGroup#insertRepetition(Structure, int) 
277     */
278    public void insertNK1(NK1 structure, int rep) throws HL7Exception { 
279       super.insertRepetition( "NK1", structure, rep);
280    }
281
282
283    /**
284     * Inserts a specific repetition of NK1 (Next of kin)
285     * @see AbstractGroup#insertRepetition(Structure, int) 
286     */
287    public NK1 insertNK1(int rep) throws HL7Exception { 
288       return (NK1)super.insertRepetition("NK1", rep);
289    }
290
291
292    /**
293     * Removes a specific repetition of NK1 (Next of kin)
294     * @see AbstractGroup#removeRepetition(String, int) 
295     */
296    public NK1 removeNK1(int rep) throws HL7Exception { 
297       return (NK1)super.removeRepetition("NK1", rep);
298    }
299
300
301
302    /**
303     * Returns
304     * the first repetition of 
305     * GT1 (Guarantor) - creates it if necessary
306     */
307    public GT1 getGT1() { 
308       return getTyped("GT1", GT1.class);
309    }
310
311
312    /**
313     * Returns a specific repetition of
314     * GT1 (Guarantor) - creates it if necessary
315     *
316     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
317     * @throws HL7Exception if the repetition requested is more than one 
318     *     greater than the number of existing repetitions.
319     */
320    public GT1 getGT1(int rep) { 
321       return getTyped("GT1", rep, GT1.class);
322    }
323
324    /** 
325     * Returns the number of existing repetitions of GT1 
326     */ 
327    public int getGT1Reps() { 
328        return getReps("GT1");
329    } 
330
331    /** 
332     * <p>
333     * Returns a non-modifiable List containing all current existing repetitions of GT1.
334     * <p>
335     * <p>
336     * Note that unlike {@link #getGT1()}, this method will not create any reps
337     * if none are already present, so an empty list may be returned.
338     * </p>
339     */ 
340    public List<GT1> getGT1All() throws HL7Exception {
341        return getAllAsList("GT1", GT1.class);
342    } 
343
344    /**
345     * Inserts a specific repetition of GT1 (Guarantor)
346     * @see AbstractGroup#insertRepetition(Structure, int) 
347     */
348    public void insertGT1(GT1 structure, int rep) throws HL7Exception { 
349       super.insertRepetition( "GT1", structure, rep);
350    }
351
352
353    /**
354     * Inserts a specific repetition of GT1 (Guarantor)
355     * @see AbstractGroup#insertRepetition(Structure, int) 
356     */
357    public GT1 insertGT1(int rep) throws HL7Exception { 
358       return (GT1)super.insertRepetition("GT1", rep);
359    }
360
361
362    /**
363     * Removes a specific repetition of GT1 (Guarantor)
364     * @see AbstractGroup#removeRepetition(String, int) 
365     */
366    public GT1 removeGT1(int rep) throws HL7Exception { 
367       return (GT1)super.removeRepetition("GT1", rep);
368    }
369
370
371
372    /**
373     * Returns
374     * the first repetition of 
375     * INSURANCE (a Group object) - creates it if necessary
376     */
377    public REF_I12_INSURANCE getINSURANCE() { 
378       return getTyped("INSURANCE", REF_I12_INSURANCE.class);
379    }
380
381
382    /**
383     * Returns a specific repetition of
384     * INSURANCE (a Group object) - creates it if necessary
385     *
386     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
387     * @throws HL7Exception if the repetition requested is more than one 
388     *     greater than the number of existing repetitions.
389     */
390    public REF_I12_INSURANCE getINSURANCE(int rep) { 
391       return getTyped("INSURANCE", rep, REF_I12_INSURANCE.class);
392    }
393
394    /** 
395     * Returns the number of existing repetitions of INSURANCE 
396     */ 
397    public int getINSURANCEReps() { 
398        return getReps("INSURANCE");
399    } 
400
401    /** 
402     * <p>
403     * Returns a non-modifiable List containing all current existing repetitions of INSURANCE.
404     * <p>
405     * <p>
406     * Note that unlike {@link #getINSURANCE()}, this method will not create any reps
407     * if none are already present, so an empty list may be returned.
408     * </p>
409     */ 
410    public List<REF_I12_INSURANCE> getINSURANCEAll() throws HL7Exception {
411        return getAllAsList("INSURANCE", REF_I12_INSURANCE.class);
412    } 
413
414    /**
415     * Inserts a specific repetition of INSURANCE (a Group object)
416     * @see AbstractGroup#insertRepetition(Structure, int) 
417     */
418    public void insertINSURANCE(REF_I12_INSURANCE structure, int rep) throws HL7Exception { 
419       super.insertRepetition( "INSURANCE", structure, rep);
420    }
421
422
423    /**
424     * Inserts a specific repetition of INSURANCE (a Group object)
425     * @see AbstractGroup#insertRepetition(Structure, int) 
426     */
427    public REF_I12_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 
428       return (REF_I12_INSURANCE)super.insertRepetition("INSURANCE", rep);
429    }
430
431
432    /**
433     * Removes a specific repetition of INSURANCE (a Group object)
434     * @see AbstractGroup#removeRepetition(String, int) 
435     */
436    public REF_I12_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 
437       return (REF_I12_INSURANCE)super.removeRepetition("INSURANCE", rep);
438    }
439
440
441
442    /**
443     * Returns
444     * ACC (Accident) - creates it if necessary
445     */
446    public ACC getACC() { 
447       return getTyped("ACC", ACC.class);
448    }
449
450
451
452
453    /**
454     * Returns
455     * the first repetition of 
456     * DG1 (Diagnosis) - creates it if necessary
457     */
458    public DG1 getDG1() { 
459       return getTyped("DG1", DG1.class);
460    }
461
462
463    /**
464     * Returns a specific repetition of
465     * DG1 (Diagnosis) - creates it if necessary
466     *
467     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
468     * @throws HL7Exception if the repetition requested is more than one 
469     *     greater than the number of existing repetitions.
470     */
471    public DG1 getDG1(int rep) { 
472       return getTyped("DG1", rep, DG1.class);
473    }
474
475    /** 
476     * Returns the number of existing repetitions of DG1 
477     */ 
478    public int getDG1Reps() { 
479        return getReps("DG1");
480    } 
481
482    /** 
483     * <p>
484     * Returns a non-modifiable List containing all current existing repetitions of DG1.
485     * <p>
486     * <p>
487     * Note that unlike {@link #getDG1()}, this method will not create any reps
488     * if none are already present, so an empty list may be returned.
489     * </p>
490     */ 
491    public List<DG1> getDG1All() throws HL7Exception {
492        return getAllAsList("DG1", DG1.class);
493    } 
494
495    /**
496     * Inserts a specific repetition of DG1 (Diagnosis)
497     * @see AbstractGroup#insertRepetition(Structure, int) 
498     */
499    public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
500       super.insertRepetition( "DG1", structure, rep);
501    }
502
503
504    /**
505     * Inserts a specific repetition of DG1 (Diagnosis)
506     * @see AbstractGroup#insertRepetition(Structure, int) 
507     */
508    public DG1 insertDG1(int rep) throws HL7Exception { 
509       return (DG1)super.insertRepetition("DG1", rep);
510    }
511
512
513    /**
514     * Removes a specific repetition of DG1 (Diagnosis)
515     * @see AbstractGroup#removeRepetition(String, int) 
516     */
517    public DG1 removeDG1(int rep) throws HL7Exception { 
518       return (DG1)super.removeRepetition("DG1", rep);
519    }
520
521
522
523    /**
524     * Returns
525     * the first repetition of 
526     * DRG (Diagnosis Related Group) - creates it if necessary
527     */
528    public DRG getDRG() { 
529       return getTyped("DRG", DRG.class);
530    }
531
532
533    /**
534     * Returns a specific repetition of
535     * DRG (Diagnosis Related Group) - creates it if necessary
536     *
537     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
538     * @throws HL7Exception if the repetition requested is more than one 
539     *     greater than the number of existing repetitions.
540     */
541    public DRG getDRG(int rep) { 
542       return getTyped("DRG", rep, DRG.class);
543    }
544
545    /** 
546     * Returns the number of existing repetitions of DRG 
547     */ 
548    public int getDRGReps() { 
549        return getReps("DRG");
550    } 
551
552    /** 
553     * <p>
554     * Returns a non-modifiable List containing all current existing repetitions of DRG.
555     * <p>
556     * <p>
557     * Note that unlike {@link #getDRG()}, this method will not create any reps
558     * if none are already present, so an empty list may be returned.
559     * </p>
560     */ 
561    public List<DRG> getDRGAll() throws HL7Exception {
562        return getAllAsList("DRG", DRG.class);
563    } 
564
565    /**
566     * Inserts a specific repetition of DRG (Diagnosis Related Group)
567     * @see AbstractGroup#insertRepetition(Structure, int) 
568     */
569    public void insertDRG(DRG structure, int rep) throws HL7Exception { 
570       super.insertRepetition( "DRG", structure, rep);
571    }
572
573
574    /**
575     * Inserts a specific repetition of DRG (Diagnosis Related Group)
576     * @see AbstractGroup#insertRepetition(Structure, int) 
577     */
578    public DRG insertDRG(int rep) throws HL7Exception { 
579       return (DRG)super.insertRepetition("DRG", rep);
580    }
581
582
583    /**
584     * Removes a specific repetition of DRG (Diagnosis Related Group)
585     * @see AbstractGroup#removeRepetition(String, int) 
586     */
587    public DRG removeDRG(int rep) throws HL7Exception { 
588       return (DRG)super.removeRepetition("DRG", rep);
589    }
590
591
592
593    /**
594     * Returns
595     * the first repetition of 
596     * AL1 (Patient allergy information) - creates it if necessary
597     */
598    public AL1 getAL1() { 
599       return getTyped("AL1", AL1.class);
600    }
601
602
603    /**
604     * Returns a specific repetition of
605     * AL1 (Patient allergy information) - creates it if necessary
606     *
607     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
608     * @throws HL7Exception if the repetition requested is more than one 
609     *     greater than the number of existing repetitions.
610     */
611    public AL1 getAL1(int rep) { 
612       return getTyped("AL1", rep, AL1.class);
613    }
614
615    /** 
616     * Returns the number of existing repetitions of AL1 
617     */ 
618    public int getAL1Reps() { 
619        return getReps("AL1");
620    } 
621
622    /** 
623     * <p>
624     * Returns a non-modifiable List containing all current existing repetitions of AL1.
625     * <p>
626     * <p>
627     * Note that unlike {@link #getAL1()}, this method will not create any reps
628     * if none are already present, so an empty list may be returned.
629     * </p>
630     */ 
631    public List<AL1> getAL1All() throws HL7Exception {
632        return getAllAsList("AL1", AL1.class);
633    } 
634
635    /**
636     * Inserts a specific repetition of AL1 (Patient allergy information)
637     * @see AbstractGroup#insertRepetition(Structure, int) 
638     */
639    public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
640       super.insertRepetition( "AL1", structure, rep);
641    }
642
643
644    /**
645     * Inserts a specific repetition of AL1 (Patient allergy information)
646     * @see AbstractGroup#insertRepetition(Structure, int) 
647     */
648    public AL1 insertAL1(int rep) throws HL7Exception { 
649       return (AL1)super.insertRepetition("AL1", rep);
650    }
651
652
653    /**
654     * Removes a specific repetition of AL1 (Patient allergy information)
655     * @see AbstractGroup#removeRepetition(String, int) 
656     */
657    public AL1 removeAL1(int rep) throws HL7Exception { 
658       return (AL1)super.removeRepetition("AL1", rep);
659    }
660
661
662
663    /**
664     * Returns
665     * the first repetition of 
666     * PROCEDURE (a Group object) - creates it if necessary
667     */
668    public REF_I12_PROCEDURE getPROCEDURE() { 
669       return getTyped("PROCEDURE", REF_I12_PROCEDURE.class);
670    }
671
672
673    /**
674     * Returns a specific repetition of
675     * PROCEDURE (a Group object) - creates it if necessary
676     *
677     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
678     * @throws HL7Exception if the repetition requested is more than one 
679     *     greater than the number of existing repetitions.
680     */
681    public REF_I12_PROCEDURE getPROCEDURE(int rep) { 
682       return getTyped("PROCEDURE", rep, REF_I12_PROCEDURE.class);
683    }
684
685    /** 
686     * Returns the number of existing repetitions of PROCEDURE 
687     */ 
688    public int getPROCEDUREReps() { 
689        return getReps("PROCEDURE");
690    } 
691
692    /** 
693     * <p>
694     * Returns a non-modifiable List containing all current existing repetitions of PROCEDURE.
695     * <p>
696     * <p>
697     * Note that unlike {@link #getPROCEDURE()}, this method will not create any reps
698     * if none are already present, so an empty list may be returned.
699     * </p>
700     */ 
701    public List<REF_I12_PROCEDURE> getPROCEDUREAll() throws HL7Exception {
702        return getAllAsList("PROCEDURE", REF_I12_PROCEDURE.class);
703    } 
704
705    /**
706     * Inserts a specific repetition of PROCEDURE (a Group object)
707     * @see AbstractGroup#insertRepetition(Structure, int) 
708     */
709    public void insertPROCEDURE(REF_I12_PROCEDURE structure, int rep) throws HL7Exception { 
710       super.insertRepetition( "PROCEDURE", structure, rep);
711    }
712
713
714    /**
715     * Inserts a specific repetition of PROCEDURE (a Group object)
716     * @see AbstractGroup#insertRepetition(Structure, int) 
717     */
718    public REF_I12_PROCEDURE insertPROCEDURE(int rep) throws HL7Exception { 
719       return (REF_I12_PROCEDURE)super.insertRepetition("PROCEDURE", rep);
720    }
721
722
723    /**
724     * Removes a specific repetition of PROCEDURE (a Group object)
725     * @see AbstractGroup#removeRepetition(String, int) 
726     */
727    public REF_I12_PROCEDURE removePROCEDURE(int rep) throws HL7Exception { 
728       return (REF_I12_PROCEDURE)super.removeRepetition("PROCEDURE", rep);
729    }
730
731
732
733    /**
734     * Returns
735     * the first repetition of 
736     * RESULTS (a Group object) - creates it if necessary
737     */
738    public REF_I12_RESULTS getRESULTS() { 
739       return getTyped("RESULTS", REF_I12_RESULTS.class);
740    }
741
742
743    /**
744     * Returns a specific repetition of
745     * RESULTS (a Group object) - creates it if necessary
746     *
747     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
748     * @throws HL7Exception if the repetition requested is more than one 
749     *     greater than the number of existing repetitions.
750     */
751    public REF_I12_RESULTS getRESULTS(int rep) { 
752       return getTyped("RESULTS", rep, REF_I12_RESULTS.class);
753    }
754
755    /** 
756     * Returns the number of existing repetitions of RESULTS 
757     */ 
758    public int getRESULTSReps() { 
759        return getReps("RESULTS");
760    } 
761
762    /** 
763     * <p>
764     * Returns a non-modifiable List containing all current existing repetitions of RESULTS.
765     * <p>
766     * <p>
767     * Note that unlike {@link #getRESULTS()}, this method will not create any reps
768     * if none are already present, so an empty list may be returned.
769     * </p>
770     */ 
771    public List<REF_I12_RESULTS> getRESULTSAll() throws HL7Exception {
772        return getAllAsList("RESULTS", REF_I12_RESULTS.class);
773    } 
774
775    /**
776     * Inserts a specific repetition of RESULTS (a Group object)
777     * @see AbstractGroup#insertRepetition(Structure, int) 
778     */
779    public void insertRESULTS(REF_I12_RESULTS structure, int rep) throws HL7Exception { 
780       super.insertRepetition( "RESULTS", structure, rep);
781    }
782
783
784    /**
785     * Inserts a specific repetition of RESULTS (a Group object)
786     * @see AbstractGroup#insertRepetition(Structure, int) 
787     */
788    public REF_I12_RESULTS insertRESULTS(int rep) throws HL7Exception { 
789       return (REF_I12_RESULTS)super.insertRepetition("RESULTS", rep);
790    }
791
792
793    /**
794     * Removes a specific repetition of RESULTS (a Group object)
795     * @see AbstractGroup#removeRepetition(String, int) 
796     */
797    public REF_I12_RESULTS removeRESULTS(int rep) throws HL7Exception { 
798       return (REF_I12_RESULTS)super.removeRepetition("RESULTS", rep);
799    }
800
801
802
803    /**
804     * Returns
805     * VISIT (a Group object) - creates it if necessary
806     */
807    public REF_I12_VISIT getVISIT() { 
808       return getTyped("VISIT", REF_I12_VISIT.class);
809    }
810
811
812
813
814    /**
815     * Returns
816     * the first repetition of 
817     * NTE (Notes and comments segment) - creates it if necessary
818     */
819    public NTE getNTE() { 
820       return getTyped("NTE", NTE.class);
821    }
822
823
824    /**
825     * Returns a specific repetition of
826     * NTE (Notes and comments segment) - creates it if necessary
827     *
828     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
829     * @throws HL7Exception if the repetition requested is more than one 
830     *     greater than the number of existing repetitions.
831     */
832    public NTE getNTE(int rep) { 
833       return getTyped("NTE", rep, NTE.class);
834    }
835
836    /** 
837     * Returns the number of existing repetitions of NTE 
838     */ 
839    public int getNTEReps() { 
840        return getReps("NTE");
841    } 
842
843    /** 
844     * <p>
845     * Returns a non-modifiable List containing all current existing repetitions of NTE.
846     * <p>
847     * <p>
848     * Note that unlike {@link #getNTE()}, this method will not create any reps
849     * if none are already present, so an empty list may be returned.
850     * </p>
851     */ 
852    public List<NTE> getNTEAll() throws HL7Exception {
853        return getAllAsList("NTE", NTE.class);
854    } 
855
856    /**
857     * Inserts a specific repetition of NTE (Notes and comments segment)
858     * @see AbstractGroup#insertRepetition(Structure, int) 
859     */
860    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
861       super.insertRepetition( "NTE", structure, rep);
862    }
863
864
865    /**
866     * Inserts a specific repetition of NTE (Notes and comments segment)
867     * @see AbstractGroup#insertRepetition(Structure, int) 
868     */
869    public NTE insertNTE(int rep) throws HL7Exception { 
870       return (NTE)super.insertRepetition("NTE", rep);
871    }
872
873
874    /**
875     * Removes a specific repetition of NTE (Notes and comments segment)
876     * @see AbstractGroup#removeRepetition(String, int) 
877     */
878    public NTE removeNTE(int rep) throws HL7Exception { 
879       return (NTE)super.removeRepetition("NTE", rep);
880    }
881
882
883
884}
885