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.v26.group;
035
036import ca.uhn.hl7v2.model.v26.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 ORU_R01_ORDER_OBSERVATION 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>optional </b></li>
051                 * <li>2: OBR (Observation Request) <b> </b></li>
052                 * <li>3: NTE (Notes and Comments) <b>optional repeating</b></li>
053                 * <li>4: ROL (Role) <b>optional repeating</b></li>
054                 * <li>5: ORU_R01_TIMING_QTY (a Group object) <b>optional repeating</b></li>
055                 * <li>6: CTD (Contact Data) <b>optional </b></li>
056                 * <li>7: ORU_R01_OBSERVATION (a Group object) <b>optional repeating</b></li>
057                 * <li>8: FT1 (Financial Transaction) <b>optional repeating</b></li>
058                 * <li>9: CTI (Clinical Trial Identification) <b>optional repeating</b></li>
059                 * <li>10: ORU_R01_SPECIMEN (a Group object) <b>optional repeating</b></li>
060 * </ul>
061 */
062@SuppressWarnings("unused")
063public class ORU_R01_ORDER_OBSERVATION extends AbstractGroup {
064
065    /** 
066     * Creates a new ORU_R01_ORDER_OBSERVATION group
067     */
068    public ORU_R01_ORDER_OBSERVATION(Group parent, ModelClassFactory factory) {
069       super(parent, factory);
070       init(factory);
071    }
072
073    private void init(ModelClassFactory factory) {
074       try {
075                          this.add(ORC.class, false, false);
076                          this.add(OBR.class, true, false);
077                          this.add(NTE.class, false, true);
078                          this.add(ROL.class, false, true);
079                          this.add(ORU_R01_TIMING_QTY.class, false, true);
080                          this.add(CTD.class, false, false);
081                          this.add(ORU_R01_OBSERVATION.class, false, true);
082                          this.add(FT1.class, false, true);
083                          this.add(CTI.class, false, true);
084                          this.add(ORU_R01_SPECIMEN.class, false, true);
085       } catch(HL7Exception e) {
086          log.error("Unexpected error creating ORU_R01_ORDER_OBSERVATION - this is probably a bug in the source code generator.", e);
087       }
088    }
089
090    /** 
091     * Returns "2.6"
092     */
093    public String getVersion() {
094       return "2.6";
095    }
096
097
098
099    /**
100     * Returns
101     * ORC (Common Order) - creates it if necessary
102     */
103    public ORC getORC() { 
104       ORC retVal = getTyped("ORC", ORC.class);
105       return retVal;
106    }
107
108
109
110
111    /**
112     * Returns
113     * OBR (Observation Request) - creates it if necessary
114     */
115    public OBR getOBR() { 
116       OBR retVal = getTyped("OBR", OBR.class);
117       return retVal;
118    }
119
120
121
122
123    /**
124     * Returns
125     * the first repetition of 
126     * NTE (Notes and Comments) - creates it if necessary
127     */
128    public NTE getNTE() { 
129       NTE retVal = getTyped("NTE", NTE.class);
130       return retVal;
131    }
132
133
134    /**
135     * Returns a specific repetition of
136     * NTE (Notes and Comments) - creates it if necessary
137     *
138     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
139     * @throws HL7Exception if the repetition requested is more than one 
140     *     greater than the number of existing repetitions.
141     */
142    public NTE getNTE(int rep) { 
143       NTE retVal = getTyped("NTE", rep, NTE.class);
144       return retVal;
145    }
146
147    /** 
148     * Returns the number of existing repetitions of NTE 
149     */ 
150    public int getNTEReps() {  
151        return getReps("NTE");
152    } 
153
154    /** 
155     * <p>
156     * Returns a non-modifiable List containing all current existing repetitions of NTE.
157     * <p>
158     * <p>
159     * Note that unlike {@link #getNTE()}, this method will not create any reps
160     * if none are already present, so an empty list may be returned.
161     * </p>
162     */ 
163    public List<NTE> getNTEAll() throws HL7Exception {
164        return getAllAsList("NTE", NTE.class);
165    } 
166
167    /**
168     * Inserts a specific repetition of NTE (Notes and Comments)
169     * @see AbstractGroup#insertRepetition(Structure, int) 
170     */
171    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
172       super.insertRepetition("NTE", structure, rep);
173    }
174
175
176    /**
177     * Inserts a specific repetition of NTE (Notes and Comments)
178     * @see AbstractGroup#insertRepetition(Structure, int) 
179     */
180    public NTE insertNTE(int rep) throws HL7Exception { 
181       return (NTE)super.insertRepetition("NTE", rep);
182    }
183
184
185    /**
186     * Removes a specific repetition of NTE (Notes and Comments)
187     * @see AbstractGroup#removeRepetition(String, int) 
188     */
189    public NTE removeNTE(int rep) throws HL7Exception { 
190       return (NTE)super.removeRepetition("NTE", rep);
191    }
192
193
194
195    /**
196     * Returns
197     * the first repetition of 
198     * ROL (Role) - creates it if necessary
199     */
200    public ROL getROL() { 
201       ROL retVal = getTyped("ROL", ROL.class);
202       return retVal;
203    }
204
205
206    /**
207     * Returns a specific repetition of
208     * ROL (Role) - creates it if necessary
209     *
210     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
211     * @throws HL7Exception if the repetition requested is more than one 
212     *     greater than the number of existing repetitions.
213     */
214    public ROL getROL(int rep) { 
215       ROL retVal = getTyped("ROL", rep, ROL.class);
216       return retVal;
217    }
218
219    /** 
220     * Returns the number of existing repetitions of ROL 
221     */ 
222    public int getROLReps() {  
223        return getReps("ROL");
224    } 
225
226    /** 
227     * <p>
228     * Returns a non-modifiable List containing all current existing repetitions of ROL.
229     * <p>
230     * <p>
231     * Note that unlike {@link #getROL()}, this method will not create any reps
232     * if none are already present, so an empty list may be returned.
233     * </p>
234     */ 
235    public List<ROL> getROLAll() throws HL7Exception {
236        return getAllAsList("ROL", ROL.class);
237    } 
238
239    /**
240     * Inserts a specific repetition of ROL (Role)
241     * @see AbstractGroup#insertRepetition(Structure, int) 
242     */
243    public void insertROL(ROL structure, int rep) throws HL7Exception { 
244       super.insertRepetition("ROL", structure, rep);
245    }
246
247
248    /**
249     * Inserts a specific repetition of ROL (Role)
250     * @see AbstractGroup#insertRepetition(Structure, int) 
251     */
252    public ROL insertROL(int rep) throws HL7Exception { 
253       return (ROL)super.insertRepetition("ROL", rep);
254    }
255
256
257    /**
258     * Removes a specific repetition of ROL (Role)
259     * @see AbstractGroup#removeRepetition(String, int) 
260     */
261    public ROL removeROL(int rep) throws HL7Exception { 
262       return (ROL)super.removeRepetition("ROL", rep);
263    }
264
265
266
267    /**
268     * Returns
269     * the first repetition of 
270     * TIMING_QTY (a Group object) - creates it if necessary
271     */
272    public ORU_R01_TIMING_QTY getTIMING_QTY() { 
273       ORU_R01_TIMING_QTY retVal = getTyped("TIMING_QTY", ORU_R01_TIMING_QTY.class);
274       return retVal;
275    }
276
277
278    /**
279     * Returns a specific repetition of
280     * TIMING_QTY (a Group object) - creates it if necessary
281     *
282     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
283     * @throws HL7Exception if the repetition requested is more than one 
284     *     greater than the number of existing repetitions.
285     */
286    public ORU_R01_TIMING_QTY getTIMING_QTY(int rep) { 
287       ORU_R01_TIMING_QTY retVal = getTyped("TIMING_QTY", rep, ORU_R01_TIMING_QTY.class);
288       return retVal;
289    }
290
291    /** 
292     * Returns the number of existing repetitions of TIMING_QTY 
293     */ 
294    public int getTIMING_QTYReps() {  
295        return getReps("TIMING_QTY");
296    } 
297
298    /** 
299     * <p>
300     * Returns a non-modifiable List containing all current existing repetitions of TIMING_QTY.
301     * <p>
302     * <p>
303     * Note that unlike {@link #getTIMING_QTY()}, this method will not create any reps
304     * if none are already present, so an empty list may be returned.
305     * </p>
306     */ 
307    public List<ORU_R01_TIMING_QTY> getTIMING_QTYAll() throws HL7Exception {
308        return getAllAsList("TIMING_QTY", ORU_R01_TIMING_QTY.class);
309    } 
310
311    /**
312     * Inserts a specific repetition of TIMING_QTY (a Group object)
313     * @see AbstractGroup#insertRepetition(Structure, int) 
314     */
315    public void insertTIMING_QTY(ORU_R01_TIMING_QTY structure, int rep) throws HL7Exception { 
316       super.insertRepetition("TIMING_QTY", structure, rep);
317    }
318
319
320    /**
321     * Inserts a specific repetition of TIMING_QTY (a Group object)
322     * @see AbstractGroup#insertRepetition(Structure, int) 
323     */
324    public ORU_R01_TIMING_QTY insertTIMING_QTY(int rep) throws HL7Exception { 
325       return (ORU_R01_TIMING_QTY)super.insertRepetition("TIMING_QTY", rep);
326    }
327
328
329    /**
330     * Removes a specific repetition of TIMING_QTY (a Group object)
331     * @see AbstractGroup#removeRepetition(String, int) 
332     */
333    public ORU_R01_TIMING_QTY removeTIMING_QTY(int rep) throws HL7Exception { 
334       return (ORU_R01_TIMING_QTY)super.removeRepetition("TIMING_QTY", rep);
335    }
336
337
338
339    /**
340     * Returns
341     * CTD (Contact Data) - creates it if necessary
342     */
343    public CTD getCTD() { 
344       CTD retVal = getTyped("CTD", CTD.class);
345       return retVal;
346    }
347
348
349
350
351    /**
352     * Returns
353     * the first repetition of 
354     * OBSERVATION (a Group object) - creates it if necessary
355     */
356    public ORU_R01_OBSERVATION getOBSERVATION() { 
357       ORU_R01_OBSERVATION retVal = getTyped("OBSERVATION", ORU_R01_OBSERVATION.class);
358       return retVal;
359    }
360
361
362    /**
363     * Returns a specific repetition of
364     * OBSERVATION (a Group object) - creates it if necessary
365     *
366     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
367     * @throws HL7Exception if the repetition requested is more than one 
368     *     greater than the number of existing repetitions.
369     */
370    public ORU_R01_OBSERVATION getOBSERVATION(int rep) { 
371       ORU_R01_OBSERVATION retVal = getTyped("OBSERVATION", rep, ORU_R01_OBSERVATION.class);
372       return retVal;
373    }
374
375    /** 
376     * Returns the number of existing repetitions of OBSERVATION 
377     */ 
378    public int getOBSERVATIONReps() {  
379        return getReps("OBSERVATION");
380    } 
381
382    /** 
383     * <p>
384     * Returns a non-modifiable List containing all current existing repetitions of OBSERVATION.
385     * <p>
386     * <p>
387     * Note that unlike {@link #getOBSERVATION()}, this method will not create any reps
388     * if none are already present, so an empty list may be returned.
389     * </p>
390     */ 
391    public List<ORU_R01_OBSERVATION> getOBSERVATIONAll() throws HL7Exception {
392        return getAllAsList("OBSERVATION", ORU_R01_OBSERVATION.class);
393    } 
394
395    /**
396     * Inserts a specific repetition of OBSERVATION (a Group object)
397     * @see AbstractGroup#insertRepetition(Structure, int) 
398     */
399    public void insertOBSERVATION(ORU_R01_OBSERVATION structure, int rep) throws HL7Exception { 
400       super.insertRepetition("OBSERVATION", structure, rep);
401    }
402
403
404    /**
405     * Inserts a specific repetition of OBSERVATION (a Group object)
406     * @see AbstractGroup#insertRepetition(Structure, int) 
407     */
408    public ORU_R01_OBSERVATION insertOBSERVATION(int rep) throws HL7Exception { 
409       return (ORU_R01_OBSERVATION)super.insertRepetition("OBSERVATION", rep);
410    }
411
412
413    /**
414     * Removes a specific repetition of OBSERVATION (a Group object)
415     * @see AbstractGroup#removeRepetition(String, int) 
416     */
417    public ORU_R01_OBSERVATION removeOBSERVATION(int rep) throws HL7Exception { 
418       return (ORU_R01_OBSERVATION)super.removeRepetition("OBSERVATION", rep);
419    }
420
421
422
423    /**
424     * Returns
425     * the first repetition of 
426     * FT1 (Financial Transaction) - creates it if necessary
427     */
428    public FT1 getFT1() { 
429       FT1 retVal = getTyped("FT1", FT1.class);
430       return retVal;
431    }
432
433
434    /**
435     * Returns a specific repetition of
436     * FT1 (Financial Transaction) - creates it if necessary
437     *
438     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
439     * @throws HL7Exception if the repetition requested is more than one 
440     *     greater than the number of existing repetitions.
441     */
442    public FT1 getFT1(int rep) { 
443       FT1 retVal = getTyped("FT1", rep, FT1.class);
444       return retVal;
445    }
446
447    /** 
448     * Returns the number of existing repetitions of FT1 
449     */ 
450    public int getFT1Reps() {  
451        return getReps("FT1");
452    } 
453
454    /** 
455     * <p>
456     * Returns a non-modifiable List containing all current existing repetitions of FT1.
457     * <p>
458     * <p>
459     * Note that unlike {@link #getFT1()}, this method will not create any reps
460     * if none are already present, so an empty list may be returned.
461     * </p>
462     */ 
463    public List<FT1> getFT1All() throws HL7Exception {
464        return getAllAsList("FT1", FT1.class);
465    } 
466
467    /**
468     * Inserts a specific repetition of FT1 (Financial Transaction)
469     * @see AbstractGroup#insertRepetition(Structure, int) 
470     */
471    public void insertFT1(FT1 structure, int rep) throws HL7Exception { 
472       super.insertRepetition("FT1", structure, rep);
473    }
474
475
476    /**
477     * Inserts a specific repetition of FT1 (Financial Transaction)
478     * @see AbstractGroup#insertRepetition(Structure, int) 
479     */
480    public FT1 insertFT1(int rep) throws HL7Exception { 
481       return (FT1)super.insertRepetition("FT1", rep);
482    }
483
484
485    /**
486     * Removes a specific repetition of FT1 (Financial Transaction)
487     * @see AbstractGroup#removeRepetition(String, int) 
488     */
489    public FT1 removeFT1(int rep) throws HL7Exception { 
490       return (FT1)super.removeRepetition("FT1", rep);
491    }
492
493
494
495    /**
496     * Returns
497     * the first repetition of 
498     * CTI (Clinical Trial Identification) - creates it if necessary
499     */
500    public CTI getCTI() { 
501       CTI retVal = getTyped("CTI", CTI.class);
502       return retVal;
503    }
504
505
506    /**
507     * Returns a specific repetition of
508     * CTI (Clinical Trial Identification) - creates it if necessary
509     *
510     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
511     * @throws HL7Exception if the repetition requested is more than one 
512     *     greater than the number of existing repetitions.
513     */
514    public CTI getCTI(int rep) { 
515       CTI retVal = getTyped("CTI", rep, CTI.class);
516       return retVal;
517    }
518
519    /** 
520     * Returns the number of existing repetitions of CTI 
521     */ 
522    public int getCTIReps() {  
523        return getReps("CTI");
524    } 
525
526    /** 
527     * <p>
528     * Returns a non-modifiable List containing all current existing repetitions of CTI.
529     * <p>
530     * <p>
531     * Note that unlike {@link #getCTI()}, this method will not create any reps
532     * if none are already present, so an empty list may be returned.
533     * </p>
534     */ 
535    public List<CTI> getCTIAll() throws HL7Exception {
536        return getAllAsList("CTI", CTI.class);
537    } 
538
539    /**
540     * Inserts a specific repetition of CTI (Clinical Trial Identification)
541     * @see AbstractGroup#insertRepetition(Structure, int) 
542     */
543    public void insertCTI(CTI structure, int rep) throws HL7Exception { 
544       super.insertRepetition("CTI", structure, rep);
545    }
546
547
548    /**
549     * Inserts a specific repetition of CTI (Clinical Trial Identification)
550     * @see AbstractGroup#insertRepetition(Structure, int) 
551     */
552    public CTI insertCTI(int rep) throws HL7Exception { 
553       return (CTI)super.insertRepetition("CTI", rep);
554    }
555
556
557    /**
558     * Removes a specific repetition of CTI (Clinical Trial Identification)
559     * @see AbstractGroup#removeRepetition(String, int) 
560     */
561    public CTI removeCTI(int rep) throws HL7Exception { 
562       return (CTI)super.removeRepetition("CTI", rep);
563    }
564
565
566
567    /**
568     * Returns
569     * the first repetition of 
570     * SPECIMEN (a Group object) - creates it if necessary
571     */
572    public ORU_R01_SPECIMEN getSPECIMEN() { 
573       ORU_R01_SPECIMEN retVal = getTyped("SPECIMEN", ORU_R01_SPECIMEN.class);
574       return retVal;
575    }
576
577
578    /**
579     * Returns a specific repetition of
580     * SPECIMEN (a Group object) - creates it if necessary
581     *
582     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
583     * @throws HL7Exception if the repetition requested is more than one 
584     *     greater than the number of existing repetitions.
585     */
586    public ORU_R01_SPECIMEN getSPECIMEN(int rep) { 
587       ORU_R01_SPECIMEN retVal = getTyped("SPECIMEN", rep, ORU_R01_SPECIMEN.class);
588       return retVal;
589    }
590
591    /** 
592     * Returns the number of existing repetitions of SPECIMEN 
593     */ 
594    public int getSPECIMENReps() {  
595        return getReps("SPECIMEN");
596    } 
597
598    /** 
599     * <p>
600     * Returns a non-modifiable List containing all current existing repetitions of SPECIMEN.
601     * <p>
602     * <p>
603     * Note that unlike {@link #getSPECIMEN()}, this method will not create any reps
604     * if none are already present, so an empty list may be returned.
605     * </p>
606     */ 
607    public List<ORU_R01_SPECIMEN> getSPECIMENAll() throws HL7Exception {
608        return getAllAsList("SPECIMEN", ORU_R01_SPECIMEN.class);
609    } 
610
611    /**
612     * Inserts a specific repetition of SPECIMEN (a Group object)
613     * @see AbstractGroup#insertRepetition(Structure, int) 
614     */
615    public void insertSPECIMEN(ORU_R01_SPECIMEN structure, int rep) throws HL7Exception { 
616       super.insertRepetition("SPECIMEN", structure, rep);
617    }
618
619
620    /**
621     * Inserts a specific repetition of SPECIMEN (a Group object)
622     * @see AbstractGroup#insertRepetition(Structure, int) 
623     */
624    public ORU_R01_SPECIMEN insertSPECIMEN(int rep) throws HL7Exception { 
625       return (ORU_R01_SPECIMEN)super.insertRepetition("SPECIMEN", rep);
626    }
627
628
629    /**
630     * Removes a specific repetition of SPECIMEN (a Group object)
631     * @see AbstractGroup#removeRepetition(String, int) 
632     */
633    public ORU_R01_SPECIMEN removeSPECIMEN(int rep) throws HL7Exception { 
634       return (ORU_R01_SPECIMEN)super.removeRepetition("SPECIMEN", rep);
635    }
636
637
638
639}
640