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