001    /*
002     * This class is an auto-generated source file for a HAPI
003     * HL7 v2.x standard structure class.
004     *
005     * For more information, visit: http://hl7api.sourceforge.net/
006     */
007    
008    package ca.uhn.hl7v2.model.v231.segment;
009    
010    // import ca.uhn.hl7v2.model.v231.group.*;
011    import ca.uhn.hl7v2.model.v231.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 RXE message segment (RXE - pharmacy/treatment encoded order segment). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>RXE-1: Quantity/Timing (TQ) <b> </b>
027         * <li>RXE-2: Give Code (CE) <b> </b>
028         * <li>RXE-3: Give Amount - Minimum (NM) <b> </b>
029         * <li>RXE-4: Give Amount - Maximum (NM) <b>optional </b>
030         * <li>RXE-5: Give Units (CE) <b> </b>
031         * <li>RXE-6: Give Dosage Form (CE) <b>optional </b>
032         * <li>RXE-7: Provider’s Administration Instructions (CE) <b>optional repeating</b>
033         * <li>RXE-8: Deliver-to Location (LA1) <b>optional </b>
034         * <li>RXE-9: Substitution Status (ID) <b>optional </b>
035         * <li>RXE-10: Dispense Amount (NM) <b>optional </b>
036         * <li>RXE-11: Dispense Units (CE) <b>optional </b>
037         * <li>RXE-12: Number Of Refills (NM) <b>optional </b>
038         * <li>RXE-13: Ordering Provider’s DEA Number (XCN) <b>optional repeating</b>
039         * <li>RXE-14: Pharmacist/Treatment Supplier’s Verifier ID (XCN) <b>optional repeating</b>
040         * <li>RXE-15: Prescription Number (ST) <b>optional </b>
041         * <li>RXE-16: Number of Refills Remaining (NM) <b>optional </b>
042         * <li>RXE-17: Number of Refills/Doses Dispensed (NM) <b>optional </b>
043         * <li>RXE-18: D/T of Most Recent Refill or Dose Dispensed (TS) <b>optional </b>
044         * <li>RXE-19: Total Daily Dose (CQ) <b>optional </b>
045         * <li>RXE-20: Needs Human Review (ID) <b>optional </b>
046         * <li>RXE-21: Pharmacy/Treatment Supplier’s Special Dispensing Instructions (CE) <b>optional repeating</b>
047         * <li>RXE-22: Give Per (Time Unit) (ST) <b>optional </b>
048         * <li>RXE-23: Give Rate Amount (ST) <b>optional </b>
049         * <li>RXE-24: Give Rate Units (CE) <b>optional </b>
050         * <li>RXE-25: Give Strength (NM) <b>optional </b>
051         * <li>RXE-26: Give Strength Units (CE) <b>optional </b>
052         * <li>RXE-27: Give Indication (CE) <b>optional repeating</b>
053         * <li>RXE-28: Dispense Package Size (NM) <b>optional </b>
054         * <li>RXE-29: Dispense Package Size Unit (CE) <b>optional </b>
055         * <li>RXE-30: Dispense Package Method (ID) <b>optional </b>
056     * </ul>
057     */
058    public class RXE extends AbstractSegment {
059    
060        /** 
061         * Creates a new RXE segment
062         */
063        public RXE(Group parent, ModelClassFactory factory) {
064           super(parent, factory);
065           init(factory);
066        }
067    
068        private void init(ModelClassFactory factory) {
069           try {
070                                      this.add(TQ.class, true, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Quantity/Timing");
071                                      this.add(CE.class, true, 1, 100, new Object[]{ getMessage(), new Integer(292) }, "Give Code");
072                                      this.add(NM.class, true, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Give Amount - Minimum");
073                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Give Amount - Maximum");
074                                      this.add(CE.class, true, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Give Units");
075                                      this.add(CE.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Give Dosage Form");
076                                      this.add(CE.class, false, 0, 200, new Object[]{ getMessage(), new Integer(0) }, "Provider’s Administration Instructions");
077                                      this.add(LA1.class, false, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Deliver-to Location");
078                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Substitution Status");
079                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Dispense Amount");
080                                      this.add(CE.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Dispense Units");
081                                      this.add(NM.class, false, 1, 3, new Object[]{ getMessage(), new Integer(0) }, "Number Of Refills");
082                                      this.add(XCN.class, false, 0, 60, new Object[]{ getMessage(), new Integer(0) }, "Ordering Provider’s DEA Number");
083                                      this.add(XCN.class, false, 0, 60, new Object[]{ getMessage(), new Integer(0) }, "Pharmacist/Treatment Supplier’s Verifier ID");
084                                      this.add(ST.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Prescription Number");
085                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Number of Refills Remaining");
086                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Number of Refills/Doses Dispensed");
087                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "D/T of Most Recent Refill or Dose Dispensed");
088                                      this.add(CQ.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "Total Daily Dose");
089                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Needs Human Review");
090                                      this.add(CE.class, false, 0, 200, new Object[]{ getMessage(), new Integer(0) }, "Pharmacy/Treatment Supplier’s Special Dispensing Instructions");
091                                      this.add(ST.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Give Per (Time Unit)");
092                                      this.add(ST.class, false, 1, 6, new Object[]{ getMessage(), new Integer(0) }, "Give Rate Amount");
093                                      this.add(CE.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Give Rate Units");
094                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Give Strength");
095                                      this.add(CE.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Give Strength Units");
096                                      this.add(CE.class, false, 0, 200, new Object[]{ getMessage(), new Integer(0) }, "Give Indication");
097                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Dispense Package Size");
098                                      this.add(CE.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Dispense Package Size Unit");
099                                      this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Dispense Package Method");
100           } catch(HL7Exception e) {
101              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating RXE - this is probably a bug in the source code generator.", e);
102           }
103        }
104    
105    
106    
107        /**
108         * Returns
109         * RXE-1: "Quantity/Timing" - creates it if necessary
110         */
111        public TQ getQuantityTiming() { 
112            TQ ret = null;
113            try {
114                Type t = this.getField(1, 0);
115                ret = (TQ)t;
116            } catch (ClassCastException cce) {
117                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
118                throw new RuntimeException(cce);
119            } catch (HL7Exception he) {
120                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
121                throw new RuntimeException(he);
122            }
123            return ret;
124        }
125    
126    
127        /**
128         * Returns
129         * RXE-1: "Quantity/Timing" - creates it if necessary
130         */
131        public TQ getRxe1_QuantityTiming() { 
132            TQ ret = null;
133            try {
134                Type t = this.getField(1, 0);
135                ret = (TQ)t;
136            } catch (ClassCastException cce) {
137                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
138                throw new RuntimeException(cce);
139            } catch (HL7Exception he) {
140                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
141                throw new RuntimeException(he);
142            }
143            return ret;
144        }
145    
146    
147    
148        /**
149         * Returns
150         * RXE-2: "Give Code" - creates it if necessary
151         */
152        public CE getGiveCode() { 
153            CE ret = null;
154            try {
155                Type t = this.getField(2, 0);
156                ret = (CE)t;
157            } catch (ClassCastException cce) {
158                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
159                throw new RuntimeException(cce);
160            } catch (HL7Exception he) {
161                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
162                throw new RuntimeException(he);
163            }
164            return ret;
165        }
166    
167    
168        /**
169         * Returns
170         * RXE-2: "Give Code" - creates it if necessary
171         */
172        public CE getRxe2_GiveCode() { 
173            CE ret = null;
174            try {
175                Type t = this.getField(2, 0);
176                ret = (CE)t;
177            } catch (ClassCastException cce) {
178                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
179                throw new RuntimeException(cce);
180            } catch (HL7Exception he) {
181                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
182                throw new RuntimeException(he);
183            }
184            return ret;
185        }
186    
187    
188    
189        /**
190         * Returns
191         * RXE-3: "Give Amount - Minimum" - creates it if necessary
192         */
193        public NM getGiveAmountMinimum() { 
194            NM ret = null;
195            try {
196                Type t = this.getField(3, 0);
197                ret = (NM)t;
198            } catch (ClassCastException cce) {
199                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
200                throw new RuntimeException(cce);
201            } catch (HL7Exception he) {
202                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
203                throw new RuntimeException(he);
204            }
205            return ret;
206        }
207    
208    
209        /**
210         * Returns
211         * RXE-3: "Give Amount - Minimum" - creates it if necessary
212         */
213        public NM getRxe3_GiveAmountMinimum() { 
214            NM ret = null;
215            try {
216                Type t = this.getField(3, 0);
217                ret = (NM)t;
218            } catch (ClassCastException cce) {
219                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
220                throw new RuntimeException(cce);
221            } catch (HL7Exception he) {
222                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
223                throw new RuntimeException(he);
224            }
225            return ret;
226        }
227    
228    
229    
230        /**
231         * Returns
232         * RXE-4: "Give Amount - Maximum" - creates it if necessary
233         */
234        public NM getGiveAmountMaximum() { 
235            NM ret = null;
236            try {
237                Type t = this.getField(4, 0);
238                ret = (NM)t;
239            } catch (ClassCastException cce) {
240                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
241                throw new RuntimeException(cce);
242            } catch (HL7Exception he) {
243                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
244                throw new RuntimeException(he);
245            }
246            return ret;
247        }
248    
249    
250        /**
251         * Returns
252         * RXE-4: "Give Amount - Maximum" - creates it if necessary
253         */
254        public NM getRxe4_GiveAmountMaximum() { 
255            NM ret = null;
256            try {
257                Type t = this.getField(4, 0);
258                ret = (NM)t;
259            } catch (ClassCastException cce) {
260                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
261                throw new RuntimeException(cce);
262            } catch (HL7Exception he) {
263                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
264                throw new RuntimeException(he);
265            }
266            return ret;
267        }
268    
269    
270    
271        /**
272         * Returns
273         * RXE-5: "Give Units" - creates it if necessary
274         */
275        public CE getGiveUnits() { 
276            CE ret = null;
277            try {
278                Type t = this.getField(5, 0);
279                ret = (CE)t;
280            } catch (ClassCastException cce) {
281                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
282                throw new RuntimeException(cce);
283            } catch (HL7Exception he) {
284                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
285                throw new RuntimeException(he);
286            }
287            return ret;
288        }
289    
290    
291        /**
292         * Returns
293         * RXE-5: "Give Units" - creates it if necessary
294         */
295        public CE getRxe5_GiveUnits() { 
296            CE ret = null;
297            try {
298                Type t = this.getField(5, 0);
299                ret = (CE)t;
300            } catch (ClassCastException cce) {
301                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
302                throw new RuntimeException(cce);
303            } catch (HL7Exception he) {
304                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
305                throw new RuntimeException(he);
306            }
307            return ret;
308        }
309    
310    
311    
312        /**
313         * Returns
314         * RXE-6: "Give Dosage Form" - creates it if necessary
315         */
316        public CE getGiveDosageForm() { 
317            CE ret = null;
318            try {
319                Type t = this.getField(6, 0);
320                ret = (CE)t;
321            } catch (ClassCastException cce) {
322                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
323                throw new RuntimeException(cce);
324            } catch (HL7Exception he) {
325                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
326                throw new RuntimeException(he);
327            }
328            return ret;
329        }
330    
331    
332        /**
333         * Returns
334         * RXE-6: "Give Dosage Form" - creates it if necessary
335         */
336        public CE getRxe6_GiveDosageForm() { 
337            CE ret = null;
338            try {
339                Type t = this.getField(6, 0);
340                ret = (CE)t;
341            } catch (ClassCastException cce) {
342                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
343                throw new RuntimeException(cce);
344            } catch (HL7Exception he) {
345                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
346                throw new RuntimeException(he);
347            }
348            return ret;
349        }
350    
351    
352        /**
353         * Returns all repetitions of Provider’s Administration Instructions (RXE-7).
354         */
355        public CE[] getProviderSAdministrationInstructions() {
356            CE[] ret = null;
357            try {
358                Type[] t = this.getField(7);  
359                ret = new CE[t.length];
360                for (int i = 0; i < ret.length; i++) {
361                    ret[i] = (CE)t[i];
362                }
363            } catch (ClassCastException cce) {
364                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
365                throw new RuntimeException(cce);
366            } catch (HL7Exception he) {
367                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
368                throw new RuntimeException(he);
369            }
370            return ret;
371        }
372    
373    
374        /**
375         * Returns a count of the current number of repetitions of Provider’s Administration Instructions (RXE-7).
376         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
377         * it will return zero.
378         */
379        public int getProviderSAdministrationInstructionsReps() {
380            CE[] ret = null;
381            try {
382                Type[] t = this.getField(7);
383                return t.length;  
384            } catch (ClassCastException cce) {
385                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
386                throw new RuntimeException(cce);
387            } catch (HL7Exception he) {
388                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
389                throw new RuntimeException(he);
390            }
391        }
392    
393    
394        /**
395         * Returns a specific repetition of
396         * RXE-7: "Provider’s Administration Instructions" - creates it if necessary
397         *
398         * @param rep The repetition index (0-indexed)
399         */
400        public CE getProviderSAdministrationInstructions(int rep) { 
401            CE ret = null;
402            try {
403                Type t = this.getField(7, rep);
404                ret = (CE)t;
405            } catch (ClassCastException cce) {
406                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
407                throw new RuntimeException(cce);
408            } catch (HL7Exception he) {
409                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
410                throw new RuntimeException(he);
411            }
412            return ret;
413        }
414    
415        /**
416         * Returns a specific repetition of
417         * RXE-7: "Provider’s Administration Instructions" - creates it if necessary
418         *
419         * @param rep The repetition index (0-indexed)
420         */
421        public CE getRxe7_ProviderSAdministrationInstructions(int rep) { 
422            CE ret = null;
423            try {
424                Type t = this.getField(7, rep);
425                ret = (CE)t;
426            } catch (ClassCastException cce) {
427                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
428                throw new RuntimeException(cce);
429            } catch (HL7Exception he) {
430                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
431                throw new RuntimeException(he);
432            }
433            return ret;
434        }
435    
436    
437        /**
438         * Returns a count of the current number of repetitions of Provider’s Administration Instructions (RXE-7).
439         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
440         * it will return zero.
441         */
442        public int getRxe7_ProviderSAdministrationInstructionsReps() {
443            CE[] ret = null;
444            try {
445                Type[] t = this.getField(7);
446                return t.length;  
447            } catch (ClassCastException cce) {
448                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
449                throw new RuntimeException(cce);
450            } catch (HL7Exception he) {
451                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
452                throw new RuntimeException(he);
453            }
454        }
455    
456    
457    
458        /**
459         * Inserts a repetition of
460         * RXE-7: "Provider’s Administration Instructions" at a specific index
461         *
462         * @param rep The repetition index (0-indexed)
463         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
464         */
465        public CE insertProviderSAdministrationInstructions(int rep) throws HL7Exception { 
466            return (CE) super.insertRepetition(7, rep);
467        }
468    
469    
470    
471        /**
472         * Inserts a repetition of
473         * RXE-7: "Provider’s Administration Instructions" at a specific index
474         *
475         * @param rep The repetition index (0-indexed)
476         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
477         */
478        public CE insertRxe7_ProviderSAdministrationInstructions(int rep) throws HL7Exception { 
479            return (CE) super.insertRepetition(7, rep);
480        }
481    
482    
483        /**
484         * Removes a repetition of
485         * RXE-7: "Provider’s Administration Instructions" at a specific index
486         *
487         * @param rep The repetition index (0-indexed)
488         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
489         */
490        public CE removeProviderSAdministrationInstructions(int rep) throws HL7Exception { 
491            return (CE) super.removeRepetition(7, rep);
492        }
493    
494    
495        /**
496         * Removes a repetition of
497         * RXE-7: "Provider’s Administration Instructions" at a specific index
498         *
499         * @param rep The repetition index (0-indexed)
500         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
501         */
502        public CE removeRxe7_ProviderSAdministrationInstructions(int rep) throws HL7Exception { 
503            return (CE) super.removeRepetition(7, rep);
504        }
505    
506    
507    
508    
509        /**
510         * Returns
511         * RXE-8: "Deliver-to Location" - creates it if necessary
512         */
513        public LA1 getDeliverToLocation() { 
514            LA1 ret = null;
515            try {
516                Type t = this.getField(8, 0);
517                ret = (LA1)t;
518            } catch (ClassCastException cce) {
519                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
520                throw new RuntimeException(cce);
521            } catch (HL7Exception he) {
522                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
523                throw new RuntimeException(he);
524            }
525            return ret;
526        }
527    
528    
529        /**
530         * Returns
531         * RXE-8: "Deliver-to Location" - creates it if necessary
532         */
533        public LA1 getRxe8_DeliverToLocation() { 
534            LA1 ret = null;
535            try {
536                Type t = this.getField(8, 0);
537                ret = (LA1)t;
538            } catch (ClassCastException cce) {
539                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
540                throw new RuntimeException(cce);
541            } catch (HL7Exception he) {
542                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
543                throw new RuntimeException(he);
544            }
545            return ret;
546        }
547    
548    
549    
550        /**
551         * Returns
552         * RXE-9: "Substitution Status" - creates it if necessary
553         */
554        public ID getSubstitutionStatus() { 
555            ID ret = null;
556            try {
557                Type t = this.getField(9, 0);
558                ret = (ID)t;
559            } catch (ClassCastException cce) {
560                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
561                throw new RuntimeException(cce);
562            } catch (HL7Exception he) {
563                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
564                throw new RuntimeException(he);
565            }
566            return ret;
567        }
568    
569    
570        /**
571         * Returns
572         * RXE-9: "Substitution Status" - creates it if necessary
573         */
574        public ID getRxe9_SubstitutionStatus() { 
575            ID ret = null;
576            try {
577                Type t = this.getField(9, 0);
578                ret = (ID)t;
579            } catch (ClassCastException cce) {
580                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
581                throw new RuntimeException(cce);
582            } catch (HL7Exception he) {
583                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
584                throw new RuntimeException(he);
585            }
586            return ret;
587        }
588    
589    
590    
591        /**
592         * Returns
593         * RXE-10: "Dispense Amount" - creates it if necessary
594         */
595        public NM getDispenseAmount() { 
596            NM ret = null;
597            try {
598                Type t = this.getField(10, 0);
599                ret = (NM)t;
600            } catch (ClassCastException cce) {
601                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
602                throw new RuntimeException(cce);
603            } catch (HL7Exception he) {
604                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
605                throw new RuntimeException(he);
606            }
607            return ret;
608        }
609    
610    
611        /**
612         * Returns
613         * RXE-10: "Dispense Amount" - creates it if necessary
614         */
615        public NM getRxe10_DispenseAmount() { 
616            NM ret = null;
617            try {
618                Type t = this.getField(10, 0);
619                ret = (NM)t;
620            } catch (ClassCastException cce) {
621                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
622                throw new RuntimeException(cce);
623            } catch (HL7Exception he) {
624                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
625                throw new RuntimeException(he);
626            }
627            return ret;
628        }
629    
630    
631    
632        /**
633         * Returns
634         * RXE-11: "Dispense Units" - creates it if necessary
635         */
636        public CE getDispenseUnits() { 
637            CE ret = null;
638            try {
639                Type t = this.getField(11, 0);
640                ret = (CE)t;
641            } catch (ClassCastException cce) {
642                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
643                throw new RuntimeException(cce);
644            } catch (HL7Exception he) {
645                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
646                throw new RuntimeException(he);
647            }
648            return ret;
649        }
650    
651    
652        /**
653         * Returns
654         * RXE-11: "Dispense Units" - creates it if necessary
655         */
656        public CE getRxe11_DispenseUnits() { 
657            CE ret = null;
658            try {
659                Type t = this.getField(11, 0);
660                ret = (CE)t;
661            } catch (ClassCastException cce) {
662                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
663                throw new RuntimeException(cce);
664            } catch (HL7Exception he) {
665                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
666                throw new RuntimeException(he);
667            }
668            return ret;
669        }
670    
671    
672    
673        /**
674         * Returns
675         * RXE-12: "Number Of Refills" - creates it if necessary
676         */
677        public NM getNumberOfRefills() { 
678            NM ret = null;
679            try {
680                Type t = this.getField(12, 0);
681                ret = (NM)t;
682            } catch (ClassCastException cce) {
683                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
684                throw new RuntimeException(cce);
685            } catch (HL7Exception he) {
686                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
687                throw new RuntimeException(he);
688            }
689            return ret;
690        }
691    
692    
693        /**
694         * Returns
695         * RXE-12: "Number Of Refills" - creates it if necessary
696         */
697        public NM getRxe12_NumberOfRefills() { 
698            NM ret = null;
699            try {
700                Type t = this.getField(12, 0);
701                ret = (NM)t;
702            } catch (ClassCastException cce) {
703                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
704                throw new RuntimeException(cce);
705            } catch (HL7Exception he) {
706                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
707                throw new RuntimeException(he);
708            }
709            return ret;
710        }
711    
712    
713        /**
714         * Returns all repetitions of Ordering Provider’s DEA Number (RXE-13).
715         */
716        public XCN[] getOrderingProviderSDEANumber() {
717            XCN[] ret = null;
718            try {
719                Type[] t = this.getField(13);  
720                ret = new XCN[t.length];
721                for (int i = 0; i < ret.length; i++) {
722                    ret[i] = (XCN)t[i];
723                }
724            } catch (ClassCastException cce) {
725                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
726                throw new RuntimeException(cce);
727            } catch (HL7Exception he) {
728                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
729                throw new RuntimeException(he);
730            }
731            return ret;
732        }
733    
734    
735        /**
736         * Returns a count of the current number of repetitions of Ordering Provider’s DEA Number (RXE-13).
737         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
738         * it will return zero.
739         */
740        public int getOrderingProviderSDEANumberReps() {
741            XCN[] ret = null;
742            try {
743                Type[] t = this.getField(13);
744                return t.length;  
745            } catch (ClassCastException cce) {
746                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
747                throw new RuntimeException(cce);
748            } catch (HL7Exception he) {
749                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
750                throw new RuntimeException(he);
751            }
752        }
753    
754    
755        /**
756         * Returns a specific repetition of
757         * RXE-13: "Ordering Provider’s DEA Number" - creates it if necessary
758         *
759         * @param rep The repetition index (0-indexed)
760         */
761        public XCN getOrderingProviderSDEANumber(int rep) { 
762            XCN ret = null;
763            try {
764                Type t = this.getField(13, rep);
765                ret = (XCN)t;
766            } catch (ClassCastException cce) {
767                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
768                throw new RuntimeException(cce);
769            } catch (HL7Exception he) {
770                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
771                throw new RuntimeException(he);
772            }
773            return ret;
774        }
775    
776        /**
777         * Returns a specific repetition of
778         * RXE-13: "Ordering Provider’s DEA Number" - creates it if necessary
779         *
780         * @param rep The repetition index (0-indexed)
781         */
782        public XCN getRxe13_OrderingProviderSDEANumber(int rep) { 
783            XCN ret = null;
784            try {
785                Type t = this.getField(13, rep);
786                ret = (XCN)t;
787            } catch (ClassCastException cce) {
788                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
789                throw new RuntimeException(cce);
790            } catch (HL7Exception he) {
791                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
792                throw new RuntimeException(he);
793            }
794            return ret;
795        }
796    
797    
798        /**
799         * Returns a count of the current number of repetitions of Ordering Provider’s DEA Number (RXE-13).
800         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
801         * it will return zero.
802         */
803        public int getRxe13_OrderingProviderSDEANumberReps() {
804            XCN[] ret = null;
805            try {
806                Type[] t = this.getField(13);
807                return t.length;  
808            } catch (ClassCastException cce) {
809                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
810                throw new RuntimeException(cce);
811            } catch (HL7Exception he) {
812                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
813                throw new RuntimeException(he);
814            }
815        }
816    
817    
818    
819        /**
820         * Inserts a repetition of
821         * RXE-13: "Ordering Provider’s DEA Number" at a specific index
822         *
823         * @param rep The repetition index (0-indexed)
824         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
825         */
826        public XCN insertOrderingProviderSDEANumber(int rep) throws HL7Exception { 
827            return (XCN) super.insertRepetition(13, rep);
828        }
829    
830    
831    
832        /**
833         * Inserts a repetition of
834         * RXE-13: "Ordering Provider’s DEA Number" at a specific index
835         *
836         * @param rep The repetition index (0-indexed)
837         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
838         */
839        public XCN insertRxe13_OrderingProviderSDEANumber(int rep) throws HL7Exception { 
840            return (XCN) super.insertRepetition(13, rep);
841        }
842    
843    
844        /**
845         * Removes a repetition of
846         * RXE-13: "Ordering Provider’s DEA Number" at a specific index
847         *
848         * @param rep The repetition index (0-indexed)
849         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
850         */
851        public XCN removeOrderingProviderSDEANumber(int rep) throws HL7Exception { 
852            return (XCN) super.removeRepetition(13, rep);
853        }
854    
855    
856        /**
857         * Removes a repetition of
858         * RXE-13: "Ordering Provider’s DEA Number" at a specific index
859         *
860         * @param rep The repetition index (0-indexed)
861         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
862         */
863        public XCN removeRxe13_OrderingProviderSDEANumber(int rep) throws HL7Exception { 
864            return (XCN) super.removeRepetition(13, rep);
865        }
866    
867    
868    
869        /**
870         * Returns all repetitions of Pharmacist/Treatment Supplier’s Verifier ID (RXE-14).
871         */
872        public XCN[] getPharmacistTreatmentSupplierSVerifierID() {
873            XCN[] ret = null;
874            try {
875                Type[] t = this.getField(14);  
876                ret = new XCN[t.length];
877                for (int i = 0; i < ret.length; i++) {
878                    ret[i] = (XCN)t[i];
879                }
880            } catch (ClassCastException cce) {
881                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
882                throw new RuntimeException(cce);
883            } catch (HL7Exception he) {
884                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
885                throw new RuntimeException(he);
886            }
887            return ret;
888        }
889    
890    
891        /**
892         * Returns a count of the current number of repetitions of Pharmacist/Treatment Supplier’s Verifier ID (RXE-14).
893         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
894         * it will return zero.
895         */
896        public int getPharmacistTreatmentSupplierSVerifierIDReps() {
897            XCN[] ret = null;
898            try {
899                Type[] t = this.getField(14);
900                return t.length;  
901            } catch (ClassCastException cce) {
902                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
903                throw new RuntimeException(cce);
904            } catch (HL7Exception he) {
905                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
906                throw new RuntimeException(he);
907            }
908        }
909    
910    
911        /**
912         * Returns a specific repetition of
913         * RXE-14: "Pharmacist/Treatment Supplier’s Verifier ID" - creates it if necessary
914         *
915         * @param rep The repetition index (0-indexed)
916         */
917        public XCN getPharmacistTreatmentSupplierSVerifierID(int rep) { 
918            XCN ret = null;
919            try {
920                Type t = this.getField(14, rep);
921                ret = (XCN)t;
922            } catch (ClassCastException cce) {
923                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
924                throw new RuntimeException(cce);
925            } catch (HL7Exception he) {
926                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
927                throw new RuntimeException(he);
928            }
929            return ret;
930        }
931    
932        /**
933         * Returns a specific repetition of
934         * RXE-14: "Pharmacist/Treatment Supplier’s Verifier ID" - creates it if necessary
935         *
936         * @param rep The repetition index (0-indexed)
937         */
938        public XCN getRxe14_PharmacistTreatmentSupplierSVerifierID(int rep) { 
939            XCN ret = null;
940            try {
941                Type t = this.getField(14, rep);
942                ret = (XCN)t;
943            } catch (ClassCastException cce) {
944                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
945                throw new RuntimeException(cce);
946            } catch (HL7Exception he) {
947                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
948                throw new RuntimeException(he);
949            }
950            return ret;
951        }
952    
953    
954        /**
955         * Returns a count of the current number of repetitions of Pharmacist/Treatment Supplier’s Verifier ID (RXE-14).
956         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
957         * it will return zero.
958         */
959        public int getRxe14_PharmacistTreatmentSupplierSVerifierIDReps() {
960            XCN[] ret = null;
961            try {
962                Type[] t = this.getField(14);
963                return t.length;  
964            } catch (ClassCastException cce) {
965                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
966                throw new RuntimeException(cce);
967            } catch (HL7Exception he) {
968                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
969                throw new RuntimeException(he);
970            }
971        }
972    
973    
974    
975        /**
976         * Inserts a repetition of
977         * RXE-14: "Pharmacist/Treatment Supplier’s Verifier ID" at a specific index
978         *
979         * @param rep The repetition index (0-indexed)
980         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
981         */
982        public XCN insertPharmacistTreatmentSupplierSVerifierID(int rep) throws HL7Exception { 
983            return (XCN) super.insertRepetition(14, rep);
984        }
985    
986    
987    
988        /**
989         * Inserts a repetition of
990         * RXE-14: "Pharmacist/Treatment Supplier’s Verifier ID" at a specific index
991         *
992         * @param rep The repetition index (0-indexed)
993         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
994         */
995        public XCN insertRxe14_PharmacistTreatmentSupplierSVerifierID(int rep) throws HL7Exception { 
996            return (XCN) super.insertRepetition(14, rep);
997        }
998    
999    
1000        /**
1001         * Removes a repetition of
1002         * RXE-14: "Pharmacist/Treatment Supplier’s Verifier ID" at a specific index
1003         *
1004         * @param rep The repetition index (0-indexed)
1005         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1006         */
1007        public XCN removePharmacistTreatmentSupplierSVerifierID(int rep) throws HL7Exception { 
1008            return (XCN) super.removeRepetition(14, rep);
1009        }
1010    
1011    
1012        /**
1013         * Removes a repetition of
1014         * RXE-14: "Pharmacist/Treatment Supplier’s Verifier ID" at a specific index
1015         *
1016         * @param rep The repetition index (0-indexed)
1017         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1018         */
1019        public XCN removeRxe14_PharmacistTreatmentSupplierSVerifierID(int rep) throws HL7Exception { 
1020            return (XCN) super.removeRepetition(14, rep);
1021        }
1022    
1023    
1024    
1025    
1026        /**
1027         * Returns
1028         * RXE-15: "Prescription Number" - creates it if necessary
1029         */
1030        public ST getPrescriptionNumber() { 
1031            ST ret = null;
1032            try {
1033                Type t = this.getField(15, 0);
1034                ret = (ST)t;
1035            } catch (ClassCastException cce) {
1036                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1037                throw new RuntimeException(cce);
1038            } catch (HL7Exception he) {
1039                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1040                throw new RuntimeException(he);
1041            }
1042            return ret;
1043        }
1044    
1045    
1046        /**
1047         * Returns
1048         * RXE-15: "Prescription Number" - creates it if necessary
1049         */
1050        public ST getRxe15_PrescriptionNumber() { 
1051            ST ret = null;
1052            try {
1053                Type t = this.getField(15, 0);
1054                ret = (ST)t;
1055            } catch (ClassCastException cce) {
1056                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1057                throw new RuntimeException(cce);
1058            } catch (HL7Exception he) {
1059                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1060                throw new RuntimeException(he);
1061            }
1062            return ret;
1063        }
1064    
1065    
1066    
1067        /**
1068         * Returns
1069         * RXE-16: "Number of Refills Remaining" - creates it if necessary
1070         */
1071        public NM getNumberOfRefillsRemaining() { 
1072            NM ret = null;
1073            try {
1074                Type t = this.getField(16, 0);
1075                ret = (NM)t;
1076            } catch (ClassCastException cce) {
1077                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1078                throw new RuntimeException(cce);
1079            } catch (HL7Exception he) {
1080                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1081                throw new RuntimeException(he);
1082            }
1083            return ret;
1084        }
1085    
1086    
1087        /**
1088         * Returns
1089         * RXE-16: "Number of Refills Remaining" - creates it if necessary
1090         */
1091        public NM getRxe16_NumberOfRefillsRemaining() { 
1092            NM ret = null;
1093            try {
1094                Type t = this.getField(16, 0);
1095                ret = (NM)t;
1096            } catch (ClassCastException cce) {
1097                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1098                throw new RuntimeException(cce);
1099            } catch (HL7Exception he) {
1100                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1101                throw new RuntimeException(he);
1102            }
1103            return ret;
1104        }
1105    
1106    
1107    
1108        /**
1109         * Returns
1110         * RXE-17: "Number of Refills/Doses Dispensed" - creates it if necessary
1111         */
1112        public NM getNumberOfRefillsDosesDispensed() { 
1113            NM ret = null;
1114            try {
1115                Type t = this.getField(17, 0);
1116                ret = (NM)t;
1117            } catch (ClassCastException cce) {
1118                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1119                throw new RuntimeException(cce);
1120            } catch (HL7Exception he) {
1121                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1122                throw new RuntimeException(he);
1123            }
1124            return ret;
1125        }
1126    
1127    
1128        /**
1129         * Returns
1130         * RXE-17: "Number of Refills/Doses Dispensed" - creates it if necessary
1131         */
1132        public NM getRxe17_NumberOfRefillsDosesDispensed() { 
1133            NM ret = null;
1134            try {
1135                Type t = this.getField(17, 0);
1136                ret = (NM)t;
1137            } catch (ClassCastException cce) {
1138                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1139                throw new RuntimeException(cce);
1140            } catch (HL7Exception he) {
1141                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1142                throw new RuntimeException(he);
1143            }
1144            return ret;
1145        }
1146    
1147    
1148    
1149        /**
1150         * Returns
1151         * RXE-18: "D/T of Most Recent Refill or Dose Dispensed" - creates it if necessary
1152         */
1153        public TS getDTOfMostRecentRefillOrDoseDispensed() { 
1154            TS ret = null;
1155            try {
1156                Type t = this.getField(18, 0);
1157                ret = (TS)t;
1158            } catch (ClassCastException cce) {
1159                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1160                throw new RuntimeException(cce);
1161            } catch (HL7Exception he) {
1162                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1163                throw new RuntimeException(he);
1164            }
1165            return ret;
1166        }
1167    
1168    
1169        /**
1170         * Returns
1171         * RXE-18: "D/T of Most Recent Refill or Dose Dispensed" - creates it if necessary
1172         */
1173        public TS getRxe18_DTOfMostRecentRefillOrDoseDispensed() { 
1174            TS ret = null;
1175            try {
1176                Type t = this.getField(18, 0);
1177                ret = (TS)t;
1178            } catch (ClassCastException cce) {
1179                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1180                throw new RuntimeException(cce);
1181            } catch (HL7Exception he) {
1182                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1183                throw new RuntimeException(he);
1184            }
1185            return ret;
1186        }
1187    
1188    
1189    
1190        /**
1191         * Returns
1192         * RXE-19: "Total Daily Dose" - creates it if necessary
1193         */
1194        public CQ getTotalDailyDose() { 
1195            CQ ret = null;
1196            try {
1197                Type t = this.getField(19, 0);
1198                ret = (CQ)t;
1199            } catch (ClassCastException cce) {
1200                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1201                throw new RuntimeException(cce);
1202            } catch (HL7Exception he) {
1203                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1204                throw new RuntimeException(he);
1205            }
1206            return ret;
1207        }
1208    
1209    
1210        /**
1211         * Returns
1212         * RXE-19: "Total Daily Dose" - creates it if necessary
1213         */
1214        public CQ getRxe19_TotalDailyDose() { 
1215            CQ ret = null;
1216            try {
1217                Type t = this.getField(19, 0);
1218                ret = (CQ)t;
1219            } catch (ClassCastException cce) {
1220                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1221                throw new RuntimeException(cce);
1222            } catch (HL7Exception he) {
1223                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1224                throw new RuntimeException(he);
1225            }
1226            return ret;
1227        }
1228    
1229    
1230    
1231        /**
1232         * Returns
1233         * RXE-20: "Needs Human Review" - creates it if necessary
1234         */
1235        public ID getNeedsHumanReview() { 
1236            ID ret = null;
1237            try {
1238                Type t = this.getField(20, 0);
1239                ret = (ID)t;
1240            } catch (ClassCastException cce) {
1241                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1242                throw new RuntimeException(cce);
1243            } catch (HL7Exception he) {
1244                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1245                throw new RuntimeException(he);
1246            }
1247            return ret;
1248        }
1249    
1250    
1251        /**
1252         * Returns
1253         * RXE-20: "Needs Human Review" - creates it if necessary
1254         */
1255        public ID getRxe20_NeedsHumanReview() { 
1256            ID ret = null;
1257            try {
1258                Type t = this.getField(20, 0);
1259                ret = (ID)t;
1260            } catch (ClassCastException cce) {
1261                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1262                throw new RuntimeException(cce);
1263            } catch (HL7Exception he) {
1264                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1265                throw new RuntimeException(he);
1266            }
1267            return ret;
1268        }
1269    
1270    
1271        /**
1272         * Returns all repetitions of Pharmacy/Treatment Supplier’s Special Dispensing Instructions (RXE-21).
1273         */
1274        public CE[] getPharmacyTreatmentSupplierSSpecialDispensingInstructions() {
1275            CE[] ret = null;
1276            try {
1277                Type[] t = this.getField(21);  
1278                ret = new CE[t.length];
1279                for (int i = 0; i < ret.length; i++) {
1280                    ret[i] = (CE)t[i];
1281                }
1282            } catch (ClassCastException cce) {
1283                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1284                throw new RuntimeException(cce);
1285            } catch (HL7Exception he) {
1286                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1287                throw new RuntimeException(he);
1288            }
1289            return ret;
1290        }
1291    
1292    
1293        /**
1294         * Returns a count of the current number of repetitions of Pharmacy/Treatment Supplier’s Special Dispensing Instructions (RXE-21).
1295         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1296         * it will return zero.
1297         */
1298        public int getPharmacyTreatmentSupplierSSpecialDispensingInstructionsReps() {
1299            CE[] ret = null;
1300            try {
1301                Type[] t = this.getField(21);
1302                return t.length;  
1303            } catch (ClassCastException cce) {
1304                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1305                throw new RuntimeException(cce);
1306            } catch (HL7Exception he) {
1307                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1308                throw new RuntimeException(he);
1309            }
1310        }
1311    
1312    
1313        /**
1314         * Returns a specific repetition of
1315         * RXE-21: "Pharmacy/Treatment Supplier’s Special Dispensing Instructions" - creates it if necessary
1316         *
1317         * @param rep The repetition index (0-indexed)
1318         */
1319        public CE getPharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) { 
1320            CE ret = null;
1321            try {
1322                Type t = this.getField(21, rep);
1323                ret = (CE)t;
1324            } catch (ClassCastException cce) {
1325                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1326                throw new RuntimeException(cce);
1327            } catch (HL7Exception he) {
1328                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1329                throw new RuntimeException(he);
1330            }
1331            return ret;
1332        }
1333    
1334        /**
1335         * Returns a specific repetition of
1336         * RXE-21: "Pharmacy/Treatment Supplier’s Special Dispensing Instructions" - creates it if necessary
1337         *
1338         * @param rep The repetition index (0-indexed)
1339         */
1340        public CE getRxe21_PharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) { 
1341            CE ret = null;
1342            try {
1343                Type t = this.getField(21, rep);
1344                ret = (CE)t;
1345            } catch (ClassCastException cce) {
1346                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1347                throw new RuntimeException(cce);
1348            } catch (HL7Exception he) {
1349                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1350                throw new RuntimeException(he);
1351            }
1352            return ret;
1353        }
1354    
1355    
1356        /**
1357         * Returns a count of the current number of repetitions of Pharmacy/Treatment Supplier’s Special Dispensing Instructions (RXE-21).
1358         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1359         * it will return zero.
1360         */
1361        public int getRxe21_PharmacyTreatmentSupplierSSpecialDispensingInstructionsReps() {
1362            CE[] ret = null;
1363            try {
1364                Type[] t = this.getField(21);
1365                return t.length;  
1366            } catch (ClassCastException cce) {
1367                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1368                throw new RuntimeException(cce);
1369            } catch (HL7Exception he) {
1370                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1371                throw new RuntimeException(he);
1372            }
1373        }
1374    
1375    
1376    
1377        /**
1378         * Inserts a repetition of
1379         * RXE-21: "Pharmacy/Treatment Supplier’s Special Dispensing Instructions" at a specific index
1380         *
1381         * @param rep The repetition index (0-indexed)
1382         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1383         */
1384        public CE insertPharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) throws HL7Exception { 
1385            return (CE) super.insertRepetition(21, rep);
1386        }
1387    
1388    
1389    
1390        /**
1391         * Inserts a repetition of
1392         * RXE-21: "Pharmacy/Treatment Supplier’s Special Dispensing Instructions" at a specific index
1393         *
1394         * @param rep The repetition index (0-indexed)
1395         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1396         */
1397        public CE insertRxe21_PharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) throws HL7Exception { 
1398            return (CE) super.insertRepetition(21, rep);
1399        }
1400    
1401    
1402        /**
1403         * Removes a repetition of
1404         * RXE-21: "Pharmacy/Treatment Supplier’s Special Dispensing Instructions" at a specific index
1405         *
1406         * @param rep The repetition index (0-indexed)
1407         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1408         */
1409        public CE removePharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) throws HL7Exception { 
1410            return (CE) super.removeRepetition(21, rep);
1411        }
1412    
1413    
1414        /**
1415         * Removes a repetition of
1416         * RXE-21: "Pharmacy/Treatment Supplier’s Special Dispensing Instructions" at a specific index
1417         *
1418         * @param rep The repetition index (0-indexed)
1419         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1420         */
1421        public CE removeRxe21_PharmacyTreatmentSupplierSSpecialDispensingInstructions(int rep) throws HL7Exception { 
1422            return (CE) super.removeRepetition(21, rep);
1423        }
1424    
1425    
1426    
1427    
1428        /**
1429         * Returns
1430         * RXE-22: "Give Per (Time Unit)" - creates it if necessary
1431         */
1432        public ST getGivePerTimeUnit() { 
1433            ST ret = null;
1434            try {
1435                Type t = this.getField(22, 0);
1436                ret = (ST)t;
1437            } catch (ClassCastException cce) {
1438                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1439                throw new RuntimeException(cce);
1440            } catch (HL7Exception he) {
1441                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1442                throw new RuntimeException(he);
1443            }
1444            return ret;
1445        }
1446    
1447    
1448        /**
1449         * Returns
1450         * RXE-22: "Give Per (Time Unit)" - creates it if necessary
1451         */
1452        public ST getRxe22_GivePerTimeUnit() { 
1453            ST ret = null;
1454            try {
1455                Type t = this.getField(22, 0);
1456                ret = (ST)t;
1457            } catch (ClassCastException cce) {
1458                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1459                throw new RuntimeException(cce);
1460            } catch (HL7Exception he) {
1461                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1462                throw new RuntimeException(he);
1463            }
1464            return ret;
1465        }
1466    
1467    
1468    
1469        /**
1470         * Returns
1471         * RXE-23: "Give Rate Amount" - creates it if necessary
1472         */
1473        public ST getGiveRateAmount() { 
1474            ST ret = null;
1475            try {
1476                Type t = this.getField(23, 0);
1477                ret = (ST)t;
1478            } catch (ClassCastException cce) {
1479                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1480                throw new RuntimeException(cce);
1481            } catch (HL7Exception he) {
1482                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1483                throw new RuntimeException(he);
1484            }
1485            return ret;
1486        }
1487    
1488    
1489        /**
1490         * Returns
1491         * RXE-23: "Give Rate Amount" - creates it if necessary
1492         */
1493        public ST getRxe23_GiveRateAmount() { 
1494            ST ret = null;
1495            try {
1496                Type t = this.getField(23, 0);
1497                ret = (ST)t;
1498            } catch (ClassCastException cce) {
1499                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1500                throw new RuntimeException(cce);
1501            } catch (HL7Exception he) {
1502                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1503                throw new RuntimeException(he);
1504            }
1505            return ret;
1506        }
1507    
1508    
1509    
1510        /**
1511         * Returns
1512         * RXE-24: "Give Rate Units" - creates it if necessary
1513         */
1514        public CE getGiveRateUnits() { 
1515            CE ret = null;
1516            try {
1517                Type t = this.getField(24, 0);
1518                ret = (CE)t;
1519            } catch (ClassCastException cce) {
1520                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1521                throw new RuntimeException(cce);
1522            } catch (HL7Exception he) {
1523                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1524                throw new RuntimeException(he);
1525            }
1526            return ret;
1527        }
1528    
1529    
1530        /**
1531         * Returns
1532         * RXE-24: "Give Rate Units" - creates it if necessary
1533         */
1534        public CE getRxe24_GiveRateUnits() { 
1535            CE ret = null;
1536            try {
1537                Type t = this.getField(24, 0);
1538                ret = (CE)t;
1539            } catch (ClassCastException cce) {
1540                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1541                throw new RuntimeException(cce);
1542            } catch (HL7Exception he) {
1543                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1544                throw new RuntimeException(he);
1545            }
1546            return ret;
1547        }
1548    
1549    
1550    
1551        /**
1552         * Returns
1553         * RXE-25: "Give Strength" - creates it if necessary
1554         */
1555        public NM getGiveStrength() { 
1556            NM ret = null;
1557            try {
1558                Type t = this.getField(25, 0);
1559                ret = (NM)t;
1560            } catch (ClassCastException cce) {
1561                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1562                throw new RuntimeException(cce);
1563            } catch (HL7Exception he) {
1564                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1565                throw new RuntimeException(he);
1566            }
1567            return ret;
1568        }
1569    
1570    
1571        /**
1572         * Returns
1573         * RXE-25: "Give Strength" - creates it if necessary
1574         */
1575        public NM getRxe25_GiveStrength() { 
1576            NM ret = null;
1577            try {
1578                Type t = this.getField(25, 0);
1579                ret = (NM)t;
1580            } catch (ClassCastException cce) {
1581                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1582                throw new RuntimeException(cce);
1583            } catch (HL7Exception he) {
1584                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1585                throw new RuntimeException(he);
1586            }
1587            return ret;
1588        }
1589    
1590    
1591    
1592        /**
1593         * Returns
1594         * RXE-26: "Give Strength Units" - creates it if necessary
1595         */
1596        public CE getGiveStrengthUnits() { 
1597            CE ret = null;
1598            try {
1599                Type t = this.getField(26, 0);
1600                ret = (CE)t;
1601            } catch (ClassCastException cce) {
1602                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1603                throw new RuntimeException(cce);
1604            } catch (HL7Exception he) {
1605                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1606                throw new RuntimeException(he);
1607            }
1608            return ret;
1609        }
1610    
1611    
1612        /**
1613         * Returns
1614         * RXE-26: "Give Strength Units" - creates it if necessary
1615         */
1616        public CE getRxe26_GiveStrengthUnits() { 
1617            CE ret = null;
1618            try {
1619                Type t = this.getField(26, 0);
1620                ret = (CE)t;
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 all repetitions of Give Indication (RXE-27).
1634         */
1635        public CE[] getGiveIndication() {
1636            CE[] ret = null;
1637            try {
1638                Type[] t = this.getField(27);  
1639                ret = new CE[t.length];
1640                for (int i = 0; i < ret.length; i++) {
1641                    ret[i] = (CE)t[i];
1642                }
1643            } catch (ClassCastException cce) {
1644                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1645                throw new RuntimeException(cce);
1646            } catch (HL7Exception he) {
1647                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1648                throw new RuntimeException(he);
1649            }
1650            return ret;
1651        }
1652    
1653    
1654        /**
1655         * Returns a count of the current number of repetitions of Give Indication (RXE-27).
1656         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1657         * it will return zero.
1658         */
1659        public int getGiveIndicationReps() {
1660            CE[] ret = null;
1661            try {
1662                Type[] t = this.getField(27);
1663                return t.length;  
1664            } catch (ClassCastException cce) {
1665                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1666                throw new RuntimeException(cce);
1667            } catch (HL7Exception he) {
1668                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1669                throw new RuntimeException(he);
1670            }
1671        }
1672    
1673    
1674        /**
1675         * Returns a specific repetition of
1676         * RXE-27: "Give Indication" - creates it if necessary
1677         *
1678         * @param rep The repetition index (0-indexed)
1679         */
1680        public CE getGiveIndication(int rep) { 
1681            CE ret = null;
1682            try {
1683                Type t = this.getField(27, rep);
1684                ret = (CE)t;
1685            } catch (ClassCastException cce) {
1686                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1687                throw new RuntimeException(cce);
1688            } catch (HL7Exception he) {
1689                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1690                throw new RuntimeException(he);
1691            }
1692            return ret;
1693        }
1694    
1695        /**
1696         * Returns a specific repetition of
1697         * RXE-27: "Give Indication" - creates it if necessary
1698         *
1699         * @param rep The repetition index (0-indexed)
1700         */
1701        public CE getRxe27_GiveIndication(int rep) { 
1702            CE ret = null;
1703            try {
1704                Type t = this.getField(27, rep);
1705                ret = (CE)t;
1706            } catch (ClassCastException cce) {
1707                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1708                throw new RuntimeException(cce);
1709            } catch (HL7Exception he) {
1710                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1711                throw new RuntimeException(he);
1712            }
1713            return ret;
1714        }
1715    
1716    
1717        /**
1718         * Returns a count of the current number of repetitions of Give Indication (RXE-27).
1719         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1720         * it will return zero.
1721         */
1722        public int getRxe27_GiveIndicationReps() {
1723            CE[] ret = null;
1724            try {
1725                Type[] t = this.getField(27);
1726                return t.length;  
1727            } catch (ClassCastException cce) {
1728                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1729                throw new RuntimeException(cce);
1730            } catch (HL7Exception he) {
1731                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1732                throw new RuntimeException(he);
1733            }
1734        }
1735    
1736    
1737    
1738        /**
1739         * Inserts a repetition of
1740         * RXE-27: "Give Indication" at a specific index
1741         *
1742         * @param rep The repetition index (0-indexed)
1743         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1744         */
1745        public CE insertGiveIndication(int rep) throws HL7Exception { 
1746            return (CE) super.insertRepetition(27, rep);
1747        }
1748    
1749    
1750    
1751        /**
1752         * Inserts a repetition of
1753         * RXE-27: "Give Indication" at a specific index
1754         *
1755         * @param rep The repetition index (0-indexed)
1756         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1757         */
1758        public CE insertRxe27_GiveIndication(int rep) throws HL7Exception { 
1759            return (CE) super.insertRepetition(27, rep);
1760        }
1761    
1762    
1763        /**
1764         * Removes a repetition of
1765         * RXE-27: "Give Indication" at a specific index
1766         *
1767         * @param rep The repetition index (0-indexed)
1768         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1769         */
1770        public CE removeGiveIndication(int rep) throws HL7Exception { 
1771            return (CE) super.removeRepetition(27, rep);
1772        }
1773    
1774    
1775        /**
1776         * Removes a repetition of
1777         * RXE-27: "Give Indication" at a specific index
1778         *
1779         * @param rep The repetition index (0-indexed)
1780         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1781         */
1782        public CE removeRxe27_GiveIndication(int rep) throws HL7Exception { 
1783            return (CE) super.removeRepetition(27, rep);
1784        }
1785    
1786    
1787    
1788    
1789        /**
1790         * Returns
1791         * RXE-28: "Dispense Package Size" - creates it if necessary
1792         */
1793        public NM getDispensePackageSize() { 
1794            NM ret = null;
1795            try {
1796                Type t = this.getField(28, 0);
1797                ret = (NM)t;
1798            } catch (ClassCastException cce) {
1799                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1800                throw new RuntimeException(cce);
1801            } catch (HL7Exception he) {
1802                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1803                throw new RuntimeException(he);
1804            }
1805            return ret;
1806        }
1807    
1808    
1809        /**
1810         * Returns
1811         * RXE-28: "Dispense Package Size" - creates it if necessary
1812         */
1813        public NM getRxe28_DispensePackageSize() { 
1814            NM ret = null;
1815            try {
1816                Type t = this.getField(28, 0);
1817                ret = (NM)t;
1818            } catch (ClassCastException cce) {
1819                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1820                throw new RuntimeException(cce);
1821            } catch (HL7Exception he) {
1822                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1823                throw new RuntimeException(he);
1824            }
1825            return ret;
1826        }
1827    
1828    
1829    
1830        /**
1831         * Returns
1832         * RXE-29: "Dispense Package Size Unit" - creates it if necessary
1833         */
1834        public CE getDispensePackageSizeUnit() { 
1835            CE ret = null;
1836            try {
1837                Type t = this.getField(29, 0);
1838                ret = (CE)t;
1839            } catch (ClassCastException cce) {
1840                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1841                throw new RuntimeException(cce);
1842            } catch (HL7Exception he) {
1843                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1844                throw new RuntimeException(he);
1845            }
1846            return ret;
1847        }
1848    
1849    
1850        /**
1851         * Returns
1852         * RXE-29: "Dispense Package Size Unit" - creates it if necessary
1853         */
1854        public CE getRxe29_DispensePackageSizeUnit() { 
1855            CE ret = null;
1856            try {
1857                Type t = this.getField(29, 0);
1858                ret = (CE)t;
1859            } catch (ClassCastException cce) {
1860                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1861                throw new RuntimeException(cce);
1862            } catch (HL7Exception he) {
1863                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1864                throw new RuntimeException(he);
1865            }
1866            return ret;
1867        }
1868    
1869    
1870    
1871        /**
1872         * Returns
1873         * RXE-30: "Dispense Package Method" - creates it if necessary
1874         */
1875        public ID getDispensePackageMethod() { 
1876            ID ret = null;
1877            try {
1878                Type t = this.getField(30, 0);
1879                ret = (ID)t;
1880            } catch (ClassCastException cce) {
1881                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1882                throw new RuntimeException(cce);
1883            } catch (HL7Exception he) {
1884                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1885                throw new RuntimeException(he);
1886            }
1887            return ret;
1888        }
1889    
1890    
1891        /**
1892         * Returns
1893         * RXE-30: "Dispense Package Method" - creates it if necessary
1894         */
1895        public ID getRxe30_DispensePackageMethod() { 
1896            ID ret = null;
1897            try {
1898                Type t = this.getField(30, 0);
1899                ret = (ID)t;
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    
1913    
1914        /** {@inheritDoc} */   
1915        protected Type createNewTypeWithoutReflection(int field) {
1916           switch (field) {
1917              case 0: return new TQ(getMessage());
1918              case 1: return new CE(getMessage());
1919              case 2: return new NM(getMessage());
1920              case 3: return new NM(getMessage());
1921              case 4: return new CE(getMessage());
1922              case 5: return new CE(getMessage());
1923              case 6: return new CE(getMessage());
1924              case 7: return new LA1(getMessage());
1925              case 8: return new ID(getMessage(), new Integer( 167 ));
1926              case 9: return new NM(getMessage());
1927              case 10: return new CE(getMessage());
1928              case 11: return new NM(getMessage());
1929              case 12: return new XCN(getMessage());
1930              case 13: return new XCN(getMessage());
1931              case 14: return new ST(getMessage());
1932              case 15: return new NM(getMessage());
1933              case 16: return new NM(getMessage());
1934              case 17: return new TS(getMessage());
1935              case 18: return new CQ(getMessage());
1936              case 19: return new ID(getMessage(), new Integer( 136 ));
1937              case 20: return new CE(getMessage());
1938              case 21: return new ST(getMessage());
1939              case 22: return new ST(getMessage());
1940              case 23: return new CE(getMessage());
1941              case 24: return new NM(getMessage());
1942              case 25: return new CE(getMessage());
1943              case 26: return new CE(getMessage());
1944              case 27: return new NM(getMessage());
1945              case 28: return new CE(getMessage());
1946              case 29: return new ID(getMessage(), new Integer( 321 ));
1947              default: return null;
1948           }
1949       }
1950    
1951    
1952    }
1953