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