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.v231.message;
035
036import ca.uhn.hl7v2.model.v231.group.*;
037import ca.uhn.hl7v2.model.v231.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 ?). This structure contains the 
048 * following elements: </p>
049 * <ul>
050                 * <li>1: MSH (MSH - message header segment) <b> </b></li>
051                 * <li>2: MSA (MSA - message acknowledgment segment) <b> </b></li>
052                 * <li>3: QRD (QRD - original-style query definition segment) <b> </b></li>
053                 * <li>4: QRF (QRF - original style query filter segment) <b>optional </b></li>
054                 * <li>5: RCL_I06_PRDCTD (a Group object) <b> repeating</b></li>
055                 * <li>6: PID (PID - patient identification segment) <b> </b></li>
056                 * <li>7: DG1 (DG1 - diagnosis segment) <b>optional repeating</b></li>
057                 * <li>8: DRG (DRG - diagnosis related group segment) <b>optional repeating</b></li>
058                 * <li>9: AL1 (AL1 - patient allergy information segment) <b>optional repeating</b></li>
059                 * <li>10: NTE (NTE - notes and comments segment) <b>optional repeating</b></li>
060                 * <li>11: DSP (DSP - display data segment) <b>optional repeating</b></li>
061                 * <li>12: DSC (DSC - Continuation pointer segment) <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(MSA.class, true, false);
086                          this.add(QRD.class, true, false);
087                          this.add(QRF.class, false, false);
088                          this.add(RCL_I06_PRDCTD.class, true, true);
089                          this.add(PID.class, true, false);
090                          this.add(DG1.class, false, true);
091                          this.add(DRG.class, false, true);
092                          this.add(AL1.class, false, true);
093                          this.add(NTE.class, false, true);
094                          this.add(DSP.class, false, true);
095                          this.add(DSC.class, false, false);
096       } catch(HL7Exception e) {
097          log.error("Unexpected error creating RCL_I06 - this is probably a bug in the source code generator.", e);
098       }
099    }
100
101    /** 
102     * Returns "2.3.1"
103     */
104    public String getVersion() {
105       return "2.3.1";
106    }
107
108
109
110    /**
111     * Returns
112     * MSH (MSH - message header segment) - creates it if necessary
113     */
114    public MSH getMSH() { 
115       return getTyped("MSH", MSH.class);
116    }
117
118
119
120
121    /**
122     * Returns
123     * MSA (MSA - message acknowledgment segment) - creates it if necessary
124     */
125    public MSA getMSA() { 
126       return getTyped("MSA", MSA.class);
127    }
128
129
130
131
132    /**
133     * Returns
134     * QRD (QRD - original-style query definition segment) - creates it if necessary
135     */
136    public QRD getQRD() { 
137       return getTyped("QRD", QRD.class);
138    }
139
140
141
142
143    /**
144     * Returns
145     * QRF (QRF - original style query filter segment) - creates it if necessary
146     */
147    public QRF getQRF() { 
148       return getTyped("QRF", QRF.class);
149    }
150
151
152
153
154    /**
155     * Returns
156     * the first repetition of 
157     * PRDCTD (a Group object) - creates it if necessary
158     */
159    public RCL_I06_PRDCTD getPRDCTD() { 
160       return getTyped("PRDCTD", RCL_I06_PRDCTD.class);
161    }
162
163
164    /**
165     * Returns a specific repetition of
166     * PRDCTD (a Group object) - creates it if necessary
167     *
168     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
169     * @throws HL7Exception if the repetition requested is more than one 
170     *     greater than the number of existing repetitions.
171     */
172    public RCL_I06_PRDCTD getPRDCTD(int rep) { 
173       return getTyped("PRDCTD", rep, RCL_I06_PRDCTD.class);
174    }
175
176    /** 
177     * Returns the number of existing repetitions of PRDCTD 
178     */ 
179    public int getPRDCTDReps() { 
180        return getReps("PRDCTD");
181    } 
182
183    /** 
184     * <p>
185     * Returns a non-modifiable List containing all current existing repetitions of PRDCTD.
186     * <p>
187     * <p>
188     * Note that unlike {@link #getPRDCTD()}, this method will not create any reps
189     * if none are already present, so an empty list may be returned.
190     * </p>
191     */ 
192    public List<RCL_I06_PRDCTD> getPRDCTDAll() throws HL7Exception {
193        return getAllAsList("PRDCTD", RCL_I06_PRDCTD.class);
194    } 
195
196    /**
197     * Inserts a specific repetition of PRDCTD (a Group object)
198     * @see AbstractGroup#insertRepetition(Structure, int) 
199     */
200    public void insertPRDCTD(RCL_I06_PRDCTD structure, int rep) throws HL7Exception { 
201       super.insertRepetition( "PRDCTD", structure, rep);
202    }
203
204
205    /**
206     * Inserts a specific repetition of PRDCTD (a Group object)
207     * @see AbstractGroup#insertRepetition(Structure, int) 
208     */
209    public RCL_I06_PRDCTD insertPRDCTD(int rep) throws HL7Exception { 
210       return (RCL_I06_PRDCTD)super.insertRepetition("PRDCTD", rep);
211    }
212
213
214    /**
215     * Removes a specific repetition of PRDCTD (a Group object)
216     * @see AbstractGroup#removeRepetition(String, int) 
217     */
218    public RCL_I06_PRDCTD removePRDCTD(int rep) throws HL7Exception { 
219       return (RCL_I06_PRDCTD)super.removeRepetition("PRDCTD", rep);
220    }
221
222
223
224    /**
225     * Returns
226     * PID (PID - patient identification segment) - creates it if necessary
227     */
228    public PID getPID() { 
229       return getTyped("PID", PID.class);
230    }
231
232
233
234
235    /**
236     * Returns
237     * the first repetition of 
238     * DG1 (DG1 - diagnosis segment) - creates it if necessary
239     */
240    public DG1 getDG1() { 
241       return getTyped("DG1", DG1.class);
242    }
243
244
245    /**
246     * Returns a specific repetition of
247     * DG1 (DG1 - diagnosis segment) - creates it if necessary
248     *
249     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
250     * @throws HL7Exception if the repetition requested is more than one 
251     *     greater than the number of existing repetitions.
252     */
253    public DG1 getDG1(int rep) { 
254       return getTyped("DG1", rep, DG1.class);
255    }
256
257    /** 
258     * Returns the number of existing repetitions of DG1 
259     */ 
260    public int getDG1Reps() { 
261        return getReps("DG1");
262    } 
263
264    /** 
265     * <p>
266     * Returns a non-modifiable List containing all current existing repetitions of DG1.
267     * <p>
268     * <p>
269     * Note that unlike {@link #getDG1()}, this method will not create any reps
270     * if none are already present, so an empty list may be returned.
271     * </p>
272     */ 
273    public List<DG1> getDG1All() throws HL7Exception {
274        return getAllAsList("DG1", DG1.class);
275    } 
276
277    /**
278     * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
279     * @see AbstractGroup#insertRepetition(Structure, int) 
280     */
281    public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
282       super.insertRepetition( "DG1", structure, rep);
283    }
284
285
286    /**
287     * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
288     * @see AbstractGroup#insertRepetition(Structure, int) 
289     */
290    public DG1 insertDG1(int rep) throws HL7Exception { 
291       return (DG1)super.insertRepetition("DG1", rep);
292    }
293
294
295    /**
296     * Removes a specific repetition of DG1 (DG1 - diagnosis segment)
297     * @see AbstractGroup#removeRepetition(String, int) 
298     */
299    public DG1 removeDG1(int rep) throws HL7Exception { 
300       return (DG1)super.removeRepetition("DG1", rep);
301    }
302
303
304
305    /**
306     * Returns
307     * the first repetition of 
308     * DRG (DRG - diagnosis related group segment) - creates it if necessary
309     */
310    public DRG getDRG() { 
311       return getTyped("DRG", DRG.class);
312    }
313
314
315    /**
316     * Returns a specific repetition of
317     * DRG (DRG - diagnosis related group segment) - creates it if necessary
318     *
319     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
320     * @throws HL7Exception if the repetition requested is more than one 
321     *     greater than the number of existing repetitions.
322     */
323    public DRG getDRG(int rep) { 
324       return getTyped("DRG", rep, DRG.class);
325    }
326
327    /** 
328     * Returns the number of existing repetitions of DRG 
329     */ 
330    public int getDRGReps() { 
331        return getReps("DRG");
332    } 
333
334    /** 
335     * <p>
336     * Returns a non-modifiable List containing all current existing repetitions of DRG.
337     * <p>
338     * <p>
339     * Note that unlike {@link #getDRG()}, this method will not create any reps
340     * if none are already present, so an empty list may be returned.
341     * </p>
342     */ 
343    public List<DRG> getDRGAll() throws HL7Exception {
344        return getAllAsList("DRG", DRG.class);
345    } 
346
347    /**
348     * Inserts a specific repetition of DRG (DRG - diagnosis related group segment)
349     * @see AbstractGroup#insertRepetition(Structure, int) 
350     */
351    public void insertDRG(DRG structure, int rep) throws HL7Exception { 
352       super.insertRepetition( "DRG", structure, rep);
353    }
354
355
356    /**
357     * Inserts a specific repetition of DRG (DRG - diagnosis related group segment)
358     * @see AbstractGroup#insertRepetition(Structure, int) 
359     */
360    public DRG insertDRG(int rep) throws HL7Exception { 
361       return (DRG)super.insertRepetition("DRG", rep);
362    }
363
364
365    /**
366     * Removes a specific repetition of DRG (DRG - diagnosis related group segment)
367     * @see AbstractGroup#removeRepetition(String, int) 
368     */
369    public DRG removeDRG(int rep) throws HL7Exception { 
370       return (DRG)super.removeRepetition("DRG", rep);
371    }
372
373
374
375    /**
376     * Returns
377     * the first repetition of 
378     * AL1 (AL1 - patient allergy information segment) - creates it if necessary
379     */
380    public AL1 getAL1() { 
381       return getTyped("AL1", AL1.class);
382    }
383
384
385    /**
386     * Returns a specific repetition of
387     * AL1 (AL1 - patient allergy information segment) - creates it if necessary
388     *
389     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
390     * @throws HL7Exception if the repetition requested is more than one 
391     *     greater than the number of existing repetitions.
392     */
393    public AL1 getAL1(int rep) { 
394       return getTyped("AL1", rep, AL1.class);
395    }
396
397    /** 
398     * Returns the number of existing repetitions of AL1 
399     */ 
400    public int getAL1Reps() { 
401        return getReps("AL1");
402    } 
403
404    /** 
405     * <p>
406     * Returns a non-modifiable List containing all current existing repetitions of AL1.
407     * <p>
408     * <p>
409     * Note that unlike {@link #getAL1()}, this method will not create any reps
410     * if none are already present, so an empty list may be returned.
411     * </p>
412     */ 
413    public List<AL1> getAL1All() throws HL7Exception {
414        return getAllAsList("AL1", AL1.class);
415    } 
416
417    /**
418     * Inserts a specific repetition of AL1 (AL1 - patient allergy information segment)
419     * @see AbstractGroup#insertRepetition(Structure, int) 
420     */
421    public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
422       super.insertRepetition( "AL1", structure, rep);
423    }
424
425
426    /**
427     * Inserts a specific repetition of AL1 (AL1 - patient allergy information segment)
428     * @see AbstractGroup#insertRepetition(Structure, int) 
429     */
430    public AL1 insertAL1(int rep) throws HL7Exception { 
431       return (AL1)super.insertRepetition("AL1", rep);
432    }
433
434
435    /**
436     * Removes a specific repetition of AL1 (AL1 - patient allergy information segment)
437     * @see AbstractGroup#removeRepetition(String, int) 
438     */
439    public AL1 removeAL1(int rep) throws HL7Exception { 
440       return (AL1)super.removeRepetition("AL1", rep);
441    }
442
443
444
445    /**
446     * Returns
447     * the first repetition of 
448     * NTE (NTE - notes and comments segment) - creates it if necessary
449     */
450    public NTE getNTE() { 
451       return getTyped("NTE", NTE.class);
452    }
453
454
455    /**
456     * Returns a specific repetition of
457     * NTE (NTE - notes and comments segment) - creates it if necessary
458     *
459     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
460     * @throws HL7Exception if the repetition requested is more than one 
461     *     greater than the number of existing repetitions.
462     */
463    public NTE getNTE(int rep) { 
464       return getTyped("NTE", rep, NTE.class);
465    }
466
467    /** 
468     * Returns the number of existing repetitions of NTE 
469     */ 
470    public int getNTEReps() { 
471        return getReps("NTE");
472    } 
473
474    /** 
475     * <p>
476     * Returns a non-modifiable List containing all current existing repetitions of NTE.
477     * <p>
478     * <p>
479     * Note that unlike {@link #getNTE()}, this method will not create any reps
480     * if none are already present, so an empty list may be returned.
481     * </p>
482     */ 
483    public List<NTE> getNTEAll() throws HL7Exception {
484        return getAllAsList("NTE", NTE.class);
485    } 
486
487    /**
488     * Inserts a specific repetition of NTE (NTE - notes and comments segment)
489     * @see AbstractGroup#insertRepetition(Structure, int) 
490     */
491    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
492       super.insertRepetition( "NTE", structure, rep);
493    }
494
495
496    /**
497     * Inserts a specific repetition of NTE (NTE - notes and comments segment)
498     * @see AbstractGroup#insertRepetition(Structure, int) 
499     */
500    public NTE insertNTE(int rep) throws HL7Exception { 
501       return (NTE)super.insertRepetition("NTE", rep);
502    }
503
504
505    /**
506     * Removes a specific repetition of NTE (NTE - notes and comments segment)
507     * @see AbstractGroup#removeRepetition(String, int) 
508     */
509    public NTE removeNTE(int rep) throws HL7Exception { 
510       return (NTE)super.removeRepetition("NTE", rep);
511    }
512
513
514
515    /**
516     * Returns
517     * the first repetition of 
518     * DSP (DSP - display data segment) - creates it if necessary
519     */
520    public DSP getDSP() { 
521       return getTyped("DSP", DSP.class);
522    }
523
524
525    /**
526     * Returns a specific repetition of
527     * DSP (DSP - display data segment) - creates it if necessary
528     *
529     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
530     * @throws HL7Exception if the repetition requested is more than one 
531     *     greater than the number of existing repetitions.
532     */
533    public DSP getDSP(int rep) { 
534       return getTyped("DSP", rep, DSP.class);
535    }
536
537    /** 
538     * Returns the number of existing repetitions of DSP 
539     */ 
540    public int getDSPReps() { 
541        return getReps("DSP");
542    } 
543
544    /** 
545     * <p>
546     * Returns a non-modifiable List containing all current existing repetitions of DSP.
547     * <p>
548     * <p>
549     * Note that unlike {@link #getDSP()}, this method will not create any reps
550     * if none are already present, so an empty list may be returned.
551     * </p>
552     */ 
553    public List<DSP> getDSPAll() throws HL7Exception {
554        return getAllAsList("DSP", DSP.class);
555    } 
556
557    /**
558     * Inserts a specific repetition of DSP (DSP - display data segment)
559     * @see AbstractGroup#insertRepetition(Structure, int) 
560     */
561    public void insertDSP(DSP structure, int rep) throws HL7Exception { 
562       super.insertRepetition( "DSP", structure, rep);
563    }
564
565
566    /**
567     * Inserts a specific repetition of DSP (DSP - display data segment)
568     * @see AbstractGroup#insertRepetition(Structure, int) 
569     */
570    public DSP insertDSP(int rep) throws HL7Exception { 
571       return (DSP)super.insertRepetition("DSP", rep);
572    }
573
574
575    /**
576     * Removes a specific repetition of DSP (DSP - display data segment)
577     * @see AbstractGroup#removeRepetition(String, int) 
578     */
579    public DSP removeDSP(int rep) throws HL7Exception { 
580       return (DSP)super.removeRepetition("DSP", rep);
581    }
582
583
584
585    /**
586     * Returns
587     * DSC (DSC - Continuation pointer segment) - creates it if necessary
588     */
589    public DSC getDSC() { 
590       return getTyped("DSC", DSC.class);
591    }
592
593
594
595
596}
597