1 /*
2 * This class is an auto-generated source file for a HAPI
3 * HL7 v2.x standard structure class.
4 *
5 * For more information, visit: http://hl7api.sourceforge.net/
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * (the "License"); you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
12 * specific language governing rights and limitations under the License.
13 *
14 * The Original Code is "[file_name]". Description:
15 * "[one_line_description]"
16 *
17 * The Initial Developer of the Original Code is University Health Network. Copyright (C)
18 * 2012. All Rights Reserved.
19 *
20 * Contributor(s): ______________________________________.
21 *
22 * Alternatively, the contents of this file may be used under the terms of the
23 * GNU General Public License (the "GPL"), in which case the provisions of the GPL are
24 * applicable instead of those above. If you wish to allow use of your version of this
25 * file only under the terms of the GPL and not to allow others to use your version
26 * of this file under the MPL, indicate your decision by deleting the provisions above
27 * and replace them with the notice and other provisions required by the GPL License.
28 * If you do not delete the provisions above, a recipient may use your version of
29 * this file under either the MPL or the GPL.
30 *
31 */
32
33
34 package ca.uhn.hl7v2.model.v23.group;
35
36 import ca.uhn.hl7v2.model.v23.segment.*;
37
38 import ca.uhn.hl7v2.HL7Exception;
39 import ca.uhn.hl7v2.parser.ModelClassFactory;
40 import ca.uhn.hl7v2.model.*;
41
42 /**
43 * <p>Represents a BAR_P01_VISIT group structure (a Group object).
44 * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
45 * This Group contains the following elements:
46 * </p>
47 * <ul>
48 * <li>1: PV1 (Patient visit) <b>optional </b></li>
49 * <li>2: PV2 (Patient visit - additional information) <b>optional </b></li>
50 * <li>3: DB1 (Disability Segment) <b>optional repeating </b></li>
51 * <li>4: OBX (Observation segment) <b>optional repeating </b></li>
52 * <li>5: AL1 (Patient allergy information) <b>optional repeating </b></li>
53 * <li>6: DG1 (Diagnosis) <b>optional repeating </b></li>
54 * <li>7: DRG (Diagnosis Related Group) <b>optional </b></li>
55 * <li>8: BAR_P01_PROCEDURE (a Group object) <b>optional repeating </b></li>
56 * <li>9: GT1 (Guarantor) <b>optional repeating </b></li>
57 * <li>10: NK1 (Next of kin) <b>optional repeating </b></li>
58 * <li>11: BAR_P01_INSURANCE (a Group object) <b>optional repeating </b></li>
59 * <li>12: ACC (Accident) <b>optional </b></li>
60 * <li>13: UB1 (UB82 data) <b>optional </b></li>
61 * <li>14: UB2 (UB92 data) <b>optional </b></li>
62 * </ul>
63 */
64 //@SuppressWarnings("unused")
65 public class BAR_P01_VISIT extends AbstractGroup {
66
67 /**
68 * Creates a new BAR_P01_VISIT group
69 */
70 public BAR_P01_VISIT(Group parent, ModelClassFactory factory) {
71 super(parent, factory);
72 init(factory);
73 }
74
75 private void init(ModelClassFactory factory) {
76 try {
77 this.add(PV1.class, false, false, false);
78 this.add(PV2.class, false, false, false);
79 this.add(DB1.class, false, true, false);
80 this.add(OBX.class, false, true, false);
81 this.add(AL1.class, false, true, false);
82 this.add(DG1.class, false, true, false);
83 this.add(DRG.class, false, false, false);
84 this.add(BAR_P01_PROCEDURE.class, false, true, false);
85 this.add(GT1.class, false, true, false);
86 this.add(NK1.class, false, true, false);
87 this.add(BAR_P01_INSURANCE.class, false, true, false);
88 this.add(ACC.class, false, false, false);
89 this.add(UB1.class, false, false, false);
90 this.add(UB2.class, false, false, false);
91 } catch(HL7Exception e) {
92 log.error("Unexpected error creating BAR_P01_VISIT - this is probably a bug in the source code generator.", e);
93 }
94 }
95
96 /**
97 * Returns "2.3"
98 */
99 public String getVersion() {
100 return "2.3";
101 }
102
103
104
105 /**
106 * Returns
107 * PV1 (Patient visit) - creates it if necessary
108 */
109 public PV1 getPV1() {
110 PV1 retVal = getTyped("PV1", PV1.class);
111 return retVal;
112 }
113
114
115
116
117 /**
118 * Returns
119 * PV2 (Patient visit - additional information) - creates it if necessary
120 */
121 public PV2 getPV2() {
122 PV2 retVal = getTyped("PV2", PV2.class);
123 return retVal;
124 }
125
126
127
128
129 /**
130 * Returns
131 * the first repetition of
132 * DB1 (Disability Segment) - creates it if necessary
133 */
134 public DB1 getDB1() {
135 DB1 retVal = getTyped("DB1", DB1.class);
136 return retVal;
137 }
138
139
140 /**
141 * Returns a specific repetition of
142 * DB1 (Disability Segment) - creates it if necessary
143 *
144 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
145 * @throws HL7Exception if the repetition requested is more than one
146 * greater than the number of existing repetitions.
147 */
148 public DB1 getDB1(int rep) {
149 DB1 retVal = getTyped("DB1", rep, DB1.class);
150 return retVal;
151 }
152
153 /**
154 * Returns the number of existing repetitions of DB1
155 */
156 public int getDB1Reps() {
157 return getReps("DB1");
158 }
159
160 /**
161 * <p>
162 * Returns a non-modifiable List containing all current existing repetitions of DB1.
163 * <p>
164 * <p>
165 * Note that unlike {@link #getDB1()}, this method will not create any reps
166 * if none are already present, so an empty list may be returned.
167 * </p>
168 */
169 public java.util.List<DB1> getDB1All() throws HL7Exception {
170 return getAllAsList("DB1", DB1.class);
171 }
172
173 /**
174 * Inserts a specific repetition of DB1 (Disability Segment)
175 * @see AbstractGroup#insertRepetition(Structure, int)
176 */
177 public void insertDB1(DB1 structure, int rep) throws HL7Exception {
178 super.insertRepetition("DB1", structure, rep);
179 }
180
181
182 /**
183 * Inserts a specific repetition of DB1 (Disability Segment)
184 * @see AbstractGroup#insertRepetition(Structure, int)
185 */
186 public DB1 insertDB1(int rep) throws HL7Exception {
187 return (DB1)super.insertRepetition("DB1", rep);
188 }
189
190
191 /**
192 * Removes a specific repetition of DB1 (Disability Segment)
193 * @see AbstractGroup#removeRepetition(String, int)
194 */
195 public DB1 removeDB1(int rep) throws HL7Exception {
196 return (DB1)super.removeRepetition("DB1", rep);
197 }
198
199
200
201 /**
202 * Returns
203 * the first repetition of
204 * OBX (Observation segment) - creates it if necessary
205 */
206 public OBX getOBX() {
207 OBX retVal = getTyped("OBX", OBX.class);
208 return retVal;
209 }
210
211
212 /**
213 * Returns a specific repetition of
214 * OBX (Observation segment) - creates it if necessary
215 *
216 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
217 * @throws HL7Exception if the repetition requested is more than one
218 * greater than the number of existing repetitions.
219 */
220 public OBX getOBX(int rep) {
221 OBX retVal = getTyped("OBX", rep, OBX.class);
222 return retVal;
223 }
224
225 /**
226 * Returns the number of existing repetitions of OBX
227 */
228 public int getOBXReps() {
229 return getReps("OBX");
230 }
231
232 /**
233 * <p>
234 * Returns a non-modifiable List containing all current existing repetitions of OBX.
235 * <p>
236 * <p>
237 * Note that unlike {@link #getOBX()}, this method will not create any reps
238 * if none are already present, so an empty list may be returned.
239 * </p>
240 */
241 public java.util.List<OBX> getOBXAll() throws HL7Exception {
242 return getAllAsList("OBX", OBX.class);
243 }
244
245 /**
246 * Inserts a specific repetition of OBX (Observation segment)
247 * @see AbstractGroup#insertRepetition(Structure, int)
248 */
249 public void insertOBX(OBX structure, int rep) throws HL7Exception {
250 super.insertRepetition("OBX", structure, rep);
251 }
252
253
254 /**
255 * Inserts a specific repetition of OBX (Observation segment)
256 * @see AbstractGroup#insertRepetition(Structure, int)
257 */
258 public OBX insertOBX(int rep) throws HL7Exception {
259 return (OBX)super.insertRepetition("OBX", rep);
260 }
261
262
263 /**
264 * Removes a specific repetition of OBX (Observation segment)
265 * @see AbstractGroup#removeRepetition(String, int)
266 */
267 public OBX removeOBX(int rep) throws HL7Exception {
268 return (OBX)super.removeRepetition("OBX", rep);
269 }
270
271
272
273 /**
274 * Returns
275 * the first repetition of
276 * AL1 (Patient allergy information) - creates it if necessary
277 */
278 public AL1 getAL1() {
279 AL1 retVal = getTyped("AL1", AL1.class);
280 return retVal;
281 }
282
283
284 /**
285 * Returns a specific repetition of
286 * AL1 (Patient allergy information) - creates it if necessary
287 *
288 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
289 * @throws HL7Exception if the repetition requested is more than one
290 * greater than the number of existing repetitions.
291 */
292 public AL1 getAL1(int rep) {
293 AL1 retVal = getTyped("AL1", rep, AL1.class);
294 return retVal;
295 }
296
297 /**
298 * Returns the number of existing repetitions of AL1
299 */
300 public int getAL1Reps() {
301 return getReps("AL1");
302 }
303
304 /**
305 * <p>
306 * Returns a non-modifiable List containing all current existing repetitions of AL1.
307 * <p>
308 * <p>
309 * Note that unlike {@link #getAL1()}, this method will not create any reps
310 * if none are already present, so an empty list may be returned.
311 * </p>
312 */
313 public java.util.List<AL1> getAL1All() throws HL7Exception {
314 return getAllAsList("AL1", AL1.class);
315 }
316
317 /**
318 * Inserts a specific repetition of AL1 (Patient allergy information)
319 * @see AbstractGroup#insertRepetition(Structure, int)
320 */
321 public void insertAL1(AL1 structure, int rep) throws HL7Exception {
322 super.insertRepetition("AL1", structure, rep);
323 }
324
325
326 /**
327 * Inserts a specific repetition of AL1 (Patient allergy information)
328 * @see AbstractGroup#insertRepetition(Structure, int)
329 */
330 public AL1 insertAL1(int rep) throws HL7Exception {
331 return (AL1)super.insertRepetition("AL1", rep);
332 }
333
334
335 /**
336 * Removes a specific repetition of AL1 (Patient allergy information)
337 * @see AbstractGroup#removeRepetition(String, int)
338 */
339 public AL1 removeAL1(int rep) throws HL7Exception {
340 return (AL1)super.removeRepetition("AL1", rep);
341 }
342
343
344
345 /**
346 * Returns
347 * the first repetition of
348 * DG1 (Diagnosis) - creates it if necessary
349 */
350 public DG1 getDG1() {
351 DG1 retVal = getTyped("DG1", DG1.class);
352 return retVal;
353 }
354
355
356 /**
357 * Returns a specific repetition of
358 * DG1 (Diagnosis) - creates it if necessary
359 *
360 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
361 * @throws HL7Exception if the repetition requested is more than one
362 * greater than the number of existing repetitions.
363 */
364 public DG1 getDG1(int rep) {
365 DG1 retVal = getTyped("DG1", rep, DG1.class);
366 return retVal;
367 }
368
369 /**
370 * Returns the number of existing repetitions of DG1
371 */
372 public int getDG1Reps() {
373 return getReps("DG1");
374 }
375
376 /**
377 * <p>
378 * Returns a non-modifiable List containing all current existing repetitions of DG1.
379 * <p>
380 * <p>
381 * Note that unlike {@link #getDG1()}, this method will not create any reps
382 * if none are already present, so an empty list may be returned.
383 * </p>
384 */
385 public java.util.List<DG1> getDG1All() throws HL7Exception {
386 return getAllAsList("DG1", DG1.class);
387 }
388
389 /**
390 * Inserts a specific repetition of DG1 (Diagnosis)
391 * @see AbstractGroup#insertRepetition(Structure, int)
392 */
393 public void insertDG1(DG1 structure, int rep) throws HL7Exception {
394 super.insertRepetition("DG1", structure, rep);
395 }
396
397
398 /**
399 * Inserts a specific repetition of DG1 (Diagnosis)
400 * @see AbstractGroup#insertRepetition(Structure, int)
401 */
402 public DG1 insertDG1(int rep) throws HL7Exception {
403 return (DG1)super.insertRepetition("DG1", rep);
404 }
405
406
407 /**
408 * Removes a specific repetition of DG1 (Diagnosis)
409 * @see AbstractGroup#removeRepetition(String, int)
410 */
411 public DG1 removeDG1(int rep) throws HL7Exception {
412 return (DG1)super.removeRepetition("DG1", rep);
413 }
414
415
416
417 /**
418 * Returns
419 * DRG (Diagnosis Related Group) - creates it if necessary
420 */
421 public DRG getDRG() {
422 DRG retVal = getTyped("DRG", DRG.class);
423 return retVal;
424 }
425
426
427
428
429 /**
430 * Returns
431 * the first repetition of
432 * PROCEDURE (a Group object) - creates it if necessary
433 */
434 public BAR_P01_PROCEDURE getPROCEDURE() {
435 BAR_P01_PROCEDURE retVal = getTyped("PROCEDURE", BAR_P01_PROCEDURE.class);
436 return retVal;
437 }
438
439
440 /**
441 * Returns a specific repetition of
442 * PROCEDURE (a Group object) - creates it if necessary
443 *
444 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
445 * @throws HL7Exception if the repetition requested is more than one
446 * greater than the number of existing repetitions.
447 */
448 public BAR_P01_PROCEDURE getPROCEDURE(int rep) {
449 BAR_P01_PROCEDURE retVal = getTyped("PROCEDURE", rep, BAR_P01_PROCEDURE.class);
450 return retVal;
451 }
452
453 /**
454 * Returns the number of existing repetitions of PROCEDURE
455 */
456 public int getPROCEDUREReps() {
457 return getReps("PROCEDURE");
458 }
459
460 /**
461 * <p>
462 * Returns a non-modifiable List containing all current existing repetitions of PROCEDURE.
463 * <p>
464 * <p>
465 * Note that unlike {@link #getPROCEDURE()}, this method will not create any reps
466 * if none are already present, so an empty list may be returned.
467 * </p>
468 */
469 public java.util.List<BAR_P01_PROCEDURE> getPROCEDUREAll() throws HL7Exception {
470 return getAllAsList("PROCEDURE", BAR_P01_PROCEDURE.class);
471 }
472
473 /**
474 * Inserts a specific repetition of PROCEDURE (a Group object)
475 * @see AbstractGroup#insertRepetition(Structure, int)
476 */
477 public void insertPROCEDURE(BAR_P01_PROCEDURE structure, int rep) throws HL7Exception {
478 super.insertRepetition("PROCEDURE", structure, rep);
479 }
480
481
482 /**
483 * Inserts a specific repetition of PROCEDURE (a Group object)
484 * @see AbstractGroup#insertRepetition(Structure, int)
485 */
486 public BAR_P01_PROCEDURE insertPROCEDURE(int rep) throws HL7Exception {
487 return (BAR_P01_PROCEDURE)super.insertRepetition("PROCEDURE", rep);
488 }
489
490
491 /**
492 * Removes a specific repetition of PROCEDURE (a Group object)
493 * @see AbstractGroup#removeRepetition(String, int)
494 */
495 public BAR_P01_PROCEDURE removePROCEDURE(int rep) throws HL7Exception {
496 return (BAR_P01_PROCEDURE)super.removeRepetition("PROCEDURE", rep);
497 }
498
499
500
501 /**
502 * Returns
503 * the first repetition of
504 * GT1 (Guarantor) - creates it if necessary
505 */
506 public GT1 getGT1() {
507 GT1 retVal = getTyped("GT1", GT1.class);
508 return retVal;
509 }
510
511
512 /**
513 * Returns a specific repetition of
514 * GT1 (Guarantor) - creates it if necessary
515 *
516 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
517 * @throws HL7Exception if the repetition requested is more than one
518 * greater than the number of existing repetitions.
519 */
520 public GT1 getGT1(int rep) {
521 GT1 retVal = getTyped("GT1", rep, GT1.class);
522 return retVal;
523 }
524
525 /**
526 * Returns the number of existing repetitions of GT1
527 */
528 public int getGT1Reps() {
529 return getReps("GT1");
530 }
531
532 /**
533 * <p>
534 * Returns a non-modifiable List containing all current existing repetitions of GT1.
535 * <p>
536 * <p>
537 * Note that unlike {@link #getGT1()}, this method will not create any reps
538 * if none are already present, so an empty list may be returned.
539 * </p>
540 */
541 public java.util.List<GT1> getGT1All() throws HL7Exception {
542 return getAllAsList("GT1", GT1.class);
543 }
544
545 /**
546 * Inserts a specific repetition of GT1 (Guarantor)
547 * @see AbstractGroup#insertRepetition(Structure, int)
548 */
549 public void insertGT1(GT1 structure, int rep) throws HL7Exception {
550 super.insertRepetition("GT1", structure, rep);
551 }
552
553
554 /**
555 * Inserts a specific repetition of GT1 (Guarantor)
556 * @see AbstractGroup#insertRepetition(Structure, int)
557 */
558 public GT1 insertGT1(int rep) throws HL7Exception {
559 return (GT1)super.insertRepetition("GT1", rep);
560 }
561
562
563 /**
564 * Removes a specific repetition of GT1 (Guarantor)
565 * @see AbstractGroup#removeRepetition(String, int)
566 */
567 public GT1 removeGT1(int rep) throws HL7Exception {
568 return (GT1)super.removeRepetition("GT1", rep);
569 }
570
571
572
573 /**
574 * Returns
575 * the first repetition of
576 * NK1 (Next of kin) - creates it if necessary
577 */
578 public NK1 getNK1() {
579 NK1 retVal = getTyped("NK1", NK1.class);
580 return retVal;
581 }
582
583
584 /**
585 * Returns a specific repetition of
586 * NK1 (Next of kin) - creates it if necessary
587 *
588 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
589 * @throws HL7Exception if the repetition requested is more than one
590 * greater than the number of existing repetitions.
591 */
592 public NK1 getNK1(int rep) {
593 NK1 retVal = getTyped("NK1", rep, NK1.class);
594 return retVal;
595 }
596
597 /**
598 * Returns the number of existing repetitions of NK1
599 */
600 public int getNK1Reps() {
601 return getReps("NK1");
602 }
603
604 /**
605 * <p>
606 * Returns a non-modifiable List containing all current existing repetitions of NK1.
607 * <p>
608 * <p>
609 * Note that unlike {@link #getNK1()}, this method will not create any reps
610 * if none are already present, so an empty list may be returned.
611 * </p>
612 */
613 public java.util.List<NK1> getNK1All() throws HL7Exception {
614 return getAllAsList("NK1", NK1.class);
615 }
616
617 /**
618 * Inserts a specific repetition of NK1 (Next of kin)
619 * @see AbstractGroup#insertRepetition(Structure, int)
620 */
621 public void insertNK1(NK1 structure, int rep) throws HL7Exception {
622 super.insertRepetition("NK1", structure, rep);
623 }
624
625
626 /**
627 * Inserts a specific repetition of NK1 (Next of kin)
628 * @see AbstractGroup#insertRepetition(Structure, int)
629 */
630 public NK1 insertNK1(int rep) throws HL7Exception {
631 return (NK1)super.insertRepetition("NK1", rep);
632 }
633
634
635 /**
636 * Removes a specific repetition of NK1 (Next of kin)
637 * @see AbstractGroup#removeRepetition(String, int)
638 */
639 public NK1 removeNK1(int rep) throws HL7Exception {
640 return (NK1)super.removeRepetition("NK1", rep);
641 }
642
643
644
645 /**
646 * Returns
647 * the first repetition of
648 * INSURANCE (a Group object) - creates it if necessary
649 */
650 public BAR_P01_INSURANCE getINSURANCE() {
651 BAR_P01_INSURANCE retVal = getTyped("INSURANCE", BAR_P01_INSURANCE.class);
652 return retVal;
653 }
654
655
656 /**
657 * Returns a specific repetition of
658 * INSURANCE (a Group object) - creates it if necessary
659 *
660 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
661 * @throws HL7Exception if the repetition requested is more than one
662 * greater than the number of existing repetitions.
663 */
664 public BAR_P01_INSURANCE getINSURANCE(int rep) {
665 BAR_P01_INSURANCE retVal = getTyped("INSURANCE", rep, BAR_P01_INSURANCE.class);
666 return retVal;
667 }
668
669 /**
670 * Returns the number of existing repetitions of INSURANCE
671 */
672 public int getINSURANCEReps() {
673 return getReps("INSURANCE");
674 }
675
676 /**
677 * <p>
678 * Returns a non-modifiable List containing all current existing repetitions of INSURANCE.
679 * <p>
680 * <p>
681 * Note that unlike {@link #getINSURANCE()}, this method will not create any reps
682 * if none are already present, so an empty list may be returned.
683 * </p>
684 */
685 public java.util.List<BAR_P01_INSURANCE> getINSURANCEAll() throws HL7Exception {
686 return getAllAsList("INSURANCE", BAR_P01_INSURANCE.class);
687 }
688
689 /**
690 * Inserts a specific repetition of INSURANCE (a Group object)
691 * @see AbstractGroup#insertRepetition(Structure, int)
692 */
693 public void insertINSURANCE(BAR_P01_INSURANCE structure, int rep) throws HL7Exception {
694 super.insertRepetition("INSURANCE", structure, rep);
695 }
696
697
698 /**
699 * Inserts a specific repetition of INSURANCE (a Group object)
700 * @see AbstractGroup#insertRepetition(Structure, int)
701 */
702 public BAR_P01_INSURANCE insertINSURANCE(int rep) throws HL7Exception {
703 return (BAR_P01_INSURANCE)super.insertRepetition("INSURANCE", rep);
704 }
705
706
707 /**
708 * Removes a specific repetition of INSURANCE (a Group object)
709 * @see AbstractGroup#removeRepetition(String, int)
710 */
711 public BAR_P01_INSURANCE removeINSURANCE(int rep) throws HL7Exception {
712 return (BAR_P01_INSURANCE)super.removeRepetition("INSURANCE", rep);
713 }
714
715
716
717 /**
718 * Returns
719 * ACC (Accident) - creates it if necessary
720 */
721 public ACC getACC() {
722 ACC retVal = getTyped("ACC", ACC.class);
723 return retVal;
724 }
725
726
727
728
729 /**
730 * Returns
731 * UB1 (UB82 data) - creates it if necessary
732 */
733 public UB1 getUB1() {
734 UB1 retVal = getTyped("UB1", UB1.class);
735 return retVal;
736 }
737
738
739
740
741 /**
742 * Returns
743 * UB2 (UB92 data) - creates it if necessary
744 */
745 public UB2 getUB2() {
746 UB2 retVal = getTyped("UB2", UB2.class);
747 return retVal;
748 }
749
750
751
752
753 }
754