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
008 package ca.uhn.hl7v2.model.v231.message;
009
010 import ca.uhn.hl7v2.model.v231.group.*;
011 import ca.uhn.hl7v2.model.v231.segment.*;
012
013 import ca.uhn.log.HapiLogFactory;
014 import ca.uhn.hl7v2.HL7Exception;
015 import ca.uhn.hl7v2.parser.ModelClassFactory;
016 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
017 import ca.uhn.hl7v2.model.AbstractMessage;
018
019 /**
020 * <p>Represents a DFT_P03 message structure (see chapter ?). This structure contains the
021 * following elements: </p>
022 * <ul>
023 * <li>1: MSH (MSH - message header segment) <b> </b></li>
024 * <li>2: EVN (EVN - event type segment) <b> </b></li>
025 * <li>3: PID (PID - patient identification segment) <b> </b></li>
026 * <li>4: PD1 (PD1 - patient additional demographic segment) <b>optional </b></li>
027 * <li>5: PV1 (PV1 - patient visit segment-) <b>optional </b></li>
028 * <li>6: PV2 (PV2 - patient visit - additional information segment) <b>optional </b></li>
029 * <li>7: DB1 (DB1 - Disability segment) <b>optional repeating</b></li>
030 * <li>8: OBX (OBX - observation/result segment) <b>optional repeating</b></li>
031 * <li>9: DFT_P03_FT1PR1ROL (a Group object) <b> repeating</b></li>
032 * <li>10: DG1 (DG1 - diagnosis segment) <b>optional repeating</b></li>
033 * <li>11: DRG (DRG - diagnosis related group segment) <b>optional </b></li>
034 * <li>12: GT1 (GT1 - guarantor segment) <b>optional repeating</b></li>
035 * <li>13: DFT_P03_IN1IN2IN3 (a Group object) <b>optional repeating</b></li>
036 * <li>14: ACC (ACC - accident segment) <b>optional </b></li>
037 * </ul>
038 */
039 public class DFT_P03 extends AbstractMessage {
040
041 /**
042 * Creates a new DFT_P03 message with DefaultModelClassFactory.
043 */
044 public DFT_P03() {
045 this(new DefaultModelClassFactory());
046 }
047
048 /**
049 * Creates a new DFT_P03 message with custom ModelClassFactory.
050 */
051 public DFT_P03(ModelClassFactory factory) {
052 super(factory);
053 init(factory);
054 }
055
056 private void init(ModelClassFactory factory) {
057 try {
058 this.add(MSH.class, true, false);
059 this.add(EVN.class, true, false);
060 this.add(PID.class, true, false);
061 this.add(PD1.class, false, false);
062 this.add(PV1.class, false, false);
063 this.add(PV2.class, false, false);
064 this.add(DB1.class, false, true);
065 this.add(OBX.class, false, true);
066 this.add(DFT_P03_FT1PR1ROL.class, true, true);
067 this.add(DG1.class, false, true);
068 this.add(DRG.class, false, false);
069 this.add(GT1.class, false, true);
070 this.add(DFT_P03_IN1IN2IN3.class, false, true);
071 this.add(ACC.class, false, false);
072 } catch(HL7Exception e) {
073 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating DFT_P03 - this is probably a bug in the source code generator.", e);
074 }
075 }
076
077 /**
078 * Returns "2.3.1"
079 */
080 public String getVersion() {
081 return "2.3.1";
082 }
083
084
085
086 /**
087 * Returns
088 * MSH (MSH - message header segment) - creates it if necessary
089 */
090 public MSH getMSH() {
091 MSH ret = null;
092 try {
093 ret = (MSH)this.get("MSH");
094 } catch(HL7Exception e) {
095 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
096 throw new RuntimeException(e);
097 }
098 return ret;
099 }
100
101
102
103
104 /**
105 * Returns
106 * EVN (EVN - event type segment) - creates it if necessary
107 */
108 public EVN getEVN() {
109 EVN ret = null;
110 try {
111 ret = (EVN)this.get("EVN");
112 } catch(HL7Exception e) {
113 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
114 throw new RuntimeException(e);
115 }
116 return ret;
117 }
118
119
120
121
122 /**
123 * Returns
124 * PID (PID - patient identification segment) - creates it if necessary
125 */
126 public PID getPID() {
127 PID ret = null;
128 try {
129 ret = (PID)this.get("PID");
130 } catch(HL7Exception e) {
131 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
132 throw new RuntimeException(e);
133 }
134 return ret;
135 }
136
137
138
139
140 /**
141 * Returns
142 * PD1 (PD1 - patient additional demographic segment) - creates it if necessary
143 */
144 public PD1 getPD1() {
145 PD1 ret = null;
146 try {
147 ret = (PD1)this.get("PD1");
148 } catch(HL7Exception e) {
149 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
150 throw new RuntimeException(e);
151 }
152 return ret;
153 }
154
155
156
157
158 /**
159 * Returns
160 * PV1 (PV1 - patient visit segment-) - creates it if necessary
161 */
162 public PV1 getPV1() {
163 PV1 ret = null;
164 try {
165 ret = (PV1)this.get("PV1");
166 } catch(HL7Exception e) {
167 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
168 throw new RuntimeException(e);
169 }
170 return ret;
171 }
172
173
174
175
176 /**
177 * Returns
178 * PV2 (PV2 - patient visit - additional information segment) - creates it if necessary
179 */
180 public PV2 getPV2() {
181 PV2 ret = null;
182 try {
183 ret = (PV2)this.get("PV2");
184 } catch(HL7Exception e) {
185 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
186 throw new RuntimeException(e);
187 }
188 return ret;
189 }
190
191
192
193
194 /**
195 * Returns
196 * the first repetition of
197 * DB1 (DB1 - Disability segment) - creates it if necessary
198 */
199 public DB1 getDB1() {
200 DB1 ret = null;
201 try {
202 ret = (DB1)this.get("DB1");
203 } catch(HL7Exception e) {
204 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
205 throw new RuntimeException(e);
206 }
207 return ret;
208 }
209
210
211 /**
212 * Returns a specific repetition of
213 * DB1 (DB1 - Disability segment) - creates it if necessary
214 *
215 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
216 * @throws HL7Exception if the repetition requested is more than one
217 * greater than the number of existing repetitions.
218 */
219 public DB1 getDB1(int rep) {
220 DB1 ret = null;
221 try {
222 ret = (DB1)this.get("DB1", rep);
223 } catch(HL7Exception e) {
224 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
225 throw new RuntimeException(e);
226 }
227 return ret;
228 }
229
230 /**
231 * Returns the number of existing repetitions of DB1
232 */
233 public int getDB1Reps() {
234 int reps = -1;
235 try {
236 reps = this.getAll("DB1").length;
237 } catch (HL7Exception e) {
238 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
239 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
240 throw new RuntimeException(message);
241 }
242 return reps;
243 }
244
245 /**
246 * Inserts a specific repetition of DB1 (DB1 - Disability segment)
247 * @see AbstractGroup\#insertRepetition(Structure, int)
248 */
249 public void insertDB1(DB1 structure, int rep) throws HL7Exception {
250 super.insertRepetition( "DB1", structure, rep);
251 }
252
253
254 /**
255 * Inserts a specific repetition of DB1 (DB1 - Disability segment)
256 * @see AbstractGroup\#insertRepetition(Structure, int)
257 */
258 public DB1 insertDB1(int rep) throws HL7Exception {
259 return (DB1)super.insertRepetition("DB1", rep);
260 }
261
262
263 /**
264 * Removes a specific repetition of DB1 (DB1 - Disability segment)
265 * @see AbstractGroup\#removeRepetition(String, int)
266 */
267 public DB1 removeDB1(int rep) throws HL7Exception {
268 return (DB1)super.removeRepetition("DB1", rep);
269 }
270
271
272
273 /**
274 * Returns
275 * the first repetition of
276 * OBX (OBX - observation/result segment) - creates it if necessary
277 */
278 public OBX getOBX() {
279 OBX ret = null;
280 try {
281 ret = (OBX)this.get("OBX");
282 } catch(HL7Exception e) {
283 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
284 throw new RuntimeException(e);
285 }
286 return ret;
287 }
288
289
290 /**
291 * Returns a specific repetition of
292 * OBX (OBX - observation/result segment) - creates it if necessary
293 *
294 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
295 * @throws HL7Exception if the repetition requested is more than one
296 * greater than the number of existing repetitions.
297 */
298 public OBX getOBX(int rep) {
299 OBX ret = null;
300 try {
301 ret = (OBX)this.get("OBX", rep);
302 } catch(HL7Exception e) {
303 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
304 throw new RuntimeException(e);
305 }
306 return ret;
307 }
308
309 /**
310 * Returns the number of existing repetitions of OBX
311 */
312 public int getOBXReps() {
313 int reps = -1;
314 try {
315 reps = this.getAll("OBX").length;
316 } catch (HL7Exception e) {
317 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
318 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
319 throw new RuntimeException(message);
320 }
321 return reps;
322 }
323
324 /**
325 * Inserts a specific repetition of OBX (OBX - observation/result segment)
326 * @see AbstractGroup\#insertRepetition(Structure, int)
327 */
328 public void insertOBX(OBX structure, int rep) throws HL7Exception {
329 super.insertRepetition( "OBX", structure, rep);
330 }
331
332
333 /**
334 * Inserts a specific repetition of OBX (OBX - observation/result segment)
335 * @see AbstractGroup\#insertRepetition(Structure, int)
336 */
337 public OBX insertOBX(int rep) throws HL7Exception {
338 return (OBX)super.insertRepetition("OBX", rep);
339 }
340
341
342 /**
343 * Removes a specific repetition of OBX (OBX - observation/result segment)
344 * @see AbstractGroup\#removeRepetition(String, int)
345 */
346 public OBX removeOBX(int rep) throws HL7Exception {
347 return (OBX)super.removeRepetition("OBX", rep);
348 }
349
350
351
352 /**
353 * Returns
354 * the first repetition of
355 * FT1PR1ROL (a Group object) - creates it if necessary
356 */
357 public DFT_P03_FT1PR1ROL getFT1PR1ROL() {
358 DFT_P03_FT1PR1ROL ret = null;
359 try {
360 ret = (DFT_P03_FT1PR1ROL)this.get("FT1PR1ROL");
361 } catch(HL7Exception e) {
362 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
363 throw new RuntimeException(e);
364 }
365 return ret;
366 }
367
368
369 /**
370 * Returns a specific repetition of
371 * FT1PR1ROL (a Group object) - creates it if necessary
372 *
373 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
374 * @throws HL7Exception if the repetition requested is more than one
375 * greater than the number of existing repetitions.
376 */
377 public DFT_P03_FT1PR1ROL getFT1PR1ROL(int rep) {
378 DFT_P03_FT1PR1ROL ret = null;
379 try {
380 ret = (DFT_P03_FT1PR1ROL)this.get("FT1PR1ROL", rep);
381 } catch(HL7Exception e) {
382 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
383 throw new RuntimeException(e);
384 }
385 return ret;
386 }
387
388 /**
389 * Returns the number of existing repetitions of FT1PR1ROL
390 */
391 public int getFT1PR1ROLReps() {
392 int reps = -1;
393 try {
394 reps = this.getAll("FT1PR1ROL").length;
395 } catch (HL7Exception e) {
396 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
397 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
398 throw new RuntimeException(message);
399 }
400 return reps;
401 }
402
403 /**
404 * Inserts a specific repetition of FT1PR1ROL (a Group object)
405 * @see AbstractGroup\#insertRepetition(Structure, int)
406 */
407 public void insertFT1PR1ROL(DFT_P03_FT1PR1ROL structure, int rep) throws HL7Exception {
408 super.insertRepetition( "FT1PR1ROL", structure, rep);
409 }
410
411
412 /**
413 * Inserts a specific repetition of FT1PR1ROL (a Group object)
414 * @see AbstractGroup\#insertRepetition(Structure, int)
415 */
416 public DFT_P03_FT1PR1ROL insertFT1PR1ROL(int rep) throws HL7Exception {
417 return (DFT_P03_FT1PR1ROL)super.insertRepetition("FT1PR1ROL", rep);
418 }
419
420
421 /**
422 * Removes a specific repetition of FT1PR1ROL (a Group object)
423 * @see AbstractGroup\#removeRepetition(String, int)
424 */
425 public DFT_P03_FT1PR1ROL removeFT1PR1ROL(int rep) throws HL7Exception {
426 return (DFT_P03_FT1PR1ROL)super.removeRepetition("FT1PR1ROL", rep);
427 }
428
429
430
431 /**
432 * Returns
433 * the first repetition of
434 * DG1 (DG1 - diagnosis segment) - creates it if necessary
435 */
436 public DG1 getDG1() {
437 DG1 ret = null;
438 try {
439 ret = (DG1)this.get("DG1");
440 } catch(HL7Exception e) {
441 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
442 throw new RuntimeException(e);
443 }
444 return ret;
445 }
446
447
448 /**
449 * Returns a specific repetition of
450 * DG1 (DG1 - diagnosis segment) - creates it if necessary
451 *
452 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
453 * @throws HL7Exception if the repetition requested is more than one
454 * greater than the number of existing repetitions.
455 */
456 public DG1 getDG1(int rep) {
457 DG1 ret = null;
458 try {
459 ret = (DG1)this.get("DG1", rep);
460 } catch(HL7Exception e) {
461 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
462 throw new RuntimeException(e);
463 }
464 return ret;
465 }
466
467 /**
468 * Returns the number of existing repetitions of DG1
469 */
470 public int getDG1Reps() {
471 int reps = -1;
472 try {
473 reps = this.getAll("DG1").length;
474 } catch (HL7Exception e) {
475 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
476 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
477 throw new RuntimeException(message);
478 }
479 return reps;
480 }
481
482 /**
483 * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
484 * @see AbstractGroup\#insertRepetition(Structure, int)
485 */
486 public void insertDG1(DG1 structure, int rep) throws HL7Exception {
487 super.insertRepetition( "DG1", structure, rep);
488 }
489
490
491 /**
492 * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
493 * @see AbstractGroup\#insertRepetition(Structure, int)
494 */
495 public DG1 insertDG1(int rep) throws HL7Exception {
496 return (DG1)super.insertRepetition("DG1", rep);
497 }
498
499
500 /**
501 * Removes a specific repetition of DG1 (DG1 - diagnosis segment)
502 * @see AbstractGroup\#removeRepetition(String, int)
503 */
504 public DG1 removeDG1(int rep) throws HL7Exception {
505 return (DG1)super.removeRepetition("DG1", rep);
506 }
507
508
509
510 /**
511 * Returns
512 * DRG (DRG - diagnosis related group segment) - creates it if necessary
513 */
514 public DRG getDRG() {
515 DRG ret = null;
516 try {
517 ret = (DRG)this.get("DRG");
518 } catch(HL7Exception e) {
519 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
520 throw new RuntimeException(e);
521 }
522 return ret;
523 }
524
525
526
527
528 /**
529 * Returns
530 * the first repetition of
531 * GT1 (GT1 - guarantor segment) - creates it if necessary
532 */
533 public GT1 getGT1() {
534 GT1 ret = null;
535 try {
536 ret = (GT1)this.get("GT1");
537 } catch(HL7Exception e) {
538 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
539 throw new RuntimeException(e);
540 }
541 return ret;
542 }
543
544
545 /**
546 * Returns a specific repetition of
547 * GT1 (GT1 - guarantor segment) - creates it if necessary
548 *
549 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
550 * @throws HL7Exception if the repetition requested is more than one
551 * greater than the number of existing repetitions.
552 */
553 public GT1 getGT1(int rep) {
554 GT1 ret = null;
555 try {
556 ret = (GT1)this.get("GT1", rep);
557 } catch(HL7Exception e) {
558 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
559 throw new RuntimeException(e);
560 }
561 return ret;
562 }
563
564 /**
565 * Returns the number of existing repetitions of GT1
566 */
567 public int getGT1Reps() {
568 int reps = -1;
569 try {
570 reps = this.getAll("GT1").length;
571 } catch (HL7Exception e) {
572 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
573 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
574 throw new RuntimeException(message);
575 }
576 return reps;
577 }
578
579 /**
580 * Inserts a specific repetition of GT1 (GT1 - guarantor segment)
581 * @see AbstractGroup\#insertRepetition(Structure, int)
582 */
583 public void insertGT1(GT1 structure, int rep) throws HL7Exception {
584 super.insertRepetition( "GT1", structure, rep);
585 }
586
587
588 /**
589 * Inserts a specific repetition of GT1 (GT1 - guarantor segment)
590 * @see AbstractGroup\#insertRepetition(Structure, int)
591 */
592 public GT1 insertGT1(int rep) throws HL7Exception {
593 return (GT1)super.insertRepetition("GT1", rep);
594 }
595
596
597 /**
598 * Removes a specific repetition of GT1 (GT1 - guarantor segment)
599 * @see AbstractGroup\#removeRepetition(String, int)
600 */
601 public GT1 removeGT1(int rep) throws HL7Exception {
602 return (GT1)super.removeRepetition("GT1", rep);
603 }
604
605
606
607 /**
608 * Returns
609 * the first repetition of
610 * IN1IN2IN3 (a Group object) - creates it if necessary
611 */
612 public DFT_P03_IN1IN2IN3 getIN1IN2IN3() {
613 DFT_P03_IN1IN2IN3 ret = null;
614 try {
615 ret = (DFT_P03_IN1IN2IN3)this.get("IN1IN2IN3");
616 } catch(HL7Exception e) {
617 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
618 throw new RuntimeException(e);
619 }
620 return ret;
621 }
622
623
624 /**
625 * Returns a specific repetition of
626 * IN1IN2IN3 (a Group object) - creates it if necessary
627 *
628 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
629 * @throws HL7Exception if the repetition requested is more than one
630 * greater than the number of existing repetitions.
631 */
632 public DFT_P03_IN1IN2IN3 getIN1IN2IN3(int rep) {
633 DFT_P03_IN1IN2IN3 ret = null;
634 try {
635 ret = (DFT_P03_IN1IN2IN3)this.get("IN1IN2IN3", rep);
636 } catch(HL7Exception e) {
637 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
638 throw new RuntimeException(e);
639 }
640 return ret;
641 }
642
643 /**
644 * Returns the number of existing repetitions of IN1IN2IN3
645 */
646 public int getIN1IN2IN3Reps() {
647 int reps = -1;
648 try {
649 reps = this.getAll("IN1IN2IN3").length;
650 } catch (HL7Exception e) {
651 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
652 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
653 throw new RuntimeException(message);
654 }
655 return reps;
656 }
657
658 /**
659 * Inserts a specific repetition of IN1IN2IN3 (a Group object)
660 * @see AbstractGroup\#insertRepetition(Structure, int)
661 */
662 public void insertIN1IN2IN3(DFT_P03_IN1IN2IN3 structure, int rep) throws HL7Exception {
663 super.insertRepetition( "IN1IN2IN3", structure, rep);
664 }
665
666
667 /**
668 * Inserts a specific repetition of IN1IN2IN3 (a Group object)
669 * @see AbstractGroup\#insertRepetition(Structure, int)
670 */
671 public DFT_P03_IN1IN2IN3 insertIN1IN2IN3(int rep) throws HL7Exception {
672 return (DFT_P03_IN1IN2IN3)super.insertRepetition("IN1IN2IN3", rep);
673 }
674
675
676 /**
677 * Removes a specific repetition of IN1IN2IN3 (a Group object)
678 * @see AbstractGroup\#removeRepetition(String, int)
679 */
680 public DFT_P03_IN1IN2IN3 removeIN1IN2IN3(int rep) throws HL7Exception {
681 return (DFT_P03_IN1IN2IN3)super.removeRepetition("IN1IN2IN3", rep);
682 }
683
684
685
686 /**
687 * Returns
688 * ACC (ACC - accident segment) - creates it if necessary
689 */
690 public ACC getACC() {
691 ACC ret = null;
692 try {
693 ret = (ACC)this.get("ACC");
694 } catch(HL7Exception e) {
695 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
696 throw new RuntimeException(e);
697 }
698 return ret;
699 }
700
701
702
703
704 }
705