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.v281.message;
35
36 import ca.uhn.hl7v2.model.v281.group.*;
37 import ca.uhn.hl7v2.model.v281.segment.*;
38
39 import ca.uhn.hl7v2.HL7Exception;
40 import ca.uhn.hl7v2.parser.ModelClassFactory;
41 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
42 import ca.uhn.hl7v2.model.*;
43
44
45 /**
46 * <p>Represents a ADT_A02 message structure (see chapter 3.3.2). This structure contains the
47 * following elements: </p>
48 * <ul>
49 * <li>1: MSH (Message Header) <b> </b> </li>
50 * <li>2: SFT (Software Segment) <b>optional repeating</b> </li>
51 * <li>3: UAC (User Authentication Credential Segment) <b>optional </b> </li>
52 * <li>4: EVN (Event Type) <b> </b> </li>
53 * <li>5: PID (Patient Identification) <b> </b> </li>
54 * <li>6: PD1 (Patient Additional Demographic) <b>optional </b> </li>
55 * <li>7: ARV (Access Restriction) <b>optional repeating</b> </li>
56 * <li>8: ROL (Role) <b>optional repeating</b> </li>
57 * <li>9: PV1 (Patient Visit) <b> </b> </li>
58 * <li>10: PV2 (Patient Visit - Additional Information) <b>optional </b> </li>
59 * <li>11: ARV (Access Restriction) <b>optional repeating</b> </li>
60 * <li>12: ROL (Role) <b>optional repeating</b> </li>
61 * <li>13: DB1 (Disability) <b>optional repeating</b> </li>
62 * <li>14: OBX (Observation/Result) <b>optional repeating</b> </li>
63 * <li>15: PDA (Patient Death and Autopsy) <b>optional </b> </li>
64 * </ul>
65 */
66 //@SuppressWarnings("unused")
67 public class ADT_A02 extends AbstractMessage {
68
69 /**
70 * Creates a new ADT_A02 message with DefaultModelClassFactory.
71 */
72 public ADT_A02() {
73 this(new DefaultModelClassFactory());
74 }
75
76 /**
77 * Creates a new ADT_A02 message with custom ModelClassFactory.
78 */
79 public ADT_A02(ModelClassFactory factory) {
80 super(factory);
81 init(factory);
82 }
83
84 private void init(ModelClassFactory factory) {
85 try {
86 this.add(MSH.class, true, false);
87 this.add(SFT.class, false, true);
88 this.add(UAC.class, false, false);
89 this.add(EVN.class, true, false);
90 this.add(PID.class, true, false);
91 this.add(PD1.class, false, false);
92 this.add(ARV.class, false, true);
93 this.add(ROL.class, false, true);
94 this.add(PV1.class, true, false);
95 this.add(PV2.class, false, false);
96 this.add(ARV.class, false, true);
97 this.add(ROL.class, false, true);
98 this.add(DB1.class, false, true);
99 this.add(OBX.class, false, true);
100 this.add(PDA.class, false, false);
101 } catch(HL7Exception e) {
102 log.error("Unexpected error creating ADT_A02 - this is probably a bug in the source code generator.", e);
103 }
104 }
105
106
107 /**
108 * Returns "2.8.1"
109 */
110 public String getVersion() {
111 return "2.8.1";
112 }
113
114
115
116
117 /**
118 * <p>
119 * Returns
120 * MSH (Message Header) - creates it if necessary
121 * </p>
122 *
123 *
124 */
125 public MSH getMSH() {
126 return getTyped("MSH", MSH.class);
127 }
128
129
130
131
132
133 /**
134 * <p>
135 * Returns
136 * the first repetition of
137 * SFT (Software Segment) - creates it if necessary
138 * </p>
139 *
140 *
141 */
142 public SFT getSFT() {
143 return getTyped("SFT", SFT.class);
144 }
145
146
147 /**
148 * <p>
149 * Returns a specific repetition of
150 * SFT (Software Segment) - creates it if necessary
151 * </p>
152 *
153 *
154 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
155 * @throws HL7Exception if the repetition requested is more than one
156 * greater than the number of existing repetitions.
157 */
158 public SFT getSFT(int rep) {
159 return getTyped("SFT", rep, SFT.class);
160 }
161
162 /**
163 * <p>
164 * Returns the number of existing repetitions of SFT
165 * </p>
166 *
167 */
168 public int getSFTReps() {
169 return getReps("SFT");
170 }
171
172 /**
173 * <p>
174 * Returns a non-modifiable List containing all current existing repetitions of SFT.
175 * <p>
176 * <p>
177 * Note that unlike {@link #getSFT()}, this method will not create any reps
178 * if none are already present, so an empty list may be returned.
179 * </p>
180 *
181 */
182 public java.util.List<SFT> getSFTAll() throws HL7Exception {
183 return getAllAsList("SFT", SFT.class);
184 }
185
186 /**
187 * <p>
188 * Inserts a specific repetition of SFT (Software Segment)
189 * </p>
190 *
191 *
192 * @see AbstractGroup#insertRepetition(Structure, int)
193 */
194 public void insertSFT(SFT structure, int rep) throws HL7Exception {
195 super.insertRepetition( "SFT", structure, rep);
196 }
197
198
199 /**
200 * <p>
201 * Inserts a specific repetition of SFT (Software Segment)
202 * </p>
203 *
204 *
205 * @see AbstractGroup#insertRepetition(Structure, int)
206 */
207 public SFT insertSFT(int rep) throws HL7Exception {
208 return (SFT)super.insertRepetition("SFT", rep);
209 }
210
211
212 /**
213 * <p>
214 * Removes a specific repetition of SFT (Software Segment)
215 * </p>
216 *
217 *
218 * @see AbstractGroup#removeRepetition(String, int)
219 */
220 public SFT removeSFT(int rep) throws HL7Exception {
221 return (SFT)super.removeRepetition("SFT", rep);
222 }
223
224
225
226
227 /**
228 * <p>
229 * Returns
230 * UAC (User Authentication Credential Segment) - creates it if necessary
231 * </p>
232 *
233 *
234 */
235 public UAC getUAC() {
236 return getTyped("UAC", UAC.class);
237 }
238
239
240
241
242
243 /**
244 * <p>
245 * Returns
246 * EVN (Event Type) - creates it if necessary
247 * </p>
248 *
249 *
250 */
251 public EVN getEVN() {
252 return getTyped("EVN", EVN.class);
253 }
254
255
256
257
258
259 /**
260 * <p>
261 * Returns
262 * PID (Patient Identification) - creates it if necessary
263 * </p>
264 *
265 *
266 */
267 public PID getPID() {
268 return getTyped("PID", PID.class);
269 }
270
271
272
273
274
275 /**
276 * <p>
277 * Returns
278 * PD1 (Patient Additional Demographic) - creates it if necessary
279 * </p>
280 *
281 *
282 */
283 public PD1 getPD1() {
284 return getTyped("PD1", PD1.class);
285 }
286
287
288
289
290
291 /**
292 * <p>
293 * Returns
294 * the first repetition of
295 * ARV (Access Restriction) - creates it if necessary
296 * </p>
297 *
298 *
299 */
300 public ARV getARV() {
301 return getTyped("ARV", ARV.class);
302 }
303
304
305 /**
306 * <p>
307 * Returns a specific repetition of
308 * ARV (Access Restriction) - creates it if necessary
309 * </p>
310 *
311 *
312 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
313 * @throws HL7Exception if the repetition requested is more than one
314 * greater than the number of existing repetitions.
315 */
316 public ARV getARV(int rep) {
317 return getTyped("ARV", rep, ARV.class);
318 }
319
320 /**
321 * <p>
322 * Returns the number of existing repetitions of ARV
323 * </p>
324 *
325 */
326 public int getARVReps() {
327 return getReps("ARV");
328 }
329
330 /**
331 * <p>
332 * Returns a non-modifiable List containing all current existing repetitions of ARV.
333 * <p>
334 * <p>
335 * Note that unlike {@link #getARV()}, this method will not create any reps
336 * if none are already present, so an empty list may be returned.
337 * </p>
338 *
339 */
340 public java.util.List<ARV> getARVAll() throws HL7Exception {
341 return getAllAsList("ARV", ARV.class);
342 }
343
344 /**
345 * <p>
346 * Inserts a specific repetition of ARV (Access Restriction)
347 * </p>
348 *
349 *
350 * @see AbstractGroup#insertRepetition(Structure, int)
351 */
352 public void insertARV(ARV structure, int rep) throws HL7Exception {
353 super.insertRepetition( "ARV", structure, rep);
354 }
355
356
357 /**
358 * <p>
359 * Inserts a specific repetition of ARV (Access Restriction)
360 * </p>
361 *
362 *
363 * @see AbstractGroup#insertRepetition(Structure, int)
364 */
365 public ARV insertARV(int rep) throws HL7Exception {
366 return (ARV)super.insertRepetition("ARV", rep);
367 }
368
369
370 /**
371 * <p>
372 * Removes a specific repetition of ARV (Access Restriction)
373 * </p>
374 *
375 *
376 * @see AbstractGroup#removeRepetition(String, int)
377 */
378 public ARV removeARV(int rep) throws HL7Exception {
379 return (ARV)super.removeRepetition("ARV", rep);
380 }
381
382
383
384
385 /**
386 * <p>
387 * Returns
388 * the first repetition of
389 * ROL (Role) - creates it if necessary
390 * </p>
391 *
392 *
393 */
394 public ROL getROL() {
395 return getTyped("ROL", ROL.class);
396 }
397
398
399 /**
400 * <p>
401 * Returns a specific repetition of
402 * ROL (Role) - creates it if necessary
403 * </p>
404 *
405 *
406 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
407 * @throws HL7Exception if the repetition requested is more than one
408 * greater than the number of existing repetitions.
409 */
410 public ROL getROL(int rep) {
411 return getTyped("ROL", rep, ROL.class);
412 }
413
414 /**
415 * <p>
416 * Returns the number of existing repetitions of ROL
417 * </p>
418 *
419 */
420 public int getROLReps() {
421 return getReps("ROL");
422 }
423
424 /**
425 * <p>
426 * Returns a non-modifiable List containing all current existing repetitions of ROL.
427 * <p>
428 * <p>
429 * Note that unlike {@link #getROL()}, this method will not create any reps
430 * if none are already present, so an empty list may be returned.
431 * </p>
432 *
433 */
434 public java.util.List<ROL> getROLAll() throws HL7Exception {
435 return getAllAsList("ROL", ROL.class);
436 }
437
438 /**
439 * <p>
440 * Inserts a specific repetition of ROL (Role)
441 * </p>
442 *
443 *
444 * @see AbstractGroup#insertRepetition(Structure, int)
445 */
446 public void insertROL(ROL structure, int rep) throws HL7Exception {
447 super.insertRepetition( "ROL", structure, rep);
448 }
449
450
451 /**
452 * <p>
453 * Inserts a specific repetition of ROL (Role)
454 * </p>
455 *
456 *
457 * @see AbstractGroup#insertRepetition(Structure, int)
458 */
459 public ROL insertROL(int rep) throws HL7Exception {
460 return (ROL)super.insertRepetition("ROL", rep);
461 }
462
463
464 /**
465 * <p>
466 * Removes a specific repetition of ROL (Role)
467 * </p>
468 *
469 *
470 * @see AbstractGroup#removeRepetition(String, int)
471 */
472 public ROL removeROL(int rep) throws HL7Exception {
473 return (ROL)super.removeRepetition("ROL", rep);
474 }
475
476
477
478
479 /**
480 * <p>
481 * Returns
482 * PV1 (Patient Visit) - creates it if necessary
483 * </p>
484 *
485 *
486 */
487 public PV1 getPV1() {
488 return getTyped("PV1", PV1.class);
489 }
490
491
492
493
494
495 /**
496 * <p>
497 * Returns
498 * PV2 (Patient Visit - Additional Information) - creates it if necessary
499 * </p>
500 *
501 *
502 */
503 public PV2 getPV2() {
504 return getTyped("PV2", PV2.class);
505 }
506
507
508
509
510
511 /**
512 * <p>
513 * Returns
514 * the first repetition of
515 * ARV2 (Access Restriction) - creates it if necessary
516 * </p>
517 *
518 *
519 */
520 public ARV getARV2() {
521 return getTyped("ARV2", ARV.class);
522 }
523
524
525 /**
526 * <p>
527 * Returns a specific repetition of
528 * ARV2 (Access Restriction) - creates it if necessary
529 * </p>
530 *
531 *
532 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
533 * @throws HL7Exception if the repetition requested is more than one
534 * greater than the number of existing repetitions.
535 */
536 public ARV getARV2(int rep) {
537 return getTyped("ARV2", rep, ARV.class);
538 }
539
540 /**
541 * <p>
542 * Returns the number of existing repetitions of ARV2
543 * </p>
544 *
545 */
546 public int getARV2Reps() {
547 return getReps("ARV2");
548 }
549
550 /**
551 * <p>
552 * Returns a non-modifiable List containing all current existing repetitions of ARV2.
553 * <p>
554 * <p>
555 * Note that unlike {@link #getARV2()}, this method will not create any reps
556 * if none are already present, so an empty list may be returned.
557 * </p>
558 *
559 */
560 public java.util.List<ARV> getARV2All() throws HL7Exception {
561 return getAllAsList("ARV2", ARV.class);
562 }
563
564 /**
565 * <p>
566 * Inserts a specific repetition of ARV2 (Access Restriction)
567 * </p>
568 *
569 *
570 * @see AbstractGroup#insertRepetition(Structure, int)
571 */
572 public void insertARV2(ARV structure, int rep) throws HL7Exception {
573 super.insertRepetition( "ARV2", structure, rep);
574 }
575
576
577 /**
578 * <p>
579 * Inserts a specific repetition of ARV2 (Access Restriction)
580 * </p>
581 *
582 *
583 * @see AbstractGroup#insertRepetition(Structure, int)
584 */
585 public ARV insertARV2(int rep) throws HL7Exception {
586 return (ARV)super.insertRepetition("ARV2", rep);
587 }
588
589
590 /**
591 * <p>
592 * Removes a specific repetition of ARV2 (Access Restriction)
593 * </p>
594 *
595 *
596 * @see AbstractGroup#removeRepetition(String, int)
597 */
598 public ARV removeARV2(int rep) throws HL7Exception {
599 return (ARV)super.removeRepetition("ARV2", rep);
600 }
601
602
603
604
605 /**
606 * <p>
607 * Returns
608 * the first repetition of
609 * ROL2 (Role) - creates it if necessary
610 * </p>
611 *
612 *
613 */
614 public ROL getROL2() {
615 return getTyped("ROL2", ROL.class);
616 }
617
618
619 /**
620 * <p>
621 * Returns a specific repetition of
622 * ROL2 (Role) - creates it if necessary
623 * </p>
624 *
625 *
626 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
627 * @throws HL7Exception if the repetition requested is more than one
628 * greater than the number of existing repetitions.
629 */
630 public ROL getROL2(int rep) {
631 return getTyped("ROL2", rep, ROL.class);
632 }
633
634 /**
635 * <p>
636 * Returns the number of existing repetitions of ROL2
637 * </p>
638 *
639 */
640 public int getROL2Reps() {
641 return getReps("ROL2");
642 }
643
644 /**
645 * <p>
646 * Returns a non-modifiable List containing all current existing repetitions of ROL2.
647 * <p>
648 * <p>
649 * Note that unlike {@link #getROL2()}, this method will not create any reps
650 * if none are already present, so an empty list may be returned.
651 * </p>
652 *
653 */
654 public java.util.List<ROL> getROL2All() throws HL7Exception {
655 return getAllAsList("ROL2", ROL.class);
656 }
657
658 /**
659 * <p>
660 * Inserts a specific repetition of ROL2 (Role)
661 * </p>
662 *
663 *
664 * @see AbstractGroup#insertRepetition(Structure, int)
665 */
666 public void insertROL2(ROL structure, int rep) throws HL7Exception {
667 super.insertRepetition( "ROL2", structure, rep);
668 }
669
670
671 /**
672 * <p>
673 * Inserts a specific repetition of ROL2 (Role)
674 * </p>
675 *
676 *
677 * @see AbstractGroup#insertRepetition(Structure, int)
678 */
679 public ROL insertROL2(int rep) throws HL7Exception {
680 return (ROL)super.insertRepetition("ROL2", rep);
681 }
682
683
684 /**
685 * <p>
686 * Removes a specific repetition of ROL2 (Role)
687 * </p>
688 *
689 *
690 * @see AbstractGroup#removeRepetition(String, int)
691 */
692 public ROL removeROL2(int rep) throws HL7Exception {
693 return (ROL)super.removeRepetition("ROL2", rep);
694 }
695
696
697
698
699 /**
700 * <p>
701 * Returns
702 * the first repetition of
703 * DB1 (Disability) - creates it if necessary
704 * </p>
705 *
706 *
707 */
708 public DB1 getDB1() {
709 return getTyped("DB1", DB1.class);
710 }
711
712
713 /**
714 * <p>
715 * Returns a specific repetition of
716 * DB1 (Disability) - creates it if necessary
717 * </p>
718 *
719 *
720 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
721 * @throws HL7Exception if the repetition requested is more than one
722 * greater than the number of existing repetitions.
723 */
724 public DB1 getDB1(int rep) {
725 return getTyped("DB1", rep, DB1.class);
726 }
727
728 /**
729 * <p>
730 * Returns the number of existing repetitions of DB1
731 * </p>
732 *
733 */
734 public int getDB1Reps() {
735 return getReps("DB1");
736 }
737
738 /**
739 * <p>
740 * Returns a non-modifiable List containing all current existing repetitions of DB1.
741 * <p>
742 * <p>
743 * Note that unlike {@link #getDB1()}, this method will not create any reps
744 * if none are already present, so an empty list may be returned.
745 * </p>
746 *
747 */
748 public java.util.List<DB1> getDB1All() throws HL7Exception {
749 return getAllAsList("DB1", DB1.class);
750 }
751
752 /**
753 * <p>
754 * Inserts a specific repetition of DB1 (Disability)
755 * </p>
756 *
757 *
758 * @see AbstractGroup#insertRepetition(Structure, int)
759 */
760 public void insertDB1(DB1 structure, int rep) throws HL7Exception {
761 super.insertRepetition( "DB1", structure, rep);
762 }
763
764
765 /**
766 * <p>
767 * Inserts a specific repetition of DB1 (Disability)
768 * </p>
769 *
770 *
771 * @see AbstractGroup#insertRepetition(Structure, int)
772 */
773 public DB1 insertDB1(int rep) throws HL7Exception {
774 return (DB1)super.insertRepetition("DB1", rep);
775 }
776
777
778 /**
779 * <p>
780 * Removes a specific repetition of DB1 (Disability)
781 * </p>
782 *
783 *
784 * @see AbstractGroup#removeRepetition(String, int)
785 */
786 public DB1 removeDB1(int rep) throws HL7Exception {
787 return (DB1)super.removeRepetition("DB1", rep);
788 }
789
790
791
792
793 /**
794 * <p>
795 * Returns
796 * the first repetition of
797 * OBX (Observation/Result) - creates it if necessary
798 * </p>
799 *
800 *
801 */
802 public OBX getOBX() {
803 return getTyped("OBX", OBX.class);
804 }
805
806
807 /**
808 * <p>
809 * Returns a specific repetition of
810 * OBX (Observation/Result) - creates it if necessary
811 * </p>
812 *
813 *
814 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
815 * @throws HL7Exception if the repetition requested is more than one
816 * greater than the number of existing repetitions.
817 */
818 public OBX getOBX(int rep) {
819 return getTyped("OBX", rep, OBX.class);
820 }
821
822 /**
823 * <p>
824 * Returns the number of existing repetitions of OBX
825 * </p>
826 *
827 */
828 public int getOBXReps() {
829 return getReps("OBX");
830 }
831
832 /**
833 * <p>
834 * Returns a non-modifiable List containing all current existing repetitions of OBX.
835 * <p>
836 * <p>
837 * Note that unlike {@link #getOBX()}, this method will not create any reps
838 * if none are already present, so an empty list may be returned.
839 * </p>
840 *
841 */
842 public java.util.List<OBX> getOBXAll() throws HL7Exception {
843 return getAllAsList("OBX", OBX.class);
844 }
845
846 /**
847 * <p>
848 * Inserts a specific repetition of OBX (Observation/Result)
849 * </p>
850 *
851 *
852 * @see AbstractGroup#insertRepetition(Structure, int)
853 */
854 public void insertOBX(OBX structure, int rep) throws HL7Exception {
855 super.insertRepetition( "OBX", structure, rep);
856 }
857
858
859 /**
860 * <p>
861 * Inserts a specific repetition of OBX (Observation/Result)
862 * </p>
863 *
864 *
865 * @see AbstractGroup#insertRepetition(Structure, int)
866 */
867 public OBX insertOBX(int rep) throws HL7Exception {
868 return (OBX)super.insertRepetition("OBX", rep);
869 }
870
871
872 /**
873 * <p>
874 * Removes a specific repetition of OBX (Observation/Result)
875 * </p>
876 *
877 *
878 * @see AbstractGroup#removeRepetition(String, int)
879 */
880 public OBX removeOBX(int rep) throws HL7Exception {
881 return (OBX)super.removeRepetition("OBX", rep);
882 }
883
884
885
886
887 /**
888 * <p>
889 * Returns
890 * PDA (Patient Death and Autopsy) - creates it if necessary
891 * </p>
892 *
893 *
894 */
895 public PDA getPDA() {
896 return getTyped("PDA", PDA.class);
897 }
898
899
900
901
902 }
903