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 ORC message segment (ORC - common order segment). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>ORC-1: Order Control (ID) <b>optional </b>
027         * <li>ORC-2: Placer Order Number (EI) <b>optional </b>
028         * <li>ORC-3: Filler Order Number (EI) <b>optional </b>
029         * <li>ORC-4: Placer Group Number (EI) <b>optional </b>
030         * <li>ORC-5: Order Status (ID) <b>optional </b>
031         * <li>ORC-6: Response Flag (ID) <b>optional </b>
032         * <li>ORC-7: Quantity/Timing (TQ) <b>optional </b>
033         * <li>ORC-8: Parent Order (EIP) <b>optional </b>
034         * <li>ORC-9: Date/Time of Transaction (TS) <b>optional </b>
035         * <li>ORC-10: Entered By (XCN) <b>optional repeating</b>
036         * <li>ORC-11: Verified By (XCN) <b>optional repeating</b>
037         * <li>ORC-12: Ordering Provider (XCN) <b>optional repeating</b>
038         * <li>ORC-13: Enterer’s Location (PL) <b>optional </b>
039         * <li>ORC-14: Call Back Phone Number (XTN) <b>optional repeating</b>
040         * <li>ORC-15: Order Effective Date/Time (TS) <b>optional </b>
041         * <li>ORC-16: Order Control Code Reason (CE) <b>optional </b>
042         * <li>ORC-17: Entering Organization (CE) <b>optional </b>
043         * <li>ORC-18: Entering Device (CE) <b>optional </b>
044         * <li>ORC-19: Action By (XCN) <b>optional repeating</b>
045         * <li>ORC-20: Advanced Beneficiary Notice Code (CE) <b>optional </b>
046         * <li>ORC-21: Ordering Facility Name (XON) <b>optional repeating</b>
047         * <li>ORC-22: Ordering Facility Address (XAD) <b>optional repeating</b>
048         * <li>ORC-23: Ordering Facility Phone Number (XTN) <b>optional repeating</b>
049         * <li>ORC-24: Ordering Provider Address (XAD) <b>optional repeating</b>
050     * </ul>
051     */
052    public class ORC extends AbstractSegment {
053    
054        /** 
055         * Creates a new ORC segment
056         */
057        public ORC(Group parent, ModelClassFactory factory) {
058           super(parent, factory);
059           init(factory);
060        }
061    
062        private void init(ModelClassFactory factory) {
063           try {
064                                      this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Order Control");
065                                      this.add(EI.class, false, 1, 22, new Object[]{ getMessage(), new Integer(0) }, "Placer Order Number");
066                                      this.add(EI.class, false, 1, 22, new Object[]{ getMessage(), new Integer(0) }, "Filler Order Number");
067                                      this.add(EI.class, false, 1, 22, new Object[]{ getMessage(), new Integer(0) }, "Placer Group Number");
068                                      this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Order Status");
069                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Response Flag");
070                                      this.add(TQ.class, false, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Quantity/Timing");
071                                      this.add(EIP.class, false, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Parent Order");
072                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Date/Time of Transaction");
073                                      this.add(XCN.class, false, 0, 120, new Object[]{ getMessage(), new Integer(0) }, "Entered By");
074                                      this.add(XCN.class, false, 0, 120, new Object[]{ getMessage(), new Integer(0) }, "Verified By");
075                                      this.add(XCN.class, false, 0, 120, new Object[]{ getMessage(), new Integer(0) }, "Ordering Provider");
076                                      this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "Enterer’s Location");
077                                      this.add(XTN.class, false, 2, 40, new Object[]{ getMessage(), new Integer(0) }, "Call Back Phone Number");
078                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Order Effective Date/Time");
079                                      this.add(CE.class, false, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Order Control Code Reason");
080                                      this.add(CE.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Entering Organization");
081                                      this.add(CE.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "Entering Device");
082                                      this.add(XCN.class, false, 0, 120, new Object[]{ getMessage(), new Integer(0) }, "Action By");
083                                      this.add(CE.class, false, 1, 40, new Object[]{ getMessage(), new Integer(339) }, "Advanced Beneficiary Notice Code");
084                                      this.add(XON.class, false, 0, 60, new Object[]{ getMessage(), new Integer(0) }, "Ordering Facility Name");
085                                      this.add(XAD.class, false, 0, 106, new Object[]{ getMessage(), new Integer(0) }, "Ordering Facility Address");
086                                      this.add(XTN.class, false, 0, 48, new Object[]{ getMessage(), new Integer(0) }, "Ordering Facility Phone Number");
087                                      this.add(XAD.class, false, 0, 106, new Object[]{ getMessage(), new Integer(0) }, "Ordering Provider Address");
088           } catch(HL7Exception e) {
089              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating ORC - this is probably a bug in the source code generator.", e);
090           }
091        }
092    
093    
094    
095        /**
096         * Returns
097         * ORC-1: "Order Control" - creates it if necessary
098         */
099        public ID getOrderControl() { 
100            ID ret = null;
101            try {
102                Type t = this.getField(1, 0);
103                ret = (ID)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         * ORC-1: "Order Control" - creates it if necessary
118         */
119        public ID getOrc1_OrderControl() { 
120            ID ret = null;
121            try {
122                Type t = this.getField(1, 0);
123                ret = (ID)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         * ORC-2: "Placer Order Number" - creates it if necessary
139         */
140        public EI getPlacerOrderNumber() { 
141            EI ret = null;
142            try {
143                Type t = this.getField(2, 0);
144                ret = (EI)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         * ORC-2: "Placer Order Number" - creates it if necessary
159         */
160        public EI getOrc2_PlacerOrderNumber() { 
161            EI ret = null;
162            try {
163                Type t = this.getField(2, 0);
164                ret = (EI)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         * ORC-3: "Filler Order Number" - creates it if necessary
180         */
181        public EI getFillerOrderNumber() { 
182            EI ret = null;
183            try {
184                Type t = this.getField(3, 0);
185                ret = (EI)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         * ORC-3: "Filler Order Number" - creates it if necessary
200         */
201        public EI getOrc3_FillerOrderNumber() { 
202            EI ret = null;
203            try {
204                Type t = this.getField(3, 0);
205                ret = (EI)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         * ORC-4: "Placer Group Number" - creates it if necessary
221         */
222        public EI getPlacerGroupNumber() { 
223            EI ret = null;
224            try {
225                Type t = this.getField(4, 0);
226                ret = (EI)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         * ORC-4: "Placer Group Number" - creates it if necessary
241         */
242        public EI getOrc4_PlacerGroupNumber() { 
243            EI ret = null;
244            try {
245                Type t = this.getField(4, 0);
246                ret = (EI)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         * ORC-5: "Order Status" - creates it if necessary
262         */
263        public ID getOrderStatus() { 
264            ID ret = null;
265            try {
266                Type t = this.getField(5, 0);
267                ret = (ID)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         * ORC-5: "Order Status" - creates it if necessary
282         */
283        public ID getOrc5_OrderStatus() { 
284            ID ret = null;
285            try {
286                Type t = this.getField(5, 0);
287                ret = (ID)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        /**
301         * Returns
302         * ORC-6: "Response Flag" - creates it if necessary
303         */
304        public ID getResponseFlag() { 
305            ID ret = null;
306            try {
307                Type t = this.getField(6, 0);
308                ret = (ID)t;
309            } catch (ClassCastException cce) {
310                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
311                throw new RuntimeException(cce);
312            } catch (HL7Exception he) {
313                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
314                throw new RuntimeException(he);
315            }
316            return ret;
317        }
318    
319    
320        /**
321         * Returns
322         * ORC-6: "Response Flag" - creates it if necessary
323         */
324        public ID getOrc6_ResponseFlag() { 
325            ID ret = null;
326            try {
327                Type t = this.getField(6, 0);
328                ret = (ID)t;
329            } catch (ClassCastException cce) {
330                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
331                throw new RuntimeException(cce);
332            } catch (HL7Exception he) {
333                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
334                throw new RuntimeException(he);
335            }
336            return ret;
337        }
338    
339    
340    
341        /**
342         * Returns
343         * ORC-7: "Quantity/Timing" - creates it if necessary
344         */
345        public TQ getQuantityTiming() { 
346            TQ ret = null;
347            try {
348                Type t = this.getField(7, 0);
349                ret = (TQ)t;
350            } catch (ClassCastException cce) {
351                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
352                throw new RuntimeException(cce);
353            } catch (HL7Exception he) {
354                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
355                throw new RuntimeException(he);
356            }
357            return ret;
358        }
359    
360    
361        /**
362         * Returns
363         * ORC-7: "Quantity/Timing" - creates it if necessary
364         */
365        public TQ getOrc7_QuantityTiming() { 
366            TQ ret = null;
367            try {
368                Type t = this.getField(7, 0);
369                ret = (TQ)t;
370            } catch (ClassCastException cce) {
371                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
372                throw new RuntimeException(cce);
373            } catch (HL7Exception he) {
374                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
375                throw new RuntimeException(he);
376            }
377            return ret;
378        }
379    
380    
381    
382        /**
383         * Returns
384         * ORC-8: "Parent Order" - creates it if necessary
385         */
386        public EIP getParentOrder() { 
387            EIP ret = null;
388            try {
389                Type t = this.getField(8, 0);
390                ret = (EIP)t;
391            } catch (ClassCastException cce) {
392                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
393                throw new RuntimeException(cce);
394            } catch (HL7Exception he) {
395                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
396                throw new RuntimeException(he);
397            }
398            return ret;
399        }
400    
401    
402        /**
403         * Returns
404         * ORC-8: "Parent Order" - creates it if necessary
405         */
406        public EIP getOrc8_ParentOrder() { 
407            EIP ret = null;
408            try {
409                Type t = this.getField(8, 0);
410                ret = (EIP)t;
411            } catch (ClassCastException cce) {
412                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
413                throw new RuntimeException(cce);
414            } catch (HL7Exception he) {
415                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
416                throw new RuntimeException(he);
417            }
418            return ret;
419        }
420    
421    
422    
423        /**
424         * Returns
425         * ORC-9: "Date/Time of Transaction" - creates it if necessary
426         */
427        public TS getDateTimeOfTransaction() { 
428            TS ret = null;
429            try {
430                Type t = this.getField(9, 0);
431                ret = (TS)t;
432            } catch (ClassCastException cce) {
433                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
434                throw new RuntimeException(cce);
435            } catch (HL7Exception he) {
436                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
437                throw new RuntimeException(he);
438            }
439            return ret;
440        }
441    
442    
443        /**
444         * Returns
445         * ORC-9: "Date/Time of Transaction" - creates it if necessary
446         */
447        public TS getOrc9_DateTimeOfTransaction() { 
448            TS ret = null;
449            try {
450                Type t = this.getField(9, 0);
451                ret = (TS)t;
452            } catch (ClassCastException cce) {
453                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
454                throw new RuntimeException(cce);
455            } catch (HL7Exception he) {
456                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
457                throw new RuntimeException(he);
458            }
459            return ret;
460        }
461    
462    
463        /**
464         * Returns all repetitions of Entered By (ORC-10).
465         */
466        public XCN[] getEnteredBy() {
467            XCN[] ret = null;
468            try {
469                Type[] t = this.getField(10);  
470                ret = new XCN[t.length];
471                for (int i = 0; i < ret.length; i++) {
472                    ret[i] = (XCN)t[i];
473                }
474            } catch (ClassCastException cce) {
475                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
476                throw new RuntimeException(cce);
477            } catch (HL7Exception he) {
478                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
479                throw new RuntimeException(he);
480            }
481            return ret;
482        }
483    
484    
485        /**
486         * Returns a count of the current number of repetitions of Entered By (ORC-10).
487         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
488         * it will return zero.
489         */
490        public int getEnteredByReps() {
491            XCN[] ret = null;
492            try {
493                Type[] t = this.getField(10);
494                return t.length;  
495            } catch (ClassCastException cce) {
496                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
497                throw new RuntimeException(cce);
498            } catch (HL7Exception he) {
499                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
500                throw new RuntimeException(he);
501            }
502        }
503    
504    
505        /**
506         * Returns a specific repetition of
507         * ORC-10: "Entered By" - creates it if necessary
508         *
509         * @param rep The repetition index (0-indexed)
510         */
511        public XCN getEnteredBy(int rep) { 
512            XCN ret = null;
513            try {
514                Type t = this.getField(10, rep);
515                ret = (XCN)t;
516            } catch (ClassCastException cce) {
517                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
518                throw new RuntimeException(cce);
519            } catch (HL7Exception he) {
520                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
521                throw new RuntimeException(he);
522            }
523            return ret;
524        }
525    
526        /**
527         * Returns a specific repetition of
528         * ORC-10: "Entered By" - creates it if necessary
529         *
530         * @param rep The repetition index (0-indexed)
531         */
532        public XCN getOrc10_EnteredBy(int rep) { 
533            XCN ret = null;
534            try {
535                Type t = this.getField(10, rep);
536                ret = (XCN)t;
537            } catch (ClassCastException cce) {
538                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
539                throw new RuntimeException(cce);
540            } catch (HL7Exception he) {
541                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
542                throw new RuntimeException(he);
543            }
544            return ret;
545        }
546    
547    
548        /**
549         * Returns a count of the current number of repetitions of Entered By (ORC-10).
550         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
551         * it will return zero.
552         */
553        public int getOrc10_EnteredByReps() {
554            XCN[] ret = null;
555            try {
556                Type[] t = this.getField(10);
557                return t.length;  
558            } catch (ClassCastException cce) {
559                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
560                throw new RuntimeException(cce);
561            } catch (HL7Exception he) {
562                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
563                throw new RuntimeException(he);
564            }
565        }
566    
567    
568    
569        /**
570         * Inserts a repetition of
571         * ORC-10: "Entered By" at a specific index
572         *
573         * @param rep The repetition index (0-indexed)
574         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
575         */
576        public XCN insertEnteredBy(int rep) throws HL7Exception { 
577            return (XCN) super.insertRepetition(10, rep);
578        }
579    
580    
581    
582        /**
583         * Inserts a repetition of
584         * ORC-10: "Entered By" at a specific index
585         *
586         * @param rep The repetition index (0-indexed)
587         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
588         */
589        public XCN insertOrc10_EnteredBy(int rep) throws HL7Exception { 
590            return (XCN) super.insertRepetition(10, rep);
591        }
592    
593    
594        /**
595         * Removes a repetition of
596         * ORC-10: "Entered By" at a specific index
597         *
598         * @param rep The repetition index (0-indexed)
599         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
600         */
601        public XCN removeEnteredBy(int rep) throws HL7Exception { 
602            return (XCN) super.removeRepetition(10, rep);
603        }
604    
605    
606        /**
607         * Removes a repetition of
608         * ORC-10: "Entered By" at a specific index
609         *
610         * @param rep The repetition index (0-indexed)
611         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
612         */
613        public XCN removeOrc10_EnteredBy(int rep) throws HL7Exception { 
614            return (XCN) super.removeRepetition(10, rep);
615        }
616    
617    
618    
619        /**
620         * Returns all repetitions of Verified By (ORC-11).
621         */
622        public XCN[] getVerifiedBy() {
623            XCN[] ret = null;
624            try {
625                Type[] t = this.getField(11);  
626                ret = new XCN[t.length];
627                for (int i = 0; i < ret.length; i++) {
628                    ret[i] = (XCN)t[i];
629                }
630            } catch (ClassCastException cce) {
631                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
632                throw new RuntimeException(cce);
633            } catch (HL7Exception he) {
634                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
635                throw new RuntimeException(he);
636            }
637            return ret;
638        }
639    
640    
641        /**
642         * Returns a count of the current number of repetitions of Verified By (ORC-11).
643         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
644         * it will return zero.
645         */
646        public int getVerifiedByReps() {
647            XCN[] ret = null;
648            try {
649                Type[] t = this.getField(11);
650                return t.length;  
651            } catch (ClassCastException cce) {
652                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
653                throw new RuntimeException(cce);
654            } catch (HL7Exception he) {
655                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
656                throw new RuntimeException(he);
657            }
658        }
659    
660    
661        /**
662         * Returns a specific repetition of
663         * ORC-11: "Verified By" - creates it if necessary
664         *
665         * @param rep The repetition index (0-indexed)
666         */
667        public XCN getVerifiedBy(int rep) { 
668            XCN ret = null;
669            try {
670                Type t = this.getField(11, rep);
671                ret = (XCN)t;
672            } catch (ClassCastException cce) {
673                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
674                throw new RuntimeException(cce);
675            } catch (HL7Exception he) {
676                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
677                throw new RuntimeException(he);
678            }
679            return ret;
680        }
681    
682        /**
683         * Returns a specific repetition of
684         * ORC-11: "Verified By" - creates it if necessary
685         *
686         * @param rep The repetition index (0-indexed)
687         */
688        public XCN getOrc11_VerifiedBy(int rep) { 
689            XCN ret = null;
690            try {
691                Type t = this.getField(11, rep);
692                ret = (XCN)t;
693            } catch (ClassCastException cce) {
694                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
695                throw new RuntimeException(cce);
696            } catch (HL7Exception he) {
697                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
698                throw new RuntimeException(he);
699            }
700            return ret;
701        }
702    
703    
704        /**
705         * Returns a count of the current number of repetitions of Verified By (ORC-11).
706         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
707         * it will return zero.
708         */
709        public int getOrc11_VerifiedByReps() {
710            XCN[] ret = null;
711            try {
712                Type[] t = this.getField(11);
713                return t.length;  
714            } catch (ClassCastException cce) {
715                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
716                throw new RuntimeException(cce);
717            } catch (HL7Exception he) {
718                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
719                throw new RuntimeException(he);
720            }
721        }
722    
723    
724    
725        /**
726         * Inserts a repetition of
727         * ORC-11: "Verified By" at a specific index
728         *
729         * @param rep The repetition index (0-indexed)
730         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
731         */
732        public XCN insertVerifiedBy(int rep) throws HL7Exception { 
733            return (XCN) super.insertRepetition(11, rep);
734        }
735    
736    
737    
738        /**
739         * Inserts a repetition of
740         * ORC-11: "Verified By" at a specific index
741         *
742         * @param rep The repetition index (0-indexed)
743         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
744         */
745        public XCN insertOrc11_VerifiedBy(int rep) throws HL7Exception { 
746            return (XCN) super.insertRepetition(11, rep);
747        }
748    
749    
750        /**
751         * Removes a repetition of
752         * ORC-11: "Verified By" at a specific index
753         *
754         * @param rep The repetition index (0-indexed)
755         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
756         */
757        public XCN removeVerifiedBy(int rep) throws HL7Exception { 
758            return (XCN) super.removeRepetition(11, rep);
759        }
760    
761    
762        /**
763         * Removes a repetition of
764         * ORC-11: "Verified By" at a specific index
765         *
766         * @param rep The repetition index (0-indexed)
767         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
768         */
769        public XCN removeOrc11_VerifiedBy(int rep) throws HL7Exception { 
770            return (XCN) super.removeRepetition(11, rep);
771        }
772    
773    
774    
775        /**
776         * Returns all repetitions of Ordering Provider (ORC-12).
777         */
778        public XCN[] getOrderingProvider() {
779            XCN[] ret = null;
780            try {
781                Type[] t = this.getField(12);  
782                ret = new XCN[t.length];
783                for (int i = 0; i < ret.length; i++) {
784                    ret[i] = (XCN)t[i];
785                }
786            } catch (ClassCastException cce) {
787                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
788                throw new RuntimeException(cce);
789            } catch (HL7Exception he) {
790                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
791                throw new RuntimeException(he);
792            }
793            return ret;
794        }
795    
796    
797        /**
798         * Returns a count of the current number of repetitions of Ordering Provider (ORC-12).
799         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
800         * it will return zero.
801         */
802        public int getOrderingProviderReps() {
803            XCN[] ret = null;
804            try {
805                Type[] t = this.getField(12);
806                return t.length;  
807            } catch (ClassCastException cce) {
808                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
809                throw new RuntimeException(cce);
810            } catch (HL7Exception he) {
811                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
812                throw new RuntimeException(he);
813            }
814        }
815    
816    
817        /**
818         * Returns a specific repetition of
819         * ORC-12: "Ordering Provider" - creates it if necessary
820         *
821         * @param rep The repetition index (0-indexed)
822         */
823        public XCN getOrderingProvider(int rep) { 
824            XCN ret = null;
825            try {
826                Type t = this.getField(12, rep);
827                ret = (XCN)t;
828            } catch (ClassCastException cce) {
829                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
830                throw new RuntimeException(cce);
831            } catch (HL7Exception he) {
832                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
833                throw new RuntimeException(he);
834            }
835            return ret;
836        }
837    
838        /**
839         * Returns a specific repetition of
840         * ORC-12: "Ordering Provider" - creates it if necessary
841         *
842         * @param rep The repetition index (0-indexed)
843         */
844        public XCN getOrc12_OrderingProvider(int rep) { 
845            XCN ret = null;
846            try {
847                Type t = this.getField(12, rep);
848                ret = (XCN)t;
849            } catch (ClassCastException cce) {
850                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
851                throw new RuntimeException(cce);
852            } catch (HL7Exception he) {
853                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
854                throw new RuntimeException(he);
855            }
856            return ret;
857        }
858    
859    
860        /**
861         * Returns a count of the current number of repetitions of Ordering Provider (ORC-12).
862         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
863         * it will return zero.
864         */
865        public int getOrc12_OrderingProviderReps() {
866            XCN[] ret = null;
867            try {
868                Type[] t = this.getField(12);
869                return t.length;  
870            } catch (ClassCastException cce) {
871                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
872                throw new RuntimeException(cce);
873            } catch (HL7Exception he) {
874                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
875                throw new RuntimeException(he);
876            }
877        }
878    
879    
880    
881        /**
882         * Inserts a repetition of
883         * ORC-12: "Ordering Provider" at a specific index
884         *
885         * @param rep The repetition index (0-indexed)
886         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
887         */
888        public XCN insertOrderingProvider(int rep) throws HL7Exception { 
889            return (XCN) super.insertRepetition(12, rep);
890        }
891    
892    
893    
894        /**
895         * Inserts a repetition of
896         * ORC-12: "Ordering Provider" at a specific index
897         *
898         * @param rep The repetition index (0-indexed)
899         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
900         */
901        public XCN insertOrc12_OrderingProvider(int rep) throws HL7Exception { 
902            return (XCN) super.insertRepetition(12, rep);
903        }
904    
905    
906        /**
907         * Removes a repetition of
908         * ORC-12: "Ordering Provider" at a specific index
909         *
910         * @param rep The repetition index (0-indexed)
911         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
912         */
913        public XCN removeOrderingProvider(int rep) throws HL7Exception { 
914            return (XCN) super.removeRepetition(12, rep);
915        }
916    
917    
918        /**
919         * Removes a repetition of
920         * ORC-12: "Ordering Provider" at a specific index
921         *
922         * @param rep The repetition index (0-indexed)
923         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
924         */
925        public XCN removeOrc12_OrderingProvider(int rep) throws HL7Exception { 
926            return (XCN) super.removeRepetition(12, rep);
927        }
928    
929    
930    
931    
932        /**
933         * Returns
934         * ORC-13: "Enterer’s Location" - creates it if necessary
935         */
936        public PL getEntererSLocation() { 
937            PL ret = null;
938            try {
939                Type t = this.getField(13, 0);
940                ret = (PL)t;
941            } catch (ClassCastException cce) {
942                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
943                throw new RuntimeException(cce);
944            } catch (HL7Exception he) {
945                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
946                throw new RuntimeException(he);
947            }
948            return ret;
949        }
950    
951    
952        /**
953         * Returns
954         * ORC-13: "Enterer’s Location" - creates it if necessary
955         */
956        public PL getOrc13_EntererSLocation() { 
957            PL ret = null;
958            try {
959                Type t = this.getField(13, 0);
960                ret = (PL)t;
961            } catch (ClassCastException cce) {
962                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
963                throw new RuntimeException(cce);
964            } catch (HL7Exception he) {
965                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
966                throw new RuntimeException(he);
967            }
968            return ret;
969        }
970    
971    
972        /**
973         * Returns all repetitions of Call Back Phone Number (ORC-14).
974         */
975        public XTN[] getCallBackPhoneNumber() {
976            XTN[] ret = null;
977            try {
978                Type[] t = this.getField(14);  
979                ret = new XTN[t.length];
980                for (int i = 0; i < ret.length; i++) {
981                    ret[i] = (XTN)t[i];
982                }
983            } catch (ClassCastException cce) {
984                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
985                throw new RuntimeException(cce);
986            } catch (HL7Exception he) {
987                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
988                throw new RuntimeException(he);
989            }
990            return ret;
991        }
992    
993    
994        /**
995         * Returns a count of the current number of repetitions of Call Back Phone Number (ORC-14).
996         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
997         * it will return zero.
998         */
999        public int getCallBackPhoneNumberReps() {
1000            XTN[] ret = null;
1001            try {
1002                Type[] t = this.getField(14);
1003                return t.length;  
1004            } catch (ClassCastException cce) {
1005                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1006                throw new RuntimeException(cce);
1007            } catch (HL7Exception he) {
1008                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1009                throw new RuntimeException(he);
1010            }
1011        }
1012    
1013    
1014        /**
1015         * Returns a specific repetition of
1016         * ORC-14: "Call Back Phone Number" - creates it if necessary
1017         *
1018         * @param rep The repetition index (0-indexed)
1019         */
1020        public XTN getCallBackPhoneNumber(int rep) { 
1021            XTN ret = null;
1022            try {
1023                Type t = this.getField(14, rep);
1024                ret = (XTN)t;
1025            } catch (ClassCastException cce) {
1026                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1027                throw new RuntimeException(cce);
1028            } catch (HL7Exception he) {
1029                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1030                throw new RuntimeException(he);
1031            }
1032            return ret;
1033        }
1034    
1035        /**
1036         * Returns a specific repetition of
1037         * ORC-14: "Call Back Phone Number" - creates it if necessary
1038         *
1039         * @param rep The repetition index (0-indexed)
1040         */
1041        public XTN getOrc14_CallBackPhoneNumber(int rep) { 
1042            XTN ret = null;
1043            try {
1044                Type t = this.getField(14, rep);
1045                ret = (XTN)t;
1046            } catch (ClassCastException cce) {
1047                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1048                throw new RuntimeException(cce);
1049            } catch (HL7Exception he) {
1050                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1051                throw new RuntimeException(he);
1052            }
1053            return ret;
1054        }
1055    
1056    
1057        /**
1058         * Returns a count of the current number of repetitions of Call Back Phone Number (ORC-14).
1059         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1060         * it will return zero.
1061         */
1062        public int getOrc14_CallBackPhoneNumberReps() {
1063            XTN[] ret = null;
1064            try {
1065                Type[] t = this.getField(14);
1066                return t.length;  
1067            } catch (ClassCastException cce) {
1068                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1069                throw new RuntimeException(cce);
1070            } catch (HL7Exception he) {
1071                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1072                throw new RuntimeException(he);
1073            }
1074        }
1075    
1076    
1077    
1078        /**
1079         * Inserts a repetition of
1080         * ORC-14: "Call Back Phone Number" at a specific index
1081         *
1082         * @param rep The repetition index (0-indexed)
1083         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1084         */
1085        public XTN insertCallBackPhoneNumber(int rep) throws HL7Exception { 
1086            return (XTN) super.insertRepetition(14, rep);
1087        }
1088    
1089    
1090    
1091        /**
1092         * Inserts a repetition of
1093         * ORC-14: "Call Back Phone Number" at a specific index
1094         *
1095         * @param rep The repetition index (0-indexed)
1096         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1097         */
1098        public XTN insertOrc14_CallBackPhoneNumber(int rep) throws HL7Exception { 
1099            return (XTN) super.insertRepetition(14, rep);
1100        }
1101    
1102    
1103        /**
1104         * Removes a repetition of
1105         * ORC-14: "Call Back Phone Number" at a specific index
1106         *
1107         * @param rep The repetition index (0-indexed)
1108         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1109         */
1110        public XTN removeCallBackPhoneNumber(int rep) throws HL7Exception { 
1111            return (XTN) super.removeRepetition(14, rep);
1112        }
1113    
1114    
1115        /**
1116         * Removes a repetition of
1117         * ORC-14: "Call Back Phone Number" at a specific index
1118         *
1119         * @param rep The repetition index (0-indexed)
1120         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1121         */
1122        public XTN removeOrc14_CallBackPhoneNumber(int rep) throws HL7Exception { 
1123            return (XTN) super.removeRepetition(14, rep);
1124        }
1125    
1126    
1127    
1128    
1129        /**
1130         * Returns
1131         * ORC-15: "Order Effective Date/Time" - creates it if necessary
1132         */
1133        public TS getOrderEffectiveDateTime() { 
1134            TS ret = null;
1135            try {
1136                Type t = this.getField(15, 0);
1137                ret = (TS)t;
1138            } catch (ClassCastException cce) {
1139                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1140                throw new RuntimeException(cce);
1141            } catch (HL7Exception he) {
1142                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1143                throw new RuntimeException(he);
1144            }
1145            return ret;
1146        }
1147    
1148    
1149        /**
1150         * Returns
1151         * ORC-15: "Order Effective Date/Time" - creates it if necessary
1152         */
1153        public TS getOrc15_OrderEffectiveDateTime() { 
1154            TS ret = null;
1155            try {
1156                Type t = this.getField(15, 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        /**
1171         * Returns
1172         * ORC-16: "Order Control Code Reason" - creates it if necessary
1173         */
1174        public CE getOrderControlCodeReason() { 
1175            CE ret = null;
1176            try {
1177                Type t = this.getField(16, 0);
1178                ret = (CE)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         * ORC-16: "Order Control Code Reason" - creates it if necessary
1193         */
1194        public CE getOrc16_OrderControlCodeReason() { 
1195            CE ret = null;
1196            try {
1197                Type t = this.getField(16, 0);
1198                ret = (CE)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         * ORC-17: "Entering Organization" - creates it if necessary
1214         */
1215        public CE getEnteringOrganization() { 
1216            CE ret = null;
1217            try {
1218                Type t = this.getField(17, 0);
1219                ret = (CE)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         * ORC-17: "Entering Organization" - creates it if necessary
1234         */
1235        public CE getOrc17_EnteringOrganization() { 
1236            CE ret = null;
1237            try {
1238                Type t = this.getField(17, 0);
1239                ret = (CE)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         * ORC-18: "Entering Device" - creates it if necessary
1255         */
1256        public CE getEnteringDevice() { 
1257            CE ret = null;
1258            try {
1259                Type t = this.getField(18, 0);
1260                ret = (CE)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         * ORC-18: "Entering Device" - creates it if necessary
1275         */
1276        public CE getOrc18_EnteringDevice() { 
1277            CE ret = null;
1278            try {
1279                Type t = this.getField(18, 0);
1280                ret = (CE)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         * Returns all repetitions of Action By (ORC-19).
1294         */
1295        public XCN[] getActionBy() {
1296            XCN[] ret = null;
1297            try {
1298                Type[] t = this.getField(19);  
1299                ret = new XCN[t.length];
1300                for (int i = 0; i < ret.length; i++) {
1301                    ret[i] = (XCN)t[i];
1302                }
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            return ret;
1311        }
1312    
1313    
1314        /**
1315         * Returns a count of the current number of repetitions of Action By (ORC-19).
1316         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1317         * it will return zero.
1318         */
1319        public int getActionByReps() {
1320            XCN[] ret = null;
1321            try {
1322                Type[] t = this.getField(19);
1323                return t.length;  
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        }
1332    
1333    
1334        /**
1335         * Returns a specific repetition of
1336         * ORC-19: "Action By" - creates it if necessary
1337         *
1338         * @param rep The repetition index (0-indexed)
1339         */
1340        public XCN getActionBy(int rep) { 
1341            XCN ret = null;
1342            try {
1343                Type t = this.getField(19, rep);
1344                ret = (XCN)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         * Returns a specific repetition of
1357         * ORC-19: "Action By" - creates it if necessary
1358         *
1359         * @param rep The repetition index (0-indexed)
1360         */
1361        public XCN getOrc19_ActionBy(int rep) { 
1362            XCN ret = null;
1363            try {
1364                Type t = this.getField(19, rep);
1365                ret = (XCN)t;
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            return ret;
1374        }
1375    
1376    
1377        /**
1378         * Returns a count of the current number of repetitions of Action By (ORC-19).
1379         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1380         * it will return zero.
1381         */
1382        public int getOrc19_ActionByReps() {
1383            XCN[] ret = null;
1384            try {
1385                Type[] t = this.getField(19);
1386                return t.length;  
1387            } catch (ClassCastException cce) {
1388                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1389                throw new RuntimeException(cce);
1390            } catch (HL7Exception he) {
1391                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1392                throw new RuntimeException(he);
1393            }
1394        }
1395    
1396    
1397    
1398        /**
1399         * Inserts a repetition of
1400         * ORC-19: "Action By" at a specific index
1401         *
1402         * @param rep The repetition index (0-indexed)
1403         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1404         */
1405        public XCN insertActionBy(int rep) throws HL7Exception { 
1406            return (XCN) super.insertRepetition(19, rep);
1407        }
1408    
1409    
1410    
1411        /**
1412         * Inserts a repetition of
1413         * ORC-19: "Action By" at a specific index
1414         *
1415         * @param rep The repetition index (0-indexed)
1416         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1417         */
1418        public XCN insertOrc19_ActionBy(int rep) throws HL7Exception { 
1419            return (XCN) super.insertRepetition(19, rep);
1420        }
1421    
1422    
1423        /**
1424         * Removes a repetition of
1425         * ORC-19: "Action By" at a specific index
1426         *
1427         * @param rep The repetition index (0-indexed)
1428         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1429         */
1430        public XCN removeActionBy(int rep) throws HL7Exception { 
1431            return (XCN) super.removeRepetition(19, rep);
1432        }
1433    
1434    
1435        /**
1436         * Removes a repetition of
1437         * ORC-19: "Action By" at a specific index
1438         *
1439         * @param rep The repetition index (0-indexed)
1440         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1441         */
1442        public XCN removeOrc19_ActionBy(int rep) throws HL7Exception { 
1443            return (XCN) super.removeRepetition(19, rep);
1444        }
1445    
1446    
1447    
1448    
1449        /**
1450         * Returns
1451         * ORC-20: "Advanced Beneficiary Notice Code" - creates it if necessary
1452         */
1453        public CE getAdvancedBeneficiaryNoticeCode() { 
1454            CE ret = null;
1455            try {
1456                Type t = this.getField(20, 0);
1457                ret = (CE)t;
1458            } catch (ClassCastException cce) {
1459                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1460                throw new RuntimeException(cce);
1461            } catch (HL7Exception he) {
1462                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1463                throw new RuntimeException(he);
1464            }
1465            return ret;
1466        }
1467    
1468    
1469        /**
1470         * Returns
1471         * ORC-20: "Advanced Beneficiary Notice Code" - creates it if necessary
1472         */
1473        public CE getOrc20_AdvancedBeneficiaryNoticeCode() { 
1474            CE ret = null;
1475            try {
1476                Type t = this.getField(20, 0);
1477                ret = (CE)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 all repetitions of Ordering Facility Name (ORC-21).
1491         */
1492        public XON[] getOrderingFacilityName() {
1493            XON[] ret = null;
1494            try {
1495                Type[] t = this.getField(21);  
1496                ret = new XON[t.length];
1497                for (int i = 0; i < ret.length; i++) {
1498                    ret[i] = (XON)t[i];
1499                }
1500            } catch (ClassCastException cce) {
1501                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1502                throw new RuntimeException(cce);
1503            } catch (HL7Exception he) {
1504                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1505                throw new RuntimeException(he);
1506            }
1507            return ret;
1508        }
1509    
1510    
1511        /**
1512         * Returns a count of the current number of repetitions of Ordering Facility Name (ORC-21).
1513         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1514         * it will return zero.
1515         */
1516        public int getOrderingFacilityNameReps() {
1517            XON[] ret = null;
1518            try {
1519                Type[] t = this.getField(21);
1520                return t.length;  
1521            } catch (ClassCastException cce) {
1522                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1523                throw new RuntimeException(cce);
1524            } catch (HL7Exception he) {
1525                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1526                throw new RuntimeException(he);
1527            }
1528        }
1529    
1530    
1531        /**
1532         * Returns a specific repetition of
1533         * ORC-21: "Ordering Facility Name" - creates it if necessary
1534         *
1535         * @param rep The repetition index (0-indexed)
1536         */
1537        public XON getOrderingFacilityName(int rep) { 
1538            XON ret = null;
1539            try {
1540                Type t = this.getField(21, rep);
1541                ret = (XON)t;
1542            } catch (ClassCastException cce) {
1543                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1544                throw new RuntimeException(cce);
1545            } catch (HL7Exception he) {
1546                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1547                throw new RuntimeException(he);
1548            }
1549            return ret;
1550        }
1551    
1552        /**
1553         * Returns a specific repetition of
1554         * ORC-21: "Ordering Facility Name" - creates it if necessary
1555         *
1556         * @param rep The repetition index (0-indexed)
1557         */
1558        public XON getOrc21_OrderingFacilityName(int rep) { 
1559            XON ret = null;
1560            try {
1561                Type t = this.getField(21, rep);
1562                ret = (XON)t;
1563            } catch (ClassCastException cce) {
1564                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1565                throw new RuntimeException(cce);
1566            } catch (HL7Exception he) {
1567                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1568                throw new RuntimeException(he);
1569            }
1570            return ret;
1571        }
1572    
1573    
1574        /**
1575         * Returns a count of the current number of repetitions of Ordering Facility Name (ORC-21).
1576         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1577         * it will return zero.
1578         */
1579        public int getOrc21_OrderingFacilityNameReps() {
1580            XON[] ret = null;
1581            try {
1582                Type[] t = this.getField(21);
1583                return t.length;  
1584            } catch (ClassCastException cce) {
1585                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1586                throw new RuntimeException(cce);
1587            } catch (HL7Exception he) {
1588                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1589                throw new RuntimeException(he);
1590            }
1591        }
1592    
1593    
1594    
1595        /**
1596         * Inserts a repetition of
1597         * ORC-21: "Ordering Facility Name" at a specific index
1598         *
1599         * @param rep The repetition index (0-indexed)
1600         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1601         */
1602        public XON insertOrderingFacilityName(int rep) throws HL7Exception { 
1603            return (XON) super.insertRepetition(21, rep);
1604        }
1605    
1606    
1607    
1608        /**
1609         * Inserts a repetition of
1610         * ORC-21: "Ordering Facility Name" at a specific index
1611         *
1612         * @param rep The repetition index (0-indexed)
1613         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1614         */
1615        public XON insertOrc21_OrderingFacilityName(int rep) throws HL7Exception { 
1616            return (XON) super.insertRepetition(21, rep);
1617        }
1618    
1619    
1620        /**
1621         * Removes a repetition of
1622         * ORC-21: "Ordering Facility Name" at a specific index
1623         *
1624         * @param rep The repetition index (0-indexed)
1625         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1626         */
1627        public XON removeOrderingFacilityName(int rep) throws HL7Exception { 
1628            return (XON) super.removeRepetition(21, rep);
1629        }
1630    
1631    
1632        /**
1633         * Removes a repetition of
1634         * ORC-21: "Ordering Facility Name" at a specific index
1635         *
1636         * @param rep The repetition index (0-indexed)
1637         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1638         */
1639        public XON removeOrc21_OrderingFacilityName(int rep) throws HL7Exception { 
1640            return (XON) super.removeRepetition(21, rep);
1641        }
1642    
1643    
1644    
1645        /**
1646         * Returns all repetitions of Ordering Facility Address (ORC-22).
1647         */
1648        public XAD[] getOrderingFacilityAddress() {
1649            XAD[] ret = null;
1650            try {
1651                Type[] t = this.getField(22);  
1652                ret = new XAD[t.length];
1653                for (int i = 0; i < ret.length; i++) {
1654                    ret[i] = (XAD)t[i];
1655                }
1656            } catch (ClassCastException cce) {
1657                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1658                throw new RuntimeException(cce);
1659            } catch (HL7Exception he) {
1660                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1661                throw new RuntimeException(he);
1662            }
1663            return ret;
1664        }
1665    
1666    
1667        /**
1668         * Returns a count of the current number of repetitions of Ordering Facility Address (ORC-22).
1669         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1670         * it will return zero.
1671         */
1672        public int getOrderingFacilityAddressReps() {
1673            XAD[] ret = null;
1674            try {
1675                Type[] t = this.getField(22);
1676                return t.length;  
1677            } catch (ClassCastException cce) {
1678                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1679                throw new RuntimeException(cce);
1680            } catch (HL7Exception he) {
1681                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1682                throw new RuntimeException(he);
1683            }
1684        }
1685    
1686    
1687        /**
1688         * Returns a specific repetition of
1689         * ORC-22: "Ordering Facility Address" - creates it if necessary
1690         *
1691         * @param rep The repetition index (0-indexed)
1692         */
1693        public XAD getOrderingFacilityAddress(int rep) { 
1694            XAD ret = null;
1695            try {
1696                Type t = this.getField(22, rep);
1697                ret = (XAD)t;
1698            } catch (ClassCastException cce) {
1699                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1700                throw new RuntimeException(cce);
1701            } catch (HL7Exception he) {
1702                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1703                throw new RuntimeException(he);
1704            }
1705            return ret;
1706        }
1707    
1708        /**
1709         * Returns a specific repetition of
1710         * ORC-22: "Ordering Facility Address" - creates it if necessary
1711         *
1712         * @param rep The repetition index (0-indexed)
1713         */
1714        public XAD getOrc22_OrderingFacilityAddress(int rep) { 
1715            XAD ret = null;
1716            try {
1717                Type t = this.getField(22, rep);
1718                ret = (XAD)t;
1719            } catch (ClassCastException cce) {
1720                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1721                throw new RuntimeException(cce);
1722            } catch (HL7Exception he) {
1723                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1724                throw new RuntimeException(he);
1725            }
1726            return ret;
1727        }
1728    
1729    
1730        /**
1731         * Returns a count of the current number of repetitions of Ordering Facility Address (ORC-22).
1732         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1733         * it will return zero.
1734         */
1735        public int getOrc22_OrderingFacilityAddressReps() {
1736            XAD[] ret = null;
1737            try {
1738                Type[] t = this.getField(22);
1739                return t.length;  
1740            } catch (ClassCastException cce) {
1741                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1742                throw new RuntimeException(cce);
1743            } catch (HL7Exception he) {
1744                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1745                throw new RuntimeException(he);
1746            }
1747        }
1748    
1749    
1750    
1751        /**
1752         * Inserts a repetition of
1753         * ORC-22: "Ordering Facility Address" 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 XAD insertOrderingFacilityAddress(int rep) throws HL7Exception { 
1759            return (XAD) super.insertRepetition(22, rep);
1760        }
1761    
1762    
1763    
1764        /**
1765         * Inserts a repetition of
1766         * ORC-22: "Ordering Facility Address" at a specific index
1767         *
1768         * @param rep The repetition index (0-indexed)
1769         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1770         */
1771        public XAD insertOrc22_OrderingFacilityAddress(int rep) throws HL7Exception { 
1772            return (XAD) super.insertRepetition(22, rep);
1773        }
1774    
1775    
1776        /**
1777         * Removes a repetition of
1778         * ORC-22: "Ordering Facility Address" at a specific index
1779         *
1780         * @param rep The repetition index (0-indexed)
1781         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1782         */
1783        public XAD removeOrderingFacilityAddress(int rep) throws HL7Exception { 
1784            return (XAD) super.removeRepetition(22, rep);
1785        }
1786    
1787    
1788        /**
1789         * Removes a repetition of
1790         * ORC-22: "Ordering Facility Address" at a specific index
1791         *
1792         * @param rep The repetition index (0-indexed)
1793         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1794         */
1795        public XAD removeOrc22_OrderingFacilityAddress(int rep) throws HL7Exception { 
1796            return (XAD) super.removeRepetition(22, rep);
1797        }
1798    
1799    
1800    
1801        /**
1802         * Returns all repetitions of Ordering Facility Phone Number (ORC-23).
1803         */
1804        public XTN[] getOrderingFacilityPhoneNumber() {
1805            XTN[] ret = null;
1806            try {
1807                Type[] t = this.getField(23);  
1808                ret = new XTN[t.length];
1809                for (int i = 0; i < ret.length; i++) {
1810                    ret[i] = (XTN)t[i];
1811                }
1812            } catch (ClassCastException cce) {
1813                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1814                throw new RuntimeException(cce);
1815            } catch (HL7Exception he) {
1816                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1817                throw new RuntimeException(he);
1818            }
1819            return ret;
1820        }
1821    
1822    
1823        /**
1824         * Returns a count of the current number of repetitions of Ordering Facility Phone Number (ORC-23).
1825         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1826         * it will return zero.
1827         */
1828        public int getOrderingFacilityPhoneNumberReps() {
1829            XTN[] ret = null;
1830            try {
1831                Type[] t = this.getField(23);
1832                return t.length;  
1833            } catch (ClassCastException cce) {
1834                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1835                throw new RuntimeException(cce);
1836            } catch (HL7Exception he) {
1837                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1838                throw new RuntimeException(he);
1839            }
1840        }
1841    
1842    
1843        /**
1844         * Returns a specific repetition of
1845         * ORC-23: "Ordering Facility Phone Number" - creates it if necessary
1846         *
1847         * @param rep The repetition index (0-indexed)
1848         */
1849        public XTN getOrderingFacilityPhoneNumber(int rep) { 
1850            XTN ret = null;
1851            try {
1852                Type t = this.getField(23, rep);
1853                ret = (XTN)t;
1854            } catch (ClassCastException cce) {
1855                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1856                throw new RuntimeException(cce);
1857            } catch (HL7Exception he) {
1858                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1859                throw new RuntimeException(he);
1860            }
1861            return ret;
1862        }
1863    
1864        /**
1865         * Returns a specific repetition of
1866         * ORC-23: "Ordering Facility Phone Number" - creates it if necessary
1867         *
1868         * @param rep The repetition index (0-indexed)
1869         */
1870        public XTN getOrc23_OrderingFacilityPhoneNumber(int rep) { 
1871            XTN ret = null;
1872            try {
1873                Type t = this.getField(23, rep);
1874                ret = (XTN)t;
1875            } catch (ClassCastException cce) {
1876                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1877                throw new RuntimeException(cce);
1878            } catch (HL7Exception he) {
1879                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1880                throw new RuntimeException(he);
1881            }
1882            return ret;
1883        }
1884    
1885    
1886        /**
1887         * Returns a count of the current number of repetitions of Ordering Facility Phone Number (ORC-23).
1888         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1889         * it will return zero.
1890         */
1891        public int getOrc23_OrderingFacilityPhoneNumberReps() {
1892            XTN[] ret = null;
1893            try {
1894                Type[] t = this.getField(23);
1895                return t.length;  
1896            } catch (ClassCastException cce) {
1897                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1898                throw new RuntimeException(cce);
1899            } catch (HL7Exception he) {
1900                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1901                throw new RuntimeException(he);
1902            }
1903        }
1904    
1905    
1906    
1907        /**
1908         * Inserts a repetition of
1909         * ORC-23: "Ordering Facility Phone Number" at a specific index
1910         *
1911         * @param rep The repetition index (0-indexed)
1912         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1913         */
1914        public XTN insertOrderingFacilityPhoneNumber(int rep) throws HL7Exception { 
1915            return (XTN) super.insertRepetition(23, rep);
1916        }
1917    
1918    
1919    
1920        /**
1921         * Inserts a repetition of
1922         * ORC-23: "Ordering Facility Phone Number" at a specific index
1923         *
1924         * @param rep The repetition index (0-indexed)
1925         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1926         */
1927        public XTN insertOrc23_OrderingFacilityPhoneNumber(int rep) throws HL7Exception { 
1928            return (XTN) super.insertRepetition(23, rep);
1929        }
1930    
1931    
1932        /**
1933         * Removes a repetition of
1934         * ORC-23: "Ordering Facility Phone Number" at a specific index
1935         *
1936         * @param rep The repetition index (0-indexed)
1937         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1938         */
1939        public XTN removeOrderingFacilityPhoneNumber(int rep) throws HL7Exception { 
1940            return (XTN) super.removeRepetition(23, rep);
1941        }
1942    
1943    
1944        /**
1945         * Removes a repetition of
1946         * ORC-23: "Ordering Facility Phone Number" at a specific index
1947         *
1948         * @param rep The repetition index (0-indexed)
1949         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1950         */
1951        public XTN removeOrc23_OrderingFacilityPhoneNumber(int rep) throws HL7Exception { 
1952            return (XTN) super.removeRepetition(23, rep);
1953        }
1954    
1955    
1956    
1957        /**
1958         * Returns all repetitions of Ordering Provider Address (ORC-24).
1959         */
1960        public XAD[] getOrderingProviderAddress() {
1961            XAD[] ret = null;
1962            try {
1963                Type[] t = this.getField(24);  
1964                ret = new XAD[t.length];
1965                for (int i = 0; i < ret.length; i++) {
1966                    ret[i] = (XAD)t[i];
1967                }
1968            } catch (ClassCastException cce) {
1969                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1970                throw new RuntimeException(cce);
1971            } catch (HL7Exception he) {
1972                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1973                throw new RuntimeException(he);
1974            }
1975            return ret;
1976        }
1977    
1978    
1979        /**
1980         * Returns a count of the current number of repetitions of Ordering Provider Address (ORC-24).
1981         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1982         * it will return zero.
1983         */
1984        public int getOrderingProviderAddressReps() {
1985            XAD[] ret = null;
1986            try {
1987                Type[] t = this.getField(24);
1988                return t.length;  
1989            } catch (ClassCastException cce) {
1990                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1991                throw new RuntimeException(cce);
1992            } catch (HL7Exception he) {
1993                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1994                throw new RuntimeException(he);
1995            }
1996        }
1997    
1998    
1999        /**
2000         * Returns a specific repetition of
2001         * ORC-24: "Ordering Provider Address" - creates it if necessary
2002         *
2003         * @param rep The repetition index (0-indexed)
2004         */
2005        public XAD getOrderingProviderAddress(int rep) { 
2006            XAD ret = null;
2007            try {
2008                Type t = this.getField(24, rep);
2009                ret = (XAD)t;
2010            } catch (ClassCastException cce) {
2011                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2012                throw new RuntimeException(cce);
2013            } catch (HL7Exception he) {
2014                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2015                throw new RuntimeException(he);
2016            }
2017            return ret;
2018        }
2019    
2020        /**
2021         * Returns a specific repetition of
2022         * ORC-24: "Ordering Provider Address" - creates it if necessary
2023         *
2024         * @param rep The repetition index (0-indexed)
2025         */
2026        public XAD getOrc24_OrderingProviderAddress(int rep) { 
2027            XAD ret = null;
2028            try {
2029                Type t = this.getField(24, rep);
2030                ret = (XAD)t;
2031            } catch (ClassCastException cce) {
2032                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2033                throw new RuntimeException(cce);
2034            } catch (HL7Exception he) {
2035                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2036                throw new RuntimeException(he);
2037            }
2038            return ret;
2039        }
2040    
2041    
2042        /**
2043         * Returns a count of the current number of repetitions of Ordering Provider Address (ORC-24).
2044         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2045         * it will return zero.
2046         */
2047        public int getOrc24_OrderingProviderAddressReps() {
2048            XAD[] ret = null;
2049            try {
2050                Type[] t = this.getField(24);
2051                return t.length;  
2052            } catch (ClassCastException cce) {
2053                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2054                throw new RuntimeException(cce);
2055            } catch (HL7Exception he) {
2056                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2057                throw new RuntimeException(he);
2058            }
2059        }
2060    
2061    
2062    
2063        /**
2064         * Inserts a repetition of
2065         * ORC-24: "Ordering Provider Address" at a specific index
2066         *
2067         * @param rep The repetition index (0-indexed)
2068         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2069         */
2070        public XAD insertOrderingProviderAddress(int rep) throws HL7Exception { 
2071            return (XAD) super.insertRepetition(24, rep);
2072        }
2073    
2074    
2075    
2076        /**
2077         * Inserts a repetition of
2078         * ORC-24: "Ordering Provider Address" at a specific index
2079         *
2080         * @param rep The repetition index (0-indexed)
2081         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2082         */
2083        public XAD insertOrc24_OrderingProviderAddress(int rep) throws HL7Exception { 
2084            return (XAD) super.insertRepetition(24, rep);
2085        }
2086    
2087    
2088        /**
2089         * Removes a repetition of
2090         * ORC-24: "Ordering Provider Address" at a specific index
2091         *
2092         * @param rep The repetition index (0-indexed)
2093         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2094         */
2095        public XAD removeOrderingProviderAddress(int rep) throws HL7Exception { 
2096            return (XAD) super.removeRepetition(24, rep);
2097        }
2098    
2099    
2100        /**
2101         * Removes a repetition of
2102         * ORC-24: "Ordering Provider Address" at a specific index
2103         *
2104         * @param rep The repetition index (0-indexed)
2105         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2106         */
2107        public XAD removeOrc24_OrderingProviderAddress(int rep) throws HL7Exception { 
2108            return (XAD) super.removeRepetition(24, rep);
2109        }
2110    
2111    
2112    
2113    
2114    
2115    
2116        /** {@inheritDoc} */   
2117        protected Type createNewTypeWithoutReflection(int field) {
2118           switch (field) {
2119              case 0: return new ID(getMessage(), new Integer( 119 ));
2120              case 1: return new EI(getMessage());
2121              case 2: return new EI(getMessage());
2122              case 3: return new EI(getMessage());
2123              case 4: return new ID(getMessage(), new Integer( 38 ));
2124              case 5: return new ID(getMessage(), new Integer( 121 ));
2125              case 6: return new TQ(getMessage());
2126              case 7: return new EIP(getMessage());
2127              case 8: return new TS(getMessage());
2128              case 9: return new XCN(getMessage());
2129              case 10: return new XCN(getMessage());
2130              case 11: return new XCN(getMessage());
2131              case 12: return new PL(getMessage());
2132              case 13: return new XTN(getMessage());
2133              case 14: return new TS(getMessage());
2134              case 15: return new CE(getMessage());
2135              case 16: return new CE(getMessage());
2136              case 17: return new CE(getMessage());
2137              case 18: return new XCN(getMessage());
2138              case 19: return new CE(getMessage());
2139              case 20: return new XON(getMessage());
2140              case 21: return new XAD(getMessage());
2141              case 22: return new XTN(getMessage());
2142              case 23: return new XAD(getMessage());
2143              default: return null;
2144           }
2145       }
2146    
2147    
2148    }
2149