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 OMP_O09_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: OMP_O09_TIMING (a Group object) <b>optional repeating</b></li>
052                 * <li>3: RXO (Pharmacy/Treatment Order) <b> </b></li>
053                 * <li>4: NTE (Notes and Comments) <b>optional repeating</b></li>
054                 * <li>5: RXR (Pharmacy/Treatment Route) <b> repeating</b></li>
055                 * <li>6: OMP_O09_COMPONENT (a Group object) <b>optional repeating</b></li>
056                 * <li>7: OMP_O09_OBSERVATION (a Group object) <b>optional repeating</b></li>
057                 * <li>8: FT1 (Financial Transaction) <b>optional repeating</b></li>
058                 * <li>9: BLG (Billing) <b>optional </b></li>
059 * </ul>
060 */
061@SuppressWarnings("unused")
062public class OMP_O09_ORDER extends AbstractGroup {
063
064    /** 
065     * Creates a new OMP_O09_ORDER group
066     */
067    public OMP_O09_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);
075                          this.add(OMP_O09_TIMING.class, false, true);
076                          this.add(RXO.class, true, false);
077                          this.add(NTE.class, false, true);
078                          this.add(RXR.class, true, true);
079                          this.add(OMP_O09_COMPONENT.class, false, true);
080                          this.add(OMP_O09_OBSERVATION.class, false, true);
081                          this.add(FT1.class, false, true);
082                          this.add(BLG.class, false, false);
083       } catch(HL7Exception e) {
084          log.error("Unexpected error creating OMP_O09_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 OMP_O09_TIMING getTIMING() { 
115       OMP_O09_TIMING retVal = getTyped("TIMING", OMP_O09_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 OMP_O09_TIMING getTIMING(int rep) { 
129       OMP_O09_TIMING retVal = getTyped("TIMING", rep, OMP_O09_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 List<OMP_O09_TIMING> getTIMINGAll() throws HL7Exception {
150        return getAllAsList("TIMING", OMP_O09_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(OMP_O09_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 OMP_O09_TIMING insertTIMING(int rep) throws HL7Exception { 
167       return (OMP_O09_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 OMP_O09_TIMING removeTIMING(int rep) throws HL7Exception { 
176       return (OMP_O09_TIMING)super.removeRepetition("TIMING", rep);
177    }
178
179
180
181    /**
182     * Returns
183     * RXO (Pharmacy/Treatment Order) - creates it if necessary
184     */
185    public RXO getRXO() { 
186       RXO retVal = getTyped("RXO", RXO.class);
187       return retVal;
188    }
189
190
191
192
193    /**
194     * Returns
195     * the first repetition of 
196     * NTE (Notes and Comments) - creates it if necessary
197     */
198    public NTE getNTE() { 
199       NTE retVal = getTyped("NTE", NTE.class);
200       return retVal;
201    }
202
203
204    /**
205     * Returns a specific repetition of
206     * NTE (Notes and Comments) - creates it if necessary
207     *
208     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
209     * @throws HL7Exception if the repetition requested is more than one 
210     *     greater than the number of existing repetitions.
211     */
212    public NTE getNTE(int rep) { 
213       NTE retVal = getTyped("NTE", rep, NTE.class);
214       return retVal;
215    }
216
217    /** 
218     * Returns the number of existing repetitions of NTE 
219     */ 
220    public int getNTEReps() {  
221        return getReps("NTE");
222    } 
223
224    /** 
225     * <p>
226     * Returns a non-modifiable List containing all current existing repetitions of NTE.
227     * <p>
228     * <p>
229     * Note that unlike {@link #getNTE()}, this method will not create any reps
230     * if none are already present, so an empty list may be returned.
231     * </p>
232     */ 
233    public List<NTE> getNTEAll() throws HL7Exception {
234        return getAllAsList("NTE", NTE.class);
235    } 
236
237    /**
238     * Inserts a specific repetition of NTE (Notes and Comments)
239     * @see AbstractGroup#insertRepetition(Structure, int) 
240     */
241    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
242       super.insertRepetition("NTE", structure, rep);
243    }
244
245
246    /**
247     * Inserts a specific repetition of NTE (Notes and Comments)
248     * @see AbstractGroup#insertRepetition(Structure, int) 
249     */
250    public NTE insertNTE(int rep) throws HL7Exception { 
251       return (NTE)super.insertRepetition("NTE", rep);
252    }
253
254
255    /**
256     * Removes a specific repetition of NTE (Notes and Comments)
257     * @see AbstractGroup#removeRepetition(String, int) 
258     */
259    public NTE removeNTE(int rep) throws HL7Exception { 
260       return (NTE)super.removeRepetition("NTE", rep);
261    }
262
263
264
265    /**
266     * Returns
267     * the first repetition of 
268     * RXR (Pharmacy/Treatment Route) - creates it if necessary
269     */
270    public RXR getRXR() { 
271       RXR retVal = getTyped("RXR", RXR.class);
272       return retVal;
273    }
274
275
276    /**
277     * Returns a specific repetition of
278     * RXR (Pharmacy/Treatment Route) - creates it if necessary
279     *
280     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
281     * @throws HL7Exception if the repetition requested is more than one 
282     *     greater than the number of existing repetitions.
283     */
284    public RXR getRXR(int rep) { 
285       RXR retVal = getTyped("RXR", rep, RXR.class);
286       return retVal;
287    }
288
289    /** 
290     * Returns the number of existing repetitions of RXR 
291     */ 
292    public int getRXRReps() {  
293        return getReps("RXR");
294    } 
295
296    /** 
297     * <p>
298     * Returns a non-modifiable List containing all current existing repetitions of RXR.
299     * <p>
300     * <p>
301     * Note that unlike {@link #getRXR()}, this method will not create any reps
302     * if none are already present, so an empty list may be returned.
303     * </p>
304     */ 
305    public List<RXR> getRXRAll() throws HL7Exception {
306        return getAllAsList("RXR", RXR.class);
307    } 
308
309    /**
310     * Inserts a specific repetition of RXR (Pharmacy/Treatment Route)
311     * @see AbstractGroup#insertRepetition(Structure, int) 
312     */
313    public void insertRXR(RXR structure, int rep) throws HL7Exception { 
314       super.insertRepetition("RXR", structure, rep);
315    }
316
317
318    /**
319     * Inserts a specific repetition of RXR (Pharmacy/Treatment Route)
320     * @see AbstractGroup#insertRepetition(Structure, int) 
321     */
322    public RXR insertRXR(int rep) throws HL7Exception { 
323       return (RXR)super.insertRepetition("RXR", rep);
324    }
325
326
327    /**
328     * Removes a specific repetition of RXR (Pharmacy/Treatment Route)
329     * @see AbstractGroup#removeRepetition(String, int) 
330     */
331    public RXR removeRXR(int rep) throws HL7Exception { 
332       return (RXR)super.removeRepetition("RXR", rep);
333    }
334
335
336
337    /**
338     * Returns
339     * the first repetition of 
340     * COMPONENT (a Group object) - creates it if necessary
341     */
342    public OMP_O09_COMPONENT getCOMPONENT() { 
343       OMP_O09_COMPONENT retVal = getTyped("COMPONENT", OMP_O09_COMPONENT.class);
344       return retVal;
345    }
346
347
348    /**
349     * Returns a specific repetition of
350     * COMPONENT (a Group object) - creates it if necessary
351     *
352     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
353     * @throws HL7Exception if the repetition requested is more than one 
354     *     greater than the number of existing repetitions.
355     */
356    public OMP_O09_COMPONENT getCOMPONENT(int rep) { 
357       OMP_O09_COMPONENT retVal = getTyped("COMPONENT", rep, OMP_O09_COMPONENT.class);
358       return retVal;
359    }
360
361    /** 
362     * Returns the number of existing repetitions of COMPONENT 
363     */ 
364    public int getCOMPONENTReps() {  
365        return getReps("COMPONENT");
366    } 
367
368    /** 
369     * <p>
370     * Returns a non-modifiable List containing all current existing repetitions of COMPONENT.
371     * <p>
372     * <p>
373     * Note that unlike {@link #getCOMPONENT()}, this method will not create any reps
374     * if none are already present, so an empty list may be returned.
375     * </p>
376     */ 
377    public List<OMP_O09_COMPONENT> getCOMPONENTAll() throws HL7Exception {
378        return getAllAsList("COMPONENT", OMP_O09_COMPONENT.class);
379    } 
380
381    /**
382     * Inserts a specific repetition of COMPONENT (a Group object)
383     * @see AbstractGroup#insertRepetition(Structure, int) 
384     */
385    public void insertCOMPONENT(OMP_O09_COMPONENT structure, int rep) throws HL7Exception { 
386       super.insertRepetition("COMPONENT", structure, rep);
387    }
388
389
390    /**
391     * Inserts a specific repetition of COMPONENT (a Group object)
392     * @see AbstractGroup#insertRepetition(Structure, int) 
393     */
394    public OMP_O09_COMPONENT insertCOMPONENT(int rep) throws HL7Exception { 
395       return (OMP_O09_COMPONENT)super.insertRepetition("COMPONENT", rep);
396    }
397
398
399    /**
400     * Removes a specific repetition of COMPONENT (a Group object)
401     * @see AbstractGroup#removeRepetition(String, int) 
402     */
403    public OMP_O09_COMPONENT removeCOMPONENT(int rep) throws HL7Exception { 
404       return (OMP_O09_COMPONENT)super.removeRepetition("COMPONENT", rep);
405    }
406
407
408
409    /**
410     * Returns
411     * the first repetition of 
412     * OBSERVATION (a Group object) - creates it if necessary
413     */
414    public OMP_O09_OBSERVATION getOBSERVATION() { 
415       OMP_O09_OBSERVATION retVal = getTyped("OBSERVATION", OMP_O09_OBSERVATION.class);
416       return retVal;
417    }
418
419
420    /**
421     * Returns a specific repetition of
422     * OBSERVATION (a Group object) - creates it if necessary
423     *
424     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
425     * @throws HL7Exception if the repetition requested is more than one 
426     *     greater than the number of existing repetitions.
427     */
428    public OMP_O09_OBSERVATION getOBSERVATION(int rep) { 
429       OMP_O09_OBSERVATION retVal = getTyped("OBSERVATION", rep, OMP_O09_OBSERVATION.class);
430       return retVal;
431    }
432
433    /** 
434     * Returns the number of existing repetitions of OBSERVATION 
435     */ 
436    public int getOBSERVATIONReps() {  
437        return getReps("OBSERVATION");
438    } 
439
440    /** 
441     * <p>
442     * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION.
443     * <p>
444     * <p>
445     * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps
446     * if none are already present, so an empty list may be returned.
447     * </p>
448     */ 
449    public List<OMP_O09_OBSERVATION> getOBSERVATIONAll() throws HL7Exception {
450        return getAllAsList("OBSERVATION", OMP_O09_OBSERVATION.class);
451    } 
452
453    /**
454     * Inserts a specific repetition of OBSERVATION (a Group object)
455     * @see AbstractGroup#insertRepetition(Structure, int) 
456     */
457    public void insertOBSERVATION(OMP_O09_OBSERVATION structure, int rep) throws HL7Exception { 
458       super.insertRepetition("OBSERVATION", structure, rep);
459    }
460
461
462    /**
463     * Inserts a specific repetition of OBSERVATION (a Group object)
464     * @see AbstractGroup#insertRepetition(Structure, int) 
465     */
466    public OMP_O09_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 
467       return (OMP_O09_OBSERVATION)super.insertRepetition("OBSERVATION", rep);
468    }
469
470
471    /**
472     * Removes a specific repetition of OBSERVATION (a Group object)
473     * @see AbstractGroup#removeRepetition(String, int) 
474     */
475    public OMP_O09_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 
476       return (OMP_O09_OBSERVATION)super.removeRepetition("OBSERVATION", rep);
477    }
478
479
480
481    /**
482     * Returns
483     * the first repetition of 
484     * FT1 (Financial Transaction) - creates it if necessary
485     */
486    public FT1 getFT1() { 
487       FT1 retVal = getTyped("FT1", FT1.class);
488       return retVal;
489    }
490
491
492    /**
493     * Returns a specific repetition of
494     * FT1 (Financial Transaction) - creates it if necessary
495     *
496     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
497     * @throws HL7Exception if the repetition requested is more than one 
498     *     greater than the number of existing repetitions.
499     */
500    public FT1 getFT1(int rep) { 
501       FT1 retVal = getTyped("FT1", rep, FT1.class);
502       return retVal;
503    }
504
505    /** 
506     * Returns the number of existing repetitions of FT1 
507     */ 
508    public int getFT1Reps() {  
509        return getReps("FT1");
510    } 
511
512    /** 
513     * <p>
514     * Returns a non-modifiable List containing all current existing repetitions of FT1.
515     * <p>
516     * <p>
517     * Note that unlike {@link #getFT1()}, this method will not create any reps
518     * if none are already present, so an empty list may be returned.
519     * </p>
520     */ 
521    public List<FT1> getFT1All() throws HL7Exception {
522        return getAllAsList("FT1", FT1.class);
523    } 
524
525    /**
526     * Inserts a specific repetition of FT1 (Financial Transaction)
527     * @see AbstractGroup#insertRepetition(Structure, int) 
528     */
529    public void insertFT1(FT1 structure, int rep) throws HL7Exception { 
530       super.insertRepetition("FT1", structure, rep);
531    }
532
533
534    /**
535     * Inserts a specific repetition of FT1 (Financial Transaction)
536     * @see AbstractGroup#insertRepetition(Structure, int) 
537     */
538    public FT1 insertFT1(int rep) throws HL7Exception { 
539       return (FT1)super.insertRepetition("FT1", rep);
540    }
541
542
543    /**
544     * Removes a specific repetition of FT1 (Financial Transaction)
545     * @see AbstractGroup#removeRepetition(String, int) 
546     */
547    public FT1 removeFT1(int rep) throws HL7Exception { 
548       return (FT1)super.removeRepetition("FT1", rep);
549    }
550
551
552
553    /**
554     * Returns
555     * BLG (Billing) - creates it if necessary
556     */
557    public BLG getBLG() { 
558       BLG retVal = getTyped("BLG", BLG.class);
559       return retVal;
560    }
561
562
563
564
565}
566