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