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