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 INV message segment (Inventory Detail).
024 * This segment has the following fields:</p>
025 * <ul>
026 * <li>INV-1: Substance Identifier (CE) <b> </b>
027 * <li>INV-2: Substance Status (CE) <b> repeating</b>
028 * <li>INV-3: Substance Type (CE) <b>optional </b>
029 * <li>INV-4: Inventory Container Identifier (CE) <b>optional </b>
030 * <li>INV-5: Container Carrier Identifier (CE) <b>optional </b>
031 * <li>INV-6: Position on Carrier (CE) <b>optional </b>
032 * <li>INV-7: Initial Quantity (NM) <b>optional </b>
033 * <li>INV-8: Current Quantity (NM) <b>optional </b>
034 * <li>INV-9: Available Quantity (NM) <b>optional </b>
035 * <li>INV-10: Consumption Quantity (NM) <b>optional </b>
036 * <li>INV-11: Quantity Units (CE) <b>optional </b>
037 * <li>INV-12: Expiration Date/Time (TS) <b>optional </b>
038 * <li>INV-13: First Used Date/Time (TS) <b>optional </b>
039 * <li>INV-14: On Board Stability Duration (TQ) <b>optional </b>
040 * <li>INV-15: Test/Fluid Identifier(s) (CE) <b>optional repeating</b>
041 * <li>INV-16: Manufacturer Lot Number (ST) <b>optional </b>
042 * <li>INV-17: Manufacturer Identifier (CE) <b>optional </b>
043 * <li>INV-18: Supplier Identifier (CE) <b>optional </b>
044 * </ul>
045 */
046 public class INV extends AbstractSegment {
047
048 /**
049 * Creates a new INV segment
050 */
051 public INV(Group parent, ModelClassFactory factory) {
052 super(parent, factory);
053 init(factory);
054 }
055
056 private void init(ModelClassFactory factory) {
057 try {
058 this.add(CE.class, true, 1, 250, new Object[]{ getMessage(), new Integer(451) }, "Substance Identifier");
059 this.add(CE.class, true, 0, 250, new Object[]{ getMessage(), new Integer(383) }, "Substance Status");
060 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(384) }, "Substance Type");
061 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Inventory Container Identifier");
062 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Container Carrier Identifier");
063 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Position on Carrier");
064 this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Initial Quantity");
065 this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Current Quantity");
066 this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Available Quantity");
067 this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Consumption Quantity");
068 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Quantity Units");
069 this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Expiration Date/Time");
070 this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "First Used Date/Time");
071 this.add(TQ.class, false, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "On Board Stability Duration");
072 this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Test/Fluid Identifier(s)");
073 this.add(ST.class, false, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Manufacturer Lot Number");
074 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(385) }, "Manufacturer Identifier");
075 this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(386) }, "Supplier Identifier");
076 } catch(HL7Exception e) {
077 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating INV - this is probably a bug in the source code generator.", e);
078 }
079 }
080
081
082
083 /**
084 * Returns
085 * INV-1: "Substance Identifier" - creates it if necessary
086 */
087 public CE getSubstanceIdentifier() {
088 CE ret = null;
089 try {
090 Type t = this.getField(1, 0);
091 ret = (CE)t;
092 } catch (ClassCastException cce) {
093 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
094 throw new RuntimeException(cce);
095 } catch (HL7Exception he) {
096 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
097 throw new RuntimeException(he);
098 }
099 return ret;
100 }
101
102
103 /**
104 * Returns
105 * INV-1: "Substance Identifier" - creates it if necessary
106 */
107 public CE getInv1_SubstanceIdentifier() {
108 CE ret = null;
109 try {
110 Type t = this.getField(1, 0);
111 ret = (CE)t;
112 } catch (ClassCastException cce) {
113 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
114 throw new RuntimeException(cce);
115 } catch (HL7Exception he) {
116 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
117 throw new RuntimeException(he);
118 }
119 return ret;
120 }
121
122
123 /**
124 * Returns all repetitions of Substance Status (INV-2).
125 */
126 public CE[] getSubstanceStatus() {
127 CE[] ret = null;
128 try {
129 Type[] t = this.getField(2);
130 ret = new CE[t.length];
131 for (int i = 0; i < ret.length; i++) {
132 ret[i] = (CE)t[i];
133 }
134 } catch (ClassCastException cce) {
135 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
136 throw new RuntimeException(cce);
137 } catch (HL7Exception he) {
138 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
139 throw new RuntimeException(he);
140 }
141 return ret;
142 }
143
144
145 /**
146 * Returns a count of the current number of repetitions of Substance Status (INV-2).
147 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
148 * it will return zero.
149 */
150 public int getSubstanceStatusReps() {
151 CE[] ret = null;
152 try {
153 Type[] t = this.getField(2);
154 return t.length;
155 } catch (ClassCastException cce) {
156 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
157 throw new RuntimeException(cce);
158 } catch (HL7Exception he) {
159 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
160 throw new RuntimeException(he);
161 }
162 }
163
164
165 /**
166 * Returns a specific repetition of
167 * INV-2: "Substance Status" - creates it if necessary
168 *
169 * @param rep The repetition index (0-indexed)
170 */
171 public CE getSubstanceStatus(int rep) {
172 CE ret = null;
173 try {
174 Type t = this.getField(2, rep);
175 ret = (CE)t;
176 } catch (ClassCastException cce) {
177 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
178 throw new RuntimeException(cce);
179 } catch (HL7Exception he) {
180 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
181 throw new RuntimeException(he);
182 }
183 return ret;
184 }
185
186 /**
187 * Returns a specific repetition of
188 * INV-2: "Substance Status" - creates it if necessary
189 *
190 * @param rep The repetition index (0-indexed)
191 */
192 public CE getInv2_SubstanceStatus(int rep) {
193 CE ret = null;
194 try {
195 Type t = this.getField(2, rep);
196 ret = (CE)t;
197 } catch (ClassCastException cce) {
198 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
199 throw new RuntimeException(cce);
200 } catch (HL7Exception he) {
201 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
202 throw new RuntimeException(he);
203 }
204 return ret;
205 }
206
207
208 /**
209 * Returns a count of the current number of repetitions of Substance Status (INV-2).
210 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
211 * it will return zero.
212 */
213 public int getInv2_SubstanceStatusReps() {
214 CE[] ret = null;
215 try {
216 Type[] t = this.getField(2);
217 return t.length;
218 } catch (ClassCastException cce) {
219 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
220 throw new RuntimeException(cce);
221 } catch (HL7Exception he) {
222 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
223 throw new RuntimeException(he);
224 }
225 }
226
227
228
229 /**
230 * Inserts a repetition of
231 * INV-2: "Substance Status" at a specific index
232 *
233 * @param rep The repetition index (0-indexed)
234 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
235 */
236 public CE insertSubstanceStatus(int rep) throws HL7Exception {
237 return (CE) super.insertRepetition(2, rep);
238 }
239
240
241
242 /**
243 * Inserts a repetition of
244 * INV-2: "Substance Status" at a specific index
245 *
246 * @param rep The repetition index (0-indexed)
247 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
248 */
249 public CE insertInv2_SubstanceStatus(int rep) throws HL7Exception {
250 return (CE) super.insertRepetition(2, rep);
251 }
252
253
254 /**
255 * Removes a repetition of
256 * INV-2: "Substance Status" at a specific index
257 *
258 * @param rep The repetition index (0-indexed)
259 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
260 */
261 public CE removeSubstanceStatus(int rep) throws HL7Exception {
262 return (CE) super.removeRepetition(2, rep);
263 }
264
265
266 /**
267 * Removes a repetition of
268 * INV-2: "Substance Status" at a specific index
269 *
270 * @param rep The repetition index (0-indexed)
271 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
272 */
273 public CE removeInv2_SubstanceStatus(int rep) throws HL7Exception {
274 return (CE) super.removeRepetition(2, rep);
275 }
276
277
278
279
280 /**
281 * Returns
282 * INV-3: "Substance Type" - creates it if necessary
283 */
284 public CE getSubstanceType() {
285 CE ret = null;
286 try {
287 Type t = this.getField(3, 0);
288 ret = (CE)t;
289 } catch (ClassCastException cce) {
290 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
291 throw new RuntimeException(cce);
292 } catch (HL7Exception he) {
293 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
294 throw new RuntimeException(he);
295 }
296 return ret;
297 }
298
299
300 /**
301 * Returns
302 * INV-3: "Substance Type" - creates it if necessary
303 */
304 public CE getInv3_SubstanceType() {
305 CE ret = null;
306 try {
307 Type t = this.getField(3, 0);
308 ret = (CE)t;
309 } catch (ClassCastException cce) {
310 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
311 throw new RuntimeException(cce);
312 } catch (HL7Exception he) {
313 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
314 throw new RuntimeException(he);
315 }
316 return ret;
317 }
318
319
320
321 /**
322 * Returns
323 * INV-4: "Inventory Container Identifier" - creates it if necessary
324 */
325 public CE getInventoryContainerIdentifier() {
326 CE ret = null;
327 try {
328 Type t = this.getField(4, 0);
329 ret = (CE)t;
330 } catch (ClassCastException cce) {
331 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
332 throw new RuntimeException(cce);
333 } catch (HL7Exception he) {
334 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
335 throw new RuntimeException(he);
336 }
337 return ret;
338 }
339
340
341 /**
342 * Returns
343 * INV-4: "Inventory Container Identifier" - creates it if necessary
344 */
345 public CE getInv4_InventoryContainerIdentifier() {
346 CE ret = null;
347 try {
348 Type t = this.getField(4, 0);
349 ret = (CE)t;
350 } catch (ClassCastException cce) {
351 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
352 throw new RuntimeException(cce);
353 } catch (HL7Exception he) {
354 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
355 throw new RuntimeException(he);
356 }
357 return ret;
358 }
359
360
361
362 /**
363 * Returns
364 * INV-5: "Container Carrier Identifier" - creates it if necessary
365 */
366 public CE getContainerCarrierIdentifier() {
367 CE ret = null;
368 try {
369 Type t = this.getField(5, 0);
370 ret = (CE)t;
371 } catch (ClassCastException cce) {
372 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
373 throw new RuntimeException(cce);
374 } catch (HL7Exception he) {
375 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
376 throw new RuntimeException(he);
377 }
378 return ret;
379 }
380
381
382 /**
383 * Returns
384 * INV-5: "Container Carrier Identifier" - creates it if necessary
385 */
386 public CE getInv5_ContainerCarrierIdentifier() {
387 CE ret = null;
388 try {
389 Type t = this.getField(5, 0);
390 ret = (CE)t;
391 } catch (ClassCastException cce) {
392 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
393 throw new RuntimeException(cce);
394 } catch (HL7Exception he) {
395 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
396 throw new RuntimeException(he);
397 }
398 return ret;
399 }
400
401
402
403 /**
404 * Returns
405 * INV-6: "Position on Carrier" - creates it if necessary
406 */
407 public CE getPositionOnCarrier() {
408 CE ret = null;
409 try {
410 Type t = this.getField(6, 0);
411 ret = (CE)t;
412 } catch (ClassCastException cce) {
413 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
414 throw new RuntimeException(cce);
415 } catch (HL7Exception he) {
416 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
417 throw new RuntimeException(he);
418 }
419 return ret;
420 }
421
422
423 /**
424 * Returns
425 * INV-6: "Position on Carrier" - creates it if necessary
426 */
427 public CE getInv6_PositionOnCarrier() {
428 CE ret = null;
429 try {
430 Type t = this.getField(6, 0);
431 ret = (CE)t;
432 } catch (ClassCastException cce) {
433 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
434 throw new RuntimeException(cce);
435 } catch (HL7Exception he) {
436 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
437 throw new RuntimeException(he);
438 }
439 return ret;
440 }
441
442
443
444 /**
445 * Returns
446 * INV-7: "Initial Quantity" - creates it if necessary
447 */
448 public NM getInitialQuantity() {
449 NM ret = null;
450 try {
451 Type t = this.getField(7, 0);
452 ret = (NM)t;
453 } catch (ClassCastException cce) {
454 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
455 throw new RuntimeException(cce);
456 } catch (HL7Exception he) {
457 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
458 throw new RuntimeException(he);
459 }
460 return ret;
461 }
462
463
464 /**
465 * Returns
466 * INV-7: "Initial Quantity" - creates it if necessary
467 */
468 public NM getInv7_InitialQuantity() {
469 NM ret = null;
470 try {
471 Type t = this.getField(7, 0);
472 ret = (NM)t;
473 } catch (ClassCastException cce) {
474 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
475 throw new RuntimeException(cce);
476 } catch (HL7Exception he) {
477 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
478 throw new RuntimeException(he);
479 }
480 return ret;
481 }
482
483
484
485 /**
486 * Returns
487 * INV-8: "Current Quantity" - creates it if necessary
488 */
489 public NM getCurrentQuantity() {
490 NM ret = null;
491 try {
492 Type t = this.getField(8, 0);
493 ret = (NM)t;
494 } catch (ClassCastException cce) {
495 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
496 throw new RuntimeException(cce);
497 } catch (HL7Exception he) {
498 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
499 throw new RuntimeException(he);
500 }
501 return ret;
502 }
503
504
505 /**
506 * Returns
507 * INV-8: "Current Quantity" - creates it if necessary
508 */
509 public NM getInv8_CurrentQuantity() {
510 NM ret = null;
511 try {
512 Type t = this.getField(8, 0);
513 ret = (NM)t;
514 } catch (ClassCastException cce) {
515 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
516 throw new RuntimeException(cce);
517 } catch (HL7Exception he) {
518 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
519 throw new RuntimeException(he);
520 }
521 return ret;
522 }
523
524
525
526 /**
527 * Returns
528 * INV-9: "Available Quantity" - creates it if necessary
529 */
530 public NM getAvailableQuantity() {
531 NM ret = null;
532 try {
533 Type t = this.getField(9, 0);
534 ret = (NM)t;
535 } catch (ClassCastException cce) {
536 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
537 throw new RuntimeException(cce);
538 } catch (HL7Exception he) {
539 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
540 throw new RuntimeException(he);
541 }
542 return ret;
543 }
544
545
546 /**
547 * Returns
548 * INV-9: "Available Quantity" - creates it if necessary
549 */
550 public NM getInv9_AvailableQuantity() {
551 NM ret = null;
552 try {
553 Type t = this.getField(9, 0);
554 ret = (NM)t;
555 } catch (ClassCastException cce) {
556 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
557 throw new RuntimeException(cce);
558 } catch (HL7Exception he) {
559 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
560 throw new RuntimeException(he);
561 }
562 return ret;
563 }
564
565
566
567 /**
568 * Returns
569 * INV-10: "Consumption Quantity" - creates it if necessary
570 */
571 public NM getConsumptionQuantity() {
572 NM ret = null;
573 try {
574 Type t = this.getField(10, 0);
575 ret = (NM)t;
576 } catch (ClassCastException cce) {
577 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
578 throw new RuntimeException(cce);
579 } catch (HL7Exception he) {
580 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
581 throw new RuntimeException(he);
582 }
583 return ret;
584 }
585
586
587 /**
588 * Returns
589 * INV-10: "Consumption Quantity" - creates it if necessary
590 */
591 public NM getInv10_ConsumptionQuantity() {
592 NM ret = null;
593 try {
594 Type t = this.getField(10, 0);
595 ret = (NM)t;
596 } catch (ClassCastException cce) {
597 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
598 throw new RuntimeException(cce);
599 } catch (HL7Exception he) {
600 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
601 throw new RuntimeException(he);
602 }
603 return ret;
604 }
605
606
607
608 /**
609 * Returns
610 * INV-11: "Quantity Units" - creates it if necessary
611 */
612 public CE getQuantityUnits() {
613 CE ret = null;
614 try {
615 Type t = this.getField(11, 0);
616 ret = (CE)t;
617 } catch (ClassCastException cce) {
618 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
619 throw new RuntimeException(cce);
620 } catch (HL7Exception he) {
621 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
622 throw new RuntimeException(he);
623 }
624 return ret;
625 }
626
627
628 /**
629 * Returns
630 * INV-11: "Quantity Units" - creates it if necessary
631 */
632 public CE getInv11_QuantityUnits() {
633 CE ret = null;
634 try {
635 Type t = this.getField(11, 0);
636 ret = (CE)t;
637 } catch (ClassCastException cce) {
638 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
639 throw new RuntimeException(cce);
640 } catch (HL7Exception he) {
641 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
642 throw new RuntimeException(he);
643 }
644 return ret;
645 }
646
647
648
649 /**
650 * Returns
651 * INV-12: "Expiration Date/Time" - creates it if necessary
652 */
653 public TS getExpirationDateTime() {
654 TS ret = null;
655 try {
656 Type t = this.getField(12, 0);
657 ret = (TS)t;
658 } catch (ClassCastException cce) {
659 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
660 throw new RuntimeException(cce);
661 } catch (HL7Exception he) {
662 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
663 throw new RuntimeException(he);
664 }
665 return ret;
666 }
667
668
669 /**
670 * Returns
671 * INV-12: "Expiration Date/Time" - creates it if necessary
672 */
673 public TS getInv12_ExpirationDateTime() {
674 TS ret = null;
675 try {
676 Type t = this.getField(12, 0);
677 ret = (TS)t;
678 } catch (ClassCastException cce) {
679 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
680 throw new RuntimeException(cce);
681 } catch (HL7Exception he) {
682 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
683 throw new RuntimeException(he);
684 }
685 return ret;
686 }
687
688
689
690 /**
691 * Returns
692 * INV-13: "First Used Date/Time" - creates it if necessary
693 */
694 public TS getFirstUsedDateTime() {
695 TS ret = null;
696 try {
697 Type t = this.getField(13, 0);
698 ret = (TS)t;
699 } catch (ClassCastException cce) {
700 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
701 throw new RuntimeException(cce);
702 } catch (HL7Exception he) {
703 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
704 throw new RuntimeException(he);
705 }
706 return ret;
707 }
708
709
710 /**
711 * Returns
712 * INV-13: "First Used Date/Time" - creates it if necessary
713 */
714 public TS getInv13_FirstUsedDateTime() {
715 TS ret = null;
716 try {
717 Type t = this.getField(13, 0);
718 ret = (TS)t;
719 } catch (ClassCastException cce) {
720 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
721 throw new RuntimeException(cce);
722 } catch (HL7Exception he) {
723 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
724 throw new RuntimeException(he);
725 }
726 return ret;
727 }
728
729
730
731 /**
732 * Returns
733 * INV-14: "On Board Stability Duration" - creates it if necessary
734 */
735 public TQ getOnBoardStabilityDuration() {
736 TQ ret = null;
737 try {
738 Type t = this.getField(14, 0);
739 ret = (TQ)t;
740 } catch (ClassCastException cce) {
741 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
742 throw new RuntimeException(cce);
743 } catch (HL7Exception he) {
744 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
745 throw new RuntimeException(he);
746 }
747 return ret;
748 }
749
750
751 /**
752 * Returns
753 * INV-14: "On Board Stability Duration" - creates it if necessary
754 */
755 public TQ getInv14_OnBoardStabilityDuration() {
756 TQ ret = null;
757 try {
758 Type t = this.getField(14, 0);
759 ret = (TQ)t;
760 } catch (ClassCastException cce) {
761 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
762 throw new RuntimeException(cce);
763 } catch (HL7Exception he) {
764 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
765 throw new RuntimeException(he);
766 }
767 return ret;
768 }
769
770
771 /**
772 * Returns all repetitions of Test/Fluid Identifier(s) (INV-15).
773 */
774 public CE[] getTestFluidIdentifierS() {
775 CE[] ret = null;
776 try {
777 Type[] t = this.getField(15);
778 ret = new CE[t.length];
779 for (int i = 0; i < ret.length; i++) {
780 ret[i] = (CE)t[i];
781 }
782 } catch (ClassCastException cce) {
783 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
784 throw new RuntimeException(cce);
785 } catch (HL7Exception he) {
786 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
787 throw new RuntimeException(he);
788 }
789 return ret;
790 }
791
792
793 /**
794 * Returns a count of the current number of repetitions of Test/Fluid Identifier(s) (INV-15).
795 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
796 * it will return zero.
797 */
798 public int getTestFluidIdentifierSReps() {
799 CE[] ret = null;
800 try {
801 Type[] t = this.getField(15);
802 return t.length;
803 } catch (ClassCastException cce) {
804 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
805 throw new RuntimeException(cce);
806 } catch (HL7Exception he) {
807 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
808 throw new RuntimeException(he);
809 }
810 }
811
812
813 /**
814 * Returns a specific repetition of
815 * INV-15: "Test/Fluid Identifier(s)" - creates it if necessary
816 *
817 * @param rep The repetition index (0-indexed)
818 */
819 public CE getTestFluidIdentifierS(int rep) {
820 CE ret = null;
821 try {
822 Type t = this.getField(15, rep);
823 ret = (CE)t;
824 } catch (ClassCastException cce) {
825 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
826 throw new RuntimeException(cce);
827 } catch (HL7Exception he) {
828 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
829 throw new RuntimeException(he);
830 }
831 return ret;
832 }
833
834 /**
835 * Returns a specific repetition of
836 * INV-15: "Test/Fluid Identifier(s)" - creates it if necessary
837 *
838 * @param rep The repetition index (0-indexed)
839 */
840 public CE getInv15_TestFluidIdentifierS(int rep) {
841 CE ret = null;
842 try {
843 Type t = this.getField(15, rep);
844 ret = (CE)t;
845 } catch (ClassCastException cce) {
846 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
847 throw new RuntimeException(cce);
848 } catch (HL7Exception he) {
849 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
850 throw new RuntimeException(he);
851 }
852 return ret;
853 }
854
855
856 /**
857 * Returns a count of the current number of repetitions of Test/Fluid Identifier(s) (INV-15).
858 * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
859 * it will return zero.
860 */
861 public int getInv15_TestFluidIdentifierSReps() {
862 CE[] ret = null;
863 try {
864 Type[] t = this.getField(15);
865 return t.length;
866 } catch (ClassCastException cce) {
867 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
868 throw new RuntimeException(cce);
869 } catch (HL7Exception he) {
870 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
871 throw new RuntimeException(he);
872 }
873 }
874
875
876
877 /**
878 * Inserts a repetition of
879 * INV-15: "Test/Fluid Identifier(s)" at a specific index
880 *
881 * @param rep The repetition index (0-indexed)
882 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
883 */
884 public CE insertTestFluidIdentifierS(int rep) throws HL7Exception {
885 return (CE) super.insertRepetition(15, rep);
886 }
887
888
889
890 /**
891 * Inserts a repetition of
892 * INV-15: "Test/Fluid Identifier(s)" at a specific index
893 *
894 * @param rep The repetition index (0-indexed)
895 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
896 */
897 public CE insertInv15_TestFluidIdentifierS(int rep) throws HL7Exception {
898 return (CE) super.insertRepetition(15, rep);
899 }
900
901
902 /**
903 * Removes a repetition of
904 * INV-15: "Test/Fluid Identifier(s)" at a specific index
905 *
906 * @param rep The repetition index (0-indexed)
907 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
908 */
909 public CE removeTestFluidIdentifierS(int rep) throws HL7Exception {
910 return (CE) super.removeRepetition(15, rep);
911 }
912
913
914 /**
915 * Removes a repetition of
916 * INV-15: "Test/Fluid Identifier(s)" at a specific index
917 *
918 * @param rep The repetition index (0-indexed)
919 * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
920 */
921 public CE removeInv15_TestFluidIdentifierS(int rep) throws HL7Exception {
922 return (CE) super.removeRepetition(15, rep);
923 }
924
925
926
927
928 /**
929 * Returns
930 * INV-16: "Manufacturer Lot Number" - creates it if necessary
931 */
932 public ST getManufacturerLotNumber() {
933 ST ret = null;
934 try {
935 Type t = this.getField(16, 0);
936 ret = (ST)t;
937 } catch (ClassCastException cce) {
938 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
939 throw new RuntimeException(cce);
940 } catch (HL7Exception he) {
941 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
942 throw new RuntimeException(he);
943 }
944 return ret;
945 }
946
947
948 /**
949 * Returns
950 * INV-16: "Manufacturer Lot Number" - creates it if necessary
951 */
952 public ST getInv16_ManufacturerLotNumber() {
953 ST ret = null;
954 try {
955 Type t = this.getField(16, 0);
956 ret = (ST)t;
957 } catch (ClassCastException cce) {
958 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
959 throw new RuntimeException(cce);
960 } catch (HL7Exception he) {
961 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
962 throw new RuntimeException(he);
963 }
964 return ret;
965 }
966
967
968
969 /**
970 * Returns
971 * INV-17: "Manufacturer Identifier" - creates it if necessary
972 */
973 public CE getManufacturerIdentifier() {
974 CE ret = null;
975 try {
976 Type t = this.getField(17, 0);
977 ret = (CE)t;
978 } catch (ClassCastException cce) {
979 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
980 throw new RuntimeException(cce);
981 } catch (HL7Exception he) {
982 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
983 throw new RuntimeException(he);
984 }
985 return ret;
986 }
987
988
989 /**
990 * Returns
991 * INV-17: "Manufacturer Identifier" - creates it if necessary
992 */
993 public CE getInv17_ManufacturerIdentifier() {
994 CE ret = null;
995 try {
996 Type t = this.getField(17, 0);
997 ret = (CE)t;
998 } catch (ClassCastException cce) {
999 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
1000 throw new RuntimeException(cce);
1001 } catch (HL7Exception he) {
1002 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
1003 throw new RuntimeException(he);
1004 }
1005 return ret;
1006 }
1007
1008
1009
1010 /**
1011 * Returns
1012 * INV-18: "Supplier Identifier" - creates it if necessary
1013 */
1014 public CE getSupplierIdentifier() {
1015 CE ret = null;
1016 try {
1017 Type t = this.getField(18, 0);
1018 ret = (CE)t;
1019 } catch (ClassCastException cce) {
1020 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
1021 throw new RuntimeException(cce);
1022 } catch (HL7Exception he) {
1023 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
1024 throw new RuntimeException(he);
1025 }
1026 return ret;
1027 }
1028
1029
1030 /**
1031 * Returns
1032 * INV-18: "Supplier Identifier" - creates it if necessary
1033 */
1034 public CE getInv18_SupplierIdentifier() {
1035 CE ret = null;
1036 try {
1037 Type t = this.getField(18, 0);
1038 ret = (CE)t;
1039 } catch (ClassCastException cce) {
1040 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce);
1041 throw new RuntimeException(cce);
1042 } catch (HL7Exception he) {
1043 HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he);
1044 throw new RuntimeException(he);
1045 }
1046 return ret;
1047 }
1048
1049
1050
1051
1052
1053 /** {@inheritDoc} */
1054 protected Type createNewTypeWithoutReflection(int field) {
1055 switch (field) {
1056 case 0: return new CE(getMessage());
1057 case 1: return new CE(getMessage());
1058 case 2: return new CE(getMessage());
1059 case 3: return new CE(getMessage());
1060 case 4: return new CE(getMessage());
1061 case 5: return new CE(getMessage());
1062 case 6: return new NM(getMessage());
1063 case 7: return new NM(getMessage());
1064 case 8: return new NM(getMessage());
1065 case 9: return new NM(getMessage());
1066 case 10: return new CE(getMessage());
1067 case 11: return new TS(getMessage());
1068 case 12: return new TS(getMessage());
1069 case 13: return new TQ(getMessage());
1070 case 14: return new CE(getMessage());
1071 case 15: return new ST(getMessage());
1072 case 16: return new CE(getMessage());
1073 case 17: return new CE(getMessage());
1074 default: return null;
1075 }
1076 }
1077
1078
1079 }
1080