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 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: MSA (Message Acknowledgment) <b> </b></li>
053                 * <li>4: QRD (Original-Style Query Definition) <b> </b></li>
054                 * <li>5: QRF (Original style query filter) <b>optional </b></li>
055                 * <li>6: RCL_I06_PROVIDER (a Group object) <b> repeating</b></li>
056                 * <li>7: PID (Patient Identification) <b> </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: NTE (Notes and Comments) <b>optional repeating</b></li>
061                 * <li>12: DSP (Display Data) <b>optional repeating</b></li>
062                 * <li>13: DSC (Continuation Pointer) <b>optional </b></li>
063 * </ul>
064 */
065@SuppressWarnings("unused")
066public class RCL_I06 extends AbstractMessage  {
067
068    /**
069     * Creates a new RCL_I06 message with DefaultModelClassFactory. 
070     */ 
071    public RCL_I06() { 
072       this(new DefaultModelClassFactory());
073    }
074
075    /** 
076     * Creates a new RCL_I06 message with custom ModelClassFactory.
077     */
078    public RCL_I06(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(MSA.class, true, false);
088                          this.add(QRD.class, true, false);
089                          this.add(QRF.class, false, false);
090                          this.add(RCL_I06_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(NTE.class, false, true);
096                          this.add(DSP.class, false, true);
097                          this.add(DSC.class, false, false);
098       } catch(HL7Exception e) {
099          log.error("Unexpected error creating RCL_I06 - this is probably a bug in the source code generator.", e);
100       }
101    }
102
103    /** 
104     * Returns "2.5"
105     */
106    public String getVersion() {
107       return "2.5";
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     * MSA (Message Acknowledgment) - creates it if necessary
196     */
197    public MSA getMSA() { 
198       return getTyped("MSA", MSA.class);
199    }
200
201
202
203
204    /**
205     * Returns
206     * QRD (Original-Style Query Definition) - creates it if necessary
207     */
208    public QRD getQRD() { 
209       return getTyped("QRD", QRD.class);
210    }
211
212
213
214
215    /**
216     * Returns
217     * QRF (Original style query filter) - creates it if necessary
218     */
219    public QRF getQRF() { 
220       return getTyped("QRF", QRF.class);
221    }
222
223
224
225
226    /**
227     * Returns
228     * the first repetition of 
229     * PROVIDER (a Group object) - creates it if necessary
230     */
231    public RCL_I06_PROVIDER getPROVIDER() { 
232       return getTyped("PROVIDER", RCL_I06_PROVIDER.class);
233    }
234
235
236    /**
237     * Returns a specific repetition of
238     * PROVIDER (a Group object) - creates it if necessary
239     *
240     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
241     * @throws HL7Exception if the repetition requested is more than one 
242     *     greater than the number of existing repetitions.
243     */
244    public RCL_I06_PROVIDER getPROVIDER(int rep) { 
245       return getTyped("PROVIDER", rep, RCL_I06_PROVIDER.class);
246    }
247
248    /** 
249     * Returns the number of existing repetitions of PROVIDER 
250     */ 
251    public int getPROVIDERReps() { 
252        return getReps("PROVIDER");
253    } 
254
255    /** 
256     * <p>
257     * Returns a non-modifiable List containing all current existing repetitions of PROVIDER.
258     * <p>
259     * <p>
260     * Note that unlike {@link #getPROVIDER()}, this method will not create any reps
261     * if none are already present, so an empty list may be returned.
262     * </p>
263     */ 
264    public List<RCL_I06_PROVIDER> getPROVIDERAll() throws HL7Exception {
265        return getAllAsList("PROVIDER", RCL_I06_PROVIDER.class);
266    } 
267
268    /**
269     * Inserts a specific repetition of PROVIDER (a Group object)
270     * @see AbstractGroup#insertRepetition(Structure, int) 
271     */
272    public void insertPROVIDER(RCL_I06_PROVIDER structure, int rep) throws HL7Exception { 
273       super.insertRepetition( "PROVIDER", structure, rep);
274    }
275
276
277    /**
278     * Inserts a specific repetition of PROVIDER (a Group object)
279     * @see AbstractGroup#insertRepetition(Structure, int) 
280     */
281    public RCL_I06_PROVIDER insertPROVIDER(int rep) throws HL7Exception { 
282       return (RCL_I06_PROVIDER)super.insertRepetition("PROVIDER", rep);
283    }
284
285
286    /**
287     * Removes a specific repetition of PROVIDER (a Group object)
288     * @see AbstractGroup#removeRepetition(String, int) 
289     */
290    public RCL_I06_PROVIDER removePROVIDER(int rep) throws HL7Exception { 
291       return (RCL_I06_PROVIDER)super.removeRepetition("PROVIDER", rep);
292    }
293
294
295
296    /**
297     * Returns
298     * PID (Patient Identification) - creates it if necessary
299     */
300    public PID getPID() { 
301       return getTyped("PID", PID.class);
302    }
303
304
305
306
307    /**
308     * Returns
309     * the first repetition of 
310     * DG1 (Diagnosis) - creates it if necessary
311     */
312    public DG1 getDG1() { 
313       return getTyped("DG1", DG1.class);
314    }
315
316
317    /**
318     * Returns a specific repetition of
319     * DG1 (Diagnosis) - creates it if necessary
320     *
321     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
322     * @throws HL7Exception if the repetition requested is more than one 
323     *     greater than the number of existing repetitions.
324     */
325    public DG1 getDG1(int rep) { 
326       return getTyped("DG1", rep, DG1.class);
327    }
328
329    /** 
330     * Returns the number of existing repetitions of DG1 
331     */ 
332    public int getDG1Reps() { 
333        return getReps("DG1");
334    } 
335
336    /** 
337     * <p>
338     * Returns a non-modifiable List containing all current existing repetitions of DG1.
339     * <p>
340     * <p>
341     * Note that unlike {@link #getDG1()}, this method will not create any reps
342     * if none are already present, so an empty list may be returned.
343     * </p>
344     */ 
345    public List<DG1> getDG1All() throws HL7Exception {
346        return getAllAsList("DG1", DG1.class);
347    } 
348
349    /**
350     * Inserts a specific repetition of DG1 (Diagnosis)
351     * @see AbstractGroup#insertRepetition(Structure, int) 
352     */
353    public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
354       super.insertRepetition( "DG1", structure, rep);
355    }
356
357
358    /**
359     * Inserts a specific repetition of DG1 (Diagnosis)
360     * @see AbstractGroup#insertRepetition(Structure, int) 
361     */
362    public DG1 insertDG1(int rep) throws HL7Exception { 
363       return (DG1)super.insertRepetition("DG1", rep);
364    }
365
366
367    /**
368     * Removes a specific repetition of DG1 (Diagnosis)
369     * @see AbstractGroup#removeRepetition(String, int) 
370     */
371    public DG1 removeDG1(int rep) throws HL7Exception { 
372       return (DG1)super.removeRepetition("DG1", rep);
373    }
374
375
376
377    /**
378     * Returns
379     * the first repetition of 
380     * DRG (Diagnosis Related Group) - creates it if necessary
381     */
382    public DRG getDRG() { 
383       return getTyped("DRG", DRG.class);
384    }
385
386
387    /**
388     * Returns a specific repetition of
389     * DRG (Diagnosis Related Group) - creates it if necessary
390     *
391     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
392     * @throws HL7Exception if the repetition requested is more than one 
393     *     greater than the number of existing repetitions.
394     */
395    public DRG getDRG(int rep) { 
396       return getTyped("DRG", rep, DRG.class);
397    }
398
399    /** 
400     * Returns the number of existing repetitions of DRG 
401     */ 
402    public int getDRGReps() { 
403        return getReps("DRG");
404    } 
405
406    /** 
407     * <p>
408     * Returns a non-modifiable List containing all current existing repetitions of DRG.
409     * <p>
410     * <p>
411     * Note that unlike {@link #getDRG()}, this method will not create any reps
412     * if none are already present, so an empty list may be returned.
413     * </p>
414     */ 
415    public List<DRG> getDRGAll() throws HL7Exception {
416        return getAllAsList("DRG", DRG.class);
417    } 
418
419    /**
420     * Inserts a specific repetition of DRG (Diagnosis Related Group)
421     * @see AbstractGroup#insertRepetition(Structure, int) 
422     */
423    public void insertDRG(DRG structure, int rep) throws HL7Exception { 
424       super.insertRepetition( "DRG", structure, rep);
425    }
426
427
428    /**
429     * Inserts a specific repetition of DRG (Diagnosis Related Group)
430     * @see AbstractGroup#insertRepetition(Structure, int) 
431     */
432    public DRG insertDRG(int rep) throws HL7Exception { 
433       return (DRG)super.insertRepetition("DRG", rep);
434    }
435
436
437    /**
438     * Removes a specific repetition of DRG (Diagnosis Related Group)
439     * @see AbstractGroup#removeRepetition(String, int) 
440     */
441    public DRG removeDRG(int rep) throws HL7Exception { 
442       return (DRG)super.removeRepetition("DRG", rep);
443    }
444
445
446
447    /**
448     * Returns
449     * the first repetition of 
450     * AL1 (Patient Allergy Information) - creates it if necessary
451     */
452    public AL1 getAL1() { 
453       return getTyped("AL1", AL1.class);
454    }
455
456
457    /**
458     * Returns a specific repetition of
459     * AL1 (Patient Allergy Information) - creates it if necessary
460     *
461     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
462     * @throws HL7Exception if the repetition requested is more than one 
463     *     greater than the number of existing repetitions.
464     */
465    public AL1 getAL1(int rep) { 
466       return getTyped("AL1", rep, AL1.class);
467    }
468
469    /** 
470     * Returns the number of existing repetitions of AL1 
471     */ 
472    public int getAL1Reps() { 
473        return getReps("AL1");
474    } 
475
476    /** 
477     * <p>
478     * Returns a non-modifiable List containing all current existing repetitions of AL1.
479     * <p>
480     * <p>
481     * Note that unlike {@link #getAL1()}, this method will not create any reps
482     * if none are already present, so an empty list may be returned.
483     * </p>
484     */ 
485    public List<AL1> getAL1All() throws HL7Exception {
486        return getAllAsList("AL1", AL1.class);
487    } 
488
489    /**
490     * Inserts a specific repetition of AL1 (Patient Allergy Information)
491     * @see AbstractGroup#insertRepetition(Structure, int) 
492     */
493    public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
494       super.insertRepetition( "AL1", structure, rep);
495    }
496
497
498    /**
499     * Inserts a specific repetition of AL1 (Patient Allergy Information)
500     * @see AbstractGroup#insertRepetition(Structure, int) 
501     */
502    public AL1 insertAL1(int rep) throws HL7Exception { 
503       return (AL1)super.insertRepetition("AL1", rep);
504    }
505
506
507    /**
508     * Removes a specific repetition of AL1 (Patient Allergy Information)
509     * @see AbstractGroup#removeRepetition(String, int) 
510     */
511    public AL1 removeAL1(int rep) throws HL7Exception { 
512       return (AL1)super.removeRepetition("AL1", rep);
513    }
514
515
516
517    /**
518     * Returns
519     * the first repetition of 
520     * NTE (Notes and Comments) - creates it if necessary
521     */
522    public NTE getNTE() { 
523       return getTyped("NTE", NTE.class);
524    }
525
526
527    /**
528     * Returns a specific repetition of
529     * NTE (Notes and Comments) - creates it if necessary
530     *
531     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
532     * @throws HL7Exception if the repetition requested is more than one 
533     *     greater than the number of existing repetitions.
534     */
535    public NTE getNTE(int rep) { 
536       return getTyped("NTE", rep, NTE.class);
537    }
538
539    /** 
540     * Returns the number of existing repetitions of NTE 
541     */ 
542    public int getNTEReps() { 
543        return getReps("NTE");
544    } 
545
546    /** 
547     * <p>
548     * Returns a non-modifiable List containing all current existing repetitions of NTE.
549     * <p>
550     * <p>
551     * Note that unlike {@link #getNTE()}, this method will not create any reps
552     * if none are already present, so an empty list may be returned.
553     * </p>
554     */ 
555    public List<NTE> getNTEAll() throws HL7Exception {
556        return getAllAsList("NTE", NTE.class);
557    } 
558
559    /**
560     * Inserts a specific repetition of NTE (Notes and Comments)
561     * @see AbstractGroup#insertRepetition(Structure, int) 
562     */
563    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
564       super.insertRepetition( "NTE", structure, rep);
565    }
566
567
568    /**
569     * Inserts a specific repetition of NTE (Notes and Comments)
570     * @see AbstractGroup#insertRepetition(Structure, int) 
571     */
572    public NTE insertNTE(int rep) throws HL7Exception { 
573       return (NTE)super.insertRepetition("NTE", rep);
574    }
575
576
577    /**
578     * Removes a specific repetition of NTE (Notes and Comments)
579     * @see AbstractGroup#removeRepetition(String, int) 
580     */
581    public NTE removeNTE(int rep) throws HL7Exception { 
582       return (NTE)super.removeRepetition("NTE", rep);
583    }
584
585
586
587    /**
588     * Returns
589     * the first repetition of 
590     * DSP (Display Data) - creates it if necessary
591     */
592    public DSP getDSP() { 
593       return getTyped("DSP", DSP.class);
594    }
595
596
597    /**
598     * Returns a specific repetition of
599     * DSP (Display Data) - creates it if necessary
600     *
601     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
602     * @throws HL7Exception if the repetition requested is more than one 
603     *     greater than the number of existing repetitions.
604     */
605    public DSP getDSP(int rep) { 
606       return getTyped("DSP", rep, DSP.class);
607    }
608
609    /** 
610     * Returns the number of existing repetitions of DSP 
611     */ 
612    public int getDSPReps() { 
613        return getReps("DSP");
614    } 
615
616    /** 
617     * <p>
618     * Returns a non-modifiable List containing all current existing repetitions of DSP.
619     * <p>
620     * <p>
621     * Note that unlike {@link #getDSP()}, this method will not create any reps
622     * if none are already present, so an empty list may be returned.
623     * </p>
624     */ 
625    public List<DSP> getDSPAll() throws HL7Exception {
626        return getAllAsList("DSP", DSP.class);
627    } 
628
629    /**
630     * Inserts a specific repetition of DSP (Display Data)
631     * @see AbstractGroup#insertRepetition(Structure, int) 
632     */
633    public void insertDSP(DSP structure, int rep) throws HL7Exception { 
634       super.insertRepetition( "DSP", structure, rep);
635    }
636
637
638    /**
639     * Inserts a specific repetition of DSP (Display Data)
640     * @see AbstractGroup#insertRepetition(Structure, int) 
641     */
642    public DSP insertDSP(int rep) throws HL7Exception { 
643       return (DSP)super.insertRepetition("DSP", rep);
644    }
645
646
647    /**
648     * Removes a specific repetition of DSP (Display Data)
649     * @see AbstractGroup#removeRepetition(String, int) 
650     */
651    public DSP removeDSP(int rep) throws HL7Exception { 
652       return (DSP)super.removeRepetition("DSP", rep);
653    }
654
655
656
657    /**
658     * Returns
659     * DSC (Continuation Pointer) - creates it if necessary
660     */
661    public DSC getDSC() { 
662       return getTyped("DSC", DSC.class);
663    }
664
665
666
667
668}
669