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 OML_O33_PATIENT 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: PID (Patient Identification) <b>  </b></li>
049                         * <li>2: PD1 (Patient Additional Demographic) <b>optional  </b></li>
050                         * <li>3: PRT (Participation Information) <b>optional repeating </b></li>
051                         * <li>4: NTE (Notes and Comments) <b>optional repeating </b></li>
052                         * <li>5: NK1 (Next of Kin / Associated Parties) <b>optional repeating </b></li>
053                         * <li>6: ARV (Access Restriction) <b>optional repeating </b></li>
054                         * <li>7: OML_O33_PATIENT_VISIT (a Group object) <b>optional  </b></li>
055                         * <li>8: OML_O33_INSURANCE (a Group object) <b>optional repeating </b></li>
056                         * <li>9: GT1 (Guarantor) <b>optional  </b></li>
057                         * <li>10: AL1 (Patient Allergy Information) <b>optional repeating </b></li>
058 * </ul>
059 */
060//@SuppressWarnings("unused")
061public class OML_O33_PATIENT extends AbstractGroup {
062
063    /** 
064     * Creates a new OML_O33_PATIENT group
065     */
066    public OML_O33_PATIENT(Group parent, ModelClassFactory factory) {
067       super(parent, factory);
068       init(factory);
069    }
070
071    private void init(ModelClassFactory factory) {
072       try {
073                                  this.add(PID.class, true, false, false);
074                                  this.add(PD1.class, false, false, false);
075                                  this.add(PRT.class, false, true, false);
076                                  this.add(NTE.class, false, true, false);
077                                  this.add(NK1.class, false, true, false);
078                                  this.add(ARV.class, false, true, false);
079                                  this.add(OML_O33_PATIENT_VISIT.class, false, false, false);
080                                  this.add(OML_O33_INSURANCE.class, false, true, false);
081                                  this.add(GT1.class, false, false, false);
082                                  this.add(AL1.class, false, true, false);
083       } catch(HL7Exception e) {
084          log.error("Unexpected error creating OML_O33_PATIENT - 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     * PID (Patient Identification) - creates it if necessary
100     */
101    public PID getPID() { 
102       PID retVal = getTyped("PID", PID.class);
103       return retVal;
104    }
105
106
107
108
109    /**
110     * Returns
111     * PD1 (Patient Additional Demographic) - creates it if necessary
112     */
113    public PD1 getPD1() { 
114       PD1 retVal = getTyped("PD1", PD1.class);
115       return retVal;
116    }
117
118
119
120
121    /**
122     * Returns
123     * the first repetition of 
124     * PRT (Participation Information) - creates it if necessary
125     */
126    public PRT getPRT() { 
127       PRT retVal = getTyped("PRT", PRT.class);
128       return retVal;
129    }
130
131
132    /**
133     * Returns a specific repetition of
134     * PRT (Participation Information) - 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 PRT getPRT(int rep) { 
141       PRT retVal = getTyped("PRT", rep, PRT.class);
142       return retVal;
143    }
144
145    /** 
146     * Returns the number of existing repetitions of PRT 
147     */ 
148    public int getPRTReps() {  
149        return getReps("PRT");
150    } 
151
152    /** 
153     * <p>
154     * Returns a non-modifiable List containing all current existing repetitions of PRT.
155     * <p>
156     * <p>
157     * Note that unlike {@link #getPRT()}, 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<PRT> getPRTAll() throws HL7Exception {
162        return getAllAsList("PRT", PRT.class);
163    } 
164
165    /**
166     * Inserts a specific repetition of PRT (Participation Information)
167     * @see AbstractGroup#insertRepetition(Structure, int) 
168     */
169    public void insertPRT(PRT structure, int rep) throws HL7Exception { 
170       super.insertRepetition("PRT", structure, rep);
171    }
172
173
174    /**
175     * Inserts a specific repetition of PRT (Participation Information)
176     * @see AbstractGroup#insertRepetition(Structure, int) 
177     */
178    public PRT insertPRT(int rep) throws HL7Exception { 
179       return (PRT)super.insertRepetition("PRT", rep);
180    }
181
182
183    /**
184     * Removes a specific repetition of PRT (Participation Information)
185     * @see AbstractGroup#removeRepetition(String, int) 
186     */
187    public PRT removePRT(int rep) throws HL7Exception { 
188       return (PRT)super.removeRepetition("PRT", rep);
189    }
190
191
192
193    /**
194     * Returns
195     * the first repetition of 
196     * NTE (Notes and Comments) - creates it if necessary
197     */
198    public NTE getNTE() { 
199       NTE retVal = getTyped("NTE", NTE.class);
200       return retVal;
201    }
202
203
204    /**
205     * Returns a specific repetition of
206     * NTE (Notes and Comments) - 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 NTE getNTE(int rep) { 
213       NTE retVal = getTyped("NTE", rep, NTE.class);
214       return retVal;
215    }
216
217    /** 
218     * Returns the number of existing repetitions of NTE 
219     */ 
220    public int getNTEReps() {  
221        return getReps("NTE");
222    } 
223
224    /** 
225     * <p>
226     * Returns a non-modifiable List containing all current existing repetitions of NTE.
227     * <p>
228     * <p>
229     * Note that unlike {@link #getNTE()}, 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<NTE> getNTEAll() throws HL7Exception {
234        return getAllAsList("NTE", NTE.class);
235    } 
236
237    /**
238     * Inserts a specific repetition of NTE (Notes and Comments)
239     * @see AbstractGroup#insertRepetition(Structure, int) 
240     */
241    public void insertNTE(NTE structure, int rep) throws HL7Exception { 
242       super.insertRepetition("NTE", structure, rep);
243    }
244
245
246    /**
247     * Inserts a specific repetition of NTE (Notes and Comments)
248     * @see AbstractGroup#insertRepetition(Structure, int) 
249     */
250    public NTE insertNTE(int rep) throws HL7Exception { 
251       return (NTE)super.insertRepetition("NTE", rep);
252    }
253
254
255    /**
256     * Removes a specific repetition of NTE (Notes and Comments)
257     * @see AbstractGroup#removeRepetition(String, int) 
258     */
259    public NTE removeNTE(int rep) throws HL7Exception { 
260       return (NTE)super.removeRepetition("NTE", rep);
261    }
262
263
264
265    /**
266     * Returns
267     * the first repetition of 
268     * NK1 (Next of Kin / Associated Parties) - creates it if necessary
269     */
270    public NK1 getNK1() { 
271       NK1 retVal = getTyped("NK1", NK1.class);
272       return retVal;
273    }
274
275
276    /**
277     * Returns a specific repetition of
278     * NK1 (Next of Kin / Associated Parties) - 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 NK1 getNK1(int rep) { 
285       NK1 retVal = getTyped("NK1", rep, NK1.class);
286       return retVal;
287    }
288
289    /** 
290     * Returns the number of existing repetitions of NK1 
291     */ 
292    public int getNK1Reps() {  
293        return getReps("NK1");
294    } 
295
296    /** 
297     * <p>
298     * Returns a non-modifiable List containing all current existing repetitions of NK1.
299     * <p>
300     * <p>
301     * Note that unlike {@link #getNK1()}, 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<NK1> getNK1All() throws HL7Exception {
306        return getAllAsList("NK1", NK1.class);
307    } 
308
309    /**
310     * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties)
311     * @see AbstractGroup#insertRepetition(Structure, int) 
312     */
313    public void insertNK1(NK1 structure, int rep) throws HL7Exception { 
314       super.insertRepetition("NK1", structure, rep);
315    }
316
317
318    /**
319     * Inserts a specific repetition of NK1 (Next of Kin / Associated Parties)
320     * @see AbstractGroup#insertRepetition(Structure, int) 
321     */
322    public NK1 insertNK1(int rep) throws HL7Exception { 
323       return (NK1)super.insertRepetition("NK1", rep);
324    }
325
326
327    /**
328     * Removes a specific repetition of NK1 (Next of Kin / Associated Parties)
329     * @see AbstractGroup#removeRepetition(String, int) 
330     */
331    public NK1 removeNK1(int rep) throws HL7Exception { 
332       return (NK1)super.removeRepetition("NK1", rep);
333    }
334
335
336
337    /**
338     * Returns
339     * the first repetition of 
340     * ARV (Access Restriction) - creates it if necessary
341     */
342    public ARV getARV() { 
343       ARV retVal = getTyped("ARV", ARV.class);
344       return retVal;
345    }
346
347
348    /**
349     * Returns a specific repetition of
350     * ARV (Access Restriction) - 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 ARV getARV(int rep) { 
357       ARV retVal = getTyped("ARV", rep, ARV.class);
358       return retVal;
359    }
360
361    /** 
362     * Returns the number of existing repetitions of ARV 
363     */ 
364    public int getARVReps() {  
365        return getReps("ARV");
366    } 
367
368    /** 
369     * <p>
370     * Returns a non-modifiable List containing all current existing repetitions of ARV.
371     * <p>
372     * <p>
373     * Note that unlike {@link #getARV()}, 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<ARV> getARVAll() throws HL7Exception {
378        return getAllAsList("ARV", ARV.class);
379    } 
380
381    /**
382     * Inserts a specific repetition of ARV (Access Restriction)
383     * @see AbstractGroup#insertRepetition(Structure, int) 
384     */
385    public void insertARV(ARV structure, int rep) throws HL7Exception { 
386       super.insertRepetition("ARV", structure, rep);
387    }
388
389
390    /**
391     * Inserts a specific repetition of ARV (Access Restriction)
392     * @see AbstractGroup#insertRepetition(Structure, int) 
393     */
394    public ARV insertARV(int rep) throws HL7Exception { 
395       return (ARV)super.insertRepetition("ARV", rep);
396    }
397
398
399    /**
400     * Removes a specific repetition of ARV (Access Restriction)
401     * @see AbstractGroup#removeRepetition(String, int) 
402     */
403    public ARV removeARV(int rep) throws HL7Exception { 
404       return (ARV)super.removeRepetition("ARV", rep);
405    }
406
407
408
409    /**
410     * Returns
411     * PATIENT_VISIT (a Group object) - creates it if necessary
412     */
413    public OML_O33_PATIENT_VISIT getPATIENT_VISIT() { 
414       OML_O33_PATIENT_VISIT retVal = getTyped("PATIENT_VISIT", OML_O33_PATIENT_VISIT.class);
415       return retVal;
416    }
417
418
419
420
421    /**
422     * Returns
423     * the first repetition of 
424     * INSURANCE (a Group object) - creates it if necessary
425     */
426    public OML_O33_INSURANCE getINSURANCE() { 
427       OML_O33_INSURANCE retVal = getTyped("INSURANCE", OML_O33_INSURANCE.class);
428       return retVal;
429    }
430
431
432    /**
433     * Returns a specific repetition of
434     * INSURANCE (a Group object) - 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 OML_O33_INSURANCE getINSURANCE(int rep) { 
441       OML_O33_INSURANCE retVal = getTyped("INSURANCE", rep, OML_O33_INSURANCE.class);
442       return retVal;
443    }
444
445    /** 
446     * Returns the number of existing repetitions of INSURANCE 
447     */ 
448    public int getINSURANCEReps() {  
449        return getReps("INSURANCE");
450    } 
451
452    /** 
453     * <p>
454     * Returns a non-modifiable List containing all current existing repetitions of INSURANCE.
455     * <p>
456     * <p>
457     * Note that unlike {@link #getINSURANCE()}, 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<OML_O33_INSURANCE> getINSURANCEAll() throws HL7Exception {
462        return getAllAsList("INSURANCE", OML_O33_INSURANCE.class);
463    } 
464
465    /**
466     * Inserts a specific repetition of INSURANCE (a Group object)
467     * @see AbstractGroup#insertRepetition(Structure, int) 
468     */
469    public void insertINSURANCE(OML_O33_INSURANCE structure, int rep) throws HL7Exception { 
470       super.insertRepetition("INSURANCE", structure, rep);
471    }
472
473
474    /**
475     * Inserts a specific repetition of INSURANCE (a Group object)
476     * @see AbstractGroup#insertRepetition(Structure, int) 
477     */
478    public OML_O33_INSURANCE insertINSURANCE(int rep) throws HL7Exception { 
479       return (OML_O33_INSURANCE)super.insertRepetition("INSURANCE", rep);
480    }
481
482
483    /**
484     * Removes a specific repetition of INSURANCE (a Group object)
485     * @see AbstractGroup#removeRepetition(String, int) 
486     */
487    public OML_O33_INSURANCE removeINSURANCE(int rep) throws HL7Exception { 
488       return (OML_O33_INSURANCE)super.removeRepetition("INSURANCE", rep);
489    }
490
491
492
493    /**
494     * Returns
495     * GT1 (Guarantor) - creates it if necessary
496     */
497    public GT1 getGT1() { 
498       GT1 retVal = getTyped("GT1", GT1.class);
499       return retVal;
500    }
501
502
503
504
505    /**
506     * Returns
507     * the first repetition of 
508     * AL1 (Patient Allergy Information) - creates it if necessary
509     */
510    public AL1 getAL1() { 
511       AL1 retVal = getTyped("AL1", AL1.class);
512       return retVal;
513    }
514
515
516    /**
517     * Returns a specific repetition of
518     * AL1 (Patient Allergy Information) - creates it if necessary
519     *
520     * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
521     * @throws HL7Exception if the repetition requested is more than one 
522     *     greater than the number of existing repetitions.
523     */
524    public AL1 getAL1(int rep) { 
525       AL1 retVal = getTyped("AL1", rep, AL1.class);
526       return retVal;
527    }
528
529    /** 
530     * Returns the number of existing repetitions of AL1 
531     */ 
532    public int getAL1Reps() {  
533        return getReps("AL1");
534    } 
535
536    /** 
537     * <p>
538     * Returns a non-modifiable List containing all current existing repetitions of AL1.
539     * <p>
540     * <p>
541     * Note that unlike {@link #getAL1()}, this method will not create any reps
542     * if none are already present, so an empty list may be returned.
543     * </p>
544     */ 
545    public java.util.List<AL1> getAL1All() throws HL7Exception {
546        return getAllAsList("AL1", AL1.class);
547    } 
548
549    /**
550     * Inserts a specific repetition of AL1 (Patient Allergy Information)
551     * @see AbstractGroup#insertRepetition(Structure, int) 
552     */
553    public void insertAL1(AL1 structure, int rep) throws HL7Exception { 
554       super.insertRepetition("AL1", structure, rep);
555    }
556
557
558    /**
559     * Inserts a specific repetition of AL1 (Patient Allergy Information)
560     * @see AbstractGroup#insertRepetition(Structure, int) 
561     */
562    public AL1 insertAL1(int rep) throws HL7Exception { 
563       return (AL1)super.insertRepetition("AL1", rep);
564    }
565
566
567    /**
568     * Removes a specific repetition of AL1 (Patient Allergy Information)
569     * @see AbstractGroup#removeRepetition(String, int) 
570     */
571    public AL1 removeAL1(int rep) throws HL7Exception { 
572       return (AL1)super.removeRepetition("AL1", rep);
573    }
574
575
576
577}
578