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