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.v28.group;
035
036import ca.uhn.hl7v2.model.v28.segment.*;
037
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.model.*;
041
042/**
043 * <p>Represents a RSP_K31_ORDER group structure (a Group object).
044 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
045 * This Group contains the following elements:  
046 * </p>
047 * <ul>
048                         * <li>1: ORC (Common Order) <b>  </b></li>
049                         * <li>2: PRT (Participation Information) <b>optional repeating </b></li>
050                         * <li>3: RSP_K31_TIMING (a Group object) <b>optional repeating </b></li>
051                         * <li>4: RSP_K31_ORDER_DETAIL (a Group object) <b>optional  </b></li>
052                         * <li>5: RSP_K31_ENCODING (a Group object) <b>optional  </b></li>
053                         * <li>6: RXD (Pharmacy/Treatment Dispense) <b>  </b></li>
054                         * <li>7: PRT (Participation Information) <b>optional repeating </b></li>
055                         * <li>8: RXR (Pharmacy/Treatment Route) <b> repeating </b></li>
056                         * <li>9: RXC (Pharmacy/Treatment Component Order) <b>optional repeating </b></li>
057                         * <li>10: CDO (Cumulative Dosage) <b>optional repeating </b></li>
058                         * <li>11: RSP_K31_OBSERVATION (a Group object) <b>optional repeating </b></li>
059 * </ul>
060 */
061//@SuppressWarnings("unused")
062public class RSP_K31_ORDER extends AbstractGroup {
063
064    /** 
065     * Creates a new RSP_K31_ORDER group
066     */
067    public RSP_K31_ORDER(Group parent, ModelClassFactory factory) {
068       super(parent, factory);
069       init(factory);
070    }
071
072    private void init(ModelClassFactory factory) {
073       try {
074                                  this.add(ORC.class, true, false, false);
075                                  this.add(PRT.class, false, true, false);
076                                  this.add(RSP_K31_TIMING.class, false, true, false);
077                                  this.add(RSP_K31_ORDER_DETAIL.class, false, false, false);
078                                  this.add(RSP_K31_ENCODING.class, false, false, false);
079                                  this.add(RXD.class, true, false, false);
080                                  this.add(PRT.class, false, true, false);
081                                  this.add(RXR.class, true, true, false);
082                                  this.add(RXC.class, false, true, false);
083                                  this.add(CDO.class, false, true, false);
084                                  this.add(RSP_K31_OBSERVATION.class, false, true, false);
085       } catch(HL7Exception e) {
086          log.error("Unexpected error creating RSP_K31_ORDER - this is probably a bug in the source code generator.", e);
087       }
088    }
089
090    /** 
091     * Returns "2.8"
092     */
093    public String getVersion() {
094       return "2.8";
095    }
096
097
098
099    /**
100     * Returns
101     * ORC (Common Order) - creates it if necessary
102     */
103    public ORC getORC() { 
104       ORC retVal = getTyped("ORC", ORC.class);
105       return retVal;
106    }
107
108
109
110
111    /**
112     * Returns
113     * the first repetition of 
114     * PRT (Participation Information) - creates it if necessary
115     */
116    public PRT getPRT() { 
117       PRT retVal = getTyped("PRT", PRT.class);
118       return retVal;
119    }
120
121
122    /**
123     * Returns a specific repetition of
124     * PRT (Participation Information) - creates it if necessary
125     *
126     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
127     * @throws HL7Exception if the repetition requested is more than one 
128     *     greater than the number of existing repetitions.
129     */
130    public PRT getPRT(int rep) { 
131       PRT retVal = getTyped("PRT", rep, PRT.class);
132       return retVal;
133    }
134
135    /** 
136     * Returns the number of existing repetitions of PRT 
137     */ 
138    public int getPRTReps() {  
139        return getReps("PRT");
140    } 
141
142    /** 
143     * <p>
144     * Returns a non-modifiable List containing all current existing repetitions of PRT.
145     * <p>
146     * <p>
147     * Note that unlike {@link #getPRT()}, this method will not create any reps
148     * if none are already present, so an empty list may be returned.
149     * </p>
150     */ 
151    public java.util.List<PRT> getPRTAll() throws HL7Exception {
152        return getAllAsList("PRT", PRT.class);
153    } 
154
155    /**
156     * Inserts a specific repetition of PRT (Participation Information)
157     * @see AbstractGroup#insertRepetition(Structure, int) 
158     */
159    public void insertPRT(PRT structure, int rep) throws HL7Exception { 
160       super.insertRepetition("PRT", structure, rep);
161    }
162
163
164    /**
165     * Inserts a specific repetition of PRT (Participation Information)
166     * @see AbstractGroup#insertRepetition(Structure, int) 
167     */
168    public PRT insertPRT(int rep) throws HL7Exception { 
169       return (PRT)super.insertRepetition("PRT", rep);
170    }
171
172
173    /**
174     * Removes a specific repetition of PRT (Participation Information)
175     * @see AbstractGroup#removeRepetition(String, int) 
176     */
177    public PRT removePRT(int rep) throws HL7Exception { 
178       return (PRT)super.removeRepetition("PRT", rep);
179    }
180
181
182
183    /**
184     * Returns
185     * the first repetition of 
186     * TIMING (a Group object) - creates it if necessary
187     */
188    public RSP_K31_TIMING getTIMING() { 
189       RSP_K31_TIMING retVal = getTyped("TIMING", RSP_K31_TIMING.class);
190       return retVal;
191    }
192
193
194    /**
195     * Returns a specific repetition of
196     * TIMING (a Group object) - creates it if necessary
197     *
198     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
199     * @throws HL7Exception if the repetition requested is more than one 
200     *     greater than the number of existing repetitions.
201     */
202    public RSP_K31_TIMING getTIMING(int rep) { 
203       RSP_K31_TIMING retVal = getTyped("TIMING", rep, RSP_K31_TIMING.class);
204       return retVal;
205    }
206
207    /** 
208     * Returns the number of existing repetitions of TIMING 
209     */ 
210    public int getTIMINGReps() {  
211        return getReps("TIMING");
212    } 
213
214    /** 
215     * <p>
216     * Returns a non-modifiable List containing all current existing repetitions of TIMING.
217     * <p>
218     * <p>
219     * Note that unlike {@link #getTIMING()}, this method will not create any reps
220     * if none are already present, so an empty list may be returned.
221     * </p>
222     */ 
223    public java.util.List<RSP_K31_TIMING> getTIMINGAll() throws HL7Exception {
224        return getAllAsList("TIMING", RSP_K31_TIMING.class);
225    } 
226
227    /**
228     * Inserts a specific repetition of TIMING (a Group object)
229     * @see AbstractGroup#insertRepetition(Structure, int) 
230     */
231    public void insertTIMING(RSP_K31_TIMING structure, int rep) throws HL7Exception { 
232       super.insertRepetition("TIMING", structure, rep);
233    }
234
235
236    /**
237     * Inserts a specific repetition of TIMING (a Group object)
238     * @see AbstractGroup#insertRepetition(Structure, int) 
239     */
240    public RSP_K31_TIMING insertTIMING(int rep) throws HL7Exception { 
241       return (RSP_K31_TIMING)super.insertRepetition("TIMING", rep);
242    }
243
244
245    /**
246     * Removes a specific repetition of TIMING (a Group object)
247     * @see AbstractGroup#removeRepetition(String, int) 
248     */
249    public RSP_K31_TIMING removeTIMING(int rep) throws HL7Exception { 
250       return (RSP_K31_TIMING)super.removeRepetition("TIMING", rep);
251    }
252
253
254
255    /**
256     * Returns
257     * ORDER_DETAIL (a Group object) - creates it if necessary
258     */
259    public RSP_K31_ORDER_DETAIL getORDER_DETAIL() { 
260       RSP_K31_ORDER_DETAIL retVal = getTyped("ORDER_DETAIL", RSP_K31_ORDER_DETAIL.class);
261       return retVal;
262    }
263
264
265
266
267    /**
268     * Returns
269     * ENCODING (a Group object) - creates it if necessary
270     */
271    public RSP_K31_ENCODING getENCODING() { 
272       RSP_K31_ENCODING retVal = getTyped("ENCODING", RSP_K31_ENCODING.class);
273       return retVal;
274    }
275
276
277
278
279    /**
280     * Returns
281     * RXD (Pharmacy/Treatment Dispense) - creates it if necessary
282     */
283    public RXD getRXD() { 
284       RXD retVal = getTyped("RXD", RXD.class);
285       return retVal;
286    }
287
288
289
290
291    /**
292     * Returns
293     * the first repetition of 
294     * PRT2 (Participation Information) - creates it if necessary
295     */
296    public PRT getPRT2() { 
297       PRT retVal = getTyped("PRT2", PRT.class);
298       return retVal;
299    }
300
301
302    /**
303     * Returns a specific repetition of
304     * PRT (Participation Information) - creates it if necessary
305     *
306     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
307     * @throws HL7Exception if the repetition requested is more than one 
308     *     greater than the number of existing repetitions.
309     */
310    public PRT getPRT2(int rep) { 
311       PRT retVal = getTyped("PRT2", rep, PRT.class);
312       return retVal;
313    }
314
315    /** 
316     * Returns the number of existing repetitions of PRT2 
317     */ 
318    public int getPRT2Reps() {  
319        return getReps("PRT2");
320    } 
321
322    /** 
323     * <p>
324     * Returns a non-modifiable List containing all current existing repetitions of PRT2.
325     * <p>
326     * <p>
327     * Note that unlike {@link #getPRT2()}, this method will not create any reps
328     * if none are already present, so an empty list may be returned.
329     * </p>
330     */ 
331    public java.util.List<PRT> getPRT2All() throws HL7Exception {
332        return getAllAsList("PRT2", PRT.class);
333    } 
334
335    /**
336     * Inserts a specific repetition of PRT2 (Participation Information)
337     * @see AbstractGroup#insertRepetition(Structure, int) 
338     */
339    public void insertPRT2(PRT structure, int rep) throws HL7Exception { 
340       super.insertRepetition("PRT2", structure, rep);
341    }
342
343
344    /**
345     * Inserts a specific repetition of PRT2 (Participation Information)
346     * @see AbstractGroup#insertRepetition(Structure, int) 
347     */
348    public PRT insertPRT2(int rep) throws HL7Exception { 
349       return (PRT)super.insertRepetition("PRT2", rep);
350    }
351
352
353    /**
354     * Removes a specific repetition of PRT2 (Participation Information)
355     * @see AbstractGroup#removeRepetition(String, int) 
356     */
357    public PRT removePRT2(int rep) throws HL7Exception { 
358       return (PRT)super.removeRepetition("PRT2", rep);
359    }
360
361
362
363    /**
364     * Returns
365     * the first repetition of 
366     * RXR (Pharmacy/Treatment Route) - creates it if necessary
367     */
368    public RXR getRXR() { 
369       RXR retVal = getTyped("RXR", RXR.class);
370       return retVal;
371    }
372
373
374    /**
375     * Returns a specific repetition of
376     * RXR (Pharmacy/Treatment Route) - creates it if necessary
377     *
378     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
379     * @throws HL7Exception if the repetition requested is more than one 
380     *     greater than the number of existing repetitions.
381     */
382    public RXR getRXR(int rep) { 
383       RXR retVal = getTyped("RXR", rep, RXR.class);
384       return retVal;
385    }
386
387    /** 
388     * Returns the number of existing repetitions of RXR 
389     */ 
390    public int getRXRReps() {  
391        return getReps("RXR");
392    } 
393
394    /** 
395     * <p>
396     * Returns a non-modifiable List containing all current existing repetitions of RXR.
397     * <p>
398     * <p>
399     * Note that unlike {@link #getRXR()}, this method will not create any reps
400     * if none are already present, so an empty list may be returned.
401     * </p>
402     */ 
403    public java.util.List<RXR> getRXRAll() throws HL7Exception {
404        return getAllAsList("RXR", RXR.class);
405    } 
406
407    /**
408     * Inserts a specific repetition of RXR (Pharmacy/Treatment Route)
409     * @see AbstractGroup#insertRepetition(Structure, int) 
410     */
411    public void insertRXR(RXR structure, int rep) throws HL7Exception { 
412       super.insertRepetition("RXR", structure, rep);
413    }
414
415
416    /**
417     * Inserts a specific repetition of RXR (Pharmacy/Treatment Route)
418     * @see AbstractGroup#insertRepetition(Structure, int) 
419     */
420    public RXR insertRXR(int rep) throws HL7Exception { 
421       return (RXR)super.insertRepetition("RXR", rep);
422    }
423
424
425    /**
426     * Removes a specific repetition of RXR (Pharmacy/Treatment Route)
427     * @see AbstractGroup#removeRepetition(String, int) 
428     */
429    public RXR removeRXR(int rep) throws HL7Exception { 
430       return (RXR)super.removeRepetition("RXR", rep);
431    }
432
433
434
435    /**
436     * Returns
437     * the first repetition of 
438     * RXC (Pharmacy/Treatment Component Order) - creates it if necessary
439     */
440    public RXC getRXC() { 
441       RXC retVal = getTyped("RXC", RXC.class);
442       return retVal;
443    }
444
445
446    /**
447     * Returns a specific repetition of
448     * RXC (Pharmacy/Treatment Component Order) - creates it if necessary
449     *
450     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
451     * @throws HL7Exception if the repetition requested is more than one 
452     *     greater than the number of existing repetitions.
453     */
454    public RXC getRXC(int rep) { 
455       RXC retVal = getTyped("RXC", rep, RXC.class);
456       return retVal;
457    }
458
459    /** 
460     * Returns the number of existing repetitions of RXC 
461     */ 
462    public int getRXCReps() {  
463        return getReps("RXC");
464    } 
465
466    /** 
467     * <p>
468     * Returns a non-modifiable List containing all current existing repetitions of RXC.
469     * <p>
470     * <p>
471     * Note that unlike {@link #getRXC()}, this method will not create any reps
472     * if none are already present, so an empty list may be returned.
473     * </p>
474     */ 
475    public java.util.List<RXC> getRXCAll() throws HL7Exception {
476        return getAllAsList("RXC", RXC.class);
477    } 
478
479    /**
480     * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order)
481     * @see AbstractGroup#insertRepetition(Structure, int) 
482     */
483    public void insertRXC(RXC structure, int rep) throws HL7Exception { 
484       super.insertRepetition("RXC", structure, rep);
485    }
486
487
488    /**
489     * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order)
490     * @see AbstractGroup#insertRepetition(Structure, int) 
491     */
492    public RXC insertRXC(int rep) throws HL7Exception { 
493       return (RXC)super.insertRepetition("RXC", rep);
494    }
495
496
497    /**
498     * Removes a specific repetition of RXC (Pharmacy/Treatment Component Order)
499     * @see AbstractGroup#removeRepetition(String, int) 
500     */
501    public RXC removeRXC(int rep) throws HL7Exception { 
502       return (RXC)super.removeRepetition("RXC", rep);
503    }
504
505
506
507    /**
508     * Returns
509     * the first repetition of 
510     * CDO (Cumulative Dosage) - creates it if necessary
511     */
512    public CDO getCDO() { 
513       CDO retVal = getTyped("CDO", CDO.class);
514       return retVal;
515    }
516
517
518    /**
519     * Returns a specific repetition of
520     * CDO (Cumulative Dosage) - creates it if necessary
521     *
522     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
523     * @throws HL7Exception if the repetition requested is more than one 
524     *     greater than the number of existing repetitions.
525     */
526    public CDO getCDO(int rep) { 
527       CDO retVal = getTyped("CDO", rep, CDO.class);
528       return retVal;
529    }
530
531    /** 
532     * Returns the number of existing repetitions of CDO 
533     */ 
534    public int getCDOReps() {  
535        return getReps("CDO");
536    } 
537
538    /** 
539     * <p>
540     * Returns a non-modifiable List containing all current existing repetitions of CDO.
541     * <p>
542     * <p>
543     * Note that unlike {@link #getCDO()}, this method will not create any reps
544     * if none are already present, so an empty list may be returned.
545     * </p>
546     */ 
547    public java.util.List<CDO> getCDOAll() throws HL7Exception {
548        return getAllAsList("CDO", CDO.class);
549    } 
550
551    /**
552     * Inserts a specific repetition of CDO (Cumulative Dosage)
553     * @see AbstractGroup#insertRepetition(Structure, int) 
554     */
555    public void insertCDO(CDO structure, int rep) throws HL7Exception { 
556       super.insertRepetition("CDO", structure, rep);
557    }
558
559
560    /**
561     * Inserts a specific repetition of CDO (Cumulative Dosage)
562     * @see AbstractGroup#insertRepetition(Structure, int) 
563     */
564    public CDO insertCDO(int rep) throws HL7Exception { 
565       return (CDO)super.insertRepetition("CDO", rep);
566    }
567
568
569    /**
570     * Removes a specific repetition of CDO (Cumulative Dosage)
571     * @see AbstractGroup#removeRepetition(String, int) 
572     */
573    public CDO removeCDO(int rep) throws HL7Exception { 
574       return (CDO)super.removeRepetition("CDO", rep);
575    }
576
577
578
579    /**
580     * Returns
581     * the first repetition of 
582     * OBSERVATION (a Group object) - creates it if necessary
583     */
584    public RSP_K31_OBSERVATION getOBSERVATION() { 
585       RSP_K31_OBSERVATION retVal = getTyped("OBSERVATION", RSP_K31_OBSERVATION.class);
586       return retVal;
587    }
588
589
590    /**
591     * Returns a specific repetition of
592     * OBSERVATION (a Group object) - creates it if necessary
593     *
594     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
595     * @throws HL7Exception if the repetition requested is more than one 
596     *     greater than the number of existing repetitions.
597     */
598    public RSP_K31_OBSERVATION getOBSERVATION(int rep) { 
599       RSP_K31_OBSERVATION retVal = getTyped("OBSERVATION", rep, RSP_K31_OBSERVATION.class);
600       return retVal;
601    }
602
603    /** 
604     * Returns the number of existing repetitions of OBSERVATION 
605     */ 
606    public int getOBSERVATIONReps() {  
607        return getReps("OBSERVATION");
608    } 
609
610    /** 
611     * <p>
612     * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION.
613     * <p>
614     * <p>
615     * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps
616     * if none are already present, so an empty list may be returned.
617     * </p>
618     */ 
619    public java.util.List<RSP_K31_OBSERVATION> getOBSERVATIONAll() throws HL7Exception {
620        return getAllAsList("OBSERVATION", RSP_K31_OBSERVATION.class);
621    } 
622
623    /**
624     * Inserts a specific repetition of OBSERVATION (a Group object)
625     * @see AbstractGroup#insertRepetition(Structure, int) 
626     */
627    public void insertOBSERVATION(RSP_K31_OBSERVATION structure, int rep) throws HL7Exception { 
628       super.insertRepetition("OBSERVATION", structure, rep);
629    }
630
631
632    /**
633     * Inserts a specific repetition of OBSERVATION (a Group object)
634     * @see AbstractGroup#insertRepetition(Structure, int) 
635     */
636    public RSP_K31_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 
637       return (RSP_K31_OBSERVATION)super.insertRepetition("OBSERVATION", rep);
638    }
639
640
641    /**
642     * Removes a specific repetition of OBSERVATION (a Group object)
643     * @see AbstractGroup#removeRepetition(String, int) 
644     */
645    public RSP_K31_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 
646       return (RSP_K31_OBSERVATION)super.removeRepetition("OBSERVATION", rep);
647    }
648
649
650
651}
652