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.v24.group;
035
036import ca.uhn.hl7v2.model.v24.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_ORDER_DETAIL (a Group object) <b>optional  </b></li>
050                         * <li>3: RDS_O13_ENCODING (a Group object) <b>optional  </b></li>
051                         * <li>4: RXD (Pharmacy/Treatment Dispense) <b>  </b></li>
052                         * <li>5: RXR (Pharmacy/Treatment Route) <b> repeating </b></li>
053                         * <li>6: RXC (Pharmacy/Treatment Component Order) <b>optional repeating </b></li>
054                         * <li>7: RDS_O13_OBSERVATION (a Group object) <b>optional repeating </b></li>
055                         * <li>8: FT1 (Financial Transaction) <b>optional repeating </b></li>
056 * </ul>
057 */
058//@SuppressWarnings("unused")
059public class RDS_O13_ORDER extends AbstractGroup {
060
061    /** 
062     * Creates a new RDS_O13_ORDER group
063     */
064    public RDS_O13_ORDER(Group parent, ModelClassFactory factory) {
065       super(parent, factory);
066       init(factory);
067    }
068
069    private void init(ModelClassFactory factory) {
070       try {
071                                  this.add(ORC.class, true, false, false);
072                                  this.add(RDS_O13_ORDER_DETAIL.class, false, false, false);
073                                  this.add(RDS_O13_ENCODING.class, false, false, false);
074                                  this.add(RXD.class, true, false, false);
075                                  this.add(RXR.class, true, true, false);
076                                  this.add(RXC.class, false, true, false);
077                                  this.add(RDS_O13_OBSERVATION.class, false, true, false);
078                                  this.add(FT1.class, false, true, false);
079       } catch(HL7Exception e) {
080          log.error("Unexpected error creating RDS_O13_ORDER - this is probably a bug in the source code generator.", e);
081       }
082    }
083
084    /** 
085     * Returns "2.4"
086     */
087    public String getVersion() {
088       return "2.4";
089    }
090
091
092
093    /**
094     * Returns
095     * ORC (Common Order) - creates it if necessary
096     */
097    public ORC getORC() { 
098       ORC retVal = getTyped("ORC", ORC.class);
099       return retVal;
100    }
101
102
103
104
105    /**
106     * Returns
107     * ORDER_DETAIL (a Group object) - creates it if necessary
108     */
109    public RDS_O13_ORDER_DETAIL getORDER_DETAIL() { 
110       RDS_O13_ORDER_DETAIL retVal = getTyped("ORDER_DETAIL", RDS_O13_ORDER_DETAIL.class);
111       return retVal;
112    }
113
114
115
116
117    /**
118     * Returns
119     * ENCODING (a Group object) - creates it if necessary
120     */
121    public RDS_O13_ENCODING getENCODING() { 
122       RDS_O13_ENCODING retVal = getTyped("ENCODING", RDS_O13_ENCODING.class);
123       return retVal;
124    }
125
126
127
128
129    /**
130     * Returns
131     * RXD (Pharmacy/Treatment Dispense) - creates it if necessary
132     */
133    public RXD getRXD() { 
134       RXD retVal = getTyped("RXD", RXD.class);
135       return retVal;
136    }
137
138
139
140
141    /**
142     * Returns
143     * the first repetition of 
144     * RXR (Pharmacy/Treatment Route) - creates it if necessary
145     */
146    public RXR getRXR() { 
147       RXR retVal = getTyped("RXR", RXR.class);
148       return retVal;
149    }
150
151
152    /**
153     * Returns a specific repetition of
154     * RXR (Pharmacy/Treatment Route) - creates it if necessary
155     *
156     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
157     * @throws HL7Exception if the repetition requested is more than one 
158     *     greater than the number of existing repetitions.
159     */
160    public RXR getRXR(int rep) { 
161       RXR retVal = getTyped("RXR", rep, RXR.class);
162       return retVal;
163    }
164
165    /** 
166     * Returns the number of existing repetitions of RXR 
167     */ 
168    public int getRXRReps() {  
169        return getReps("RXR");
170    } 
171
172    /** 
173     * <p>
174     * Returns a non-modifiable List containing all current existing repetitions of RXR.
175     * <p>
176     * <p>
177     * Note that unlike {@link #getRXR()}, this method will not create any reps
178     * if none are already present, so an empty list may be returned.
179     * </p>
180     */ 
181    public java.util.List<RXR> getRXRAll() throws HL7Exception {
182        return getAllAsList("RXR", RXR.class);
183    } 
184
185    /**
186     * Inserts a specific repetition of RXR (Pharmacy/Treatment Route)
187     * @see AbstractGroup#insertRepetition(Structure, int) 
188     */
189    public void insertRXR(RXR structure, int rep) throws HL7Exception { 
190       super.insertRepetition("RXR", structure, rep);
191    }
192
193
194    /**
195     * Inserts a specific repetition of RXR (Pharmacy/Treatment Route)
196     * @see AbstractGroup#insertRepetition(Structure, int) 
197     */
198    public RXR insertRXR(int rep) throws HL7Exception { 
199       return (RXR)super.insertRepetition("RXR", rep);
200    }
201
202
203    /**
204     * Removes a specific repetition of RXR (Pharmacy/Treatment Route)
205     * @see AbstractGroup#removeRepetition(String, int) 
206     */
207    public RXR removeRXR(int rep) throws HL7Exception { 
208       return (RXR)super.removeRepetition("RXR", rep);
209    }
210
211
212
213    /**
214     * Returns
215     * the first repetition of 
216     * RXC (Pharmacy/Treatment Component Order) - creates it if necessary
217     */
218    public RXC getRXC() { 
219       RXC retVal = getTyped("RXC", RXC.class);
220       return retVal;
221    }
222
223
224    /**
225     * Returns a specific repetition of
226     * RXC (Pharmacy/Treatment Component Order) - creates it if necessary
227     *
228     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
229     * @throws HL7Exception if the repetition requested is more than one 
230     *     greater than the number of existing repetitions.
231     */
232    public RXC getRXC(int rep) { 
233       RXC retVal = getTyped("RXC", rep, RXC.class);
234       return retVal;
235    }
236
237    /** 
238     * Returns the number of existing repetitions of RXC 
239     */ 
240    public int getRXCReps() {  
241        return getReps("RXC");
242    } 
243
244    /** 
245     * <p>
246     * Returns a non-modifiable List containing all current existing repetitions of RXC.
247     * <p>
248     * <p>
249     * Note that unlike {@link #getRXC()}, this method will not create any reps
250     * if none are already present, so an empty list may be returned.
251     * </p>
252     */ 
253    public java.util.List<RXC> getRXCAll() throws HL7Exception {
254        return getAllAsList("RXC", RXC.class);
255    } 
256
257    /**
258     * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order)
259     * @see AbstractGroup#insertRepetition(Structure, int) 
260     */
261    public void insertRXC(RXC structure, int rep) throws HL7Exception { 
262       super.insertRepetition("RXC", structure, rep);
263    }
264
265
266    /**
267     * Inserts a specific repetition of RXC (Pharmacy/Treatment Component Order)
268     * @see AbstractGroup#insertRepetition(Structure, int) 
269     */
270    public RXC insertRXC(int rep) throws HL7Exception { 
271       return (RXC)super.insertRepetition("RXC", rep);
272    }
273
274
275    /**
276     * Removes a specific repetition of RXC (Pharmacy/Treatment Component Order)
277     * @see AbstractGroup#removeRepetition(String, int) 
278     */
279    public RXC removeRXC(int rep) throws HL7Exception { 
280       return (RXC)super.removeRepetition("RXC", rep);
281    }
282
283
284
285    /**
286     * Returns
287     * the first repetition of 
288     * OBSERVATION (a Group object) - creates it if necessary
289     */
290    public RDS_O13_OBSERVATION getOBSERVATION() { 
291       RDS_O13_OBSERVATION retVal = getTyped("OBSERVATION", RDS_O13_OBSERVATION.class);
292       return retVal;
293    }
294
295
296    /**
297     * Returns a specific repetition of
298     * OBSERVATION (a Group object) - creates it if necessary
299     *
300     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
301     * @throws HL7Exception if the repetition requested is more than one 
302     *     greater than the number of existing repetitions.
303     */
304    public RDS_O13_OBSERVATION getOBSERVATION(int rep) { 
305       RDS_O13_OBSERVATION retVal = getTyped("OBSERVATION", rep, RDS_O13_OBSERVATION.class);
306       return retVal;
307    }
308
309    /** 
310     * Returns the number of existing repetitions of OBSERVATION 
311     */ 
312    public int getOBSERVATIONReps() {  
313        return getReps("OBSERVATION");
314    } 
315
316    /** 
317     * <p>
318     * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION.
319     * <p>
320     * <p>
321     * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps
322     * if none are already present, so an empty list may be returned.
323     * </p>
324     */ 
325    public java.util.List<RDS_O13_OBSERVATION> getOBSERVATIONAll() throws HL7Exception {
326        return getAllAsList("OBSERVATION", RDS_O13_OBSERVATION.class);
327    } 
328
329    /**
330     * Inserts a specific repetition of OBSERVATION (a Group object)
331     * @see AbstractGroup#insertRepetition(Structure, int) 
332     */
333    public void insertOBSERVATION(RDS_O13_OBSERVATION structure, int rep) throws HL7Exception { 
334       super.insertRepetition("OBSERVATION", structure, rep);
335    }
336
337
338    /**
339     * Inserts a specific repetition of OBSERVATION (a Group object)
340     * @see AbstractGroup#insertRepetition(Structure, int) 
341     */
342    public RDS_O13_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 
343       return (RDS_O13_OBSERVATION)super.insertRepetition("OBSERVATION", rep);
344    }
345
346
347    /**
348     * Removes a specific repetition of OBSERVATION (a Group object)
349     * @see AbstractGroup#removeRepetition(String, int) 
350     */
351    public RDS_O13_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 
352       return (RDS_O13_OBSERVATION)super.removeRepetition("OBSERVATION", rep);
353    }
354
355
356
357    /**
358     * Returns
359     * the first repetition of 
360     * FT1 (Financial Transaction) - creates it if necessary
361     */
362    public FT1 getFT1() { 
363       FT1 retVal = getTyped("FT1", FT1.class);
364       return retVal;
365    }
366
367
368    /**
369     * Returns a specific repetition of
370     * FT1 (Financial Transaction) - creates it if necessary
371     *
372     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
373     * @throws HL7Exception if the repetition requested is more than one 
374     *     greater than the number of existing repetitions.
375     */
376    public FT1 getFT1(int rep) { 
377       FT1 retVal = getTyped("FT1", rep, FT1.class);
378       return retVal;
379    }
380
381    /** 
382     * Returns the number of existing repetitions of FT1 
383     */ 
384    public int getFT1Reps() {  
385        return getReps("FT1");
386    } 
387
388    /** 
389     * <p>
390     * Returns a non-modifiable List containing all current existing repetitions of FT1.
391     * <p>
392     * <p>
393     * Note that unlike {@link #getFT1()}, this method will not create any reps
394     * if none are already present, so an empty list may be returned.
395     * </p>
396     */ 
397    public java.util.List<FT1> getFT1All() throws HL7Exception {
398        return getAllAsList("FT1", FT1.class);
399    } 
400
401    /**
402     * Inserts a specific repetition of FT1 (Financial Transaction)
403     * @see AbstractGroup#insertRepetition(Structure, int) 
404     */
405    public void insertFT1(FT1 structure, int rep) throws HL7Exception { 
406       super.insertRepetition("FT1", structure, rep);
407    }
408
409
410    /**
411     * Inserts a specific repetition of FT1 (Financial Transaction)
412     * @see AbstractGroup#insertRepetition(Structure, int) 
413     */
414    public FT1 insertFT1(int rep) throws HL7Exception { 
415       return (FT1)super.insertRepetition("FT1", rep);
416    }
417
418
419    /**
420     * Removes a specific repetition of FT1 (Financial Transaction)
421     * @see AbstractGroup#removeRepetition(String, int) 
422     */
423    public FT1 removeFT1(int rep) throws HL7Exception { 
424       return (FT1)super.removeRepetition("FT1", rep);
425    }
426
427
428
429}
430