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.v27.message;
035
036import ca.uhn.hl7v2.model.v27.group.*;
037import ca.uhn.hl7v2.model.v27.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 RCI_I05 message structure (see chapter 11.3.5). 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: UAC (User Authentication Credential Segment) <b>optional </b> </li>
052                                 * <li>4: MSA (Message Acknowledgment) <b> </b> </li>
053                                 * <li>5: QRD (withdrawn) <b> </b> </li>
054                                 * <li>6: QRF (withdrawn) <b>optional </b> </li>
055                                 * <li>7: RCI_I05_PROVIDER (a Group object) <b> repeating</b> </li>
056                                 * <li>8: PID (Patient Identification) <b> </b> </li>
057                                 * <li>9: DG1 (Diagnosis) <b>optional repeating</b> </li>
058                                 * <li>10: DRG (Diagnosis Related Group) <b>optional repeating</b> </li>
059                                 * <li>11: AL1 (Patient Allergy Information) <b>optional repeating</b> </li>
060                                 * <li>12: RCI_I05_OBSERVATION (a Group object) <b>optional </b> </li>
061                                 * <li>13: NTE (Notes and Comments) <b>optional repeating</b> </li>
062 * </ul>
063 */
064//@SuppressWarnings("unused")
065public class RCI_I05 extends AbstractMessage  {
066
067    /**
068     * Creates a new RCI_I05 message with DefaultModelClassFactory. 
069     */ 
070    public RCI_I05() { 
071       this(new DefaultModelClassFactory());
072    }
073
074    /** 
075     * Creates a new RCI_I05 message with custom ModelClassFactory.
076     */
077    public RCI_I05(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(UAC.class, false, false);
087                                  this.add(MSA.class, true, false);
088                                  this.add(QRD.class, true, false);
089                                  this.add(QRF.class, false, false);
090                                  this.add(RCI_I05_PROVIDER.class, true, true);
091                                  this.add(PID.class, true, false);
092                                  this.add(DG1.class, false, true);
093                                  this.add(DRG.class, false, true);
094                                  this.add(AL1.class, false, true);
095                                  this.add(RCI_I05_OBSERVATION.class, false, false);
096                                  this.add(NTE.class, false, true);
097               } catch(HL7Exception e) {
098          log.error("Unexpected error creating RCI_I05 - this is probably a bug in the source code generator.", e);
099       }
100    }
101
102
103    /** 
104     * Returns "2.7"
105     */
106    public String getVersion() {
107       return "2.7";
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     * UAC (User Authentication Credential Segment) - creates it if necessary
227     * </p>
228     * 
229     *
230     */
231    public UAC getUAC() { 
232       return getTyped("UAC", UAC.class);
233    }
234
235
236
237
238
239    /**
240     * <p>
241     * Returns
242     * MSA (Message Acknowledgment) - creates it if necessary
243     * </p>
244     * 
245     *
246     */
247    public MSA getMSA() { 
248       return getTyped("MSA", MSA.class);
249    }
250
251
252
253
254
255    /**
256     * <p>
257     * Returns
258     * QRD (withdrawn) - creates it if necessary
259     * </p>
260     * 
261     *
262     */
263    public QRD getQRD() { 
264       return getTyped("QRD", QRD.class);
265    }
266
267
268
269
270
271    /**
272     * <p>
273     * Returns
274     * QRF (withdrawn) - creates it if necessary
275     * </p>
276     * 
277     *
278     */
279    public QRF getQRF() { 
280       return getTyped("QRF", QRF.class);
281    }
282
283
284
285
286
287    /**
288     * <p>
289     * Returns
290     * the first repetition of 
291     * PROVIDER (a Group object) - creates it if necessary
292     * </p>
293     * 
294     *
295     */
296    public RCI_I05_PROVIDER getPROVIDER() { 
297       return getTyped("PROVIDER", RCI_I05_PROVIDER.class);
298    }
299
300
301    /**
302     * <p>
303     * Returns a specific repetition of
304     * PROVIDER (a Group object) - creates it if necessary
305     * </p>
306     * 
307     *
308     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
309     * @throws HL7Exception if the repetition requested is more than one 
310     *     greater than the number of existing repetitions.
311     */
312    public RCI_I05_PROVIDER getPROVIDER(int rep) { 
313       return getTyped("PROVIDER", rep, RCI_I05_PROVIDER.class);
314    }
315
316    /** 
317     * <p>
318     * Returns the number of existing repetitions of PROVIDER 
319     * </p>
320     * 
321     */ 
322    public int getPROVIDERReps() { 
323        return getReps("PROVIDER");
324    } 
325
326    /** 
327     * <p>
328     * Returns a non-modifiable List containing all current existing repetitions of PROVIDER.
329     * <p>
330     * <p>
331     * Note that unlike {@link #getPROVIDER()}, this method will not create any reps
332     * if none are already present, so an empty list may be returned.
333     * </p>
334     * 
335     */ 
336    public java.util.List<RCI_I05_PROVIDER> getPROVIDERAll() throws HL7Exception {
337        return getAllAsList("PROVIDER", RCI_I05_PROVIDER.class);
338    } 
339
340    /**
341     * <p>
342     * Inserts a specific repetition of PROVIDER (a Group object)
343     * </p>
344     * 
345     *
346     * @see AbstractGroup#insertRepetition(Structure, int) 
347     */
348    public void insertPROVIDER(RCI_I05_PROVIDER structure, int rep) throws HL7Exception { 
349       super.insertRepetition( "PROVIDER", structure, rep);
350    }
351
352
353    /**
354     * <p>
355     * Inserts a specific repetition of PROVIDER (a Group object)
356     * </p>
357     * 
358     *
359     * @see AbstractGroup#insertRepetition(Structure, int) 
360     */
361    public RCI_I05_PROVIDER insertPROVIDER(int rep) throws HL7Exception { 
362       return (RCI_I05_PROVIDER)super.insertRepetition("PROVIDER", rep);
363    }
364
365
366    /**
367     * <p>
368     * Removes a specific repetition of PROVIDER (a Group object)
369     * </p>
370     * 
371     *
372     * @see AbstractGroup#removeRepetition(String, int) 
373     */
374    public RCI_I05_PROVIDER removePROVIDER(int rep) throws HL7Exception { 
375       return (RCI_I05_PROVIDER)super.removeRepetition("PROVIDER", rep);
376    }
377
378
379
380
381    /**
382     * <p>
383     * Returns
384     * PID (Patient Identification) - creates it if necessary
385     * </p>
386     * 
387     *
388     */
389    public PID getPID() { 
390       return getTyped("PID", PID.class);
391    }
392
393
394
395
396
397    /**
398     * <p>
399     * Returns
400     * the first repetition of 
401     * DG1 (Diagnosis) - creates it if necessary
402     * </p>
403     * 
404     *
405     */
406    public DG1 getDG1() { 
407       return getTyped("DG1", DG1.class);
408    }
409
410
411    /**
412     * <p>
413     * Returns a specific repetition of
414     * DG1 (Diagnosis) - creates it if necessary
415     * </p>
416     * 
417     *
418     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
419     * @throws HL7Exception if the repetition requested is more than one 
420     *     greater than the number of existing repetitions.
421     */
422    public DG1 getDG1(int rep) { 
423       return getTyped("DG1", rep, DG1.class);
424    }
425
426    /** 
427     * <p>
428     * Returns the number of existing repetitions of DG1 
429     * </p>
430     * 
431     */ 
432    public int getDG1Reps() { 
433        return getReps("DG1");
434    } 
435
436    /** 
437     * <p>
438     * Returns a non-modifiable List containing all current existing repetitions of DG1.
439     * <p>
440     * <p>
441     * Note that unlike {@link #getDG1()}, this method will not create any reps
442     * if none are already present, so an empty list may be returned.
443     * </p>
444     * 
445     */ 
446    public java.util.List<DG1> getDG1All() throws HL7Exception {
447        return getAllAsList("DG1", DG1.class);
448    } 
449
450    /**
451     * <p>
452     * Inserts a specific repetition of DG1 (Diagnosis)
453     * </p>
454     * 
455     *
456     * @see AbstractGroup#insertRepetition(Structure, int) 
457     */
458    public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
459       super.insertRepetition( "DG1", structure, rep);
460    }
461
462
463    /**
464     * <p>
465     * Inserts a specific repetition of DG1 (Diagnosis)
466     * </p>
467     * 
468     *
469     * @see AbstractGroup#insertRepetition(Structure, int) 
470     */
471    public DG1 insertDG1(int rep) throws HL7Exception { 
472       return (DG1)super.insertRepetition("DG1", rep);
473    }
474
475
476    /**
477     * <p>
478     * Removes a specific repetition of DG1 (Diagnosis)
479     * </p>
480     * 
481     *
482     * @see AbstractGroup#removeRepetition(String, int) 
483     */
484    public DG1 removeDG1(int rep) throws HL7Exception { 
485       return (DG1)super.removeRepetition("DG1", rep);
486    }
487
488
489
490
491    /**
492     * <p>
493     * Returns
494     * the first repetition of 
495     * DRG (Diagnosis Related Group) - creates it if necessary
496     * </p>
497     * 
498     *
499     */
500    public DRG getDRG() { 
501       return getTyped("DRG", DRG.class);
502    }
503
504
505    /**
506     * <p>
507     * Returns a specific repetition of
508     * DRG (Diagnosis Related Group) - creates it if necessary
509     * </p>
510     * 
511     *
512     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
513     * @throws HL7Exception if the repetition requested is more than one 
514     *     greater than the number of existing repetitions.
515     */
516    public DRG getDRG(int rep) { 
517       return getTyped("DRG", rep, DRG.class);
518    }
519
520    /** 
521     * <p>
522     * Returns the number of existing repetitions of DRG 
523     * </p>
524     * 
525     */ 
526    public int getDRGReps() { 
527        return getReps("DRG");
528    } 
529
530    /** 
531     * <p>
532     * Returns a non-modifiable List containing all current existing repetitions of DRG.
533     * <p>
534     * <p>
535     * Note that unlike {@link #getDRG()}, this method will not create any reps
536     * if none are already present, so an empty list may be returned.
537     * </p>
538     * 
539     */ 
540    public java.util.List<DRG> getDRGAll() throws HL7Exception {
541        return getAllAsList("DRG", DRG.class);
542    } 
543
544    /**
545     * <p>
546     * Inserts a specific repetition of DRG (Diagnosis Related Group)
547     * </p>
548     * 
549     *
550     * @see AbstractGroup#insertRepetition(Structure, int) 
551     */
552    public void insertDRG(DRG structure, int rep) throws HL7Exception { 
553       super.insertRepetition( "DRG", structure, rep);
554    }
555
556
557    /**
558     * <p>
559     * Inserts a specific repetition of DRG (Diagnosis Related Group)
560     * </p>
561     * 
562     *
563     * @see AbstractGroup#insertRepetition(Structure, int) 
564     */
565    public DRG insertDRG(int rep) throws HL7Exception { 
566       return (DRG)super.insertRepetition("DRG", rep);
567    }
568
569
570    /**
571     * <p>
572     * Removes a specific repetition of DRG (Diagnosis Related Group)
573     * </p>
574     * 
575     *
576     * @see AbstractGroup#removeRepetition(String, int) 
577     */
578    public DRG removeDRG(int rep) throws HL7Exception { 
579       return (DRG)super.removeRepetition("DRG", rep);
580    }
581
582
583
584
585    /**
586     * <p>
587     * Returns
588     * the first repetition of 
589     * AL1 (Patient Allergy Information) - creates it if necessary
590     * </p>
591     * 
592     *
593     */
594    public AL1 getAL1() { 
595       return getTyped("AL1", AL1.class);
596    }
597
598
599    /**
600     * <p>
601     * Returns a specific repetition of
602     * AL1 (Patient Allergy Information) - creates it if necessary
603     * </p>
604     * 
605     *
606     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
607     * @throws HL7Exception if the repetition requested is more than one 
608     *     greater than the number of existing repetitions.
609     */
610    public AL1 getAL1(int rep) { 
611       return getTyped("AL1", rep, AL1.class);
612    }
613
614    /** 
615     * <p>
616     * Returns the number of existing repetitions of AL1 
617     * </p>
618     * 
619     */ 
620    public int getAL1Reps() { 
621        return getReps("AL1");
622    } 
623
624    /** 
625     * <p>
626     * Returns a non-modifiable List containing all current existing repetitions of AL1.
627     * <p>
628     * <p>
629     * Note that unlike {@link #getAL1()}, this method will not create any reps
630     * if none are already present, so an empty list may be returned.
631     * </p>
632     * 
633     */ 
634    public java.util.List<AL1> getAL1All() throws HL7Exception {
635        return getAllAsList("AL1", AL1.class);
636    } 
637
638    /**
639     * <p>
640     * Inserts a specific repetition of AL1 (Patient Allergy Information)
641     * </p>
642     * 
643     *
644     * @see AbstractGroup#insertRepetition(Structure, int) 
645     */
646    public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
647       super.insertRepetition( "AL1", structure, rep);
648    }
649
650
651    /**
652     * <p>
653     * Inserts a specific repetition of AL1 (Patient Allergy Information)
654     * </p>
655     * 
656     *
657     * @see AbstractGroup#insertRepetition(Structure, int) 
658     */
659    public AL1 insertAL1(int rep) throws HL7Exception { 
660       return (AL1)super.insertRepetition("AL1", rep);
661    }
662
663
664    /**
665     * <p>
666     * Removes a specific repetition of AL1 (Patient Allergy Information)
667     * </p>
668     * 
669     *
670     * @see AbstractGroup#removeRepetition(String, int) 
671     */
672    public AL1 removeAL1(int rep) throws HL7Exception { 
673       return (AL1)super.removeRepetition("AL1", rep);
674    }
675
676
677
678
679    /**
680     * <p>
681     * Returns
682     * OBSERVATION (a Group object) - creates it if necessary
683     * </p>
684     * 
685     *
686     */
687    public RCI_I05_OBSERVATION getOBSERVATION() { 
688       return getTyped("OBSERVATION", RCI_I05_OBSERVATION.class);
689    }
690
691
692
693
694
695    /**
696     * <p>
697     * Returns
698     * the first repetition of 
699     * NTE (Notes and Comments) - creates it if necessary
700     * </p>
701     * 
702     *
703     */
704    public NTE getNTE() { 
705       return getTyped("NTE", NTE.class);
706    }
707
708
709    /**
710     * <p>
711     * Returns a specific repetition of
712     * NTE (Notes and Comments) - creates it if necessary
713     * </p>
714     * 
715     *
716     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
717     * @throws HL7Exception if the repetition requested is more than one 
718     *     greater than the number of existing repetitions.
719     */
720    public NTE getNTE(int rep) { 
721       return getTyped("NTE", rep, NTE.class);
722    }
723
724    /** 
725     * <p>
726     * Returns the number of existing repetitions of NTE 
727     * </p>
728     * 
729     */ 
730    public int getNTEReps() { 
731        return getReps("NTE");
732    } 
733
734    /** 
735     * <p>
736     * Returns a non-modifiable List containing all current existing repetitions of NTE.
737     * <p>
738     * <p>
739     * Note that unlike {@link #getNTE()}, this method will not create any reps
740     * if none are already present, so an empty list may be returned.
741     * </p>
742     * 
743     */ 
744    public java.util.List<NTE> getNTEAll() throws HL7Exception {
745        return getAllAsList("NTE", NTE.class);
746    } 
747
748    /**
749     * <p>
750     * Inserts a specific repetition of NTE (Notes and Comments)
751     * </p>
752     * 
753     *
754     * @see AbstractGroup#insertRepetition(Structure, int) 
755     */
756    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
757       super.insertRepetition( "NTE", structure, rep);
758    }
759
760
761    /**
762     * <p>
763     * Inserts a specific repetition of NTE (Notes and Comments)
764     * </p>
765     * 
766     *
767     * @see AbstractGroup#insertRepetition(Structure, int) 
768     */
769    public NTE insertNTE(int rep) throws HL7Exception { 
770       return (NTE)super.insertRepetition("NTE", rep);
771    }
772
773
774    /**
775     * <p>
776     * Removes a specific repetition of NTE (Notes and Comments)
777     * </p>
778     * 
779     *
780     * @see AbstractGroup#removeRepetition(String, int) 
781     */
782    public NTE removeNTE(int rep) throws HL7Exception { 
783       return (NTE)super.removeRepetition("NTE", rep);
784    }
785
786
787
788}
789