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 RRI_I15 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: MSA (Message acknowledgement segment) <b>optional </b></li>
052                 * <li>3: RF1 (Referral Information Segment) <b>optional </b></li>
053                 * <li>4: RRI_I15_AUTHORIZATION (a Group object) <b>optional </b></li>
054                 * <li>5: RRI_I15_PROVIDER (a Group object) <b> repeating</b></li>
055                 * <li>6: PID (Patient Identification) <b> </b></li>
056                 * <li>7: ACC (Accident) <b>optional </b></li>
057                 * <li>8: DG1 (Diagnosis) <b>optional repeating</b></li>
058                 * <li>9: DRG (Diagnosis Related Group) <b>optional repeating</b></li>
059                 * <li>10: AL1 (Patient allergy information) <b>optional repeating</b></li>
060                 * <li>11: RRI_I15_PROCEDURE (a Group object) <b>optional repeating</b></li>
061                 * <li>12: RRI_I15_RESULTS (a Group object) <b>optional repeating</b></li>
062                 * <li>13: RRI_I15_VISIT (a Group object) <b>optional </b></li>
063                 * <li>14: NTE (Notes and comments segment) <b>optional repeating</b></li>
064 * </ul>
065 */
066@SuppressWarnings("unused")
067public class RRI_I15 extends AbstractMessage  {
068
069    /**
070     * Creates a new RRI_I15 message with DefaultModelClassFactory. 
071     */ 
072    public RRI_I15() { 
073       this(new DefaultModelClassFactory());
074    }
075
076    /** 
077     * Creates a new RRI_I15 message with custom ModelClassFactory.
078     */
079    public RRI_I15(ModelClassFactory factory) {
080       super(factory);
081       init(factory);
082    }
083
084    private void init(ModelClassFactory factory) {
085       try {
086                          this.add(MSH.class, true, false);
087                          this.add(MSA.class, false, false);
088                          this.add(RF1.class, false, false);
089                          this.add(RRI_I15_AUTHORIZATION.class, false, false);
090                          this.add(RRI_I15_PROVIDER.class, true, true);
091                          this.add(PID.class, true, false);
092                          this.add(ACC.class, false, false);
093                          this.add(DG1.class, false, true);
094                          this.add(DRG.class, false, true);
095                          this.add(AL1.class, false, true);
096                          this.add(RRI_I15_PROCEDURE.class, false, true);
097                          this.add(RRI_I15_RESULTS.class, false, true);
098                          this.add(RRI_I15_VISIT.class, false, false);
099                          this.add(NTE.class, false, true);
100       } catch(HL7Exception e) {
101          log.error("Unexpected error creating RRI_I15 - this is probably a bug in the source code generator.", e);
102       }
103    }
104
105    /** 
106     * Returns "2.3"
107     */
108    public String getVersion() {
109       return "2.3";
110    }
111
112
113
114    /**
115     * Returns
116     * MSH (Message header segment) - creates it if necessary
117     */
118    public MSH getMSH() { 
119       return getTyped("MSH", MSH.class);
120    }
121
122
123
124
125    /**
126     * Returns
127     * MSA (Message acknowledgement segment) - creates it if necessary
128     */
129    public MSA getMSA() { 
130       return getTyped("MSA", MSA.class);
131    }
132
133
134
135
136    /**
137     * Returns
138     * RF1 (Referral Information Segment) - creates it if necessary
139     */
140    public RF1 getRF1() { 
141       return getTyped("RF1", RF1.class);
142    }
143
144
145
146
147    /**
148     * Returns
149     * AUTHORIZATION (a Group object) - creates it if necessary
150     */
151    public RRI_I15_AUTHORIZATION getAUTHORIZATION() { 
152       return getTyped("AUTHORIZATION", RRI_I15_AUTHORIZATION.class);
153    }
154
155
156
157
158    /**
159     * Returns
160     * the first repetition of 
161     * PROVIDER (a Group object) - creates it if necessary
162     */
163    public RRI_I15_PROVIDER getPROVIDER() { 
164       return getTyped("PROVIDER", RRI_I15_PROVIDER.class);
165    }
166
167
168    /**
169     * Returns a specific repetition of
170     * PROVIDER (a Group object) - creates it if necessary
171     *
172     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
173     * @throws HL7Exception if the repetition requested is more than one 
174     *     greater than the number of existing repetitions.
175     */
176    public RRI_I15_PROVIDER getPROVIDER(int rep) { 
177       return getTyped("PROVIDER", rep, RRI_I15_PROVIDER.class);
178    }
179
180    /** 
181     * Returns the number of existing repetitions of PROVIDER 
182     */ 
183    public int getPROVIDERReps() { 
184        return getReps("PROVIDER");
185    } 
186
187    /** 
188     * <p>
189     * Returns a non-modifiable List containing all current existing repetitions of PROVIDER.
190     * <p>
191     * <p>
192     * Note that unlike {@link #getPROVIDER()}, this method will not create any reps
193     * if none are already present, so an empty list may be returned.
194     * </p>
195     */ 
196    public List<RRI_I15_PROVIDER> getPROVIDERAll() throws HL7Exception {
197        return getAllAsList("PROVIDER", RRI_I15_PROVIDER.class);
198    } 
199
200    /**
201     * Inserts a specific repetition of PROVIDER (a Group object)
202     * @see AbstractGroup#insertRepetition(Structure, int) 
203     */
204    public void insertPROVIDER(RRI_I15_PROVIDER structure, int rep) throws HL7Exception { 
205       super.insertRepetition( "PROVIDER", structure, rep);
206    }
207
208
209    /**
210     * Inserts a specific repetition of PROVIDER (a Group object)
211     * @see AbstractGroup#insertRepetition(Structure, int) 
212     */
213    public RRI_I15_PROVIDER insertPROVIDER(int rep) throws HL7Exception { 
214       return (RRI_I15_PROVIDER)super.insertRepetition("PROVIDER", rep);
215    }
216
217
218    /**
219     * Removes a specific repetition of PROVIDER (a Group object)
220     * @see AbstractGroup#removeRepetition(String, int) 
221     */
222    public RRI_I15_PROVIDER removePROVIDER(int rep) throws HL7Exception { 
223       return (RRI_I15_PROVIDER)super.removeRepetition("PROVIDER", rep);
224    }
225
226
227
228    /**
229     * Returns
230     * PID (Patient Identification) - creates it if necessary
231     */
232    public PID getPID() { 
233       return getTyped("PID", PID.class);
234    }
235
236
237
238
239    /**
240     * Returns
241     * ACC (Accident) - creates it if necessary
242     */
243    public ACC getACC() { 
244       return getTyped("ACC", ACC.class);
245    }
246
247
248
249
250    /**
251     * Returns
252     * the first repetition of 
253     * DG1 (Diagnosis) - creates it if necessary
254     */
255    public DG1 getDG1() { 
256       return getTyped("DG1", DG1.class);
257    }
258
259
260    /**
261     * Returns a specific repetition of
262     * DG1 (Diagnosis) - creates it if necessary
263     *
264     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
265     * @throws HL7Exception if the repetition requested is more than one 
266     *     greater than the number of existing repetitions.
267     */
268    public DG1 getDG1(int rep) { 
269       return getTyped("DG1", rep, DG1.class);
270    }
271
272    /** 
273     * Returns the number of existing repetitions of DG1 
274     */ 
275    public int getDG1Reps() { 
276        return getReps("DG1");
277    } 
278
279    /** 
280     * <p>
281     * Returns a non-modifiable List containing all current existing repetitions of DG1.
282     * <p>
283     * <p>
284     * Note that unlike {@link #getDG1()}, this method will not create any reps
285     * if none are already present, so an empty list may be returned.
286     * </p>
287     */ 
288    public List<DG1> getDG1All() throws HL7Exception {
289        return getAllAsList("DG1", DG1.class);
290    } 
291
292    /**
293     * Inserts a specific repetition of DG1 (Diagnosis)
294     * @see AbstractGroup#insertRepetition(Structure, int) 
295     */
296    public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
297       super.insertRepetition( "DG1", structure, rep);
298    }
299
300
301    /**
302     * Inserts a specific repetition of DG1 (Diagnosis)
303     * @see AbstractGroup#insertRepetition(Structure, int) 
304     */
305    public DG1 insertDG1(int rep) throws HL7Exception { 
306       return (DG1)super.insertRepetition("DG1", rep);
307    }
308
309
310    /**
311     * Removes a specific repetition of DG1 (Diagnosis)
312     * @see AbstractGroup#removeRepetition(String, int) 
313     */
314    public DG1 removeDG1(int rep) throws HL7Exception { 
315       return (DG1)super.removeRepetition("DG1", rep);
316    }
317
318
319
320    /**
321     * Returns
322     * the first repetition of 
323     * DRG (Diagnosis Related Group) - creates it if necessary
324     */
325    public DRG getDRG() { 
326       return getTyped("DRG", DRG.class);
327    }
328
329
330    /**
331     * Returns a specific repetition of
332     * DRG (Diagnosis Related Group) - creates it if necessary
333     *
334     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
335     * @throws HL7Exception if the repetition requested is more than one 
336     *     greater than the number of existing repetitions.
337     */
338    public DRG getDRG(int rep) { 
339       return getTyped("DRG", rep, DRG.class);
340    }
341
342    /** 
343     * Returns the number of existing repetitions of DRG 
344     */ 
345    public int getDRGReps() { 
346        return getReps("DRG");
347    } 
348
349    /** 
350     * <p>
351     * Returns a non-modifiable List containing all current existing repetitions of DRG.
352     * <p>
353     * <p>
354     * Note that unlike {@link #getDRG()}, this method will not create any reps
355     * if none are already present, so an empty list may be returned.
356     * </p>
357     */ 
358    public List<DRG> getDRGAll() throws HL7Exception {
359        return getAllAsList("DRG", DRG.class);
360    } 
361
362    /**
363     * Inserts a specific repetition of DRG (Diagnosis Related Group)
364     * @see AbstractGroup#insertRepetition(Structure, int) 
365     */
366    public void insertDRG(DRG structure, int rep) throws HL7Exception { 
367       super.insertRepetition( "DRG", structure, rep);
368    }
369
370
371    /**
372     * Inserts a specific repetition of DRG (Diagnosis Related Group)
373     * @see AbstractGroup#insertRepetition(Structure, int) 
374     */
375    public DRG insertDRG(int rep) throws HL7Exception { 
376       return (DRG)super.insertRepetition("DRG", rep);
377    }
378
379
380    /**
381     * Removes a specific repetition of DRG (Diagnosis Related Group)
382     * @see AbstractGroup#removeRepetition(String, int) 
383     */
384    public DRG removeDRG(int rep) throws HL7Exception { 
385       return (DRG)super.removeRepetition("DRG", rep);
386    }
387
388
389
390    /**
391     * Returns
392     * the first repetition of 
393     * AL1 (Patient allergy information) - creates it if necessary
394     */
395    public AL1 getAL1() { 
396       return getTyped("AL1", AL1.class);
397    }
398
399
400    /**
401     * Returns a specific repetition of
402     * AL1 (Patient allergy information) - creates it if necessary
403     *
404     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
405     * @throws HL7Exception if the repetition requested is more than one 
406     *     greater than the number of existing repetitions.
407     */
408    public AL1 getAL1(int rep) { 
409       return getTyped("AL1", rep, AL1.class);
410    }
411
412    /** 
413     * Returns the number of existing repetitions of AL1 
414     */ 
415    public int getAL1Reps() { 
416        return getReps("AL1");
417    } 
418
419    /** 
420     * <p>
421     * Returns a non-modifiable List containing all current existing repetitions of AL1.
422     * <p>
423     * <p>
424     * Note that unlike {@link #getAL1()}, this method will not create any reps
425     * if none are already present, so an empty list may be returned.
426     * </p>
427     */ 
428    public List<AL1> getAL1All() throws HL7Exception {
429        return getAllAsList("AL1", AL1.class);
430    } 
431
432    /**
433     * Inserts a specific repetition of AL1 (Patient allergy information)
434     * @see AbstractGroup#insertRepetition(Structure, int) 
435     */
436    public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
437       super.insertRepetition( "AL1", structure, rep);
438    }
439
440
441    /**
442     * Inserts a specific repetition of AL1 (Patient allergy information)
443     * @see AbstractGroup#insertRepetition(Structure, int) 
444     */
445    public AL1 insertAL1(int rep) throws HL7Exception { 
446       return (AL1)super.insertRepetition("AL1", rep);
447    }
448
449
450    /**
451     * Removes a specific repetition of AL1 (Patient allergy information)
452     * @see AbstractGroup#removeRepetition(String, int) 
453     */
454    public AL1 removeAL1(int rep) throws HL7Exception { 
455       return (AL1)super.removeRepetition("AL1", rep);
456    }
457
458
459
460    /**
461     * Returns
462     * the first repetition of 
463     * PROCEDURE (a Group object) - creates it if necessary
464     */
465    public RRI_I15_PROCEDURE getPROCEDURE() { 
466       return getTyped("PROCEDURE", RRI_I15_PROCEDURE.class);
467    }
468
469
470    /**
471     * Returns a specific repetition of
472     * PROCEDURE (a Group object) - creates it if necessary
473     *
474     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
475     * @throws HL7Exception if the repetition requested is more than one 
476     *     greater than the number of existing repetitions.
477     */
478    public RRI_I15_PROCEDURE getPROCEDURE(int rep) { 
479       return getTyped("PROCEDURE", rep, RRI_I15_PROCEDURE.class);
480    }
481
482    /** 
483     * Returns the number of existing repetitions of PROCEDURE 
484     */ 
485    public int getPROCEDUREReps() { 
486        return getReps("PROCEDURE");
487    } 
488
489    /** 
490     * <p>
491     * Returns a non-modifiable List containing all current existing repetitions of PROCEDURE.
492     * <p>
493     * <p>
494     * Note that unlike {@link #getPROCEDURE()}, this method will not create any reps
495     * if none are already present, so an empty list may be returned.
496     * </p>
497     */ 
498    public List<RRI_I15_PROCEDURE> getPROCEDUREAll() throws HL7Exception {
499        return getAllAsList("PROCEDURE", RRI_I15_PROCEDURE.class);
500    } 
501
502    /**
503     * Inserts a specific repetition of PROCEDURE (a Group object)
504     * @see AbstractGroup#insertRepetition(Structure, int) 
505     */
506    public void insertPROCEDURE(RRI_I15_PROCEDURE structure, int rep) throws HL7Exception { 
507       super.insertRepetition( "PROCEDURE", structure, rep);
508    }
509
510
511    /**
512     * Inserts a specific repetition of PROCEDURE (a Group object)
513     * @see AbstractGroup#insertRepetition(Structure, int) 
514     */
515    public RRI_I15_PROCEDURE insertPROCEDURE(int rep) throws HL7Exception { 
516       return (RRI_I15_PROCEDURE)super.insertRepetition("PROCEDURE", rep);
517    }
518
519
520    /**
521     * Removes a specific repetition of PROCEDURE (a Group object)
522     * @see AbstractGroup#removeRepetition(String, int) 
523     */
524    public RRI_I15_PROCEDURE removePROCEDURE(int rep) throws HL7Exception { 
525       return (RRI_I15_PROCEDURE)super.removeRepetition("PROCEDURE", rep);
526    }
527
528
529
530    /**
531     * Returns
532     * the first repetition of 
533     * RESULTS (a Group object) - creates it if necessary
534     */
535    public RRI_I15_RESULTS getRESULTS() { 
536       return getTyped("RESULTS", RRI_I15_RESULTS.class);
537    }
538
539
540    /**
541     * Returns a specific repetition of
542     * RESULTS (a Group object) - creates it if necessary
543     *
544     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
545     * @throws HL7Exception if the repetition requested is more than one 
546     *     greater than the number of existing repetitions.
547     */
548    public RRI_I15_RESULTS getRESULTS(int rep) { 
549       return getTyped("RESULTS", rep, RRI_I15_RESULTS.class);
550    }
551
552    /** 
553     * Returns the number of existing repetitions of RESULTS 
554     */ 
555    public int getRESULTSReps() { 
556        return getReps("RESULTS");
557    } 
558
559    /** 
560     * <p>
561     * Returns a non-modifiable List containing all current existing repetitions of RESULTS.
562     * <p>
563     * <p>
564     * Note that unlike {@link #getRESULTS()}, this method will not create any reps
565     * if none are already present, so an empty list may be returned.
566     * </p>
567     */ 
568    public List<RRI_I15_RESULTS> getRESULTSAll() throws HL7Exception {
569        return getAllAsList("RESULTS", RRI_I15_RESULTS.class);
570    } 
571
572    /**
573     * Inserts a specific repetition of RESULTS (a Group object)
574     * @see AbstractGroup#insertRepetition(Structure, int) 
575     */
576    public void insertRESULTS(RRI_I15_RESULTS structure, int rep) throws HL7Exception { 
577       super.insertRepetition( "RESULTS", structure, rep);
578    }
579
580
581    /**
582     * Inserts a specific repetition of RESULTS (a Group object)
583     * @see AbstractGroup#insertRepetition(Structure, int) 
584     */
585    public RRI_I15_RESULTS insertRESULTS(int rep) throws HL7Exception { 
586       return (RRI_I15_RESULTS)super.insertRepetition("RESULTS", rep);
587    }
588
589
590    /**
591     * Removes a specific repetition of RESULTS (a Group object)
592     * @see AbstractGroup#removeRepetition(String, int) 
593     */
594    public RRI_I15_RESULTS removeRESULTS(int rep) throws HL7Exception { 
595       return (RRI_I15_RESULTS)super.removeRepetition("RESULTS", rep);
596    }
597
598
599
600    /**
601     * Returns
602     * VISIT (a Group object) - creates it if necessary
603     */
604    public RRI_I15_VISIT getVISIT() { 
605       return getTyped("VISIT", RRI_I15_VISIT.class);
606    }
607
608
609
610
611    /**
612     * Returns
613     * the first repetition of 
614     * NTE (Notes and comments segment) - creates it if necessary
615     */
616    public NTE getNTE() { 
617       return getTyped("NTE", NTE.class);
618    }
619
620
621    /**
622     * Returns a specific repetition of
623     * NTE (Notes and comments segment) - creates it if necessary
624     *
625     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
626     * @throws HL7Exception if the repetition requested is more than one 
627     *     greater than the number of existing repetitions.
628     */
629    public NTE getNTE(int rep) { 
630       return getTyped("NTE", rep, NTE.class);
631    }
632
633    /** 
634     * Returns the number of existing repetitions of NTE 
635     */ 
636    public int getNTEReps() { 
637        return getReps("NTE");
638    } 
639
640    /** 
641     * <p>
642     * Returns a non-modifiable List containing all current existing repetitions of NTE.
643     * <p>
644     * <p>
645     * Note that unlike {@link #getNTE()}, this method will not create any reps
646     * if none are already present, so an empty list may be returned.
647     * </p>
648     */ 
649    public List<NTE> getNTEAll() throws HL7Exception {
650        return getAllAsList("NTE", NTE.class);
651    } 
652
653    /**
654     * Inserts a specific repetition of NTE (Notes and comments segment)
655     * @see AbstractGroup#insertRepetition(Structure, int) 
656     */
657    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
658       super.insertRepetition( "NTE", structure, rep);
659    }
660
661
662    /**
663     * Inserts a specific repetition of NTE (Notes and comments segment)
664     * @see AbstractGroup#insertRepetition(Structure, int) 
665     */
666    public NTE insertNTE(int rep) throws HL7Exception { 
667       return (NTE)super.insertRepetition("NTE", rep);
668    }
669
670
671    /**
672     * Removes a specific repetition of NTE (Notes and comments segment)
673     * @see AbstractGroup#removeRepetition(String, int) 
674     */
675    public NTE removeNTE(int rep) throws HL7Exception { 
676       return (NTE)super.removeRepetition("NTE", rep);
677    }
678
679
680
681}
682