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