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.segment;
009
010 // import ca.uhn.hl7v2.model.v24.group.*;
011 import ca.uhn.hl7v2.model.v24.datatype.*;
012 import ca.uhn.log.HapiLogFactory;
013 import ca.uhn.hl7v2.HL7Exception;
014 import ca.uhn.hl7v2.parser.ModelClassFactory;
015 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
016 import ca.uhn.hl7v2.model.AbstractMessage;
017 import ca.uhn.hl7v2.model.Group;
018 import ca.uhn.hl7v2.model.Type;
019 import ca.uhn.hl7v2.model.AbstractSegment;
020 import ca.uhn.hl7v2.model.Varies;
021
022 /**
023 *<p>Represents an HL7 AIS message segment (Appointment Information - Service).
024 * This segment has the following fields:</p>
025 * <ul>
026 * <li>AIS-1: Set ID - AIS (SI) <b> </b>
027 * <li>AIS-2: Segment Action Code (ID) <b>optional </b>
028 * <li>AIS-3: Universal Service Identifier (CE) <b> </b>
029 * <li>AIS-4: Start Date/Time (TS) <b>optional </b>
030 * <li>AIS-5: Start Date/Time Offset (NM) <b>optional </b>
031 * <li>AIS-6: Start Date/Time Offset Units (CE) <b>optional </b>
032 * <li>AIS-7: Duration (NM) <b>optional </b>
033 * <li>AIS-8: Duration Units (CE) <b>optional </b>
034 * <li>AIS-9: Allow Substitution Code (IS) <b>optional </b>
035 * <li>AIS-10: Filler Status Code (CE) <b>optional </b>
036 * <li>AIS-11: Placer Supplemental Service Information (CE) <b>optional repeating</b>
037 * <li>AIS-12: Filler Supplemental Service Information (CE) <b>optional repeating</b>
038 * </ul>
039 */
040 public class AIS extends AbstractSegment {
041
042 /**
043 * Creates a new AIS segment
044 */
045 public AIS(Group parent, ModelClassFactory factory) {
046 super(parent, factory);
047 init(factory);
048 }
049
050 private void init(ModelClassFactory factory) {
051 try {
052 this.add(SI.class, true, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Set ID - AIS");
053 this.add(ID.class, false, 1, 3, new Object[]{ getMessage() }, "Segment Action Code");
054 this.add(CE.class, true, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Universal Service Identifier");
055 this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Start Date/Time");
056 this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Start Date/Time Offset");
057 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Start Date/Time Offset Units");
058 this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Duration");
059 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Duration Units");
060 this.add(IS.class, false, 1, 10, new Object[]{ getMessage() }, "Allow Substitution Code");
061 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(278) }, "Filler Status Code");
062 this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(411) }, "Placer Supplemental Service Information");
063 this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(411) }, "Filler Supplemental Service Information");
064 } catch(HL7Exception e) {
065 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating AIS - this is probably a bug in the source code generator.", e);
066 }
067 }
068
069
070
071 /**
072 * Returns
073 * AIS-1: "Set ID - AIS" - creates it if necessary
074 */
075 public SI getSetIDAIS() {
076 SI ret = null;
077 try {
078 Type t = this.getField(1, 0);
079 ret = (SI)t;
080 } catch (ClassCastException cce) {
081 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
082 throw new RuntimeException(cce);
083 } catch (HL7Exception he) {
084 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
085 throw new RuntimeException(he);
086 }
087 return ret;
088 }
089
090
091 /**
092 * Returns
093 * AIS-1: "Set ID - AIS" - creates it if necessary
094 */
095 public SI getAis1_SetIDAIS() {
096 SI ret = null;
097 try {
098 Type t = this.getField(1, 0);
099 ret = (SI)t;
100 } catch (ClassCastException cce) {
101 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
102 throw new RuntimeException(cce);
103 } catch (HL7Exception he) {
104 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
105 throw new RuntimeException(he);
106 }
107 return ret;
108 }
109
110
111
112 /**
113 * Returns
114 * AIS-2: "Segment Action Code" - creates it if necessary
115 */
116 public ID getSegmentActionCode() {
117 ID ret = null;
118 try {
119 Type t = this.getField(2, 0);
120 ret = (ID)t;
121 } catch (ClassCastException cce) {
122 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
123 throw new RuntimeException(cce);
124 } catch (HL7Exception he) {
125 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
126 throw new RuntimeException(he);
127 }
128 return ret;
129 }
130
131
132 /**
133 * Returns
134 * AIS-2: "Segment Action Code" - creates it if necessary
135 */
136 public ID getAis2_SegmentActionCode() {
137 ID ret = null;
138 try {
139 Type t = this.getField(2, 0);
140 ret = (ID)t;
141 } catch (ClassCastException cce) {
142 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
143 throw new RuntimeException(cce);
144 } catch (HL7Exception he) {
145 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
146 throw new RuntimeException(he);
147 }
148 return ret;
149 }
150
151
152
153 /**
154 * Returns
155 * AIS-3: "Universal Service Identifier" - creates it if necessary
156 */
157 public CE getUniversalServiceIdentifier() {
158 CE ret = null;
159 try {
160 Type t = this.getField(3, 0);
161 ret = (CE)t;
162 } catch (ClassCastException cce) {
163 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
164 throw new RuntimeException(cce);
165 } catch (HL7Exception he) {
166 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
167 throw new RuntimeException(he);
168 }
169 return ret;
170 }
171
172
173 /**
174 * Returns
175 * AIS-3: "Universal Service Identifier" - creates it if necessary
176 */
177 public CE getAis3_UniversalServiceIdentifier() {
178 CE ret = null;
179 try {
180 Type t = this.getField(3, 0);
181 ret = (CE)t;
182 } catch (ClassCastException cce) {
183 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
184 throw new RuntimeException(cce);
185 } catch (HL7Exception he) {
186 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
187 throw new RuntimeException(he);
188 }
189 return ret;
190 }
191
192
193
194 /**
195 * Returns
196 * AIS-4: "Start Date/Time" - creates it if necessary
197 */
198 public TS getStartDateTime() {
199 TS ret = null;
200 try {
201 Type t = this.getField(4, 0);
202 ret = (TS)t;
203 } catch (ClassCastException cce) {
204 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
205 throw new RuntimeException(cce);
206 } catch (HL7Exception he) {
207 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
208 throw new RuntimeException(he);
209 }
210 return ret;
211 }
212
213
214 /**
215 * Returns
216 * AIS-4: "Start Date/Time" - creates it if necessary
217 */
218 public TS getAis4_StartDateTime() {
219 TS ret = null;
220 try {
221 Type t = this.getField(4, 0);
222 ret = (TS)t;
223 } catch (ClassCastException cce) {
224 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
225 throw new RuntimeException(cce);
226 } catch (HL7Exception he) {
227 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
228 throw new RuntimeException(he);
229 }
230 return ret;
231 }
232
233
234
235 /**
236 * Returns
237 * AIS-5: "Start Date/Time Offset" - creates it if necessary
238 */
239 public NM getStartDateTimeOffset() {
240 NM ret = null;
241 try {
242 Type t = this.getField(5, 0);
243 ret = (NM)t;
244 } catch (ClassCastException cce) {
245 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
246 throw new RuntimeException(cce);
247 } catch (HL7Exception he) {
248 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
249 throw new RuntimeException(he);
250 }
251 return ret;
252 }
253
254
255 /**
256 * Returns
257 * AIS-5: "Start Date/Time Offset" - creates it if necessary
258 */
259 public NM getAis5_StartDateTimeOffset() {
260 NM ret = null;
261 try {
262 Type t = this.getField(5, 0);
263 ret = (NM)t;
264 } catch (ClassCastException cce) {
265 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
266 throw new RuntimeException(cce);
267 } catch (HL7Exception he) {
268 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
269 throw new RuntimeException(he);
270 }
271 return ret;
272 }
273
274
275
276 /**
277 * Returns
278 * AIS-6: "Start Date/Time Offset Units" - creates it if necessary
279 */
280 public CE getStartDateTimeOffsetUnits() {
281 CE ret = null;
282 try {
283 Type t = this.getField(6, 0);
284 ret = (CE)t;
285 } catch (ClassCastException cce) {
286 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
287 throw new RuntimeException(cce);
288 } catch (HL7Exception he) {
289 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
290 throw new RuntimeException(he);
291 }
292 return ret;
293 }
294
295
296 /**
297 * Returns
298 * AIS-6: "Start Date/Time Offset Units" - creates it if necessary
299 */
300 public CE getAis6_StartDateTimeOffsetUnits() {
301 CE ret = null;
302 try {
303 Type t = this.getField(6, 0);
304 ret = (CE)t;
305 } catch (ClassCastException cce) {
306 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
307 throw new RuntimeException(cce);
308 } catch (HL7Exception he) {
309 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
310 throw new RuntimeException(he);
311 }
312 return ret;
313 }
314
315
316
317 /**
318 * Returns
319 * AIS-7: "Duration" - creates it if necessary
320 */
321 public NM getDuration() {
322 NM ret = null;
323 try {
324 Type t = this.getField(7, 0);
325 ret = (NM)t;
326 } catch (ClassCastException cce) {
327 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
328 throw new RuntimeException(cce);
329 } catch (HL7Exception he) {
330 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
331 throw new RuntimeException(he);
332 }
333 return ret;
334 }
335
336
337 /**
338 * Returns
339 * AIS-7: "Duration" - creates it if necessary
340 */
341 public NM getAis7_Duration() {
342 NM ret = null;
343 try {
344 Type t = this.getField(7, 0);
345 ret = (NM)t;
346 } catch (ClassCastException cce) {
347 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
348 throw new RuntimeException(cce);
349 } catch (HL7Exception he) {
350 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
351 throw new RuntimeException(he);
352 }
353 return ret;
354 }
355
356
357
358 /**
359 * Returns
360 * AIS-8: "Duration Units" - creates it if necessary
361 */
362 public CE getDurationUnits() {
363 CE ret = null;
364 try {
365 Type t = this.getField(8, 0);
366 ret = (CE)t;
367 } catch (ClassCastException cce) {
368 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
369 throw new RuntimeException(cce);
370 } catch (HL7Exception he) {
371 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
372 throw new RuntimeException(he);
373 }
374 return ret;
375 }
376
377
378 /**
379 * Returns
380 * AIS-8: "Duration Units" - creates it if necessary
381 */
382 public CE getAis8_DurationUnits() {
383 CE ret = null;
384 try {
385 Type t = this.getField(8, 0);
386 ret = (CE)t;
387 } catch (ClassCastException cce) {
388 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
389 throw new RuntimeException(cce);
390 } catch (HL7Exception he) {
391 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
392 throw new RuntimeException(he);
393 }
394 return ret;
395 }
396
397
398
399 /**
400 * Returns
401 * AIS-9: "Allow Substitution Code" - creates it if necessary
402 */
403 public IS getAllowSubstitutionCode() {
404 IS ret = null;
405 try {
406 Type t = this.getField(9, 0);
407 ret = (IS)t;
408 } catch (ClassCastException cce) {
409 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
410 throw new RuntimeException(cce);
411 } catch (HL7Exception he) {
412 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
413 throw new RuntimeException(he);
414 }
415 return ret;
416 }
417
418
419 /**
420 * Returns
421 * AIS-9: "Allow Substitution Code" - creates it if necessary
422 */
423 public IS getAis9_AllowSubstitutionCode() {
424 IS ret = null;
425 try {
426 Type t = this.getField(9, 0);
427 ret = (IS)t;
428 } catch (ClassCastException cce) {
429 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
430 throw new RuntimeException(cce);
431 } catch (HL7Exception he) {
432 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
433 throw new RuntimeException(he);
434 }
435 return ret;
436 }
437
438
439
440 /**
441 * Returns
442 * AIS-10: "Filler Status Code" - creates it if necessary
443 */
444 public CE getFillerStatusCode() {
445 CE ret = null;
446 try {
447 Type t = this.getField(10, 0);
448 ret = (CE)t;
449 } catch (ClassCastException cce) {
450 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
451 throw new RuntimeException(cce);
452 } catch (HL7Exception he) {
453 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
454 throw new RuntimeException(he);
455 }
456 return ret;
457 }
458
459
460 /**
461 * Returns
462 * AIS-10: "Filler Status Code" - creates it if necessary
463 */
464 public CE getAis10_FillerStatusCode() {
465 CE ret = null;
466 try {
467 Type t = this.getField(10, 0);
468 ret = (CE)t;
469 } catch (ClassCastException cce) {
470 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
471 throw new RuntimeException(cce);
472 } catch (HL7Exception he) {
473 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
474 throw new RuntimeException(he);
475 }
476 return ret;
477 }
478
479
480 /**
481 * Returns all repetitions of Placer Supplemental Service Information (AIS-11).
482 */
483 public CE[] getPlacerSupplementalServiceInformation() {
484 CE[] ret = null;
485 try {
486 Type[] t = this.getField(11);
487 ret = new CE[t.length];
488 for (int i = 0; i < ret.length; i++) {
489 ret[i] = (CE)t[i];
490 }
491 } catch (ClassCastException cce) {
492 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
493 throw new RuntimeException(cce);
494 } catch (HL7Exception he) {
495 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
496 throw new RuntimeException(he);
497 }
498 return ret;
499 }
500
501
502 /**
503 * Returns a count of the current number of repetitions of Placer Supplemental Service Information (AIS-11).
504 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
505 * it will return zero.
506 */
507 public int getPlacerSupplementalServiceInformationReps() {
508 CE[] ret = null;
509 try {
510 Type[] t = this.getField(11);
511 return t.length;
512 } catch (ClassCastException cce) {
513 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
514 throw new RuntimeException(cce);
515 } catch (HL7Exception he) {
516 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
517 throw new RuntimeException(he);
518 }
519 }
520
521
522 /**
523 * Returns a specific repetition of
524 * AIS-11: "Placer Supplemental Service Information" - creates it if necessary
525 *
526 * @param rep The repetition index (0-indexed)
527 */
528 public CE getPlacerSupplementalServiceInformation(int rep) {
529 CE ret = null;
530 try {
531 Type t = this.getField(11, rep);
532 ret = (CE)t;
533 } catch (ClassCastException cce) {
534 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
535 throw new RuntimeException(cce);
536 } catch (HL7Exception he) {
537 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
538 throw new RuntimeException(he);
539 }
540 return ret;
541 }
542
543 /**
544 * Returns a specific repetition of
545 * AIS-11: "Placer Supplemental Service Information" - creates it if necessary
546 *
547 * @param rep The repetition index (0-indexed)
548 */
549 public CE getAis11_PlacerSupplementalServiceInformation(int rep) {
550 CE ret = null;
551 try {
552 Type t = this.getField(11, rep);
553 ret = (CE)t;
554 } catch (ClassCastException cce) {
555 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
556 throw new RuntimeException(cce);
557 } catch (HL7Exception he) {
558 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
559 throw new RuntimeException(he);
560 }
561 return ret;
562 }
563
564
565 /**
566 * Returns a count of the current number of repetitions of Placer Supplemental Service Information (AIS-11).
567 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
568 * it will return zero.
569 */
570 public int getAis11_PlacerSupplementalServiceInformationReps() {
571 CE[] ret = null;
572 try {
573 Type[] t = this.getField(11);
574 return t.length;
575 } catch (ClassCastException cce) {
576 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
577 throw new RuntimeException(cce);
578 } catch (HL7Exception he) {
579 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
580 throw new RuntimeException(he);
581 }
582 }
583
584
585
586 /**
587 * Inserts a repetition of
588 * AIS-11: "Placer Supplemental Service Information" at a specific index
589 *
590 * @param rep The repetition index (0-indexed)
591 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
592 */
593 public CE insertPlacerSupplementalServiceInformation(int rep) throws HL7Exception {
594 return (CE) super.insertRepetition(11, rep);
595 }
596
597
598
599 /**
600 * Inserts a repetition of
601 * AIS-11: "Placer Supplemental Service Information" at a specific index
602 *
603 * @param rep The repetition index (0-indexed)
604 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
605 */
606 public CE insertAis11_PlacerSupplementalServiceInformation(int rep) throws HL7Exception {
607 return (CE) super.insertRepetition(11, rep);
608 }
609
610
611 /**
612 * Removes a repetition of
613 * AIS-11: "Placer Supplemental Service Information" at a specific index
614 *
615 * @param rep The repetition index (0-indexed)
616 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
617 */
618 public CE removePlacerSupplementalServiceInformation(int rep) throws HL7Exception {
619 return (CE) super.removeRepetition(11, rep);
620 }
621
622
623 /**
624 * Removes a repetition of
625 * AIS-11: "Placer Supplemental Service Information" at a specific index
626 *
627 * @param rep The repetition index (0-indexed)
628 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
629 */
630 public CE removeAis11_PlacerSupplementalServiceInformation(int rep) throws HL7Exception {
631 return (CE) super.removeRepetition(11, rep);
632 }
633
634
635
636 /**
637 * Returns all repetitions of Filler Supplemental Service Information (AIS-12).
638 */
639 public CE[] getFillerSupplementalServiceInformation() {
640 CE[] ret = null;
641 try {
642 Type[] t = this.getField(12);
643 ret = new CE[t.length];
644 for (int i = 0; i < ret.length; i++) {
645 ret[i] = (CE)t[i];
646 }
647 } catch (ClassCastException cce) {
648 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
649 throw new RuntimeException(cce);
650 } catch (HL7Exception he) {
651 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
652 throw new RuntimeException(he);
653 }
654 return ret;
655 }
656
657
658 /**
659 * Returns a count of the current number of repetitions of Filler Supplemental Service Information (AIS-12).
660 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
661 * it will return zero.
662 */
663 public int getFillerSupplementalServiceInformationReps() {
664 CE[] ret = null;
665 try {
666 Type[] t = this.getField(12);
667 return t.length;
668 } catch (ClassCastException cce) {
669 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
670 throw new RuntimeException(cce);
671 } catch (HL7Exception he) {
672 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
673 throw new RuntimeException(he);
674 }
675 }
676
677
678 /**
679 * Returns a specific repetition of
680 * AIS-12: "Filler Supplemental Service Information" - creates it if necessary
681 *
682 * @param rep The repetition index (0-indexed)
683 */
684 public CE getFillerSupplementalServiceInformation(int rep) {
685 CE ret = null;
686 try {
687 Type t = this.getField(12, rep);
688 ret = (CE)t;
689 } catch (ClassCastException cce) {
690 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
691 throw new RuntimeException(cce);
692 } catch (HL7Exception he) {
693 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
694 throw new RuntimeException(he);
695 }
696 return ret;
697 }
698
699 /**
700 * Returns a specific repetition of
701 * AIS-12: "Filler Supplemental Service Information" - creates it if necessary
702 *
703 * @param rep The repetition index (0-indexed)
704 */
705 public CE getAis12_FillerSupplementalServiceInformation(int rep) {
706 CE ret = null;
707 try {
708 Type t = this.getField(12, rep);
709 ret = (CE)t;
710 } catch (ClassCastException cce) {
711 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
712 throw new RuntimeException(cce);
713 } catch (HL7Exception he) {
714 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
715 throw new RuntimeException(he);
716 }
717 return ret;
718 }
719
720
721 /**
722 * Returns a count of the current number of repetitions of Filler Supplemental Service Information (AIS-12).
723 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
724 * it will return zero.
725 */
726 public int getAis12_FillerSupplementalServiceInformationReps() {
727 CE[] ret = null;
728 try {
729 Type[] t = this.getField(12);
730 return t.length;
731 } catch (ClassCastException cce) {
732 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
733 throw new RuntimeException(cce);
734 } catch (HL7Exception he) {
735 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
736 throw new RuntimeException(he);
737 }
738 }
739
740
741
742 /**
743 * Inserts a repetition of
744 * AIS-12: "Filler Supplemental Service Information" at a specific index
745 *
746 * @param rep The repetition index (0-indexed)
747 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
748 */
749 public CE insertFillerSupplementalServiceInformation(int rep) throws HL7Exception {
750 return (CE) super.insertRepetition(12, rep);
751 }
752
753
754
755 /**
756 * Inserts a repetition of
757 * AIS-12: "Filler Supplemental Service Information" at a specific index
758 *
759 * @param rep The repetition index (0-indexed)
760 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
761 */
762 public CE insertAis12_FillerSupplementalServiceInformation(int rep) throws HL7Exception {
763 return (CE) super.insertRepetition(12, rep);
764 }
765
766
767 /**
768 * Removes a repetition of
769 * AIS-12: "Filler Supplemental Service Information" at a specific index
770 *
771 * @param rep The repetition index (0-indexed)
772 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
773 */
774 public CE removeFillerSupplementalServiceInformation(int rep) throws HL7Exception {
775 return (CE) super.removeRepetition(12, rep);
776 }
777
778
779 /**
780 * Removes a repetition of
781 * AIS-12: "Filler Supplemental Service Information" at a specific index
782 *
783 * @param rep The repetition index (0-indexed)
784 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
785 */
786 public CE removeAis12_FillerSupplementalServiceInformation(int rep) throws HL7Exception {
787 return (CE) super.removeRepetition(12, rep);
788 }
789
790
791
792
793
794
795 /** {@inheritDoc} */
796 protected Type createNewTypeWithoutReflection(int field) {
797 switch (field) {
798 case 0: return new SI(getMessage());
799 case 1: return new ID(getMessage(), new Integer( 206 ));
800 case 2: return new CE(getMessage());
801 case 3: return new TS(getMessage());
802 case 4: return new NM(getMessage());
803 case 5: return new CE(getMessage());
804 case 6: return new NM(getMessage());
805 case 7: return new CE(getMessage());
806 case 8: return new IS(getMessage(), new Integer( 279 ));
807 case 9: return new CE(getMessage());
808 case 10: return new CE(getMessage());
809 case 11: return new CE(getMessage());
810 default: return null;
811 }
812 }
813
814
815 }
816