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 ADT_A07 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: MRG (MRG - merge patient information segment-) <b>optional </b></li>
028 * <li>6: NK1 (NK1 - next of kin / associated parties segment-) <b>optional repeating</b></li>
029 * <li>7: PV1 (PV1 - patient visit segment-) <b> </b></li>
030 * <li>8: PV2 (PV2 - patient visit - additional information segment) <b>optional </b></li>
031 * <li>9: DB1 (DB1 - Disability segment) <b>optional repeating</b></li>
032 * <li>10: OBX (OBX - observation/result segment) <b>optional repeating</b></li>
033 * <li>11: AL1 (AL1 - patient allergy information segment) <b>optional repeating</b></li>
034 * <li>12: DG1 (DG1 - diagnosis segment) <b>optional repeating</b></li>
035 * <li>13: DRG (DRG - diagnosis related group segment) <b>optional </b></li>
036 * <li>14: ADT_A07_PR1ROL (a Group object) <b>optional repeating</b></li>
037 * <li>15: GT1 (GT1 - guarantor segment) <b>optional repeating</b></li>
038 * <li>16: ADT_A07_IN1IN2IN3 (a Group object) <b>optional repeating</b></li>
039 * <li>17: ACC (ACC - accident segment) <b>optional </b></li>
040 * <li>18: UB1 (UB1 - UB82 data segment) <b>optional </b></li>
041 * <li>19: UB2 (UB2 - UB92 data segment) <b>optional </b></li>
042 * </ul>
043 */
044 public class ADT_A07 extends AbstractMessage {
045
046 /**
047 * Creates a new ADT_A07 message with DefaultModelClassFactory.
048 */
049 public ADT_A07() {
050 this(new DefaultModelClassFactory());
051 }
052
053 /**
054 * Creates a new ADT_A07 message with custom ModelClassFactory.
055 */
056 public ADT_A07(ModelClassFactory factory) {
057 super(factory);
058 init(factory);
059 }
060
061 private void init(ModelClassFactory factory) {
062 try {
063 this.add(MSH.class, true, false);
064 this.add(EVN.class, true, false);
065 this.add(PID.class, true, false);
066 this.add(PD1.class, false, false);
067 this.add(MRG.class, false, false);
068 this.add(NK1.class, false, true);
069 this.add(PV1.class, true, false);
070 this.add(PV2.class, false, false);
071 this.add(DB1.class, false, true);
072 this.add(OBX.class, false, true);
073 this.add(AL1.class, false, true);
074 this.add(DG1.class, false, true);
075 this.add(DRG.class, false, false);
076 this.add(ADT_A07_PR1ROL.class, false, true);
077 this.add(GT1.class, false, true);
078 this.add(ADT_A07_IN1IN2IN3.class, false, true);
079 this.add(ACC.class, false, false);
080 this.add(UB1.class, false, false);
081 this.add(UB2.class, false, false);
082 } catch(HL7Exception e) {
083 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating ADT_A07 - this is probably a bug in the source code generator.", e);
084 }
085 }
086
087 /**
088 * Returns "2.3.1"
089 */
090 public String getVersion() {
091 return "2.3.1";
092 }
093
094
095
096 /**
097 * Returns
098 * MSH (MSH - message header segment) - creates it if necessary
099 */
100 public MSH getMSH() {
101 MSH ret = null;
102 try {
103 ret = (MSH)this.get("MSH");
104 } catch(HL7Exception e) {
105 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
106 throw new RuntimeException(e);
107 }
108 return ret;
109 }
110
111
112
113
114 /**
115 * Returns
116 * EVN (EVN - event type segment) - creates it if necessary
117 */
118 public EVN getEVN() {
119 EVN ret = null;
120 try {
121 ret = (EVN)this.get("EVN");
122 } catch(HL7Exception e) {
123 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
124 throw new RuntimeException(e);
125 }
126 return ret;
127 }
128
129
130
131
132 /**
133 * Returns
134 * PID (PID - patient identification segment) - creates it if necessary
135 */
136 public PID getPID() {
137 PID ret = null;
138 try {
139 ret = (PID)this.get("PID");
140 } catch(HL7Exception e) {
141 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
142 throw new RuntimeException(e);
143 }
144 return ret;
145 }
146
147
148
149
150 /**
151 * Returns
152 * PD1 (PD1 - patient additional demographic segment) - creates it if necessary
153 */
154 public PD1 getPD1() {
155 PD1 ret = null;
156 try {
157 ret = (PD1)this.get("PD1");
158 } catch(HL7Exception e) {
159 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
160 throw new RuntimeException(e);
161 }
162 return ret;
163 }
164
165
166
167
168 /**
169 * Returns
170 * MRG (MRG - merge patient information segment-) - creates it if necessary
171 */
172 public MRG getMRG() {
173 MRG ret = null;
174 try {
175 ret = (MRG)this.get("MRG");
176 } catch(HL7Exception e) {
177 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
178 throw new RuntimeException(e);
179 }
180 return ret;
181 }
182
183
184
185
186 /**
187 * Returns
188 * the first repetition of
189 * NK1 (NK1 - next of kin / associated parties segment-) - creates it if necessary
190 */
191 public NK1 getNK1() {
192 NK1 ret = null;
193 try {
194 ret = (NK1)this.get("NK1");
195 } catch(HL7Exception e) {
196 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
197 throw new RuntimeException(e);
198 }
199 return ret;
200 }
201
202
203 /**
204 * Returns a specific repetition of
205 * NK1 (NK1 - next of kin / associated parties segment-) - creates it if necessary
206 *
207 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
208 * @throws HL7Exception if the repetition requested is more than one
209 * greater than the number of existing repetitions.
210 */
211 public NK1 getNK1(int rep) {
212 NK1 ret = null;
213 try {
214 ret = (NK1)this.get("NK1", rep);
215 } catch(HL7Exception e) {
216 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
217 throw new RuntimeException(e);
218 }
219 return ret;
220 }
221
222 /**
223 * Returns the number of existing repetitions of NK1
224 */
225 public int getNK1Reps() {
226 int reps = -1;
227 try {
228 reps = this.getAll("NK1").length;
229 } catch (HL7Exception e) {
230 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
231 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
232 throw new RuntimeException(message);
233 }
234 return reps;
235 }
236
237 /**
238 * Inserts a specific repetition of NK1 (NK1 - next of kin / associated parties segment-)
239 * @see AbstractGroup\#insertRepetition(Structure, int)
240 */
241 public void insertNK1(NK1 structure, int rep) throws HL7Exception {
242 super.insertRepetition( "NK1", structure, rep);
243 }
244
245
246 /**
247 * Inserts a specific repetition of NK1 (NK1 - next of kin / associated parties segment-)
248 * @see AbstractGroup\#insertRepetition(Structure, int)
249 */
250 public NK1 insertNK1(int rep) throws HL7Exception {
251 return (NK1)super.insertRepetition("NK1", rep);
252 }
253
254
255 /**
256 * Removes a specific repetition of NK1 (NK1 - next of kin / associated parties segment-)
257 * @see AbstractGroup\#removeRepetition(String, int)
258 */
259 public NK1 removeNK1(int rep) throws HL7Exception {
260 return (NK1)super.removeRepetition("NK1", rep);
261 }
262
263
264
265 /**
266 * Returns
267 * PV1 (PV1 - patient visit segment-) - creates it if necessary
268 */
269 public PV1 getPV1() {
270 PV1 ret = null;
271 try {
272 ret = (PV1)this.get("PV1");
273 } catch(HL7Exception e) {
274 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
275 throw new RuntimeException(e);
276 }
277 return ret;
278 }
279
280
281
282
283 /**
284 * Returns
285 * PV2 (PV2 - patient visit - additional information segment) - creates it if necessary
286 */
287 public PV2 getPV2() {
288 PV2 ret = null;
289 try {
290 ret = (PV2)this.get("PV2");
291 } catch(HL7Exception e) {
292 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
293 throw new RuntimeException(e);
294 }
295 return ret;
296 }
297
298
299
300
301 /**
302 * Returns
303 * the first repetition of
304 * DB1 (DB1 - Disability segment) - creates it if necessary
305 */
306 public DB1 getDB1() {
307 DB1 ret = null;
308 try {
309 ret = (DB1)this.get("DB1");
310 } catch(HL7Exception e) {
311 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
312 throw new RuntimeException(e);
313 }
314 return ret;
315 }
316
317
318 /**
319 * Returns a specific repetition of
320 * DB1 (DB1 - Disability segment) - creates it if necessary
321 *
322 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
323 * @throws HL7Exception if the repetition requested is more than one
324 * greater than the number of existing repetitions.
325 */
326 public DB1 getDB1(int rep) {
327 DB1 ret = null;
328 try {
329 ret = (DB1)this.get("DB1", rep);
330 } catch(HL7Exception e) {
331 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
332 throw new RuntimeException(e);
333 }
334 return ret;
335 }
336
337 /**
338 * Returns the number of existing repetitions of DB1
339 */
340 public int getDB1Reps() {
341 int reps = -1;
342 try {
343 reps = this.getAll("DB1").length;
344 } catch (HL7Exception e) {
345 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
346 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
347 throw new RuntimeException(message);
348 }
349 return reps;
350 }
351
352 /**
353 * Inserts a specific repetition of DB1 (DB1 - Disability segment)
354 * @see AbstractGroup\#insertRepetition(Structure, int)
355 */
356 public void insertDB1(DB1 structure, int rep) throws HL7Exception {
357 super.insertRepetition( "DB1", structure, rep);
358 }
359
360
361 /**
362 * Inserts a specific repetition of DB1 (DB1 - Disability segment)
363 * @see AbstractGroup\#insertRepetition(Structure, int)
364 */
365 public DB1 insertDB1(int rep) throws HL7Exception {
366 return (DB1)super.insertRepetition("DB1", rep);
367 }
368
369
370 /**
371 * Removes a specific repetition of DB1 (DB1 - Disability segment)
372 * @see AbstractGroup\#removeRepetition(String, int)
373 */
374 public DB1 removeDB1(int rep) throws HL7Exception {
375 return (DB1)super.removeRepetition("DB1", rep);
376 }
377
378
379
380 /**
381 * Returns
382 * the first repetition of
383 * OBX (OBX - observation/result segment) - creates it if necessary
384 */
385 public OBX getOBX() {
386 OBX ret = null;
387 try {
388 ret = (OBX)this.get("OBX");
389 } catch(HL7Exception e) {
390 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
391 throw new RuntimeException(e);
392 }
393 return ret;
394 }
395
396
397 /**
398 * Returns a specific repetition of
399 * OBX (OBX - observation/result segment) - creates it if necessary
400 *
401 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
402 * @throws HL7Exception if the repetition requested is more than one
403 * greater than the number of existing repetitions.
404 */
405 public OBX getOBX(int rep) {
406 OBX ret = null;
407 try {
408 ret = (OBX)this.get("OBX", rep);
409 } catch(HL7Exception e) {
410 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
411 throw new RuntimeException(e);
412 }
413 return ret;
414 }
415
416 /**
417 * Returns the number of existing repetitions of OBX
418 */
419 public int getOBXReps() {
420 int reps = -1;
421 try {
422 reps = this.getAll("OBX").length;
423 } catch (HL7Exception e) {
424 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
425 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
426 throw new RuntimeException(message);
427 }
428 return reps;
429 }
430
431 /**
432 * Inserts a specific repetition of OBX (OBX - observation/result segment)
433 * @see AbstractGroup\#insertRepetition(Structure, int)
434 */
435 public void insertOBX(OBX structure, int rep) throws HL7Exception {
436 super.insertRepetition( "OBX", structure, rep);
437 }
438
439
440 /**
441 * Inserts a specific repetition of OBX (OBX - observation/result segment)
442 * @see AbstractGroup\#insertRepetition(Structure, int)
443 */
444 public OBX insertOBX(int rep) throws HL7Exception {
445 return (OBX)super.insertRepetition("OBX", rep);
446 }
447
448
449 /**
450 * Removes a specific repetition of OBX (OBX - observation/result segment)
451 * @see AbstractGroup\#removeRepetition(String, int)
452 */
453 public OBX removeOBX(int rep) throws HL7Exception {
454 return (OBX)super.removeRepetition("OBX", rep);
455 }
456
457
458
459 /**
460 * Returns
461 * the first repetition of
462 * AL1 (AL1 - patient allergy information segment) - creates it if necessary
463 */
464 public AL1 getAL1() {
465 AL1 ret = null;
466 try {
467 ret = (AL1)this.get("AL1");
468 } catch(HL7Exception e) {
469 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
470 throw new RuntimeException(e);
471 }
472 return ret;
473 }
474
475
476 /**
477 * Returns a specific repetition of
478 * AL1 (AL1 - patient allergy information segment) - creates it if necessary
479 *
480 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
481 * @throws HL7Exception if the repetition requested is more than one
482 * greater than the number of existing repetitions.
483 */
484 public AL1 getAL1(int rep) {
485 AL1 ret = null;
486 try {
487 ret = (AL1)this.get("AL1", rep);
488 } catch(HL7Exception e) {
489 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
490 throw new RuntimeException(e);
491 }
492 return ret;
493 }
494
495 /**
496 * Returns the number of existing repetitions of AL1
497 */
498 public int getAL1Reps() {
499 int reps = -1;
500 try {
501 reps = this.getAll("AL1").length;
502 } catch (HL7Exception e) {
503 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
504 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
505 throw new RuntimeException(message);
506 }
507 return reps;
508 }
509
510 /**
511 * Inserts a specific repetition of AL1 (AL1 - patient allergy information segment)
512 * @see AbstractGroup\#insertRepetition(Structure, int)
513 */
514 public void insertAL1(AL1 structure, int rep) throws HL7Exception {
515 super.insertRepetition( "AL1", structure, rep);
516 }
517
518
519 /**
520 * Inserts a specific repetition of AL1 (AL1 - patient allergy information segment)
521 * @see AbstractGroup\#insertRepetition(Structure, int)
522 */
523 public AL1 insertAL1(int rep) throws HL7Exception {
524 return (AL1)super.insertRepetition("AL1", rep);
525 }
526
527
528 /**
529 * Removes a specific repetition of AL1 (AL1 - patient allergy information segment)
530 * @see AbstractGroup\#removeRepetition(String, int)
531 */
532 public AL1 removeAL1(int rep) throws HL7Exception {
533 return (AL1)super.removeRepetition("AL1", rep);
534 }
535
536
537
538 /**
539 * Returns
540 * the first repetition of
541 * DG1 (DG1 - diagnosis segment) - creates it if necessary
542 */
543 public DG1 getDG1() {
544 DG1 ret = null;
545 try {
546 ret = (DG1)this.get("DG1");
547 } catch(HL7Exception e) {
548 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
549 throw new RuntimeException(e);
550 }
551 return ret;
552 }
553
554
555 /**
556 * Returns a specific repetition of
557 * DG1 (DG1 - diagnosis segment) - creates it if necessary
558 *
559 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
560 * @throws HL7Exception if the repetition requested is more than one
561 * greater than the number of existing repetitions.
562 */
563 public DG1 getDG1(int rep) {
564 DG1 ret = null;
565 try {
566 ret = (DG1)this.get("DG1", rep);
567 } catch(HL7Exception e) {
568 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
569 throw new RuntimeException(e);
570 }
571 return ret;
572 }
573
574 /**
575 * Returns the number of existing repetitions of DG1
576 */
577 public int getDG1Reps() {
578 int reps = -1;
579 try {
580 reps = this.getAll("DG1").length;
581 } catch (HL7Exception e) {
582 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
583 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
584 throw new RuntimeException(message);
585 }
586 return reps;
587 }
588
589 /**
590 * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
591 * @see AbstractGroup\#insertRepetition(Structure, int)
592 */
593 public void insertDG1(DG1 structure, int rep) throws HL7Exception {
594 super.insertRepetition( "DG1", structure, rep);
595 }
596
597
598 /**
599 * Inserts a specific repetition of DG1 (DG1 - diagnosis segment)
600 * @see AbstractGroup\#insertRepetition(Structure, int)
601 */
602 public DG1 insertDG1(int rep) throws HL7Exception {
603 return (DG1)super.insertRepetition("DG1", rep);
604 }
605
606
607 /**
608 * Removes a specific repetition of DG1 (DG1 - diagnosis segment)
609 * @see AbstractGroup\#removeRepetition(String, int)
610 */
611 public DG1 removeDG1(int rep) throws HL7Exception {
612 return (DG1)super.removeRepetition("DG1", rep);
613 }
614
615
616
617 /**
618 * Returns
619 * DRG (DRG - diagnosis related group segment) - creates it if necessary
620 */
621 public DRG getDRG() {
622 DRG ret = null;
623 try {
624 ret = (DRG)this.get("DRG");
625 } catch(HL7Exception e) {
626 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
627 throw new RuntimeException(e);
628 }
629 return ret;
630 }
631
632
633
634
635 /**
636 * Returns
637 * the first repetition of
638 * PR1ROL (a Group object) - creates it if necessary
639 */
640 public ADT_A07_PR1ROL getPR1ROL() {
641 ADT_A07_PR1ROL ret = null;
642 try {
643 ret = (ADT_A07_PR1ROL)this.get("PR1ROL");
644 } catch(HL7Exception e) {
645 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
646 throw new RuntimeException(e);
647 }
648 return ret;
649 }
650
651
652 /**
653 * Returns a specific repetition of
654 * PR1ROL (a Group object) - creates it if necessary
655 *
656 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
657 * @throws HL7Exception if the repetition requested is more than one
658 * greater than the number of existing repetitions.
659 */
660 public ADT_A07_PR1ROL getPR1ROL(int rep) {
661 ADT_A07_PR1ROL ret = null;
662 try {
663 ret = (ADT_A07_PR1ROL)this.get("PR1ROL", rep);
664 } catch(HL7Exception e) {
665 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
666 throw new RuntimeException(e);
667 }
668 return ret;
669 }
670
671 /**
672 * Returns the number of existing repetitions of PR1ROL
673 */
674 public int getPR1ROLReps() {
675 int reps = -1;
676 try {
677 reps = this.getAll("PR1ROL").length;
678 } catch (HL7Exception e) {
679 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
680 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
681 throw new RuntimeException(message);
682 }
683 return reps;
684 }
685
686 /**
687 * Inserts a specific repetition of PR1ROL (a Group object)
688 * @see AbstractGroup\#insertRepetition(Structure, int)
689 */
690 public void insertPR1ROL(ADT_A07_PR1ROL structure, int rep) throws HL7Exception {
691 super.insertRepetition( "PR1ROL", structure, rep);
692 }
693
694
695 /**
696 * Inserts a specific repetition of PR1ROL (a Group object)
697 * @see AbstractGroup\#insertRepetition(Structure, int)
698 */
699 public ADT_A07_PR1ROL insertPR1ROL(int rep) throws HL7Exception {
700 return (ADT_A07_PR1ROL)super.insertRepetition("PR1ROL", rep);
701 }
702
703
704 /**
705 * Removes a specific repetition of PR1ROL (a Group object)
706 * @see AbstractGroup\#removeRepetition(String, int)
707 */
708 public ADT_A07_PR1ROL removePR1ROL(int rep) throws HL7Exception {
709 return (ADT_A07_PR1ROL)super.removeRepetition("PR1ROL", rep);
710 }
711
712
713
714 /**
715 * Returns
716 * the first repetition of
717 * GT1 (GT1 - guarantor segment) - creates it if necessary
718 */
719 public GT1 getGT1() {
720 GT1 ret = null;
721 try {
722 ret = (GT1)this.get("GT1");
723 } catch(HL7Exception e) {
724 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
725 throw new RuntimeException(e);
726 }
727 return ret;
728 }
729
730
731 /**
732 * Returns a specific repetition of
733 * GT1 (GT1 - guarantor segment) - creates it if necessary
734 *
735 * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
736 * @throws HL7Exception if the repetition requested is more than one
737 * greater than the number of existing repetitions.
738 */
739 public GT1 getGT1(int rep) {
740 GT1 ret = null;
741 try {
742 ret = (GT1)this.get("GT1", rep);
743 } catch(HL7Exception e) {
744 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
745 throw new RuntimeException(e);
746 }
747 return ret;
748 }
749
750 /**
751 * Returns the number of existing repetitions of GT1
752 */
753 public int getGT1Reps() {
754 int reps = -1;
755 try {
756 reps = this.getAll("GT1").length;
757 } catch (HL7Exception e) {
758 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
759 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
760 throw new RuntimeException(message);
761 }
762 return reps;
763 }
764
765 /**
766 * Inserts a specific repetition of GT1 (GT1 - guarantor segment)
767 * @see AbstractGroup\#insertRepetition(Structure, int)
768 */
769 public void insertGT1(GT1 structure, int rep) throws HL7Exception {
770 super.insertRepetition( "GT1", structure, rep);
771 }
772
773
774 /**
775 * Inserts a specific repetition of GT1 (GT1 - guarantor segment)
776 * @see AbstractGroup\#insertRepetition(Structure, int)
777 */
778 public GT1 insertGT1(int rep) throws HL7Exception {
779 return (GT1)super.insertRepetition("GT1", rep);
780 }
781
782
783 /**
784 * Removes a specific repetition of GT1 (GT1 - guarantor segment)
785 * @see AbstractGroup\#removeRepetition(String, int)
786 */
787 public GT1 removeGT1(int rep) throws HL7Exception {
788 return (GT1)super.removeRepetition("GT1", rep);
789 }
790
791
792
793 /**
794 * Returns
795 * the first repetition of
796 * IN1IN2IN3 (a Group object) - creates it if necessary
797 */
798 public ADT_A07_IN1IN2IN3 getIN1IN2IN3() {
799 ADT_A07_IN1IN2IN3 ret = null;
800 try {
801 ret = (ADT_A07_IN1IN2IN3)this.get("IN1IN2IN3");
802 } catch(HL7Exception e) {
803 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
804 throw new RuntimeException(e);
805 }
806 return ret;
807 }
808
809
810 /**
811 * Returns a specific repetition of
812 * IN1IN2IN3 (a Group object) - creates it if necessary
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 ADT_A07_IN1IN2IN3 getIN1IN2IN3(int rep) {
819 ADT_A07_IN1IN2IN3 ret = null;
820 try {
821 ret = (ADT_A07_IN1IN2IN3)this.get("IN1IN2IN3", rep);
822 } catch(HL7Exception e) {
823 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
824 throw new RuntimeException(e);
825 }
826 return ret;
827 }
828
829 /**
830 * Returns the number of existing repetitions of IN1IN2IN3
831 */
832 public int getIN1IN2IN3Reps() {
833 int reps = -1;
834 try {
835 reps = this.getAll("IN1IN2IN3").length;
836 } catch (HL7Exception e) {
837 String message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
838 HapiLogFactory.getHapiLog(this.getClass()).error(message, e);
839 throw new RuntimeException(message);
840 }
841 return reps;
842 }
843
844 /**
845 * Inserts a specific repetition of IN1IN2IN3 (a Group object)
846 * @see AbstractGroup\#insertRepetition(Structure, int)
847 */
848 public void insertIN1IN2IN3(ADT_A07_IN1IN2IN3 structure, int rep) throws HL7Exception {
849 super.insertRepetition( "IN1IN2IN3", structure, rep);
850 }
851
852
853 /**
854 * Inserts a specific repetition of IN1IN2IN3 (a Group object)
855 * @see AbstractGroup\#insertRepetition(Structure, int)
856 */
857 public ADT_A07_IN1IN2IN3 insertIN1IN2IN3(int rep) throws HL7Exception {
858 return (ADT_A07_IN1IN2IN3)super.insertRepetition("IN1IN2IN3", rep);
859 }
860
861
862 /**
863 * Removes a specific repetition of IN1IN2IN3 (a Group object)
864 * @see AbstractGroup\#removeRepetition(String, int)
865 */
866 public ADT_A07_IN1IN2IN3 removeIN1IN2IN3(int rep) throws HL7Exception {
867 return (ADT_A07_IN1IN2IN3)super.removeRepetition("IN1IN2IN3", rep);
868 }
869
870
871
872 /**
873 * Returns
874 * ACC (ACC - accident segment) - creates it if necessary
875 */
876 public ACC getACC() {
877 ACC ret = null;
878 try {
879 ret = (ACC)this.get("ACC");
880 } catch(HL7Exception e) {
881 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
882 throw new RuntimeException(e);
883 }
884 return ret;
885 }
886
887
888
889
890 /**
891 * Returns
892 * UB1 (UB1 - UB82 data segment) - creates it if necessary
893 */
894 public UB1 getUB1() {
895 UB1 ret = null;
896 try {
897 ret = (UB1)this.get("UB1");
898 } catch(HL7Exception e) {
899 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
900 throw new RuntimeException(e);
901 }
902 return ret;
903 }
904
905
906
907
908 /**
909 * Returns
910 * UB2 (UB2 - UB92 data segment) - creates it if necessary
911 */
912 public UB2 getUB2() {
913 UB2 ret = null;
914 try {
915 ret = (UB2)this.get("UB2");
916 } catch(HL7Exception e) {
917 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
918 throw new RuntimeException(e);
919 }
920 return ret;
921 }
922
923
924
925
926 }
927