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.v23.group;
035
036import ca.uhn.hl7v2.model.v23.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 ORM_O01_ORDER_DETAIL 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: OBR (Observation request segment) <b> </b></li>
051                 * <li>2: RQD (Requisition detail) <b> </b></li>
052                 * <li>3: RQ1 (Requisition detail-1 segment) <b> </b></li>
053                 * <li>4: RXO (Pharmacy prescription order segment) <b> </b></li>
054                 * <li>5: ODS (Dietary orders, supplements, and preferences) <b> </b></li>
055                 * <li>6: ODT (Diet tray instructions segment) <b> </b></li>
056                 * <li>7: NTE (Notes and comments segment) <b>optional repeating</b></li>
057                 * <li>8: DG1 (Diagnosis) <b>optional repeating</b></li>
058                 * <li>9: ORM_O01_OBSERVATION (a Group object) <b>optional repeating</b></li>
059 * </ul>
060 */
061@SuppressWarnings("unused")
062public class ORM_O01_ORDER_DETAIL extends AbstractGroup {
063
064    /** 
065     * Creates a new ORM_O01_ORDER_DETAIL group
066     */
067    public ORM_O01_ORDER_DETAIL(Group parent, ModelClassFactory factory) {
068       super(parent, factory);
069       init(factory);
070    }
071
072    private void init(ModelClassFactory factory) {
073       try {
074                          this.add(OBR.class, true, false);
075                          this.add(RQD.class, true, false);
076                          this.add(RQ1.class, true, false);
077                          this.add(RXO.class, true, false);
078                          this.add(ODS.class, true, false);
079                          this.add(ODT.class, true, false);
080                          this.add(NTE.class, false, true);
081                          this.add(DG1.class, false, true);
082                          this.add(ORM_O01_OBSERVATION.class, false, true);
083       } catch(HL7Exception e) {
084          log.error("Unexpected error creating ORM_O01_ORDER_DETAIL - this is probably a bug in the source code generator.", e);
085       }
086    }
087
088    /** 
089     * Returns "2.3"
090     */
091    public String getVersion() {
092       return "2.3";
093    }
094
095
096
097    /**
098     * Returns
099     * OBR (Observation request segment) - creates it if necessary
100     */
101    public OBR getOBR() { 
102       OBR retVal = getTyped("OBR", OBR.class);
103       return retVal;
104    }
105
106
107
108
109    /**
110     * Returns
111     * RQD (Requisition detail) - creates it if necessary
112     */
113    public RQD getRQD() { 
114       RQD retVal = getTyped("RQD", RQD.class);
115       return retVal;
116    }
117
118
119
120
121    /**
122     * Returns
123     * RQ1 (Requisition detail-1 segment) - creates it if necessary
124     */
125    public RQ1 getRQ1() { 
126       RQ1 retVal = getTyped("RQ1", RQ1.class);
127       return retVal;
128    }
129
130
131
132
133    /**
134     * Returns
135     * RXO (Pharmacy prescription order segment) - creates it if necessary
136     */
137    public RXO getRXO() { 
138       RXO retVal = getTyped("RXO", RXO.class);
139       return retVal;
140    }
141
142
143
144
145    /**
146     * Returns
147     * ODS (Dietary orders, supplements, and preferences) - creates it if necessary
148     */
149    public ODS getODS() { 
150       ODS retVal = getTyped("ODS", ODS.class);
151       return retVal;
152    }
153
154
155
156
157    /**
158     * Returns
159     * ODT (Diet tray instructions segment) - creates it if necessary
160     */
161    public ODT getODT() { 
162       ODT retVal = getTyped("ODT", ODT.class);
163       return retVal;
164    }
165
166
167
168
169    /**
170     * Returns
171     * the first repetition of 
172     * NTE (Notes and comments segment) - creates it if necessary
173     */
174    public NTE getNTE() { 
175       NTE retVal = getTyped("NTE", NTE.class);
176       return retVal;
177    }
178
179
180    /**
181     * Returns a specific repetition of
182     * NTE (Notes and comments segment) - creates it if necessary
183     *
184     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
185     * @throws HL7Exception if the repetition requested is more than one 
186     *     greater than the number of existing repetitions.
187     */
188    public NTE getNTE(int rep) { 
189       NTE retVal = getTyped("NTE", rep, NTE.class);
190       return retVal;
191    }
192
193    /** 
194     * Returns the number of existing repetitions of NTE 
195     */ 
196    public int getNTEReps() {  
197        return getReps("NTE");
198    } 
199
200    /** 
201     * <p>
202     * Returns a non-modifiable List containing all current existing repetitions of NTE.
203     * <p>
204     * <p>
205     * Note that unlike {@link #getNTE()}, this method will not create any reps
206     * if none are already present, so an empty list may be returned.
207     * </p>
208     */ 
209    public List<NTE> getNTEAll() throws HL7Exception {
210        return getAllAsList("NTE", NTE.class);
211    } 
212
213    /**
214     * Inserts a specific repetition of NTE (Notes and comments segment)
215     * @see AbstractGroup#insertRepetition(Structure, int) 
216     */
217    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
218       super.insertRepetition("NTE", structure, rep);
219    }
220
221
222    /**
223     * Inserts a specific repetition of NTE (Notes and comments segment)
224     * @see AbstractGroup#insertRepetition(Structure, int) 
225     */
226    public NTE insertNTE(int rep) throws HL7Exception { 
227       return (NTE)super.insertRepetition("NTE", rep);
228    }
229
230
231    /**
232     * Removes a specific repetition of NTE (Notes and comments segment)
233     * @see AbstractGroup#removeRepetition(String, int) 
234     */
235    public NTE removeNTE(int rep) throws HL7Exception { 
236       return (NTE)super.removeRepetition("NTE", rep);
237    }
238
239
240
241    /**
242     * Returns
243     * the first repetition of 
244     * DG1 (Diagnosis) - creates it if necessary
245     */
246    public DG1 getDG1() { 
247       DG1 retVal = getTyped("DG1", DG1.class);
248       return retVal;
249    }
250
251
252    /**
253     * Returns a specific repetition of
254     * DG1 (Diagnosis) - creates it if necessary
255     *
256     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
257     * @throws HL7Exception if the repetition requested is more than one 
258     *     greater than the number of existing repetitions.
259     */
260    public DG1 getDG1(int rep) { 
261       DG1 retVal = getTyped("DG1", rep, DG1.class);
262       return retVal;
263    }
264
265    /** 
266     * Returns the number of existing repetitions of DG1 
267     */ 
268    public int getDG1Reps() {  
269        return getReps("DG1");
270    } 
271
272    /** 
273     * <p>
274     * Returns a non-modifiable List containing all current existing repetitions of DG1.
275     * <p>
276     * <p>
277     * Note that unlike {@link #getDG1()}, this method will not create any reps
278     * if none are already present, so an empty list may be returned.
279     * </p>
280     */ 
281    public List<DG1> getDG1All() throws HL7Exception {
282        return getAllAsList("DG1", DG1.class);
283    } 
284
285    /**
286     * Inserts a specific repetition of DG1 (Diagnosis)
287     * @see AbstractGroup#insertRepetition(Structure, int) 
288     */
289    public void insertDG1(DG1 structure, int rep) throws HL7Exception { 
290       super.insertRepetition("DG1", structure, rep);
291    }
292
293
294    /**
295     * Inserts a specific repetition of DG1 (Diagnosis)
296     * @see AbstractGroup#insertRepetition(Structure, int) 
297     */
298    public DG1 insertDG1(int rep) throws HL7Exception { 
299       return (DG1)super.insertRepetition("DG1", rep);
300    }
301
302
303    /**
304     * Removes a specific repetition of DG1 (Diagnosis)
305     * @see AbstractGroup#removeRepetition(String, int) 
306     */
307    public DG1 removeDG1(int rep) throws HL7Exception { 
308       return (DG1)super.removeRepetition("DG1", rep);
309    }
310
311
312
313    /**
314     * Returns
315     * the first repetition of 
316     * OBSERVATION (a Group object) - creates it if necessary
317     */
318    public ORM_O01_OBSERVATION getOBSERVATION() { 
319       ORM_O01_OBSERVATION retVal = getTyped("OBSERVATION", ORM_O01_OBSERVATION.class);
320       return retVal;
321    }
322
323
324    /**
325     * Returns a specific repetition of
326     * OBSERVATION (a Group object) - creates it if necessary
327     *
328     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
329     * @throws HL7Exception if the repetition requested is more than one 
330     *     greater than the number of existing repetitions.
331     */
332    public ORM_O01_OBSERVATION getOBSERVATION(int rep) { 
333       ORM_O01_OBSERVATION retVal = getTyped("OBSERVATION", rep, ORM_O01_OBSERVATION.class);
334       return retVal;
335    }
336
337    /** 
338     * Returns the number of existing repetitions of OBSERVATION 
339     */ 
340    public int getOBSERVATIONReps() {  
341        return getReps("OBSERVATION");
342    } 
343
344    /** 
345     * <p>
346     * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION.
347     * <p>
348     * <p>
349     * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps
350     * if none are already present, so an empty list may be returned.
351     * </p>
352     */ 
353    public List<ORM_O01_OBSERVATION> getOBSERVATIONAll() throws HL7Exception {
354        return getAllAsList("OBSERVATION", ORM_O01_OBSERVATION.class);
355    } 
356
357    /**
358     * Inserts a specific repetition of OBSERVATION (a Group object)
359     * @see AbstractGroup#insertRepetition(Structure, int) 
360     */
361    public void insertOBSERVATION(ORM_O01_OBSERVATION structure, int rep) throws HL7Exception { 
362       super.insertRepetition("OBSERVATION", structure, rep);
363    }
364
365
366    /**
367     * Inserts a specific repetition of OBSERVATION (a Group object)
368     * @see AbstractGroup#insertRepetition(Structure, int) 
369     */
370    public ORM_O01_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 
371       return (ORM_O01_OBSERVATION)super.insertRepetition("OBSERVATION", rep);
372    }
373
374
375    /**
376     * Removes a specific repetition of OBSERVATION (a Group object)
377     * @see AbstractGroup#removeRepetition(String, int) 
378     */
379    public ORM_O01_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 
380       return (ORM_O01_OBSERVATION)super.removeRepetition("OBSERVATION", rep);
381    }
382
383
384
385}
386