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