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