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