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.v251.message;
35
36 import ca.uhn.hl7v2.model.v251.group.*;
37 import ca.uhn.hl7v2.model.v251.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_A17 message structure (see chapter 3.3.17). 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: EVN (Event Type) <b> </b> </li>
52 * <li>4: PID (Patient Identification) <b> </b> </li>
53 * <li>5: PD1 (Patient Additional Demographic) <b>optional </b> </li>
54 * <li>6: PV1 (Patient Visit) <b> </b> </li>
55 * <li>7: PV2 (Patient Visit - Additional Information) <b>optional </b> </li>
56 * <li>8: DB1 (Disability) <b>optional repeating</b> </li>
57 * <li>9: OBX (Observation/Result) <b>optional repeating</b> </li>
58 * <li>10: PID (Patient Identification) <b> </b> </li>
59 * <li>11: PD1 (Patient Additional Demographic) <b>optional </b> </li>
60 * <li>12: PV1 (Patient Visit) <b> </b> </li>
61 * <li>13: PV2 (Patient Visit - Additional Information) <b>optional </b> </li>
62 * <li>14: DB1 (Disability) <b>optional repeating</b> </li>
63 * <li>15: OBX (Observation/Result) <b>optional repeating</b> </li>
64 * </ul>
65 */
66 //@SuppressWarnings("unused")
67 public class ADT_A17 extends AbstractMessage {
68
69 /**
70 * Creates a new ADT_A17 message with DefaultModelClassFactory.
71 */
72 public ADT_A17() {
73 this(new DefaultModelClassFactory());
74 }
75
76 /**
77 * Creates a new ADT_A17 message with custom ModelClassFactory.
78 */
79 public ADT_A17(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(EVN.class, true, false);
89 this.add(PID.class, true, false);
90 this.add(PD1.class, false, false);
91 this.add(PV1.class, true, false);
92 this.add(PV2.class, false, false);
93 this.add(DB1.class, false, true);
94 this.add(OBX.class, false, true);
95 this.add(PID.class, true, false);
96 this.add(PD1.class, false, false);
97 this.add(PV1.class, true, false);
98 this.add(PV2.class, false, false);
99 this.add(DB1.class, false, true);
100 this.add(OBX.class, false, true);
101 } catch(HL7Exception e) {
102 log.error("Unexpected error creating ADT_A17 - this is probably a bug in the source code generator.", e);
103 }
104 }
105
106
107 /**
108 * Returns "2.5.1"
109 */
110 public String getVersion() {
111 return "2.5.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 * EVN (Event Type) - creates it if necessary
231 * </p>
232 *
233 *
234 */
235 public EVN getEVN() {
236 return getTyped("EVN", EVN.class);
237 }
238
239
240
241
242
243 /**
244 * <p>
245 * Returns
246 * PID (Patient Identification) - creates it if necessary
247 * </p>
248 *
249 *
250 */
251 public PID getPID() {
252 return getTyped("PID", PID.class);
253 }
254
255
256
257
258
259 /**
260 * <p>
261 * Returns
262 * PD1 (Patient Additional Demographic) - creates it if necessary
263 * </p>
264 *
265 *
266 */
267 public PD1 getPD1() {
268 return getTyped("PD1", PD1.class);
269 }
270
271
272
273
274
275 /**
276 * <p>
277 * Returns
278 * PV1 (Patient Visit) - creates it if necessary
279 * </p>
280 *
281 *
282 */
283 public PV1 getPV1() {
284 return getTyped("PV1", PV1.class);
285 }
286
287
288
289
290
291 /**
292 * <p>
293 * Returns
294 * PV2 (Patient Visit - Additional Information) - creates it if necessary
295 * </p>
296 *
297 *
298 */
299 public PV2 getPV2() {
300 return getTyped("PV2", PV2.class);
301 }
302
303
304
305
306
307 /**
308 * <p>
309 * Returns
310 * the first repetition of
311 * DB1 (Disability) - creates it if necessary
312 * </p>
313 *
314 *
315 */
316 public DB1 getDB1() {
317 return getTyped("DB1", DB1.class);
318 }
319
320
321 /**
322 * <p>
323 * Returns a specific repetition of
324 * DB1 (Disability) - creates it if necessary
325 * </p>
326 *
327 *
328 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
329 * @throws HL7Exception if the repetition requested is more than one
330 * greater than the number of existing repetitions.
331 */
332 public DB1 getDB1(int rep) {
333 return getTyped("DB1", rep, DB1.class);
334 }
335
336 /**
337 * <p>
338 * Returns the number of existing repetitions of DB1
339 * </p>
340 *
341 */
342 public int getDB1Reps() {
343 return getReps("DB1");
344 }
345
346 /**
347 * <p>
348 * Returns a non-modifiable List containing all current existing repetitions of DB1.
349 * <p>
350 * <p>
351 * Note that unlike {@link #getDB1()}, this method will not create any reps
352 * if none are already present, so an empty list may be returned.
353 * </p>
354 *
355 */
356 public java.util.List<DB1> getDB1All() throws HL7Exception {
357 return getAllAsList("DB1", DB1.class);
358 }
359
360 /**
361 * <p>
362 * Inserts a specific repetition of DB1 (Disability)
363 * </p>
364 *
365 *
366 * @see AbstractGroup#insertRepetition(Structure, int)
367 */
368 public void insertDB1(DB1 structure, int rep) throws HL7Exception {
369 super.insertRepetition( "DB1", structure, rep);
370 }
371
372
373 /**
374 * <p>
375 * Inserts a specific repetition of DB1 (Disability)
376 * </p>
377 *
378 *
379 * @see AbstractGroup#insertRepetition(Structure, int)
380 */
381 public DB1 insertDB1(int rep) throws HL7Exception {
382 return (DB1)super.insertRepetition("DB1", rep);
383 }
384
385
386 /**
387 * <p>
388 * Removes a specific repetition of DB1 (Disability)
389 * </p>
390 *
391 *
392 * @see AbstractGroup#removeRepetition(String, int)
393 */
394 public DB1 removeDB1(int rep) throws HL7Exception {
395 return (DB1)super.removeRepetition("DB1", rep);
396 }
397
398
399
400
401 /**
402 * <p>
403 * Returns
404 * the first repetition of
405 * OBX (Observation/Result) - creates it if necessary
406 * </p>
407 *
408 *
409 */
410 public OBX getOBX() {
411 return getTyped("OBX", OBX.class);
412 }
413
414
415 /**
416 * <p>
417 * Returns a specific repetition of
418 * OBX (Observation/Result) - creates it if necessary
419 * </p>
420 *
421 *
422 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
423 * @throws HL7Exception if the repetition requested is more than one
424 * greater than the number of existing repetitions.
425 */
426 public OBX getOBX(int rep) {
427 return getTyped("OBX", rep, OBX.class);
428 }
429
430 /**
431 * <p>
432 * Returns the number of existing repetitions of OBX
433 * </p>
434 *
435 */
436 public int getOBXReps() {
437 return getReps("OBX");
438 }
439
440 /**
441 * <p>
442 * Returns a non-modifiable List containing all current existing repetitions of OBX.
443 * <p>
444 * <p>
445 * Note that unlike {@link #getOBX()}, this method will not create any reps
446 * if none are already present, so an empty list may be returned.
447 * </p>
448 *
449 */
450 public java.util.List<OBX> getOBXAll() throws HL7Exception {
451 return getAllAsList("OBX", OBX.class);
452 }
453
454 /**
455 * <p>
456 * Inserts a specific repetition of OBX (Observation/Result)
457 * </p>
458 *
459 *
460 * @see AbstractGroup#insertRepetition(Structure, int)
461 */
462 public void insertOBX(OBX structure, int rep) throws HL7Exception {
463 super.insertRepetition( "OBX", structure, rep);
464 }
465
466
467 /**
468 * <p>
469 * Inserts a specific repetition of OBX (Observation/Result)
470 * </p>
471 *
472 *
473 * @see AbstractGroup#insertRepetition(Structure, int)
474 */
475 public OBX insertOBX(int rep) throws HL7Exception {
476 return (OBX)super.insertRepetition("OBX", rep);
477 }
478
479
480 /**
481 * <p>
482 * Removes a specific repetition of OBX (Observation/Result)
483 * </p>
484 *
485 *
486 * @see AbstractGroup#removeRepetition(String, int)
487 */
488 public OBX removeOBX(int rep) throws HL7Exception {
489 return (OBX)super.removeRepetition("OBX", rep);
490 }
491
492
493
494
495 /**
496 * <p>
497 * Returns
498 * PID2 (Patient Identification) - creates it if necessary
499 * </p>
500 *
501 *
502 */
503 public PID getPID2() {
504 return getTyped("PID2", PID.class);
505 }
506
507
508
509
510
511 /**
512 * <p>
513 * Returns
514 * PD12 (Patient Additional Demographic) - creates it if necessary
515 * </p>
516 *
517 *
518 */
519 public PD1 getPD12() {
520 return getTyped("PD12", PD1.class);
521 }
522
523
524
525
526
527 /**
528 * <p>
529 * Returns
530 * PV12 (Patient Visit) - creates it if necessary
531 * </p>
532 *
533 *
534 */
535 public PV1 getPV12() {
536 return getTyped("PV12", PV1.class);
537 }
538
539
540
541
542
543 /**
544 * <p>
545 * Returns
546 * PV22 (Patient Visit - Additional Information) - creates it if necessary
547 * </p>
548 *
549 *
550 */
551 public PV2 getPV22() {
552 return getTyped("PV22", PV2.class);
553 }
554
555
556
557
558
559 /**
560 * <p>
561 * Returns
562 * the first repetition of
563 * DB12 (Disability) - creates it if necessary
564 * </p>
565 *
566 *
567 */
568 public DB1 getDB12() {
569 return getTyped("DB12", DB1.class);
570 }
571
572
573 /**
574 * <p>
575 * Returns a specific repetition of
576 * DB12 (Disability) - creates it if necessary
577 * </p>
578 *
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 DB1 getDB12(int rep) {
585 return getTyped("DB12", rep, DB1.class);
586 }
587
588 /**
589 * <p>
590 * Returns the number of existing repetitions of DB12
591 * </p>
592 *
593 */
594 public int getDB12Reps() {
595 return getReps("DB12");
596 }
597
598 /**
599 * <p>
600 * Returns a non-modifiable List containing all current existing repetitions of DB12.
601 * <p>
602 * <p>
603 * Note that unlike {@link #getDB12()}, this method will not create any reps
604 * if none are already present, so an empty list may be returned.
605 * </p>
606 *
607 */
608 public java.util.List<DB1> getDB12All() throws HL7Exception {
609 return getAllAsList("DB12", DB1.class);
610 }
611
612 /**
613 * <p>
614 * Inserts a specific repetition of DB12 (Disability)
615 * </p>
616 *
617 *
618 * @see AbstractGroup#insertRepetition(Structure, int)
619 */
620 public void insertDB12(DB1 structure, int rep) throws HL7Exception {
621 super.insertRepetition( "DB12", structure, rep);
622 }
623
624
625 /**
626 * <p>
627 * Inserts a specific repetition of DB12 (Disability)
628 * </p>
629 *
630 *
631 * @see AbstractGroup#insertRepetition(Structure, int)
632 */
633 public DB1 insertDB12(int rep) throws HL7Exception {
634 return (DB1)super.insertRepetition("DB12", rep);
635 }
636
637
638 /**
639 * <p>
640 * Removes a specific repetition of DB12 (Disability)
641 * </p>
642 *
643 *
644 * @see AbstractGroup#removeRepetition(String, int)
645 */
646 public DB1 removeDB12(int rep) throws HL7Exception {
647 return (DB1)super.removeRepetition("DB12", rep);
648 }
649
650
651
652
653 /**
654 * <p>
655 * Returns
656 * the first repetition of
657 * OBX2 (Observation/Result) - creates it if necessary
658 * </p>
659 *
660 *
661 */
662 public OBX getOBX2() {
663 return getTyped("OBX2", OBX.class);
664 }
665
666
667 /**
668 * <p>
669 * Returns a specific repetition of
670 * OBX2 (Observation/Result) - creates it if necessary
671 * </p>
672 *
673 *
674 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
675 * @throws HL7Exception if the repetition requested is more than one
676 * greater than the number of existing repetitions.
677 */
678 public OBX getOBX2(int rep) {
679 return getTyped("OBX2", rep, OBX.class);
680 }
681
682 /**
683 * <p>
684 * Returns the number of existing repetitions of OBX2
685 * </p>
686 *
687 */
688 public int getOBX2Reps() {
689 return getReps("OBX2");
690 }
691
692 /**
693 * <p>
694 * Returns a non-modifiable List containing all current existing repetitions of OBX2.
695 * <p>
696 * <p>
697 * Note that unlike {@link #getOBX2()}, this method will not create any reps
698 * if none are already present, so an empty list may be returned.
699 * </p>
700 *
701 */
702 public java.util.List<OBX> getOBX2All() throws HL7Exception {
703 return getAllAsList("OBX2", OBX.class);
704 }
705
706 /**
707 * <p>
708 * Inserts a specific repetition of OBX2 (Observation/Result)
709 * </p>
710 *
711 *
712 * @see AbstractGroup#insertRepetition(Structure, int)
713 */
714 public void insertOBX2(OBX structure, int rep) throws HL7Exception {
715 super.insertRepetition( "OBX2", structure, rep);
716 }
717
718
719 /**
720 * <p>
721 * Inserts a specific repetition of OBX2 (Observation/Result)
722 * </p>
723 *
724 *
725 * @see AbstractGroup#insertRepetition(Structure, int)
726 */
727 public OBX insertOBX2(int rep) throws HL7Exception {
728 return (OBX)super.insertRepetition("OBX2", rep);
729 }
730
731
732 /**
733 * <p>
734 * Removes a specific repetition of OBX2 (Observation/Result)
735 * </p>
736 *
737 *
738 * @see AbstractGroup#removeRepetition(String, int)
739 */
740 public OBX removeOBX2(int rep) throws HL7Exception {
741 return (OBX)super.removeRepetition("OBX2", rep);
742 }
743
744
745
746 }
747