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 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 ORR_O02_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: OBR (Observation Request) <b> </b></li>
052                 * <li>3: RQD (Requisition Detail) <b> </b></li>
053                 * <li>4: RQ1 (Requisition Detail-1) <b> </b></li>
054                 * <li>5: RXO (Pharmacy/Treatment Order) <b> </b></li>
055                 * <li>6: ODS (Dietary Orders, Supplements, and Preferences) <b> </b></li>
056                 * <li>7: ODT (Diet Tray Instructions) <b> </b></li>
057                 * <li>8: NTE (Notes and Comments) <b>optional repeating</b></li>
058                 * <li>9: CTI (Clinical Trial Identification) <b>optional repeating</b></li>
059 * </ul>
060 */
061@SuppressWarnings("unused")
062public class ORR_O02_ORDER extends AbstractGroup {
063
064    /** 
065     * Creates a new ORR_O02_ORDER group
066     */
067    public ORR_O02_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(OBR.class, true, false);
076                          this.add(RQD.class, true, false);
077                          this.add(RQ1.class, true, false);
078                          this.add(RXO.class, true, false);
079                          this.add(ODS.class, true, false);
080                          this.add(ODT.class, true, false);
081                          this.add(NTE.class, false, true);
082                          this.add(CTI.class, false, true);
083       } catch(HL7Exception e) {
084          log.error("Unexpected error creating ORR_O02_ORDER - this is probably a bug in the source code generator.", e);
085       }
086    }
087
088    /** 
089     * Returns "2.4"
090     */
091    public String getVersion() {
092       return "2.4";
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     * OBR (Observation Request) - creates it if necessary
112     */
113    public OBR getOBR() { 
114       OBR retVal = getTyped("OBR", OBR.class);
115       return retVal;
116    }
117
118
119
120
121    /**
122     * Returns
123     * RQD (Requisition Detail) - creates it if necessary
124     */
125    public RQD getRQD() { 
126       RQD retVal = getTyped("RQD", RQD.class);
127       return retVal;
128    }
129
130
131
132
133    /**
134     * Returns
135     * RQ1 (Requisition Detail-1) - creates it if necessary
136     */
137    public RQ1 getRQ1() { 
138       RQ1 retVal = getTyped("RQ1", RQ1.class);
139       return retVal;
140    }
141
142
143
144
145    /**
146     * Returns
147     * RXO (Pharmacy/Treatment Order) - creates it if necessary
148     */
149    public RXO getRXO() { 
150       RXO retVal = getTyped("RXO", RXO.class);
151       return retVal;
152    }
153
154
155
156
157    /**
158     * Returns
159     * ODS (Dietary Orders, Supplements, and Preferences) - creates it if necessary
160     */
161    public ODS getODS() { 
162       ODS retVal = getTyped("ODS", ODS.class);
163       return retVal;
164    }
165
166
167
168
169    /**
170     * Returns
171     * ODT (Diet Tray Instructions) - creates it if necessary
172     */
173    public ODT getODT() { 
174       ODT retVal = getTyped("ODT", ODT.class);
175       return retVal;
176    }
177
178
179
180
181    /**
182     * Returns
183     * the first repetition of 
184     * NTE (Notes and Comments) - creates it if necessary
185     */
186    public NTE getNTE() { 
187       NTE retVal = getTyped("NTE", NTE.class);
188       return retVal;
189    }
190
191
192    /**
193     * Returns a specific repetition of
194     * NTE (Notes and Comments) - creates it if necessary
195     *
196     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
197     * @throws HL7Exception if the repetition requested is more than one 
198     *     greater than the number of existing repetitions.
199     */
200    public NTE getNTE(int rep) { 
201       NTE retVal = getTyped("NTE", rep, NTE.class);
202       return retVal;
203    }
204
205    /** 
206     * Returns the number of existing repetitions of NTE 
207     */ 
208    public int getNTEReps() {  
209        return getReps("NTE");
210    } 
211
212    /** 
213     * <p>
214     * Returns a non-modifiable List containing all current existing repetitions of NTE.
215     * <p>
216     * <p>
217     * Note that unlike {@link #getNTE()}, this method will not create any reps
218     * if none are already present, so an empty list may be returned.
219     * </p>
220     */ 
221    public List<NTE> getNTEAll() throws HL7Exception {
222        return getAllAsList("NTE", NTE.class);
223    } 
224
225    /**
226     * Inserts a specific repetition of NTE (Notes and Comments)
227     * @see AbstractGroup#insertRepetition(Structure, int) 
228     */
229    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
230       super.insertRepetition("NTE", structure, rep);
231    }
232
233
234    /**
235     * Inserts a specific repetition of NTE (Notes and Comments)
236     * @see AbstractGroup#insertRepetition(Structure, int) 
237     */
238    public NTE insertNTE(int rep) throws HL7Exception { 
239       return (NTE)super.insertRepetition("NTE", rep);
240    }
241
242
243    /**
244     * Removes a specific repetition of NTE (Notes and Comments)
245     * @see AbstractGroup#removeRepetition(String, int) 
246     */
247    public NTE removeNTE(int rep) throws HL7Exception { 
248       return (NTE)super.removeRepetition("NTE", rep);
249    }
250
251
252
253    /**
254     * Returns
255     * the first repetition of 
256     * CTI (Clinical Trial Identification) - creates it if necessary
257     */
258    public CTI getCTI() { 
259       CTI retVal = getTyped("CTI", CTI.class);
260       return retVal;
261    }
262
263
264    /**
265     * Returns a specific repetition of
266     * CTI (Clinical Trial Identification) - creates it if necessary
267     *
268     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
269     * @throws HL7Exception if the repetition requested is more than one 
270     *     greater than the number of existing repetitions.
271     */
272    public CTI getCTI(int rep) { 
273       CTI retVal = getTyped("CTI", rep, CTI.class);
274       return retVal;
275    }
276
277    /** 
278     * Returns the number of existing repetitions of CTI 
279     */ 
280    public int getCTIReps() {  
281        return getReps("CTI");
282    } 
283
284    /** 
285     * <p>
286     * Returns a non-modifiable List containing all current existing repetitions of CTI.
287     * <p>
288     * <p>
289     * Note that unlike {@link #getCTI()}, this method will not create any reps
290     * if none are already present, so an empty list may be returned.
291     * </p>
292     */ 
293    public List<CTI> getCTIAll() throws HL7Exception {
294        return getAllAsList("CTI", CTI.class);
295    } 
296
297    /**
298     * Inserts a specific repetition of CTI (Clinical Trial Identification)
299     * @see AbstractGroup#insertRepetition(Structure, int) 
300     */
301    public void insertCTI(CTI structure, int rep) throws HL7Exception { 
302       super.insertRepetition("CTI", structure, rep);
303    }
304
305
306    /**
307     * Inserts a specific repetition of CTI (Clinical Trial Identification)
308     * @see AbstractGroup#insertRepetition(Structure, int) 
309     */
310    public CTI insertCTI(int rep) throws HL7Exception { 
311       return (CTI)super.insertRepetition("CTI", rep);
312    }
313
314
315    /**
316     * Removes a specific repetition of CTI (Clinical Trial Identification)
317     * @see AbstractGroup#removeRepetition(String, int) 
318     */
319    public CTI removeCTI(int rep) throws HL7Exception { 
320       return (CTI)super.removeRepetition("CTI", rep);
321    }
322
323
324
325}
326