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