1 /*
2 * This class is an auto-generated source file for a HAPI
3 * HL7 v2.x standard structure class.
4 *
5 * For more information, visit: http://hl7api.sourceforge.net/
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * (the "License"); you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
12 * specific language governing rights and limitations under the License.
13 *
14 * The Original Code is "[file_name]". Description:
15 * "[one_line_description]"
16 *
17 * The Initial Developer of the Original Code is University Health Network. Copyright (C)
18 * 2012. All Rights Reserved.
19 *
20 * Contributor(s): ______________________________________.
21 *
22 * Alternatively, the contents of this file may be used under the terms of the
23 * GNU General Public License (the "GPL"), in which case the provisions of the GPL are
24 * applicable instead of those above. If you wish to allow use of your version of this
25 * file only under the terms of the GPL and not to allow others to use your version
26 * of this file under the MPL, indicate your decision by deleting the provisions above
27 * and replace them with the notice and other provisions required by the GPL License.
28 * If you do not delete the provisions above, a recipient may use your version of
29 * this file under either the MPL or the GPL.
30 *
31 */
32
33
34 package ca.uhn.hl7v2.model.v231.group;
35
36 import ca.uhn.hl7v2.model.v231.segment.*;
37
38 import ca.uhn.hl7v2.HL7Exception;
39 import ca.uhn.hl7v2.parser.ModelClassFactory;
40 import ca.uhn.hl7v2.model.*;
41
42 /**
43 * <p>Represents a ORM_O01_OBRRQDRQ1ODSODTRXONTEDG1RXRRXCNTEOBXNTE group structure (a Group object).
44 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
45 * This Group contains the following elements:
46 * </p>
47 * <ul>
48 * <li>1: OBR (OBR - observation request segment) <b> choice</b></li>
49 * <li>2: RQD (RQD - requisition detail segment) <b> choice</b></li>
50 * <li>3: RQ1 (RQ1 - requisition detail-1 segment) <b> choice</b></li>
51 * <li>4: ODS (ODS - dietary orders, supplements, and preferences segment) <b> choice</b></li>
52 * <li>5: ODT (ODT - diet tray instructions segment) <b> choice</b></li>
53 * <li>6: RXO (RXO - pharmacy/treatment order segment) <b> choice</b></li>
54 * <li>7: NTE (NTE - notes and comments segment) <b>optional repeating </b></li>
55 * <li>8: DG1 (DG1 - diagnosis segment) <b>optional repeating </b></li>
56 * <li>9: RXR (RXR - pharmacy/treatment route segment) <b> repeating </b></li>
57 * <li>10: ORM_O01_RXCNTE (a Group object) <b>optional </b></li>
58 * <li>11: ORM_O01_OBXNTE (a Group object) <b>optional repeating </b></li>
59 * </ul>
60 * <p>
61 * Note that this structure has "choice" elements. This means that one of the
62 * structures above marked as "choice" must be present, but no more than one.
63 * </p>
64 */
65 //@SuppressWarnings("unused")
66 public class ORM_O01_OBRRQDRQ1ODSODTRXONTEDG1RXRRXCNTEOBXNTE extends AbstractGroup {
67
68 /**
69 * Creates a new ORM_O01_OBRRQDRQ1ODSODTRXONTEDG1RXRRXCNTEOBXNTE group
70 */
71 public ORM_O01_OBRRQDRQ1ODSODTRXONTEDG1RXRRXCNTEOBXNTE(Group parent, ModelClassFactory factory) {
72 super(parent, factory);
73 init(factory);
74 }
75
76 private void init(ModelClassFactory factory) {
77 try {
78 this.add(OBR.class, true, false, true);
79 this.add(RQD.class, true, false, true);
80 this.add(RQ1.class, true, false, true);
81 this.add(ODS.class, true, false, true);
82 this.add(ODT.class, true, false, true);
83 this.add(RXO.class, true, false, true);
84 this.add(NTE.class, false, true, false);
85 this.add(DG1.class, false, true, false);
86 this.add(RXR.class, true, true, false);
87 this.add(ORM_O01_RXCNTE.class, false, false, false);
88 this.add(ORM_O01_OBXNTE.class, false, true, false);
89 } catch(HL7Exception e) {
90 log.error("Unexpected error creating ORM_O01_OBRRQDRQ1ODSODTRXONTEDG1RXRRXCNTEOBXNTE - this is probably a bug in the source code generator.", e);
91 }
92 }
93
94 /**
95 * Returns "2.3.1"
96 */
97 public String getVersion() {
98 return "2.3.1";
99 }
100
101
102
103 /**
104 * Returns
105 * OBR (OBR - observation request segment) - creates it if necessary
106 */
107 public OBR getOBR() {
108 OBR retVal = getTyped("OBR", OBR.class);
109 return retVal;
110 }
111
112
113
114
115 /**
116 * Returns
117 * RQD (RQD - requisition detail segment) - creates it if necessary
118 */
119 public RQD getRQD() {
120 RQD retVal = getTyped("RQD", RQD.class);
121 return retVal;
122 }
123
124
125
126
127 /**
128 * Returns
129 * RQ1 (RQ1 - requisition detail-1 segment) - creates it if necessary
130 */
131 public RQ1 getRQ1() {
132 RQ1 retVal = getTyped("RQ1", RQ1.class);
133 return retVal;
134 }
135
136
137
138
139 /**
140 * Returns
141 * ODS (ODS - dietary orders, supplements, and preferences segment) - creates it if necessary
142 */
143 public ODS getODS() {
144 ODS retVal = getTyped("ODS", ODS.class);
145 return retVal;
146 }
147
148
149
150
151 /**
152 * Returns
153 * ODT (ODT - diet tray instructions segment) - creates it if necessary
154 */
155 public ODT getODT() {
156 ODT retVal = getTyped("ODT", ODT.class);
157 return retVal;
158 }
159
160
161
162
163 /**
164 * Returns
165 * RXO (RXO - pharmacy/treatment order segment) - creates it if necessary
166 */
167 public RXO getRXO() {
168 RXO retVal = getTyped("RXO", RXO.class);
169 return retVal;
170 }
171
172
173
174
175 /**
176 * Returns
177 * the first repetition of
178 * NTE (NTE - notes and comments segment) - creates it if necessary
179 */
180 public NTE getNTE() {
181 NTE retVal = getTyped("NTE", NTE.class);
182 return retVal;
183 }
184
185
186 /**
187 * Returns a specific repetition of
188 * NTE (NTE - notes and comments segment) - creates it if necessary
189 *
190 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
191 * @throws HL7Exception if the repetition requested is more than one
192 * greater than the number of existing repetitions.
193 */
194 public NTE getNTE(int rep) {
195 NTE retVal = getTyped("NTE", rep, NTE.class);
196 return retVal;
197 }
198
199 /**
200 * Returns the number of existing repetitions of NTE
201 */
202 public int getNTEReps() {
203 return getReps("NTE");
204 }
205
206 /**
207 * <p>
208 * Returns a non-modifiable List containing all current existing repetitions of NTE.
209 * <p>
210 * <p>
211 * Note that unlike {@link #getNTE()}, this method will not create any reps
212 * if none are already present, so an empty list may be returned.
213 * </p>
214 */
215 public java.util.List<NTE> getNTEAll() throws HL7Exception {
216 return getAllAsList("NTE", NTE.class);
217 }
218
219 /**
220 * Inserts a specific repetition of NTE (NTE - notes and comments segment)
221 * @see AbstractGroup#insertRepetition(Structure, int)
222 */
223 public void insertNTE(NTE structure, int rep) throws HL7Exception {
224 super.insertRepetition("NTE", structure, rep);
225 }
226
227
228 /**
229 * Inserts a specific repetition of NTE (NTE - notes and comments segment)
230 * @see AbstractGroup#insertRepetition(Structure, int)
231 */
232 public NTE insertNTE(int rep) throws HL7Exception {
233 return (NTE)super.insertRepetition("NTE", rep);
234 }
235
236
237 /**
238 * Removes a specific repetition of NTE (NTE - notes and comments segment)
239 * @see AbstractGroup#removeRepetition(String, int)
240 */
241 public NTE removeNTE(int rep) throws HL7Exception {
242 return (NTE)super.removeRepetition("NTE", rep);
243 }
244
245
246
247 /**
248 * Returns
249 * the first repetition of
250 * DG1 (DG1 - diagnosis segment) - creates it if necessary
251 */
252 public DG1 getDG1() {
253 DG1 retVal = getTyped("DG1", DG1.class);
254 return retVal;
255 }
256
257
258 /**
259 * Returns a specific repetition of
260 * DG1 (DG1 - diagnosis segment) - creates it if necessary
261 *
262 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
263 * @throws HL7Exception if the repetition requested is more than one
264 * greater than the number of existing repetitions.
265 */
266 public DG1 getDG1(int rep) {
267 DG1 retVal = getTyped("DG1", rep, DG1.class);
268 return retVal;
269 }
270
271 /**
272 * Returns the number of existing repetitions of DG1
273 */
274 public int getDG1Reps() {
275 return getReps("DG1");
276 }
277
278 /**
279 * <p>
280 * Returns a non-modifiable List containing all current existing repetitions of DG1.
281 * <p>
282 * <p>
283 * Note that unlike {@link #getDG1()}, this method will not create any reps
284 * if none are already present, so an empty list may be returned.
285 * </p>
286 */
287 public java.util.List<DG1> getDG1All() throws HL7Exception {
288 return getAllAsList("DG1", DG1.class);
289 }
290
291 /**
292 * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
293 * @see AbstractGroup#insertRepetition(Structure, int)
294 */
295 public void insertDG1(DG1 structure, int rep) throws HL7Exception {
296 super.insertRepetition("DG1", structure, rep);
297 }
298
299
300 /**
301 * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
302 * @see AbstractGroup#insertRepetition(Structure, int)
303 */
304 public DG1 insertDG1(int rep) throws HL7Exception {
305 return (DG1)super.insertRepetition("DG1", rep);
306 }
307
308
309 /**
310 * Removes a specific repetition of DG1 (DG1 - diagnosis segment)
311 * @see AbstractGroup#removeRepetition(String, int)
312 */
313 public DG1 removeDG1(int rep) throws HL7Exception {
314 return (DG1)super.removeRepetition("DG1", rep);
315 }
316
317
318
319 /**
320 * Returns
321 * the first repetition of
322 * RXR (RXR - pharmacy/treatment route segment) - creates it if necessary
323 */
324 public RXR getRXR() {
325 RXR retVal = getTyped("RXR", RXR.class);
326 return retVal;
327 }
328
329
330 /**
331 * Returns a specific repetition of
332 * RXR (RXR - pharmacy/treatment route segment) - creates it if necessary
333 *
334 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
335 * @throws HL7Exception if the repetition requested is more than one
336 * greater than the number of existing repetitions.
337 */
338 public RXR getRXR(int rep) {
339 RXR retVal = getTyped("RXR", rep, RXR.class);
340 return retVal;
341 }
342
343 /**
344 * Returns the number of existing repetitions of RXR
345 */
346 public int getRXRReps() {
347 return getReps("RXR");
348 }
349
350 /**
351 * <p>
352 * Returns a non-modifiable List containing all current existing repetitions of RXR.
353 * <p>
354 * <p>
355 * Note that unlike {@link #getRXR()}, this method will not create any reps
356 * if none are already present, so an empty list may be returned.
357 * </p>
358 */
359 public java.util.List<RXR> getRXRAll() throws HL7Exception {
360 return getAllAsList("RXR", RXR.class);
361 }
362
363 /**
364 * Inserts a specific repetition of RXR (RXR - pharmacy/treatment route segment)
365 * @see AbstractGroup#insertRepetition(Structure, int)
366 */
367 public void insertRXR(RXR structure, int rep) throws HL7Exception {
368 super.insertRepetition("RXR", structure, rep);
369 }
370
371
372 /**
373 * Inserts a specific repetition of RXR (RXR - pharmacy/treatment route segment)
374 * @see AbstractGroup#insertRepetition(Structure, int)
375 */
376 public RXR insertRXR(int rep) throws HL7Exception {
377 return (RXR)super.insertRepetition("RXR", rep);
378 }
379
380
381 /**
382 * Removes a specific repetition of RXR (RXR - pharmacy/treatment route segment)
383 * @see AbstractGroup#removeRepetition(String, int)
384 */
385 public RXR removeRXR(int rep) throws HL7Exception {
386 return (RXR)super.removeRepetition("RXR", rep);
387 }
388
389
390
391 /**
392 * Returns
393 * RXCNTE (a Group object) - creates it if necessary
394 */
395 public ORM_O01_RXCNTE getRXCNTE() {
396 ORM_O01_RXCNTE retVal = getTyped("RXCNTE", ORM_O01_RXCNTE.class);
397 return retVal;
398 }
399
400
401
402
403 /**
404 * Returns
405 * the first repetition of
406 * OBXNTE (a Group object) - creates it if necessary
407 */
408 public ORM_O01_OBXNTE getOBXNTE() {
409 ORM_O01_OBXNTE retVal = getTyped("OBXNTE", ORM_O01_OBXNTE.class);
410 return retVal;
411 }
412
413
414 /**
415 * Returns a specific repetition of
416 * OBXNTE (a Group object) - creates it if necessary
417 *
418 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
419 * @throws HL7Exception if the repetition requested is more than one
420 * greater than the number of existing repetitions.
421 */
422 public ORM_O01_OBXNTE getOBXNTE(int rep) {
423 ORM_O01_OBXNTE retVal = getTyped("OBXNTE", rep, ORM_O01_OBXNTE.class);
424 return retVal;
425 }
426
427 /**
428 * Returns the number of existing repetitions of OBXNTE
429 */
430 public int getOBXNTEReps() {
431 return getReps("OBXNTE");
432 }
433
434 /**
435 * <p>
436 * Returns a non-modifiable List containing all current existing repetitions of OBXNTE.
437 * <p>
438 * <p>
439 * Note that unlike {@link #getOBXNTE()}, this method will not create any reps
440 * if none are already present, so an empty list may be returned.
441 * </p>
442 */
443 public java.util.List<ORM_O01_OBXNTE> getOBXNTEAll() throws HL7Exception {
444 return getAllAsList("OBXNTE", ORM_O01_OBXNTE.class);
445 }
446
447 /**
448 * Inserts a specific repetition of OBXNTE (a Group object)
449 * @see AbstractGroup#insertRepetition(Structure, int)
450 */
451 public void insertOBXNTE(ORM_O01_OBXNTE structure, int rep) throws HL7Exception {
452 super.insertRepetition("OBXNTE", structure, rep);
453 }
454
455
456 /**
457 * Inserts a specific repetition of OBXNTE (a Group object)
458 * @see AbstractGroup#insertRepetition(Structure, int)
459 */
460 public ORM_O01_OBXNTE insertOBXNTE(int rep) throws HL7Exception {
461 return (ORM_O01_OBXNTE)super.insertRepetition("OBXNTE", rep);
462 }
463
464
465 /**
466 * Removes a specific repetition of OBXNTE (a Group object)
467 * @see AbstractGroup#removeRepetition(String, int)
468 */
469 public ORM_O01_OBXNTE removeOBXNTE(int rep) throws HL7Exception {
470 return (ORM_O01_OBXNTE)super.removeRepetition("OBXNTE", rep);
471 }
472
473
474
475 }
476