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 RXD message segment (Pharmacy/Treatment Dispense). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>RXD-1: Dispense Sub-ID Counter (NM) <b> </b>
027         * <li>RXD-2: Dispense/Give Code (CE) <b> </b>
028         * <li>RXD-3: Date/Time Dispensed (TS) <b> </b>
029         * <li>RXD-4: Actual Dispense Amount (NM) <b> </b>
030         * <li>RXD-5: Actual Dispense Units (CE) <b>optional </b>
031         * <li>RXD-6: Actual Dosage Form (CE) <b>optional </b>
032         * <li>RXD-7: Prescription Number (ST) <b> </b>
033         * <li>RXD-8: Number of Refills Remaining (NM) <b>optional </b>
034         * <li>RXD-9: Dispense Notes (ST) <b>optional repeating</b>
035         * <li>RXD-10: Dispensing Provider (XCN) <b>optional repeating</b>
036         * <li>RXD-11: Substitution Status (ID) <b>optional </b>
037         * <li>RXD-12: Total Daily Dose (CQ) <b>optional </b>
038         * <li>RXD-13: Dispense-To Location (LA2) <b>optional </b>
039         * <li>RXD-14: Needs Human Review (ID) <b>optional </b>
040         * <li>RXD-15: Pharmacy/Treatment Supplier's Special Dispensing Instructions (CE) <b>optional repeating</b>
041         * <li>RXD-16: Actual Strength (NM) <b>optional </b>
042         * <li>RXD-17: Actual Strength Unit (CE) <b>optional </b>
043         * <li>RXD-18: Substance Lot Number (ST) <b>optional repeating</b>
044         * <li>RXD-19: Substance Expiration Date (TS) <b>optional repeating</b>
045         * <li>RXD-20: Substance Manufacturer Name (CE) <b>optional repeating</b>
046         * <li>RXD-21: Indication (CE) <b>optional repeating</b>
047         * <li>RXD-22: Dispense Package Size (NM) <b>optional </b>
048         * <li>RXD-23: Dispense Package Size Unit (CE) <b>optional </b>
049         * <li>RXD-24: Dispense Package Method (ID) <b>optional </b>
050         * <li>RXD-25: Supplementary Code (CE) <b>optional repeating</b>
051         * <li>RXD-26: Initiating Location (CE) <b>optional </b>
052         * <li>RXD-27: Packaging/Assembly Location (CE) <b>optional </b>
053     * </ul>
054     */
055    public class RXD extends AbstractSegment {
056    
057        /** 
058         * Creates a new RXD segment
059         */
060        public RXD(Group parent, ModelClassFactory factory) {
061           super(parent, factory);
062           init(factory);
063        }
064    
065        private void init(ModelClassFactory factory) {
066           try {
067                                      this.add(NM.class, true, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Dispense Sub-ID Counter");
068                                      this.add(CE.class, true, 1, 250, new Object[]{ getMessage(), new Integer(292) }, "Dispense/Give Code");
069                                      this.add(TS.class, true, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Date/Time Dispensed");
070                                      this.add(NM.class, true, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Actual Dispense Amount");
071                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Actual Dispense Units");
072                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Actual Dosage Form");
073                                      this.add(ST.class, true, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Prescription Number");
074                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Number of Refills Remaining");
075                                      this.add(ST.class, false, 0, 200, new Object[]{ getMessage(), new Integer(0) }, "Dispense Notes");
076                                      this.add(XCN.class, false, 0, 200, new Object[]{ getMessage(), new Integer(0) }, "Dispensing Provider");
077                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Substitution Status");
078                                      this.add(CQ.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "Total Daily Dose");
079                                      this.add(LA2.class, false, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Dispense-To Location");
080                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Needs Human Review");
081                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Pharmacy/Treatment Supplier's Special Dispensing Instructions");
082                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Actual Strength");
083                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Actual Strength Unit");
084                                      this.add(ST.class, false, 0, 20, new Object[]{ getMessage(), new Integer(0) }, "Substance Lot Number");
085                                      this.add(TS.class, false, 0, 26, new Object[]{ getMessage(), new Integer(0) }, "Substance Expiration Date");
086                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(227) }, "Substance Manufacturer Name");
087                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Indication");
088                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Dispense Package Size");
089                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Dispense Package Size Unit");
090                                      this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Dispense Package Method");
091                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Supplementary Code");
092                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Initiating Location");
093                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Packaging/Assembly Location");
094           } catch(HL7Exception e) {
095              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating RXD - this is probably a bug in the source code generator.", e);
096           }
097        }
098    
099    
100    
101        /**
102         * Returns
103         * RXD-1: "Dispense Sub-ID Counter" - creates it if necessary
104         */
105        public NM getDispenseSubIDCounter() { 
106            NM ret = null;
107            try {
108                Type t = this.getField(1, 0);
109                ret = (NM)t;
110            } catch (ClassCastException cce) {
111                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
112                throw new RuntimeException(cce);
113            } catch (HL7Exception he) {
114                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
115                throw new RuntimeException(he);
116            }
117            return ret;
118        }
119    
120    
121        /**
122         * Returns
123         * RXD-1: "Dispense Sub-ID Counter" - creates it if necessary
124         */
125        public NM getRxd1_DispenseSubIDCounter() { 
126            NM ret = null;
127            try {
128                Type t = this.getField(1, 0);
129                ret = (NM)t;
130            } catch (ClassCastException cce) {
131                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
132                throw new RuntimeException(cce);
133            } catch (HL7Exception he) {
134                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
135                throw new RuntimeException(he);
136            }
137            return ret;
138        }
139    
140    
141    
142        /**
143         * Returns
144         * RXD-2: "Dispense/Give Code" - creates it if necessary
145         */
146        public CE getDispenseGiveCode() { 
147            CE ret = null;
148            try {
149                Type t = this.getField(2, 0);
150                ret = (CE)t;
151            } catch (ClassCastException cce) {
152                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
153                throw new RuntimeException(cce);
154            } catch (HL7Exception he) {
155                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
156                throw new RuntimeException(he);
157            }
158            return ret;
159        }
160    
161    
162        /**
163         * Returns
164         * RXD-2: "Dispense/Give Code" - creates it if necessary
165         */
166        public CE getRxd2_DispenseGiveCode() { 
167            CE ret = null;
168            try {
169                Type t = this.getField(2, 0);
170                ret = (CE)t;
171            } catch (ClassCastException cce) {
172                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
173                throw new RuntimeException(cce);
174            } catch (HL7Exception he) {
175                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
176                throw new RuntimeException(he);
177            }
178            return ret;
179        }
180    
181    
182    
183        /**
184         * Returns
185         * RXD-3: "Date/Time Dispensed" - creates it if necessary
186         */
187        public TS getDateTimeDispensed() { 
188            TS ret = null;
189            try {
190                Type t = this.getField(3, 0);
191                ret = (TS)t;
192            } catch (ClassCastException cce) {
193                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
194                throw new RuntimeException(cce);
195            } catch (HL7Exception he) {
196                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
197                throw new RuntimeException(he);
198            }
199            return ret;
200        }
201    
202    
203        /**
204         * Returns
205         * RXD-3: "Date/Time Dispensed" - creates it if necessary
206         */
207        public TS getRxd3_DateTimeDispensed() { 
208            TS ret = null;
209            try {
210                Type t = this.getField(3, 0);
211                ret = (TS)t;
212            } catch (ClassCastException cce) {
213                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
214                throw new RuntimeException(cce);
215            } catch (HL7Exception he) {
216                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
217                throw new RuntimeException(he);
218            }
219            return ret;
220        }
221    
222    
223    
224        /**
225         * Returns
226         * RXD-4: "Actual Dispense Amount" - creates it if necessary
227         */
228        public NM getActualDispenseAmount() { 
229            NM ret = null;
230            try {
231                Type t = this.getField(4, 0);
232                ret = (NM)t;
233            } catch (ClassCastException cce) {
234                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
235                throw new RuntimeException(cce);
236            } catch (HL7Exception he) {
237                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
238                throw new RuntimeException(he);
239            }
240            return ret;
241        }
242    
243    
244        /**
245         * Returns
246         * RXD-4: "Actual Dispense Amount" - creates it if necessary
247         */
248        public NM getRxd4_ActualDispenseAmount() { 
249            NM ret = null;
250            try {
251                Type t = this.getField(4, 0);
252                ret = (NM)t;
253            } catch (ClassCastException cce) {
254                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
255                throw new RuntimeException(cce);
256            } catch (HL7Exception he) {
257                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
258                throw new RuntimeException(he);
259            }
260            return ret;
261        }
262    
263    
264    
265        /**
266         * Returns
267         * RXD-5: "Actual Dispense Units" - creates it if necessary
268         */
269        public CE getActualDispenseUnits() { 
270            CE ret = null;
271            try {
272                Type t = this.getField(5, 0);
273                ret = (CE)t;
274            } catch (ClassCastException cce) {
275                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
276                throw new RuntimeException(cce);
277            } catch (HL7Exception he) {
278                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
279                throw new RuntimeException(he);
280            }
281            return ret;
282        }
283    
284    
285        /**
286         * Returns
287         * RXD-5: "Actual Dispense Units" - creates it if necessary
288         */
289        public CE getRxd5_ActualDispenseUnits() { 
290            CE ret = null;
291            try {
292                Type t = this.getField(5, 0);
293                ret = (CE)t;
294            } catch (ClassCastException cce) {
295                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
296                throw new RuntimeException(cce);
297            } catch (HL7Exception he) {
298                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
299                throw new RuntimeException(he);
300            }
301            return ret;
302        }
303    
304    
305    
306        /**
307         * Returns
308         * RXD-6: "Actual Dosage Form" - creates it if necessary
309         */
310        public CE getActualDosageForm() { 
311            CE ret = null;
312            try {
313                Type t = this.getField(6, 0);
314                ret = (CE)t;
315            } catch (ClassCastException cce) {
316                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
317                throw new RuntimeException(cce);
318            } catch (HL7Exception he) {
319                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
320                throw new RuntimeException(he);
321            }
322            return ret;
323        }
324    
325    
326        /**
327         * Returns
328         * RXD-6: "Actual Dosage Form" - creates it if necessary
329         */
330        public CE getRxd6_ActualDosageForm() { 
331            CE ret = null;
332            try {
333                Type t = this.getField(6, 0);
334                ret = (CE)t;
335            } catch (ClassCastException cce) {
336                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
337                throw new RuntimeException(cce);
338            } catch (HL7Exception he) {
339                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
340                throw new RuntimeException(he);
341            }
342            return ret;
343        }
344    
345    
346    
347        /**
348         * Returns
349         * RXD-7: "Prescription Number" - creates it if necessary
350         */
351        public ST getPrescriptionNumber() { 
352            ST ret = null;
353            try {
354                Type t = this.getField(7, 0);
355                ret = (ST)t;
356            } catch (ClassCastException cce) {
357                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
358                throw new RuntimeException(cce);
359            } catch (HL7Exception he) {
360                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
361                throw new RuntimeException(he);
362            }
363            return ret;
364        }
365    
366    
367        /**
368         * Returns
369         * RXD-7: "Prescription Number" - creates it if necessary
370         */
371        public ST getRxd7_PrescriptionNumber() { 
372            ST ret = null;
373            try {
374                Type t = this.getField(7, 0);
375                ret = (ST)t;
376            } catch (ClassCastException cce) {
377                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
378                throw new RuntimeException(cce);
379            } catch (HL7Exception he) {
380                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
381                throw new RuntimeException(he);
382            }
383            return ret;
384        }
385    
386    
387    
388        /**
389         * Returns
390         * RXD-8: "Number of Refills Remaining" - creates it if necessary
391         */
392        public NM getNumberOfRefillsRemaining() { 
393            NM ret = null;
394            try {
395                Type t = this.getField(8, 0);
396                ret = (NM)t;
397            } catch (ClassCastException cce) {
398                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
399                throw new RuntimeException(cce);
400            } catch (HL7Exception he) {
401                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
402                throw new RuntimeException(he);
403            }
404            return ret;
405        }
406    
407    
408        /**
409         * Returns
410         * RXD-8: "Number of Refills Remaining" - creates it if necessary
411         */
412        public NM getRxd8_NumberOfRefillsRemaining() { 
413            NM ret = null;
414            try {
415                Type t = this.getField(8, 0);
416                ret = (NM)t;
417            } catch (ClassCastException cce) {
418                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
419                throw new RuntimeException(cce);
420            } catch (HL7Exception he) {
421                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
422                throw new RuntimeException(he);
423            }
424            return ret;
425        }
426    
427    
428        /**
429         * Returns all repetitions of Dispense Notes (RXD-9).
430         */
431        public ST[] getDispenseNotes() {
432            ST[] ret = null;
433            try {
434                Type[] t = this.getField(9);  
435                ret = new ST[t.length];
436                for (int i = 0; i < ret.length; i++) {
437                    ret[i] = (ST)t[i];
438                }
439            } catch (ClassCastException cce) {
440                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
441                throw new RuntimeException(cce);
442            } catch (HL7Exception he) {
443                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
444                throw new RuntimeException(he);
445            }
446            return ret;
447        }
448    
449    
450        /**
451         * Returns a count of the current number of repetitions of Dispense Notes (RXD-9).
452         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
453         * it will return zero.
454         */
455        public int getDispenseNotesReps() {
456            ST[] ret = null;
457            try {
458                Type[] t = this.getField(9);
459                return t.length;  
460            } catch (ClassCastException cce) {
461                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
462                throw new RuntimeException(cce);
463            } catch (HL7Exception he) {
464                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
465                throw new RuntimeException(he);
466            }
467        }
468    
469    
470        /**
471         * Returns a specific repetition of
472         * RXD-9: "Dispense Notes" - creates it if necessary
473         *
474         * @param rep The repetition index (0-indexed)
475         */
476        public ST getDispenseNotes(int rep) { 
477            ST ret = null;
478            try {
479                Type t = this.getField(9, rep);
480                ret = (ST)t;
481            } catch (ClassCastException cce) {
482                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
483                throw new RuntimeException(cce);
484            } catch (HL7Exception he) {
485                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
486                throw new RuntimeException(he);
487            }
488            return ret;
489        }
490    
491        /**
492         * Returns a specific repetition of
493         * RXD-9: "Dispense Notes" - creates it if necessary
494         *
495         * @param rep The repetition index (0-indexed)
496         */
497        public ST getRxd9_DispenseNotes(int rep) { 
498            ST ret = null;
499            try {
500                Type t = this.getField(9, rep);
501                ret = (ST)t;
502            } catch (ClassCastException cce) {
503                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
504                throw new RuntimeException(cce);
505            } catch (HL7Exception he) {
506                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
507                throw new RuntimeException(he);
508            }
509            return ret;
510        }
511    
512    
513        /**
514         * Returns a count of the current number of repetitions of Dispense Notes (RXD-9).
515         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
516         * it will return zero.
517         */
518        public int getRxd9_DispenseNotesReps() {
519            ST[] ret = null;
520            try {
521                Type[] t = this.getField(9);
522                return t.length;  
523            } catch (ClassCastException cce) {
524                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
525                throw new RuntimeException(cce);
526            } catch (HL7Exception he) {
527                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
528                throw new RuntimeException(he);
529            }
530        }
531    
532    
533    
534        /**
535         * Inserts a repetition of
536         * RXD-9: "Dispense Notes" at a specific index
537         *
538         * @param rep The repetition index (0-indexed)
539         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
540         */
541        public ST insertDispenseNotes(int rep) throws HL7Exception { 
542            return (ST) super.insertRepetition(9, rep);
543        }
544    
545    
546    
547        /**
548         * Inserts a repetition of
549         * RXD-9: "Dispense Notes" at a specific index
550         *
551         * @param rep The repetition index (0-indexed)
552         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
553         */
554        public ST insertRxd9_DispenseNotes(int rep) throws HL7Exception { 
555            return (ST) super.insertRepetition(9, rep);
556        }
557    
558    
559        /**
560         * Removes a repetition of
561         * RXD-9: "Dispense Notes" at a specific index
562         *
563         * @param rep The repetition index (0-indexed)
564         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
565         */
566        public ST removeDispenseNotes(int rep) throws HL7Exception { 
567            return (ST) super.removeRepetition(9, rep);
568        }
569    
570    
571        /**
572         * Removes a repetition of
573         * RXD-9: "Dispense Notes" at a specific index
574         *
575         * @param rep The repetition index (0-indexed)
576         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
577         */
578        public ST removeRxd9_DispenseNotes(int rep) throws HL7Exception { 
579            return (ST) super.removeRepetition(9, rep);
580        }
581    
582    
583    
584        /**
585         * Returns all repetitions of Dispensing Provider (RXD-10).
586         */
587        public XCN[] getDispensingProvider() {
588            XCN[] ret = null;
589            try {
590                Type[] t = this.getField(10);  
591                ret = new XCN[t.length];
592                for (int i = 0; i < ret.length; i++) {
593                    ret[i] = (XCN)t[i];
594                }
595            } catch (ClassCastException cce) {
596                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
597                throw new RuntimeException(cce);
598            } catch (HL7Exception he) {
599                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
600                throw new RuntimeException(he);
601            }
602            return ret;
603        }
604    
605    
606        /**
607         * Returns a count of the current number of repetitions of Dispensing Provider (RXD-10).
608         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
609         * it will return zero.
610         */
611        public int getDispensingProviderReps() {
612            XCN[] ret = null;
613            try {
614                Type[] t = this.getField(10);
615                return t.length;  
616            } catch (ClassCastException cce) {
617                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
618                throw new RuntimeException(cce);
619            } catch (HL7Exception he) {
620                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
621                throw new RuntimeException(he);
622            }
623        }
624    
625    
626        /**
627         * Returns a specific repetition of
628         * RXD-10: "Dispensing Provider" - creates it if necessary
629         *
630         * @param rep The repetition index (0-indexed)
631         */
632        public XCN getDispensingProvider(int rep) { 
633            XCN ret = null;
634            try {
635                Type t = this.getField(10, rep);
636                ret = (XCN)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         * Returns a specific repetition of
649         * RXD-10: "Dispensing Provider" - creates it if necessary
650         *
651         * @param rep The repetition index (0-indexed)
652         */
653        public XCN getRxd10_DispensingProvider(int rep) { 
654            XCN ret = null;
655            try {
656                Type t = this.getField(10, rep);
657                ret = (XCN)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 a count of the current number of repetitions of Dispensing Provider (RXD-10).
671         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
672         * it will return zero.
673         */
674        public int getRxd10_DispensingProviderReps() {
675            XCN[] ret = null;
676            try {
677                Type[] t = this.getField(10);
678                return t.length;  
679            } catch (ClassCastException cce) {
680                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
681                throw new RuntimeException(cce);
682            } catch (HL7Exception he) {
683                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
684                throw new RuntimeException(he);
685            }
686        }
687    
688    
689    
690        /**
691         * Inserts a repetition of
692         * RXD-10: "Dispensing Provider" at a specific index
693         *
694         * @param rep The repetition index (0-indexed)
695         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
696         */
697        public XCN insertDispensingProvider(int rep) throws HL7Exception { 
698            return (XCN) super.insertRepetition(10, rep);
699        }
700    
701    
702    
703        /**
704         * Inserts a repetition of
705         * RXD-10: "Dispensing Provider" at a specific index
706         *
707         * @param rep The repetition index (0-indexed)
708         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
709         */
710        public XCN insertRxd10_DispensingProvider(int rep) throws HL7Exception { 
711            return (XCN) super.insertRepetition(10, rep);
712        }
713    
714    
715        /**
716         * Removes a repetition of
717         * RXD-10: "Dispensing Provider" at a specific index
718         *
719         * @param rep The repetition index (0-indexed)
720         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
721         */
722        public XCN removeDispensingProvider(int rep) throws HL7Exception { 
723            return (XCN) super.removeRepetition(10, rep);
724        }
725    
726    
727        /**
728         * Removes a repetition of
729         * RXD-10: "Dispensing Provider" at a specific index
730         *
731         * @param rep The repetition index (0-indexed)
732         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
733         */
734        public XCN removeRxd10_DispensingProvider(int rep) throws HL7Exception { 
735            return (XCN) super.removeRepetition(10, rep);
736        }
737    
738    
739    
740    
741        /**
742         * Returns
743         * RXD-11: "Substitution Status" - creates it if necessary
744         */
745        public ID getSubstitutionStatus() { 
746            ID ret = null;
747            try {
748                Type t = this.getField(11, 0);
749                ret = (ID)t;
750            } catch (ClassCastException cce) {
751                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
752                throw new RuntimeException(cce);
753            } catch (HL7Exception he) {
754                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
755                throw new RuntimeException(he);
756            }
757            return ret;
758        }
759    
760    
761        /**
762         * Returns
763         * RXD-11: "Substitution Status" - creates it if necessary
764         */
765        public ID getRxd11_SubstitutionStatus() { 
766            ID ret = null;
767            try {
768                Type t = this.getField(11, 0);
769                ret = (ID)t;
770            } catch (ClassCastException cce) {
771                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
772                throw new RuntimeException(cce);
773            } catch (HL7Exception he) {
774                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
775                throw new RuntimeException(he);
776            }
777            return ret;
778        }
779    
780    
781    
782        /**
783         * Returns
784         * RXD-12: "Total Daily Dose" - creates it if necessary
785         */
786        public CQ getTotalDailyDose() { 
787            CQ ret = null;
788            try {
789                Type t = this.getField(12, 0);
790                ret = (CQ)t;
791            } catch (ClassCastException cce) {
792                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
793                throw new RuntimeException(cce);
794            } catch (HL7Exception he) {
795                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
796                throw new RuntimeException(he);
797            }
798            return ret;
799        }
800    
801    
802        /**
803         * Returns
804         * RXD-12: "Total Daily Dose" - creates it if necessary
805         */
806        public CQ getRxd12_TotalDailyDose() { 
807            CQ ret = null;
808            try {
809                Type t = this.getField(12, 0);
810                ret = (CQ)t;
811            } catch (ClassCastException cce) {
812                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
813                throw new RuntimeException(cce);
814            } catch (HL7Exception he) {
815                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
816                throw new RuntimeException(he);
817            }
818            return ret;
819        }
820    
821    
822    
823        /**
824         * Returns
825         * RXD-13: "Dispense-To Location" - creates it if necessary
826         */
827        public LA2 getDispenseToLocation() { 
828            LA2 ret = null;
829            try {
830                Type t = this.getField(13, 0);
831                ret = (LA2)t;
832            } catch (ClassCastException cce) {
833                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
834                throw new RuntimeException(cce);
835            } catch (HL7Exception he) {
836                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
837                throw new RuntimeException(he);
838            }
839            return ret;
840        }
841    
842    
843        /**
844         * Returns
845         * RXD-13: "Dispense-To Location" - creates it if necessary
846         */
847        public LA2 getRxd13_DispenseToLocation() { 
848            LA2 ret = null;
849            try {
850                Type t = this.getField(13, 0);
851                ret = (LA2)t;
852            } catch (ClassCastException cce) {
853                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
854                throw new RuntimeException(cce);
855            } catch (HL7Exception he) {
856                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
857                throw new RuntimeException(he);
858            }
859            return ret;
860        }
861    
862    
863    
864        /**
865         * Returns
866         * RXD-14: "Needs Human Review" - creates it if necessary
867         */
868        public ID getNeedsHumanReview() { 
869            ID ret = null;
870            try {
871                Type t = this.getField(14, 0);
872                ret = (ID)t;
873            } catch (ClassCastException cce) {
874                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
875                throw new RuntimeException(cce);
876            } catch (HL7Exception he) {
877                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
878                throw new RuntimeException(he);
879            }
880            return ret;
881        }
882    
883    
884        /**
885         * Returns
886         * RXD-14: "Needs Human Review" - creates it if necessary
887         */
888        public ID getRxd14_NeedsHumanReview() { 
889            ID ret = null;
890            try {
891                Type t = this.getField(14, 0);
892                ret = (ID)t;
893            } catch (ClassCastException cce) {
894                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
895                throw new RuntimeException(cce);
896            } catch (HL7Exception he) {
897                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
898                throw new RuntimeException(he);
899            }
900            return ret;
901        }
902    
903    
904        /**
905         * Returns all repetitions of Pharmacy/Treatment Supplier's Special Dispensing Instructions (RXD-15).
906         */
907        public CE[] getPharmacyTreatmentSupplierSSpecialDispensingInstructions() {
908            CE[] ret = null;
909            try {
910                Type[] t = this.getField(15);  
911                ret = new CE[t.length];
912                for (int i = 0; i < ret.length; i++) {
913                    ret[i] = (CE)t[i];
914                }
915            } catch (ClassCastException cce) {
916                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
917                throw new RuntimeException(cce);
918            } catch (HL7Exception he) {
919                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
920                throw new RuntimeException(he);
921            }
922            return ret;
923        }
924    
925    
926        /**
927         * Returns a count of the current number of repetitions of Pharmacy/Treatment Supplier's Special Dispensing Instructions (RXD-15).
928         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
929         * it will return zero.
930         */
931        public int getPharmacyTreatmentSupplierSSpecialDispensingInstructionsReps() {
932            CE[] ret = null;
933            try {
934                Type[] t = this.getField(15);
935                return t.length;  
936            } catch (ClassCastException cce) {
937                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
938                throw new RuntimeException(cce);
939            } catch (HL7Exception he) {
940                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
941                throw new RuntimeException(he);
942            }
943        }
944    
945    
946        /**
947         * Returns a specific repetition of
948         * RXD-15: "Pharmacy/Treatment Supplier's Special Dispensing Instructions" - creates it if necessary
949         *
950         * @param rep The repetition index (0-indexed)
951         */
952        public CE getPharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) { 
953            CE ret = null;
954            try {
955                Type t = this.getField(15, rep);
956                ret = (CE)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         * Returns a specific repetition of
969         * RXD-15: "Pharmacy/Treatment Supplier's Special Dispensing Instructions" - creates it if necessary
970         *
971         * @param rep The repetition index (0-indexed)
972         */
973        public CE getRxd15_PharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) { 
974            CE ret = null;
975            try {
976                Type t = this.getField(15, rep);
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 a count of the current number of repetitions of Pharmacy/Treatment Supplier's Special Dispensing Instructions (RXD-15).
991         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
992         * it will return zero.
993         */
994        public int getRxd15_PharmacyTreatmentSupplierSSpecialDispensingInstructionsReps() {
995            CE[] ret = null;
996            try {
997                Type[] t = this.getField(15);
998                return t.length;  
999            } catch (ClassCastException cce) {
1000                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1001                throw new RuntimeException(cce);
1002            } catch (HL7Exception he) {
1003                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1004                throw new RuntimeException(he);
1005            }
1006        }
1007    
1008    
1009    
1010        /**
1011         * Inserts a repetition of
1012         * RXD-15: "Pharmacy/Treatment Supplier's Special Dispensing Instructions" at a specific index
1013         *
1014         * @param rep The repetition index (0-indexed)
1015         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1016         */
1017        public CE insertPharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) throws HL7Exception { 
1018            return (CE) super.insertRepetition(15, rep);
1019        }
1020    
1021    
1022    
1023        /**
1024         * Inserts a repetition of
1025         * RXD-15: "Pharmacy/Treatment Supplier's Special Dispensing Instructions" at a specific index
1026         *
1027         * @param rep The repetition index (0-indexed)
1028         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1029         */
1030        public CE insertRxd15_PharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) throws HL7Exception { 
1031            return (CE) super.insertRepetition(15, rep);
1032        }
1033    
1034    
1035        /**
1036         * Removes a repetition of
1037         * RXD-15: "Pharmacy/Treatment Supplier's Special Dispensing Instructions" at a specific index
1038         *
1039         * @param rep The repetition index (0-indexed)
1040         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1041         */
1042        public CE removePharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) throws HL7Exception { 
1043            return (CE) super.removeRepetition(15, rep);
1044        }
1045    
1046    
1047        /**
1048         * Removes a repetition of
1049         * RXD-15: "Pharmacy/Treatment Supplier's Special Dispensing Instructions" at a specific index
1050         *
1051         * @param rep The repetition index (0-indexed)
1052         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1053         */
1054        public CE removeRxd15_PharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) throws HL7Exception { 
1055            return (CE) super.removeRepetition(15, rep);
1056        }
1057    
1058    
1059    
1060    
1061        /**
1062         * Returns
1063         * RXD-16: "Actual Strength" - creates it if necessary
1064         */
1065        public NM getActualStrength() { 
1066            NM ret = null;
1067            try {
1068                Type t = this.getField(16, 0);
1069                ret = (NM)t;
1070            } catch (ClassCastException cce) {
1071                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1072                throw new RuntimeException(cce);
1073            } catch (HL7Exception he) {
1074                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1075                throw new RuntimeException(he);
1076            }
1077            return ret;
1078        }
1079    
1080    
1081        /**
1082         * Returns
1083         * RXD-16: "Actual Strength" - creates it if necessary
1084         */
1085        public NM getRxd16_ActualStrength() { 
1086            NM ret = null;
1087            try {
1088                Type t = this.getField(16, 0);
1089                ret = (NM)t;
1090            } catch (ClassCastException cce) {
1091                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1092                throw new RuntimeException(cce);
1093            } catch (HL7Exception he) {
1094                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1095                throw new RuntimeException(he);
1096            }
1097            return ret;
1098        }
1099    
1100    
1101    
1102        /**
1103         * Returns
1104         * RXD-17: "Actual Strength Unit" - creates it if necessary
1105         */
1106        public CE getActualStrengthUnit() { 
1107            CE ret = null;
1108            try {
1109                Type t = this.getField(17, 0);
1110                ret = (CE)t;
1111            } catch (ClassCastException cce) {
1112                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1113                throw new RuntimeException(cce);
1114            } catch (HL7Exception he) {
1115                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1116                throw new RuntimeException(he);
1117            }
1118            return ret;
1119        }
1120    
1121    
1122        /**
1123         * Returns
1124         * RXD-17: "Actual Strength Unit" - creates it if necessary
1125         */
1126        public CE getRxd17_ActualStrengthUnit() { 
1127            CE ret = null;
1128            try {
1129                Type t = this.getField(17, 0);
1130                ret = (CE)t;
1131            } catch (ClassCastException cce) {
1132                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1133                throw new RuntimeException(cce);
1134            } catch (HL7Exception he) {
1135                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1136                throw new RuntimeException(he);
1137            }
1138            return ret;
1139        }
1140    
1141    
1142        /**
1143         * Returns all repetitions of Substance Lot Number (RXD-18).
1144         */
1145        public ST[] getSubstanceLotNumber() {
1146            ST[] ret = null;
1147            try {
1148                Type[] t = this.getField(18);  
1149                ret = new ST[t.length];
1150                for (int i = 0; i < ret.length; i++) {
1151                    ret[i] = (ST)t[i];
1152                }
1153            } catch (ClassCastException cce) {
1154                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1155                throw new RuntimeException(cce);
1156            } catch (HL7Exception he) {
1157                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1158                throw new RuntimeException(he);
1159            }
1160            return ret;
1161        }
1162    
1163    
1164        /**
1165         * Returns a count of the current number of repetitions of Substance Lot Number (RXD-18).
1166         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1167         * it will return zero.
1168         */
1169        public int getSubstanceLotNumberReps() {
1170            ST[] ret = null;
1171            try {
1172                Type[] t = this.getField(18);
1173                return t.length;  
1174            } catch (ClassCastException cce) {
1175                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1176                throw new RuntimeException(cce);
1177            } catch (HL7Exception he) {
1178                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1179                throw new RuntimeException(he);
1180            }
1181        }
1182    
1183    
1184        /**
1185         * Returns a specific repetition of
1186         * RXD-18: "Substance Lot Number" - creates it if necessary
1187         *
1188         * @param rep The repetition index (0-indexed)
1189         */
1190        public ST getSubstanceLotNumber(int rep) { 
1191            ST ret = null;
1192            try {
1193                Type t = this.getField(18, rep);
1194                ret = (ST)t;
1195            } catch (ClassCastException cce) {
1196                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1197                throw new RuntimeException(cce);
1198            } catch (HL7Exception he) {
1199                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1200                throw new RuntimeException(he);
1201            }
1202            return ret;
1203        }
1204    
1205        /**
1206         * Returns a specific repetition of
1207         * RXD-18: "Substance Lot Number" - creates it if necessary
1208         *
1209         * @param rep The repetition index (0-indexed)
1210         */
1211        public ST getRxd18_SubstanceLotNumber(int rep) { 
1212            ST ret = null;
1213            try {
1214                Type t = this.getField(18, rep);
1215                ret = (ST)t;
1216            } catch (ClassCastException cce) {
1217                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1218                throw new RuntimeException(cce);
1219            } catch (HL7Exception he) {
1220                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1221                throw new RuntimeException(he);
1222            }
1223            return ret;
1224        }
1225    
1226    
1227        /**
1228         * Returns a count of the current number of repetitions of Substance Lot Number (RXD-18).
1229         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1230         * it will return zero.
1231         */
1232        public int getRxd18_SubstanceLotNumberReps() {
1233            ST[] ret = null;
1234            try {
1235                Type[] t = this.getField(18);
1236                return t.length;  
1237            } catch (ClassCastException cce) {
1238                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1239                throw new RuntimeException(cce);
1240            } catch (HL7Exception he) {
1241                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1242                throw new RuntimeException(he);
1243            }
1244        }
1245    
1246    
1247    
1248        /**
1249         * Inserts a repetition of
1250         * RXD-18: "Substance Lot Number" at a specific index
1251         *
1252         * @param rep The repetition index (0-indexed)
1253         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1254         */
1255        public ST insertSubstanceLotNumber(int rep) throws HL7Exception { 
1256            return (ST) super.insertRepetition(18, rep);
1257        }
1258    
1259    
1260    
1261        /**
1262         * Inserts a repetition of
1263         * RXD-18: "Substance Lot Number" at a specific index
1264         *
1265         * @param rep The repetition index (0-indexed)
1266         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1267         */
1268        public ST insertRxd18_SubstanceLotNumber(int rep) throws HL7Exception { 
1269            return (ST) super.insertRepetition(18, rep);
1270        }
1271    
1272    
1273        /**
1274         * Removes a repetition of
1275         * RXD-18: "Substance Lot Number" at a specific index
1276         *
1277         * @param rep The repetition index (0-indexed)
1278         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1279         */
1280        public ST removeSubstanceLotNumber(int rep) throws HL7Exception { 
1281            return (ST) super.removeRepetition(18, rep);
1282        }
1283    
1284    
1285        /**
1286         * Removes a repetition of
1287         * RXD-18: "Substance Lot Number" at a specific index
1288         *
1289         * @param rep The repetition index (0-indexed)
1290         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1291         */
1292        public ST removeRxd18_SubstanceLotNumber(int rep) throws HL7Exception { 
1293            return (ST) super.removeRepetition(18, rep);
1294        }
1295    
1296    
1297    
1298        /**
1299         * Returns all repetitions of Substance Expiration Date (RXD-19).
1300         */
1301        public TS[] getSubstanceExpirationDate() {
1302            TS[] ret = null;
1303            try {
1304                Type[] t = this.getField(19);  
1305                ret = new TS[t.length];
1306                for (int i = 0; i < ret.length; i++) {
1307                    ret[i] = (TS)t[i];
1308                }
1309            } catch (ClassCastException cce) {
1310                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1311                throw new RuntimeException(cce);
1312            } catch (HL7Exception he) {
1313                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1314                throw new RuntimeException(he);
1315            }
1316            return ret;
1317        }
1318    
1319    
1320        /**
1321         * Returns a count of the current number of repetitions of Substance Expiration Date (RXD-19).
1322         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1323         * it will return zero.
1324         */
1325        public int getSubstanceExpirationDateReps() {
1326            TS[] ret = null;
1327            try {
1328                Type[] t = this.getField(19);
1329                return t.length;  
1330            } catch (ClassCastException cce) {
1331                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1332                throw new RuntimeException(cce);
1333            } catch (HL7Exception he) {
1334                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1335                throw new RuntimeException(he);
1336            }
1337        }
1338    
1339    
1340        /**
1341         * Returns a specific repetition of
1342         * RXD-19: "Substance Expiration Date" - creates it if necessary
1343         *
1344         * @param rep The repetition index (0-indexed)
1345         */
1346        public TS getSubstanceExpirationDate(int rep) { 
1347            TS ret = null;
1348            try {
1349                Type t = this.getField(19, rep);
1350                ret = (TS)t;
1351            } catch (ClassCastException cce) {
1352                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1353                throw new RuntimeException(cce);
1354            } catch (HL7Exception he) {
1355                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1356                throw new RuntimeException(he);
1357            }
1358            return ret;
1359        }
1360    
1361        /**
1362         * Returns a specific repetition of
1363         * RXD-19: "Substance Expiration Date" - creates it if necessary
1364         *
1365         * @param rep The repetition index (0-indexed)
1366         */
1367        public TS getRxd19_SubstanceExpirationDate(int rep) { 
1368            TS ret = null;
1369            try {
1370                Type t = this.getField(19, rep);
1371                ret = (TS)t;
1372            } catch (ClassCastException cce) {
1373                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1374                throw new RuntimeException(cce);
1375            } catch (HL7Exception he) {
1376                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1377                throw new RuntimeException(he);
1378            }
1379            return ret;
1380        }
1381    
1382    
1383        /**
1384         * Returns a count of the current number of repetitions of Substance Expiration Date (RXD-19).
1385         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1386         * it will return zero.
1387         */
1388        public int getRxd19_SubstanceExpirationDateReps() {
1389            TS[] ret = null;
1390            try {
1391                Type[] t = this.getField(19);
1392                return t.length;  
1393            } catch (ClassCastException cce) {
1394                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1395                throw new RuntimeException(cce);
1396            } catch (HL7Exception he) {
1397                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1398                throw new RuntimeException(he);
1399            }
1400        }
1401    
1402    
1403    
1404        /**
1405         * Inserts a repetition of
1406         * RXD-19: "Substance Expiration Date" at a specific index
1407         *
1408         * @param rep The repetition index (0-indexed)
1409         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1410         */
1411        public TS insertSubstanceExpirationDate(int rep) throws HL7Exception { 
1412            return (TS) super.insertRepetition(19, rep);
1413        }
1414    
1415    
1416    
1417        /**
1418         * Inserts a repetition of
1419         * RXD-19: "Substance Expiration Date" at a specific index
1420         *
1421         * @param rep The repetition index (0-indexed)
1422         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1423         */
1424        public TS insertRxd19_SubstanceExpirationDate(int rep) throws HL7Exception { 
1425            return (TS) super.insertRepetition(19, rep);
1426        }
1427    
1428    
1429        /**
1430         * Removes a repetition of
1431         * RXD-19: "Substance Expiration Date" at a specific index
1432         *
1433         * @param rep The repetition index (0-indexed)
1434         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1435         */
1436        public TS removeSubstanceExpirationDate(int rep) throws HL7Exception { 
1437            return (TS) super.removeRepetition(19, rep);
1438        }
1439    
1440    
1441        /**
1442         * Removes a repetition of
1443         * RXD-19: "Substance Expiration Date" at a specific index
1444         *
1445         * @param rep The repetition index (0-indexed)
1446         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1447         */
1448        public TS removeRxd19_SubstanceExpirationDate(int rep) throws HL7Exception { 
1449            return (TS) super.removeRepetition(19, rep);
1450        }
1451    
1452    
1453    
1454        /**
1455         * Returns all repetitions of Substance Manufacturer Name (RXD-20).
1456         */
1457        public CE[] getSubstanceManufacturerName() {
1458            CE[] ret = null;
1459            try {
1460                Type[] t = this.getField(20);  
1461                ret = new CE[t.length];
1462                for (int i = 0; i < ret.length; i++) {
1463                    ret[i] = (CE)t[i];
1464                }
1465            } catch (ClassCastException cce) {
1466                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1467                throw new RuntimeException(cce);
1468            } catch (HL7Exception he) {
1469                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1470                throw new RuntimeException(he);
1471            }
1472            return ret;
1473        }
1474    
1475    
1476        /**
1477         * Returns a count of the current number of repetitions of Substance Manufacturer Name (RXD-20).
1478         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1479         * it will return zero.
1480         */
1481        public int getSubstanceManufacturerNameReps() {
1482            CE[] ret = null;
1483            try {
1484                Type[] t = this.getField(20);
1485                return t.length;  
1486            } catch (ClassCastException cce) {
1487                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1488                throw new RuntimeException(cce);
1489            } catch (HL7Exception he) {
1490                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1491                throw new RuntimeException(he);
1492            }
1493        }
1494    
1495    
1496        /**
1497         * Returns a specific repetition of
1498         * RXD-20: "Substance Manufacturer Name" - creates it if necessary
1499         *
1500         * @param rep The repetition index (0-indexed)
1501         */
1502        public CE getSubstanceManufacturerName(int rep) { 
1503            CE ret = null;
1504            try {
1505                Type t = this.getField(20, rep);
1506                ret = (CE)t;
1507            } catch (ClassCastException cce) {
1508                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1509                throw new RuntimeException(cce);
1510            } catch (HL7Exception he) {
1511                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1512                throw new RuntimeException(he);
1513            }
1514            return ret;
1515        }
1516    
1517        /**
1518         * Returns a specific repetition of
1519         * RXD-20: "Substance Manufacturer Name" - creates it if necessary
1520         *
1521         * @param rep The repetition index (0-indexed)
1522         */
1523        public CE getRxd20_SubstanceManufacturerName(int rep) { 
1524            CE ret = null;
1525            try {
1526                Type t = this.getField(20, rep);
1527                ret = (CE)t;
1528            } catch (ClassCastException cce) {
1529                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1530                throw new RuntimeException(cce);
1531            } catch (HL7Exception he) {
1532                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1533                throw new RuntimeException(he);
1534            }
1535            return ret;
1536        }
1537    
1538    
1539        /**
1540         * Returns a count of the current number of repetitions of Substance Manufacturer Name (RXD-20).
1541         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1542         * it will return zero.
1543         */
1544        public int getRxd20_SubstanceManufacturerNameReps() {
1545            CE[] ret = null;
1546            try {
1547                Type[] t = this.getField(20);
1548                return t.length;  
1549            } catch (ClassCastException cce) {
1550                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1551                throw new RuntimeException(cce);
1552            } catch (HL7Exception he) {
1553                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1554                throw new RuntimeException(he);
1555            }
1556        }
1557    
1558    
1559    
1560        /**
1561         * Inserts a repetition of
1562         * RXD-20: "Substance Manufacturer Name" at a specific index
1563         *
1564         * @param rep The repetition index (0-indexed)
1565         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1566         */
1567        public CE insertSubstanceManufacturerName(int rep) throws HL7Exception { 
1568            return (CE) super.insertRepetition(20, rep);
1569        }
1570    
1571    
1572    
1573        /**
1574         * Inserts a repetition of
1575         * RXD-20: "Substance Manufacturer Name" at a specific index
1576         *
1577         * @param rep The repetition index (0-indexed)
1578         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1579         */
1580        public CE insertRxd20_SubstanceManufacturerName(int rep) throws HL7Exception { 
1581            return (CE) super.insertRepetition(20, rep);
1582        }
1583    
1584    
1585        /**
1586         * Removes a repetition of
1587         * RXD-20: "Substance Manufacturer Name" at a specific index
1588         *
1589         * @param rep The repetition index (0-indexed)
1590         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1591         */
1592        public CE removeSubstanceManufacturerName(int rep) throws HL7Exception { 
1593            return (CE) super.removeRepetition(20, rep);
1594        }
1595    
1596    
1597        /**
1598         * Removes a repetition of
1599         * RXD-20: "Substance Manufacturer Name" at a specific index
1600         *
1601         * @param rep The repetition index (0-indexed)
1602         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1603         */
1604        public CE removeRxd20_SubstanceManufacturerName(int rep) throws HL7Exception { 
1605            return (CE) super.removeRepetition(20, rep);
1606        }
1607    
1608    
1609    
1610        /**
1611         * Returns all repetitions of Indication (RXD-21).
1612         */
1613        public CE[] getIndication() {
1614            CE[] ret = null;
1615            try {
1616                Type[] t = this.getField(21);  
1617                ret = new CE[t.length];
1618                for (int i = 0; i < ret.length; i++) {
1619                    ret[i] = (CE)t[i];
1620                }
1621            } catch (ClassCastException cce) {
1622                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1623                throw new RuntimeException(cce);
1624            } catch (HL7Exception he) {
1625                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1626                throw new RuntimeException(he);
1627            }
1628            return ret;
1629        }
1630    
1631    
1632        /**
1633         * Returns a count of the current number of repetitions of Indication (RXD-21).
1634         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1635         * it will return zero.
1636         */
1637        public int getIndicationReps() {
1638            CE[] ret = null;
1639            try {
1640                Type[] t = this.getField(21);
1641                return t.length;  
1642            } catch (ClassCastException cce) {
1643                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1644                throw new RuntimeException(cce);
1645            } catch (HL7Exception he) {
1646                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1647                throw new RuntimeException(he);
1648            }
1649        }
1650    
1651    
1652        /**
1653         * Returns a specific repetition of
1654         * RXD-21: "Indication" - creates it if necessary
1655         *
1656         * @param rep The repetition index (0-indexed)
1657         */
1658        public CE getIndication(int rep) { 
1659            CE ret = null;
1660            try {
1661                Type t = this.getField(21, rep);
1662                ret = (CE)t;
1663            } catch (ClassCastException cce) {
1664                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1665                throw new RuntimeException(cce);
1666            } catch (HL7Exception he) {
1667                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1668                throw new RuntimeException(he);
1669            }
1670            return ret;
1671        }
1672    
1673        /**
1674         * Returns a specific repetition of
1675         * RXD-21: "Indication" - creates it if necessary
1676         *
1677         * @param rep The repetition index (0-indexed)
1678         */
1679        public CE getRxd21_Indication(int rep) { 
1680            CE ret = null;
1681            try {
1682                Type t = this.getField(21, rep);
1683                ret = (CE)t;
1684            } catch (ClassCastException cce) {
1685                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1686                throw new RuntimeException(cce);
1687            } catch (HL7Exception he) {
1688                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1689                throw new RuntimeException(he);
1690            }
1691            return ret;
1692        }
1693    
1694    
1695        /**
1696         * Returns a count of the current number of repetitions of Indication (RXD-21).
1697         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1698         * it will return zero.
1699         */
1700        public int getRxd21_IndicationReps() {
1701            CE[] ret = null;
1702            try {
1703                Type[] t = this.getField(21);
1704                return t.length;  
1705            } catch (ClassCastException cce) {
1706                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1707                throw new RuntimeException(cce);
1708            } catch (HL7Exception he) {
1709                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1710                throw new RuntimeException(he);
1711            }
1712        }
1713    
1714    
1715    
1716        /**
1717         * Inserts a repetition of
1718         * RXD-21: "Indication" at a specific index
1719         *
1720         * @param rep The repetition index (0-indexed)
1721         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1722         */
1723        public CE insertIndication(int rep) throws HL7Exception { 
1724            return (CE) super.insertRepetition(21, rep);
1725        }
1726    
1727    
1728    
1729        /**
1730         * Inserts a repetition of
1731         * RXD-21: "Indication" at a specific index
1732         *
1733         * @param rep The repetition index (0-indexed)
1734         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1735         */
1736        public CE insertRxd21_Indication(int rep) throws HL7Exception { 
1737            return (CE) super.insertRepetition(21, rep);
1738        }
1739    
1740    
1741        /**
1742         * Removes a repetition of
1743         * RXD-21: "Indication" at a specific index
1744         *
1745         * @param rep The repetition index (0-indexed)
1746         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1747         */
1748        public CE removeIndication(int rep) throws HL7Exception { 
1749            return (CE) super.removeRepetition(21, rep);
1750        }
1751    
1752    
1753        /**
1754         * Removes a repetition of
1755         * RXD-21: "Indication" at a specific index
1756         *
1757         * @param rep The repetition index (0-indexed)
1758         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1759         */
1760        public CE removeRxd21_Indication(int rep) throws HL7Exception { 
1761            return (CE) super.removeRepetition(21, rep);
1762        }
1763    
1764    
1765    
1766    
1767        /**
1768         * Returns
1769         * RXD-22: "Dispense Package Size" - creates it if necessary
1770         */
1771        public NM getDispensePackageSize() { 
1772            NM ret = null;
1773            try {
1774                Type t = this.getField(22, 0);
1775                ret = (NM)t;
1776            } catch (ClassCastException cce) {
1777                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1778                throw new RuntimeException(cce);
1779            } catch (HL7Exception he) {
1780                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1781                throw new RuntimeException(he);
1782            }
1783            return ret;
1784        }
1785    
1786    
1787        /**
1788         * Returns
1789         * RXD-22: "Dispense Package Size" - creates it if necessary
1790         */
1791        public NM getRxd22_DispensePackageSize() { 
1792            NM ret = null;
1793            try {
1794                Type t = this.getField(22, 0);
1795                ret = (NM)t;
1796            } catch (ClassCastException cce) {
1797                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1798                throw new RuntimeException(cce);
1799            } catch (HL7Exception he) {
1800                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1801                throw new RuntimeException(he);
1802            }
1803            return ret;
1804        }
1805    
1806    
1807    
1808        /**
1809         * Returns
1810         * RXD-23: "Dispense Package Size Unit" - creates it if necessary
1811         */
1812        public CE getDispensePackageSizeUnit() { 
1813            CE ret = null;
1814            try {
1815                Type t = this.getField(23, 0);
1816                ret = (CE)t;
1817            } catch (ClassCastException cce) {
1818                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1819                throw new RuntimeException(cce);
1820            } catch (HL7Exception he) {
1821                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1822                throw new RuntimeException(he);
1823            }
1824            return ret;
1825        }
1826    
1827    
1828        /**
1829         * Returns
1830         * RXD-23: "Dispense Package Size Unit" - creates it if necessary
1831         */
1832        public CE getRxd23_DispensePackageSizeUnit() { 
1833            CE ret = null;
1834            try {
1835                Type t = this.getField(23, 0);
1836                ret = (CE)t;
1837            } catch (ClassCastException cce) {
1838                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1839                throw new RuntimeException(cce);
1840            } catch (HL7Exception he) {
1841                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1842                throw new RuntimeException(he);
1843            }
1844            return ret;
1845        }
1846    
1847    
1848    
1849        /**
1850         * Returns
1851         * RXD-24: "Dispense Package Method" - creates it if necessary
1852         */
1853        public ID getDispensePackageMethod() { 
1854            ID ret = null;
1855            try {
1856                Type t = this.getField(24, 0);
1857                ret = (ID)t;
1858            } catch (ClassCastException cce) {
1859                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1860                throw new RuntimeException(cce);
1861            } catch (HL7Exception he) {
1862                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1863                throw new RuntimeException(he);
1864            }
1865            return ret;
1866        }
1867    
1868    
1869        /**
1870         * Returns
1871         * RXD-24: "Dispense Package Method" - creates it if necessary
1872         */
1873        public ID getRxd24_DispensePackageMethod() { 
1874            ID ret = null;
1875            try {
1876                Type t = this.getField(24, 0);
1877                ret = (ID)t;
1878            } catch (ClassCastException cce) {
1879                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1880                throw new RuntimeException(cce);
1881            } catch (HL7Exception he) {
1882                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1883                throw new RuntimeException(he);
1884            }
1885            return ret;
1886        }
1887    
1888    
1889        /**
1890         * Returns all repetitions of Supplementary Code (RXD-25).
1891         */
1892        public CE[] getSupplementaryCode() {
1893            CE[] ret = null;
1894            try {
1895                Type[] t = this.getField(25);  
1896                ret = new CE[t.length];
1897                for (int i = 0; i < ret.length; i++) {
1898                    ret[i] = (CE)t[i];
1899                }
1900            } catch (ClassCastException cce) {
1901                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1902                throw new RuntimeException(cce);
1903            } catch (HL7Exception he) {
1904                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1905                throw new RuntimeException(he);
1906            }
1907            return ret;
1908        }
1909    
1910    
1911        /**
1912         * Returns a count of the current number of repetitions of Supplementary Code (RXD-25).
1913         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1914         * it will return zero.
1915         */
1916        public int getSupplementaryCodeReps() {
1917            CE[] ret = null;
1918            try {
1919                Type[] t = this.getField(25);
1920                return t.length;  
1921            } catch (ClassCastException cce) {
1922                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1923                throw new RuntimeException(cce);
1924            } catch (HL7Exception he) {
1925                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1926                throw new RuntimeException(he);
1927            }
1928        }
1929    
1930    
1931        /**
1932         * Returns a specific repetition of
1933         * RXD-25: "Supplementary Code" - creates it if necessary
1934         *
1935         * @param rep The repetition index (0-indexed)
1936         */
1937        public CE getSupplementaryCode(int rep) { 
1938            CE ret = null;
1939            try {
1940                Type t = this.getField(25, rep);
1941                ret = (CE)t;
1942            } catch (ClassCastException cce) {
1943                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1944                throw new RuntimeException(cce);
1945            } catch (HL7Exception he) {
1946                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1947                throw new RuntimeException(he);
1948            }
1949            return ret;
1950        }
1951    
1952        /**
1953         * Returns a specific repetition of
1954         * RXD-25: "Supplementary Code" - creates it if necessary
1955         *
1956         * @param rep The repetition index (0-indexed)
1957         */
1958        public CE getRxd25_SupplementaryCode(int rep) { 
1959            CE ret = null;
1960            try {
1961                Type t = this.getField(25, rep);
1962                ret = (CE)t;
1963            } catch (ClassCastException cce) {
1964                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1965                throw new RuntimeException(cce);
1966            } catch (HL7Exception he) {
1967                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1968                throw new RuntimeException(he);
1969            }
1970            return ret;
1971        }
1972    
1973    
1974        /**
1975         * Returns a count of the current number of repetitions of Supplementary Code (RXD-25).
1976         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1977         * it will return zero.
1978         */
1979        public int getRxd25_SupplementaryCodeReps() {
1980            CE[] ret = null;
1981            try {
1982                Type[] t = this.getField(25);
1983                return t.length;  
1984            } catch (ClassCastException cce) {
1985                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1986                throw new RuntimeException(cce);
1987            } catch (HL7Exception he) {
1988                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1989                throw new RuntimeException(he);
1990            }
1991        }
1992    
1993    
1994    
1995        /**
1996         * Inserts a repetition of
1997         * RXD-25: "Supplementary Code" at a specific index
1998         *
1999         * @param rep The repetition index (0-indexed)
2000         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2001         */
2002        public CE insertSupplementaryCode(int rep) throws HL7Exception { 
2003            return (CE) super.insertRepetition(25, rep);
2004        }
2005    
2006    
2007    
2008        /**
2009         * Inserts a repetition of
2010         * RXD-25: "Supplementary Code" at a specific index
2011         *
2012         * @param rep The repetition index (0-indexed)
2013         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2014         */
2015        public CE insertRxd25_SupplementaryCode(int rep) throws HL7Exception { 
2016            return (CE) super.insertRepetition(25, rep);
2017        }
2018    
2019    
2020        /**
2021         * Removes a repetition of
2022         * RXD-25: "Supplementary Code" at a specific index
2023         *
2024         * @param rep The repetition index (0-indexed)
2025         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2026         */
2027        public CE removeSupplementaryCode(int rep) throws HL7Exception { 
2028            return (CE) super.removeRepetition(25, rep);
2029        }
2030    
2031    
2032        /**
2033         * Removes a repetition of
2034         * RXD-25: "Supplementary Code" at a specific index
2035         *
2036         * @param rep The repetition index (0-indexed)
2037         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2038         */
2039        public CE removeRxd25_SupplementaryCode(int rep) throws HL7Exception { 
2040            return (CE) super.removeRepetition(25, rep);
2041        }
2042    
2043    
2044    
2045    
2046        /**
2047         * Returns
2048         * RXD-26: "Initiating Location" - creates it if necessary
2049         */
2050        public CE getInitiatingLocation() { 
2051            CE ret = null;
2052            try {
2053                Type t = this.getField(26, 0);
2054                ret = (CE)t;
2055            } catch (ClassCastException cce) {
2056                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2057                throw new RuntimeException(cce);
2058            } catch (HL7Exception he) {
2059                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2060                throw new RuntimeException(he);
2061            }
2062            return ret;
2063        }
2064    
2065    
2066        /**
2067         * Returns
2068         * RXD-26: "Initiating Location" - creates it if necessary
2069         */
2070        public CE getRxd26_InitiatingLocation() { 
2071            CE ret = null;
2072            try {
2073                Type t = this.getField(26, 0);
2074                ret = (CE)t;
2075            } catch (ClassCastException cce) {
2076                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2077                throw new RuntimeException(cce);
2078            } catch (HL7Exception he) {
2079                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2080                throw new RuntimeException(he);
2081            }
2082            return ret;
2083        }
2084    
2085    
2086    
2087        /**
2088         * Returns
2089         * RXD-27: "Packaging/Assembly Location" - creates it if necessary
2090         */
2091        public CE getPackagingAssemblyLocation() { 
2092            CE ret = null;
2093            try {
2094                Type t = this.getField(27, 0);
2095                ret = (CE)t;
2096            } catch (ClassCastException cce) {
2097                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2098                throw new RuntimeException(cce);
2099            } catch (HL7Exception he) {
2100                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2101                throw new RuntimeException(he);
2102            }
2103            return ret;
2104        }
2105    
2106    
2107        /**
2108         * Returns
2109         * RXD-27: "Packaging/Assembly Location" - creates it if necessary
2110         */
2111        public CE getRxd27_PackagingAssemblyLocation() { 
2112            CE ret = null;
2113            try {
2114                Type t = this.getField(27, 0);
2115                ret = (CE)t;
2116            } catch (ClassCastException cce) {
2117                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2118                throw new RuntimeException(cce);
2119            } catch (HL7Exception he) {
2120                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2121                throw new RuntimeException(he);
2122            }
2123            return ret;
2124        }
2125    
2126    
2127    
2128    
2129    
2130        /** {@inheritDoc} */   
2131        protected Type createNewTypeWithoutReflection(int field) {
2132           switch (field) {
2133              case 0: return new NM(getMessage());
2134              case 1: return new CE(getMessage());
2135              case 2: return new TS(getMessage());
2136              case 3: return new NM(getMessage());
2137              case 4: return new CE(getMessage());
2138              case 5: return new CE(getMessage());
2139              case 6: return new ST(getMessage());
2140              case 7: return new NM(getMessage());
2141              case 8: return new ST(getMessage());
2142              case 9: return new XCN(getMessage());
2143              case 10: return new ID(getMessage(), new Integer( 167 ));
2144              case 11: return new CQ(getMessage());
2145              case 12: return new LA2(getMessage());
2146              case 13: return new ID(getMessage(), new Integer( 136 ));
2147              case 14: return new CE(getMessage());
2148              case 15: return new NM(getMessage());
2149              case 16: return new CE(getMessage());
2150              case 17: return new ST(getMessage());
2151              case 18: return new TS(getMessage());
2152              case 19: return new CE(getMessage());
2153              case 20: return new CE(getMessage());
2154              case 21: return new NM(getMessage());
2155              case 22: return new CE(getMessage());
2156              case 23: return new ID(getMessage(), new Integer( 321 ));
2157              case 24: return new CE(getMessage());
2158              case 25: return new CE(getMessage());
2159              case 26: return new CE(getMessage());
2160              default: return null;
2161           }
2162       }
2163    
2164    
2165    }
2166