001    /*
002     * This class is an auto-generated source file for a HAPI
003     * HL7 v2.x standard structure class.
004     *
005     * For more information, visit: http://hl7api.sourceforge.net/
006     */
007    
008    package ca.uhn.hl7v2.model.v24.segment;
009    
010    // import ca.uhn.hl7v2.model.v24.group.*;
011    import ca.uhn.hl7v2.model.v24.datatype.*;
012    import ca.uhn.log.HapiLogFactory;
013    import ca.uhn.hl7v2.HL7Exception;
014    import ca.uhn.hl7v2.parser.ModelClassFactory;
015    import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
016    import ca.uhn.hl7v2.model.AbstractMessage;
017    import ca.uhn.hl7v2.model.Group;
018    import ca.uhn.hl7v2.model.Type;
019    import ca.uhn.hl7v2.model.AbstractSegment;
020    import ca.uhn.hl7v2.model.Varies;
021    
022    /**
023     *<p>Represents an HL7 ORC message segment (Common Order). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>ORC-1: Order Control (ID) <b> </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 repeating</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         * <li>ORC-25: Order Status Modifier (CWE) <b>optional </b>
051     * </ul>
052     */
053    public class ORC extends AbstractSegment {
054    
055        /** 
056         * Creates a new ORC segment
057         */
058        public ORC(Group parent, ModelClassFactory factory) {
059           super(parent, factory);
060           init(factory);
061        }
062    
063        private void init(ModelClassFactory factory) {
064           try {
065                                      this.add(ID.class, true, 1, 2, new Object[]{ getMessage() }, "Order Control");
066                                      this.add(EI.class, false, 1, 22, new Object[]{ getMessage(), new Integer(0) }, "Placer Order Number");
067                                      this.add(EI.class, false, 1, 22, new Object[]{ getMessage(), new Integer(0) }, "Filler Order Number");
068                                      this.add(EI.class, false, 1, 22, new Object[]{ getMessage(), new Integer(0) }, "Placer Group Number");
069                                      this.add(ID.class, false, 1, 2, new Object[]{ getMessage() }, "Order Status");
070                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Response Flag");
071                                      this.add(TQ.class, false, 0, 200, new Object[]{ getMessage(), new Integer(0) }, "Quantity/Timing");
072                                      this.add(EIP.class, false, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Parent Order");
073                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Date/Time of Transaction");
074                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Entered By");
075                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Verified By");
076                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Ordering Provider");
077                                      this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "Enterer's Location");
078                                      this.add(XTN.class, false, 2, 250, new Object[]{ getMessage(), new Integer(0) }, "Call Back Phone Number");
079                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Order Effective Date/Time");
080                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Order Control Code Reason");
081                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Entering Organization");
082                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Entering Device");
083                                      this.add(XCN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Action By");
084                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(339) }, "Advanced Beneficiary Notice Code");
085                                      this.add(XON.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Ordering Facility Name");
086                                      this.add(XAD.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Ordering Facility Address");
087                                      this.add(XTN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Ordering Facility Phone Number");
088                                      this.add(XAD.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Ordering Provider Address");
089                                      this.add(CWE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Order Status Modifier");
090           } catch(HL7Exception e) {
091              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating ORC - this is probably a bug in the source code generator.", e);
092           }
093        }
094    
095    
096    
097        /**
098         * Returns
099         * ORC-1: "Order Control" - creates it if necessary
100         */
101        public ID getOrderControl() { 
102            ID ret = null;
103            try {
104                Type t = this.getField(1, 0);
105                ret = (ID)t;
106            } catch (ClassCastException cce) {
107                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
108                throw new RuntimeException(cce);
109            } catch (HL7Exception he) {
110                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
111                throw new RuntimeException(he);
112            }
113            return ret;
114        }
115    
116    
117        /**
118         * Returns
119         * ORC-1: "Order Control" - creates it if necessary
120         */
121        public ID getOrc1_OrderControl() { 
122            ID ret = null;
123            try {
124                Type t = this.getField(1, 0);
125                ret = (ID)t;
126            } catch (ClassCastException cce) {
127                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
128                throw new RuntimeException(cce);
129            } catch (HL7Exception he) {
130                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
131                throw new RuntimeException(he);
132            }
133            return ret;
134        }
135    
136    
137    
138        /**
139         * Returns
140         * ORC-2: "Placer Order Number" - creates it if necessary
141         */
142        public EI getPlacerOrderNumber() { 
143            EI ret = null;
144            try {
145                Type t = this.getField(2, 0);
146                ret = (EI)t;
147            } catch (ClassCastException cce) {
148                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
149                throw new RuntimeException(cce);
150            } catch (HL7Exception he) {
151                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
152                throw new RuntimeException(he);
153            }
154            return ret;
155        }
156    
157    
158        /**
159         * Returns
160         * ORC-2: "Placer Order Number" - creates it if necessary
161         */
162        public EI getOrc2_PlacerOrderNumber() { 
163            EI ret = null;
164            try {
165                Type t = this.getField(2, 0);
166                ret = (EI)t;
167            } catch (ClassCastException cce) {
168                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
169                throw new RuntimeException(cce);
170            } catch (HL7Exception he) {
171                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
172                throw new RuntimeException(he);
173            }
174            return ret;
175        }
176    
177    
178    
179        /**
180         * Returns
181         * ORC-3: "Filler Order Number" - creates it if necessary
182         */
183        public EI getFillerOrderNumber() { 
184            EI ret = null;
185            try {
186                Type t = this.getField(3, 0);
187                ret = (EI)t;
188            } catch (ClassCastException cce) {
189                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
190                throw new RuntimeException(cce);
191            } catch (HL7Exception he) {
192                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
193                throw new RuntimeException(he);
194            }
195            return ret;
196        }
197    
198    
199        /**
200         * Returns
201         * ORC-3: "Filler Order Number" - creates it if necessary
202         */
203        public EI getOrc3_FillerOrderNumber() { 
204            EI ret = null;
205            try {
206                Type t = this.getField(3, 0);
207                ret = (EI)t;
208            } catch (ClassCastException cce) {
209                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
210                throw new RuntimeException(cce);
211            } catch (HL7Exception he) {
212                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
213                throw new RuntimeException(he);
214            }
215            return ret;
216        }
217    
218    
219    
220        /**
221         * Returns
222         * ORC-4: "Placer Group Number" - creates it if necessary
223         */
224        public EI getPlacerGroupNumber() { 
225            EI ret = null;
226            try {
227                Type t = this.getField(4, 0);
228                ret = (EI)t;
229            } catch (ClassCastException cce) {
230                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
231                throw new RuntimeException(cce);
232            } catch (HL7Exception he) {
233                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
234                throw new RuntimeException(he);
235            }
236            return ret;
237        }
238    
239    
240        /**
241         * Returns
242         * ORC-4: "Placer Group Number" - creates it if necessary
243         */
244        public EI getOrc4_PlacerGroupNumber() { 
245            EI ret = null;
246            try {
247                Type t = this.getField(4, 0);
248                ret = (EI)t;
249            } catch (ClassCastException cce) {
250                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
251                throw new RuntimeException(cce);
252            } catch (HL7Exception he) {
253                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
254                throw new RuntimeException(he);
255            }
256            return ret;
257        }
258    
259    
260    
261        /**
262         * Returns
263         * ORC-5: "Order Status" - creates it if necessary
264         */
265        public ID getOrderStatus() { 
266            ID ret = null;
267            try {
268                Type t = this.getField(5, 0);
269                ret = (ID)t;
270            } catch (ClassCastException cce) {
271                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
272                throw new RuntimeException(cce);
273            } catch (HL7Exception he) {
274                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
275                throw new RuntimeException(he);
276            }
277            return ret;
278        }
279    
280    
281        /**
282         * Returns
283         * ORC-5: "Order Status" - creates it if necessary
284         */
285        public ID getOrc5_OrderStatus() { 
286            ID ret = null;
287            try {
288                Type t = this.getField(5, 0);
289                ret = (ID)t;
290            } catch (ClassCastException cce) {
291                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
292                throw new RuntimeException(cce);
293            } catch (HL7Exception he) {
294                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
295                throw new RuntimeException(he);
296            }
297            return ret;
298        }
299    
300    
301    
302        /**
303         * Returns
304         * ORC-6: "Response Flag" - creates it if necessary
305         */
306        public ID getResponseFlag() { 
307            ID ret = null;
308            try {
309                Type t = this.getField(6, 0);
310                ret = (ID)t;
311            } catch (ClassCastException cce) {
312                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
313                throw new RuntimeException(cce);
314            } catch (HL7Exception he) {
315                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
316                throw new RuntimeException(he);
317            }
318            return ret;
319        }
320    
321    
322        /**
323         * Returns
324         * ORC-6: "Response Flag" - creates it if necessary
325         */
326        public ID getOrc6_ResponseFlag() { 
327            ID ret = null;
328            try {
329                Type t = this.getField(6, 0);
330                ret = (ID)t;
331            } catch (ClassCastException cce) {
332                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
333                throw new RuntimeException(cce);
334            } catch (HL7Exception he) {
335                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
336                throw new RuntimeException(he);
337            }
338            return ret;
339        }
340    
341    
342        /**
343         * Returns all repetitions of Quantity/Timing (ORC-7).
344         */
345        public TQ[] getQuantityTiming() {
346            TQ[] ret = null;
347            try {
348                Type[] t = this.getField(7);  
349                ret = new TQ[t.length];
350                for (int i = 0; i < ret.length; i++) {
351                    ret[i] = (TQ)t[i];
352                }
353            } catch (ClassCastException cce) {
354                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
355                throw new RuntimeException(cce);
356            } catch (HL7Exception he) {
357                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
358                throw new RuntimeException(he);
359            }
360            return ret;
361        }
362    
363    
364        /**
365         * Returns a count of the current number of repetitions of Quantity/Timing (ORC-7).
366         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
367         * it will return zero.
368         */
369        public int getQuantityTimingReps() {
370            TQ[] ret = null;
371            try {
372                Type[] t = this.getField(7);
373                return t.length;  
374            } catch (ClassCastException cce) {
375                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
376                throw new RuntimeException(cce);
377            } catch (HL7Exception he) {
378                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
379                throw new RuntimeException(he);
380            }
381        }
382    
383    
384        /**
385         * Returns a specific repetition of
386         * ORC-7: "Quantity/Timing" - creates it if necessary
387         *
388         * @param rep The repetition index (0-indexed)
389         */
390        public TQ getQuantityTiming(int rep) { 
391            TQ ret = null;
392            try {
393                Type t = this.getField(7, rep);
394                ret = (TQ)t;
395            } catch (ClassCastException cce) {
396                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
397                throw new RuntimeException(cce);
398            } catch (HL7Exception he) {
399                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
400                throw new RuntimeException(he);
401            }
402            return ret;
403        }
404    
405        /**
406         * Returns a specific repetition of
407         * ORC-7: "Quantity/Timing" - creates it if necessary
408         *
409         * @param rep The repetition index (0-indexed)
410         */
411        public TQ getOrc7_QuantityTiming(int rep) { 
412            TQ ret = null;
413            try {
414                Type t = this.getField(7, rep);
415                ret = (TQ)t;
416            } catch (ClassCastException cce) {
417                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
418                throw new RuntimeException(cce);
419            } catch (HL7Exception he) {
420                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
421                throw new RuntimeException(he);
422            }
423            return ret;
424        }
425    
426    
427        /**
428         * Returns a count of the current number of repetitions of Quantity/Timing (ORC-7).
429         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
430         * it will return zero.
431         */
432        public int getOrc7_QuantityTimingReps() {
433            TQ[] ret = null;
434            try {
435                Type[] t = this.getField(7);
436                return t.length;  
437            } catch (ClassCastException cce) {
438                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
439                throw new RuntimeException(cce);
440            } catch (HL7Exception he) {
441                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
442                throw new RuntimeException(he);
443            }
444        }
445    
446    
447    
448        /**
449         * Inserts a repetition of
450         * ORC-7: "Quantity/Timing" at a specific index
451         *
452         * @param rep The repetition index (0-indexed)
453         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
454         */
455        public TQ insertQuantityTiming(int rep) throws HL7Exception { 
456            return (TQ) super.insertRepetition(7, rep);
457        }
458    
459    
460    
461        /**
462         * Inserts a repetition of
463         * ORC-7: "Quantity/Timing" at a specific index
464         *
465         * @param rep The repetition index (0-indexed)
466         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
467         */
468        public TQ insertOrc7_QuantityTiming(int rep) throws HL7Exception { 
469            return (TQ) super.insertRepetition(7, rep);
470        }
471    
472    
473        /**
474         * Removes a repetition of
475         * ORC-7: "Quantity/Timing" at a specific index
476         *
477         * @param rep The repetition index (0-indexed)
478         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
479         */
480        public TQ removeQuantityTiming(int rep) throws HL7Exception { 
481            return (TQ) super.removeRepetition(7, rep);
482        }
483    
484    
485        /**
486         * Removes a repetition of
487         * ORC-7: "Quantity/Timing" at a specific index
488         *
489         * @param rep The repetition index (0-indexed)
490         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
491         */
492        public TQ removeOrc7_QuantityTiming(int rep) throws HL7Exception { 
493            return (TQ) super.removeRepetition(7, rep);
494        }
495    
496    
497    
498    
499        /**
500         * Returns
501         * ORC-8: "Parent Order" - creates it if necessary
502         */
503        public EIP getParentOrder() { 
504            EIP ret = null;
505            try {
506                Type t = this.getField(8, 0);
507                ret = (EIP)t;
508            } catch (ClassCastException cce) {
509                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
510                throw new RuntimeException(cce);
511            } catch (HL7Exception he) {
512                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
513                throw new RuntimeException(he);
514            }
515            return ret;
516        }
517    
518    
519        /**
520         * Returns
521         * ORC-8: "Parent Order" - creates it if necessary
522         */
523        public EIP getOrc8_ParentOrder() { 
524            EIP ret = null;
525            try {
526                Type t = this.getField(8, 0);
527                ret = (EIP)t;
528            } catch (ClassCastException cce) {
529                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
530                throw new RuntimeException(cce);
531            } catch (HL7Exception he) {
532                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
533                throw new RuntimeException(he);
534            }
535            return ret;
536        }
537    
538    
539    
540        /**
541         * Returns
542         * ORC-9: "Date/Time of Transaction" - creates it if necessary
543         */
544        public TS getDateTimeOfTransaction() { 
545            TS ret = null;
546            try {
547                Type t = this.getField(9, 0);
548                ret = (TS)t;
549            } catch (ClassCastException cce) {
550                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
551                throw new RuntimeException(cce);
552            } catch (HL7Exception he) {
553                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
554                throw new RuntimeException(he);
555            }
556            return ret;
557        }
558    
559    
560        /**
561         * Returns
562         * ORC-9: "Date/Time of Transaction" - creates it if necessary
563         */
564        public TS getOrc9_DateTimeOfTransaction() { 
565            TS ret = null;
566            try {
567                Type t = this.getField(9, 0);
568                ret = (TS)t;
569            } catch (ClassCastException cce) {
570                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
571                throw new RuntimeException(cce);
572            } catch (HL7Exception he) {
573                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
574                throw new RuntimeException(he);
575            }
576            return ret;
577        }
578    
579    
580        /**
581         * Returns all repetitions of Entered By (ORC-10).
582         */
583        public XCN[] getEnteredBy() {
584            XCN[] ret = null;
585            try {
586                Type[] t = this.getField(10);  
587                ret = new XCN[t.length];
588                for (int i = 0; i < ret.length; i++) {
589                    ret[i] = (XCN)t[i];
590                }
591            } catch (ClassCastException cce) {
592                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
593                throw new RuntimeException(cce);
594            } catch (HL7Exception he) {
595                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
596                throw new RuntimeException(he);
597            }
598            return ret;
599        }
600    
601    
602        /**
603         * Returns a count of the current number of repetitions of Entered By (ORC-10).
604         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
605         * it will return zero.
606         */
607        public int getEnteredByReps() {
608            XCN[] ret = null;
609            try {
610                Type[] t = this.getField(10);
611                return t.length;  
612            } catch (ClassCastException cce) {
613                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
614                throw new RuntimeException(cce);
615            } catch (HL7Exception he) {
616                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
617                throw new RuntimeException(he);
618            }
619        }
620    
621    
622        /**
623         * Returns a specific repetition of
624         * ORC-10: "Entered By" - creates it if necessary
625         *
626         * @param rep The repetition index (0-indexed)
627         */
628        public XCN getEnteredBy(int rep) { 
629            XCN ret = null;
630            try {
631                Type t = this.getField(10, rep);
632                ret = (XCN)t;
633            } catch (ClassCastException cce) {
634                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
635                throw new RuntimeException(cce);
636            } catch (HL7Exception he) {
637                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
638                throw new RuntimeException(he);
639            }
640            return ret;
641        }
642    
643        /**
644         * Returns a specific repetition of
645         * ORC-10: "Entered By" - creates it if necessary
646         *
647         * @param rep The repetition index (0-indexed)
648         */
649        public XCN getOrc10_EnteredBy(int rep) { 
650            XCN ret = null;
651            try {
652                Type t = this.getField(10, rep);
653                ret = (XCN)t;
654            } catch (ClassCastException cce) {
655                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
656                throw new RuntimeException(cce);
657            } catch (HL7Exception he) {
658                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
659                throw new RuntimeException(he);
660            }
661            return ret;
662        }
663    
664    
665        /**
666         * Returns a count of the current number of repetitions of Entered By (ORC-10).
667         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
668         * it will return zero.
669         */
670        public int getOrc10_EnteredByReps() {
671            XCN[] ret = null;
672            try {
673                Type[] t = this.getField(10);
674                return t.length;  
675            } catch (ClassCastException cce) {
676                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
677                throw new RuntimeException(cce);
678            } catch (HL7Exception he) {
679                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
680                throw new RuntimeException(he);
681            }
682        }
683    
684    
685    
686        /**
687         * Inserts a repetition of
688         * ORC-10: "Entered By" at a specific index
689         *
690         * @param rep The repetition index (0-indexed)
691         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
692         */
693        public XCN insertEnteredBy(int rep) throws HL7Exception { 
694            return (XCN) super.insertRepetition(10, rep);
695        }
696    
697    
698    
699        /**
700         * Inserts a repetition of
701         * ORC-10: "Entered By" at a specific index
702         *
703         * @param rep The repetition index (0-indexed)
704         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
705         */
706        public XCN insertOrc10_EnteredBy(int rep) throws HL7Exception { 
707            return (XCN) super.insertRepetition(10, rep);
708        }
709    
710    
711        /**
712         * Removes a repetition of
713         * ORC-10: "Entered By" at a specific index
714         *
715         * @param rep The repetition index (0-indexed)
716         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
717         */
718        public XCN removeEnteredBy(int rep) throws HL7Exception { 
719            return (XCN) super.removeRepetition(10, rep);
720        }
721    
722    
723        /**
724         * Removes a repetition of
725         * ORC-10: "Entered By" at a specific index
726         *
727         * @param rep The repetition index (0-indexed)
728         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
729         */
730        public XCN removeOrc10_EnteredBy(int rep) throws HL7Exception { 
731            return (XCN) super.removeRepetition(10, rep);
732        }
733    
734    
735    
736        /**
737         * Returns all repetitions of Verified By (ORC-11).
738         */
739        public XCN[] getVerifiedBy() {
740            XCN[] ret = null;
741            try {
742                Type[] t = this.getField(11);  
743                ret = new XCN[t.length];
744                for (int i = 0; i < ret.length; i++) {
745                    ret[i] = (XCN)t[i];
746                }
747            } catch (ClassCastException cce) {
748                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
749                throw new RuntimeException(cce);
750            } catch (HL7Exception he) {
751                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
752                throw new RuntimeException(he);
753            }
754            return ret;
755        }
756    
757    
758        /**
759         * Returns a count of the current number of repetitions of Verified By (ORC-11).
760         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
761         * it will return zero.
762         */
763        public int getVerifiedByReps() {
764            XCN[] ret = null;
765            try {
766                Type[] t = this.getField(11);
767                return t.length;  
768            } catch (ClassCastException cce) {
769                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
770                throw new RuntimeException(cce);
771            } catch (HL7Exception he) {
772                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
773                throw new RuntimeException(he);
774            }
775        }
776    
777    
778        /**
779         * Returns a specific repetition of
780         * ORC-11: "Verified By" - creates it if necessary
781         *
782         * @param rep The repetition index (0-indexed)
783         */
784        public XCN getVerifiedBy(int rep) { 
785            XCN ret = null;
786            try {
787                Type t = this.getField(11, rep);
788                ret = (XCN)t;
789            } catch (ClassCastException cce) {
790                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
791                throw new RuntimeException(cce);
792            } catch (HL7Exception he) {
793                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
794                throw new RuntimeException(he);
795            }
796            return ret;
797        }
798    
799        /**
800         * Returns a specific repetition of
801         * ORC-11: "Verified By" - creates it if necessary
802         *
803         * @param rep The repetition index (0-indexed)
804         */
805        public XCN getOrc11_VerifiedBy(int rep) { 
806            XCN ret = null;
807            try {
808                Type t = this.getField(11, rep);
809                ret = (XCN)t;
810            } catch (ClassCastException cce) {
811                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
812                throw new RuntimeException(cce);
813            } catch (HL7Exception he) {
814                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
815                throw new RuntimeException(he);
816            }
817            return ret;
818        }
819    
820    
821        /**
822         * Returns a count of the current number of repetitions of Verified By (ORC-11).
823         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
824         * it will return zero.
825         */
826        public int getOrc11_VerifiedByReps() {
827            XCN[] ret = null;
828            try {
829                Type[] t = this.getField(11);
830                return t.length;  
831            } catch (ClassCastException cce) {
832                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
833                throw new RuntimeException(cce);
834            } catch (HL7Exception he) {
835                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
836                throw new RuntimeException(he);
837            }
838        }
839    
840    
841    
842        /**
843         * Inserts a repetition of
844         * ORC-11: "Verified By" at a specific index
845         *
846         * @param rep The repetition index (0-indexed)
847         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
848         */
849        public XCN insertVerifiedBy(int rep) throws HL7Exception { 
850            return (XCN) super.insertRepetition(11, rep);
851        }
852    
853    
854    
855        /**
856         * Inserts a repetition of
857         * ORC-11: "Verified By" at a specific index
858         *
859         * @param rep The repetition index (0-indexed)
860         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
861         */
862        public XCN insertOrc11_VerifiedBy(int rep) throws HL7Exception { 
863            return (XCN) super.insertRepetition(11, rep);
864        }
865    
866    
867        /**
868         * Removes a repetition of
869         * ORC-11: "Verified By" at a specific index
870         *
871         * @param rep The repetition index (0-indexed)
872         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
873         */
874        public XCN removeVerifiedBy(int rep) throws HL7Exception { 
875            return (XCN) super.removeRepetition(11, rep);
876        }
877    
878    
879        /**
880         * Removes a repetition of
881         * ORC-11: "Verified By" at a specific index
882         *
883         * @param rep The repetition index (0-indexed)
884         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
885         */
886        public XCN removeOrc11_VerifiedBy(int rep) throws HL7Exception { 
887            return (XCN) super.removeRepetition(11, rep);
888        }
889    
890    
891    
892        /**
893         * Returns all repetitions of Ordering Provider (ORC-12).
894         */
895        public XCN[] getOrderingProvider() {
896            XCN[] ret = null;
897            try {
898                Type[] t = this.getField(12);  
899                ret = new XCN[t.length];
900                for (int i = 0; i < ret.length; i++) {
901                    ret[i] = (XCN)t[i];
902                }
903            } catch (ClassCastException cce) {
904                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
905                throw new RuntimeException(cce);
906            } catch (HL7Exception he) {
907                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
908                throw new RuntimeException(he);
909            }
910            return ret;
911        }
912    
913    
914        /**
915         * Returns a count of the current number of repetitions of Ordering Provider (ORC-12).
916         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
917         * it will return zero.
918         */
919        public int getOrderingProviderReps() {
920            XCN[] ret = null;
921            try {
922                Type[] t = this.getField(12);
923                return t.length;  
924            } catch (ClassCastException cce) {
925                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
926                throw new RuntimeException(cce);
927            } catch (HL7Exception he) {
928                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
929                throw new RuntimeException(he);
930            }
931        }
932    
933    
934        /**
935         * Returns a specific repetition of
936         * ORC-12: "Ordering Provider" - creates it if necessary
937         *
938         * @param rep The repetition index (0-indexed)
939         */
940        public XCN getOrderingProvider(int rep) { 
941            XCN ret = null;
942            try {
943                Type t = this.getField(12, rep);
944                ret = (XCN)t;
945            } catch (ClassCastException cce) {
946                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
947                throw new RuntimeException(cce);
948            } catch (HL7Exception he) {
949                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
950                throw new RuntimeException(he);
951            }
952            return ret;
953        }
954    
955        /**
956         * Returns a specific repetition of
957         * ORC-12: "Ordering Provider" - creates it if necessary
958         *
959         * @param rep The repetition index (0-indexed)
960         */
961        public XCN getOrc12_OrderingProvider(int rep) { 
962            XCN ret = null;
963            try {
964                Type t = this.getField(12, rep);
965                ret = (XCN)t;
966            } catch (ClassCastException cce) {
967                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
968                throw new RuntimeException(cce);
969            } catch (HL7Exception he) {
970                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
971                throw new RuntimeException(he);
972            }
973            return ret;
974        }
975    
976    
977        /**
978         * Returns a count of the current number of repetitions of Ordering Provider (ORC-12).
979         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
980         * it will return zero.
981         */
982        public int getOrc12_OrderingProviderReps() {
983            XCN[] ret = null;
984            try {
985                Type[] t = this.getField(12);
986                return t.length;  
987            } catch (ClassCastException cce) {
988                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
989                throw new RuntimeException(cce);
990            } catch (HL7Exception he) {
991                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
992                throw new RuntimeException(he);
993            }
994        }
995    
996    
997    
998        /**
999         * Inserts a repetition of
1000         * ORC-12: "Ordering Provider" at a specific index
1001         *
1002         * @param rep The repetition index (0-indexed)
1003         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1004         */
1005        public XCN insertOrderingProvider(int rep) throws HL7Exception { 
1006            return (XCN) super.insertRepetition(12, rep);
1007        }
1008    
1009    
1010    
1011        /**
1012         * Inserts a repetition of
1013         * ORC-12: "Ordering Provider" at a specific index
1014         *
1015         * @param rep The repetition index (0-indexed)
1016         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1017         */
1018        public XCN insertOrc12_OrderingProvider(int rep) throws HL7Exception { 
1019            return (XCN) super.insertRepetition(12, rep);
1020        }
1021    
1022    
1023        /**
1024         * Removes a repetition of
1025         * ORC-12: "Ordering Provider" at a specific index
1026         *
1027         * @param rep The repetition index (0-indexed)
1028         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1029         */
1030        public XCN removeOrderingProvider(int rep) throws HL7Exception { 
1031            return (XCN) super.removeRepetition(12, rep);
1032        }
1033    
1034    
1035        /**
1036         * Removes a repetition of
1037         * ORC-12: "Ordering Provider" at a specific index
1038         *
1039         * @param rep The repetition index (0-indexed)
1040         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1041         */
1042        public XCN removeOrc12_OrderingProvider(int rep) throws HL7Exception { 
1043            return (XCN) super.removeRepetition(12, rep);
1044        }
1045    
1046    
1047    
1048    
1049        /**
1050         * Returns
1051         * ORC-13: "Enterer's Location" - creates it if necessary
1052         */
1053        public PL getEntererSLocation() { 
1054            PL ret = null;
1055            try {
1056                Type t = this.getField(13, 0);
1057                ret = (PL)t;
1058            } catch (ClassCastException cce) {
1059                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1060                throw new RuntimeException(cce);
1061            } catch (HL7Exception he) {
1062                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1063                throw new RuntimeException(he);
1064            }
1065            return ret;
1066        }
1067    
1068    
1069        /**
1070         * Returns
1071         * ORC-13: "Enterer's Location" - creates it if necessary
1072         */
1073        public PL getOrc13_EntererSLocation() { 
1074            PL ret = null;
1075            try {
1076                Type t = this.getField(13, 0);
1077                ret = (PL)t;
1078            } catch (ClassCastException cce) {
1079                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1080                throw new RuntimeException(cce);
1081            } catch (HL7Exception he) {
1082                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1083                throw new RuntimeException(he);
1084            }
1085            return ret;
1086        }
1087    
1088    
1089        /**
1090         * Returns all repetitions of Call Back Phone Number (ORC-14).
1091         */
1092        public XTN[] getCallBackPhoneNumber() {
1093            XTN[] ret = null;
1094            try {
1095                Type[] t = this.getField(14);  
1096                ret = new XTN[t.length];
1097                for (int i = 0; i < ret.length; i++) {
1098                    ret[i] = (XTN)t[i];
1099                }
1100            } catch (ClassCastException cce) {
1101                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1102                throw new RuntimeException(cce);
1103            } catch (HL7Exception he) {
1104                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1105                throw new RuntimeException(he);
1106            }
1107            return ret;
1108        }
1109    
1110    
1111        /**
1112         * Returns a count of the current number of repetitions of Call Back Phone Number (ORC-14).
1113         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1114         * it will return zero.
1115         */
1116        public int getCallBackPhoneNumberReps() {
1117            XTN[] ret = null;
1118            try {
1119                Type[] t = this.getField(14);
1120                return t.length;  
1121            } catch (ClassCastException cce) {
1122                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1123                throw new RuntimeException(cce);
1124            } catch (HL7Exception he) {
1125                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1126                throw new RuntimeException(he);
1127            }
1128        }
1129    
1130    
1131        /**
1132         * Returns a specific repetition of
1133         * ORC-14: "Call Back Phone Number" - creates it if necessary
1134         *
1135         * @param rep The repetition index (0-indexed)
1136         */
1137        public XTN getCallBackPhoneNumber(int rep) { 
1138            XTN ret = null;
1139            try {
1140                Type t = this.getField(14, rep);
1141                ret = (XTN)t;
1142            } catch (ClassCastException cce) {
1143                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1144                throw new RuntimeException(cce);
1145            } catch (HL7Exception he) {
1146                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1147                throw new RuntimeException(he);
1148            }
1149            return ret;
1150        }
1151    
1152        /**
1153         * Returns a specific repetition of
1154         * ORC-14: "Call Back Phone Number" - creates it if necessary
1155         *
1156         * @param rep The repetition index (0-indexed)
1157         */
1158        public XTN getOrc14_CallBackPhoneNumber(int rep) { 
1159            XTN ret = null;
1160            try {
1161                Type t = this.getField(14, rep);
1162                ret = (XTN)t;
1163            } catch (ClassCastException cce) {
1164                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1165                throw new RuntimeException(cce);
1166            } catch (HL7Exception he) {
1167                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1168                throw new RuntimeException(he);
1169            }
1170            return ret;
1171        }
1172    
1173    
1174        /**
1175         * Returns a count of the current number of repetitions of Call Back Phone Number (ORC-14).
1176         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1177         * it will return zero.
1178         */
1179        public int getOrc14_CallBackPhoneNumberReps() {
1180            XTN[] ret = null;
1181            try {
1182                Type[] t = this.getField(14);
1183                return t.length;  
1184            } catch (ClassCastException cce) {
1185                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1186                throw new RuntimeException(cce);
1187            } catch (HL7Exception he) {
1188                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1189                throw new RuntimeException(he);
1190            }
1191        }
1192    
1193    
1194    
1195        /**
1196         * Inserts a repetition of
1197         * ORC-14: "Call Back Phone Number" at a specific index
1198         *
1199         * @param rep The repetition index (0-indexed)
1200         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1201         */
1202        public XTN insertCallBackPhoneNumber(int rep) throws HL7Exception { 
1203            return (XTN) super.insertRepetition(14, rep);
1204        }
1205    
1206    
1207    
1208        /**
1209         * Inserts a repetition of
1210         * ORC-14: "Call Back Phone Number" at a specific index
1211         *
1212         * @param rep The repetition index (0-indexed)
1213         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1214         */
1215        public XTN insertOrc14_CallBackPhoneNumber(int rep) throws HL7Exception { 
1216            return (XTN) super.insertRepetition(14, rep);
1217        }
1218    
1219    
1220        /**
1221         * Removes a repetition of
1222         * ORC-14: "Call Back Phone Number" at a specific index
1223         *
1224         * @param rep The repetition index (0-indexed)
1225         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1226         */
1227        public XTN removeCallBackPhoneNumber(int rep) throws HL7Exception { 
1228            return (XTN) super.removeRepetition(14, rep);
1229        }
1230    
1231    
1232        /**
1233         * Removes a repetition of
1234         * ORC-14: "Call Back Phone Number" at a specific index
1235         *
1236         * @param rep The repetition index (0-indexed)
1237         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1238         */
1239        public XTN removeOrc14_CallBackPhoneNumber(int rep) throws HL7Exception { 
1240            return (XTN) super.removeRepetition(14, rep);
1241        }
1242    
1243    
1244    
1245    
1246        /**
1247         * Returns
1248         * ORC-15: "Order Effective Date/Time" - creates it if necessary
1249         */
1250        public TS getOrderEffectiveDateTime() { 
1251            TS ret = null;
1252            try {
1253                Type t = this.getField(15, 0);
1254                ret = (TS)t;
1255            } catch (ClassCastException cce) {
1256                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1257                throw new RuntimeException(cce);
1258            } catch (HL7Exception he) {
1259                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1260                throw new RuntimeException(he);
1261            }
1262            return ret;
1263        }
1264    
1265    
1266        /**
1267         * Returns
1268         * ORC-15: "Order Effective Date/Time" - creates it if necessary
1269         */
1270        public TS getOrc15_OrderEffectiveDateTime() { 
1271            TS ret = null;
1272            try {
1273                Type t = this.getField(15, 0);
1274                ret = (TS)t;
1275            } catch (ClassCastException cce) {
1276                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1277                throw new RuntimeException(cce);
1278            } catch (HL7Exception he) {
1279                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1280                throw new RuntimeException(he);
1281            }
1282            return ret;
1283        }
1284    
1285    
1286    
1287        /**
1288         * Returns
1289         * ORC-16: "Order Control Code Reason" - creates it if necessary
1290         */
1291        public CE getOrderControlCodeReason() { 
1292            CE ret = null;
1293            try {
1294                Type t = this.getField(16, 0);
1295                ret = (CE)t;
1296            } catch (ClassCastException cce) {
1297                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1298                throw new RuntimeException(cce);
1299            } catch (HL7Exception he) {
1300                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1301                throw new RuntimeException(he);
1302            }
1303            return ret;
1304        }
1305    
1306    
1307        /**
1308         * Returns
1309         * ORC-16: "Order Control Code Reason" - creates it if necessary
1310         */
1311        public CE getOrc16_OrderControlCodeReason() { 
1312            CE ret = null;
1313            try {
1314                Type t = this.getField(16, 0);
1315                ret = (CE)t;
1316            } catch (ClassCastException cce) {
1317                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1318                throw new RuntimeException(cce);
1319            } catch (HL7Exception he) {
1320                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1321                throw new RuntimeException(he);
1322            }
1323            return ret;
1324        }
1325    
1326    
1327    
1328        /**
1329         * Returns
1330         * ORC-17: "Entering Organization" - creates it if necessary
1331         */
1332        public CE getEnteringOrganization() { 
1333            CE ret = null;
1334            try {
1335                Type t = this.getField(17, 0);
1336                ret = (CE)t;
1337            } catch (ClassCastException cce) {
1338                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1339                throw new RuntimeException(cce);
1340            } catch (HL7Exception he) {
1341                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1342                throw new RuntimeException(he);
1343            }
1344            return ret;
1345        }
1346    
1347    
1348        /**
1349         * Returns
1350         * ORC-17: "Entering Organization" - creates it if necessary
1351         */
1352        public CE getOrc17_EnteringOrganization() { 
1353            CE ret = null;
1354            try {
1355                Type t = this.getField(17, 0);
1356                ret = (CE)t;
1357            } catch (ClassCastException cce) {
1358                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1359                throw new RuntimeException(cce);
1360            } catch (HL7Exception he) {
1361                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1362                throw new RuntimeException(he);
1363            }
1364            return ret;
1365        }
1366    
1367    
1368    
1369        /**
1370         * Returns
1371         * ORC-18: "Entering Device" - creates it if necessary
1372         */
1373        public CE getEnteringDevice() { 
1374            CE ret = null;
1375            try {
1376                Type t = this.getField(18, 0);
1377                ret = (CE)t;
1378            } catch (ClassCastException cce) {
1379                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1380                throw new RuntimeException(cce);
1381            } catch (HL7Exception he) {
1382                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1383                throw new RuntimeException(he);
1384            }
1385            return ret;
1386        }
1387    
1388    
1389        /**
1390         * Returns
1391         * ORC-18: "Entering Device" - creates it if necessary
1392         */
1393        public CE getOrc18_EnteringDevice() { 
1394            CE ret = null;
1395            try {
1396                Type t = this.getField(18, 0);
1397                ret = (CE)t;
1398            } catch (ClassCastException cce) {
1399                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1400                throw new RuntimeException(cce);
1401            } catch (HL7Exception he) {
1402                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1403                throw new RuntimeException(he);
1404            }
1405            return ret;
1406        }
1407    
1408    
1409        /**
1410         * Returns all repetitions of Action By (ORC-19).
1411         */
1412        public XCN[] getActionBy() {
1413            XCN[] ret = null;
1414            try {
1415                Type[] t = this.getField(19);  
1416                ret = new XCN[t.length];
1417                for (int i = 0; i < ret.length; i++) {
1418                    ret[i] = (XCN)t[i];
1419                }
1420            } catch (ClassCastException cce) {
1421                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1422                throw new RuntimeException(cce);
1423            } catch (HL7Exception he) {
1424                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1425                throw new RuntimeException(he);
1426            }
1427            return ret;
1428        }
1429    
1430    
1431        /**
1432         * Returns a count of the current number of repetitions of Action By (ORC-19).
1433         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1434         * it will return zero.
1435         */
1436        public int getActionByReps() {
1437            XCN[] ret = null;
1438            try {
1439                Type[] t = this.getField(19);
1440                return t.length;  
1441            } catch (ClassCastException cce) {
1442                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1443                throw new RuntimeException(cce);
1444            } catch (HL7Exception he) {
1445                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1446                throw new RuntimeException(he);
1447            }
1448        }
1449    
1450    
1451        /**
1452         * Returns a specific repetition of
1453         * ORC-19: "Action By" - creates it if necessary
1454         *
1455         * @param rep The repetition index (0-indexed)
1456         */
1457        public XCN getActionBy(int rep) { 
1458            XCN ret = null;
1459            try {
1460                Type t = this.getField(19, rep);
1461                ret = (XCN)t;
1462            } catch (ClassCastException cce) {
1463                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1464                throw new RuntimeException(cce);
1465            } catch (HL7Exception he) {
1466                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1467                throw new RuntimeException(he);
1468            }
1469            return ret;
1470        }
1471    
1472        /**
1473         * Returns a specific repetition of
1474         * ORC-19: "Action By" - creates it if necessary
1475         *
1476         * @param rep The repetition index (0-indexed)
1477         */
1478        public XCN getOrc19_ActionBy(int rep) { 
1479            XCN ret = null;
1480            try {
1481                Type t = this.getField(19, rep);
1482                ret = (XCN)t;
1483            } catch (ClassCastException cce) {
1484                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1485                throw new RuntimeException(cce);
1486            } catch (HL7Exception he) {
1487                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1488                throw new RuntimeException(he);
1489            }
1490            return ret;
1491        }
1492    
1493    
1494        /**
1495         * Returns a count of the current number of repetitions of Action By (ORC-19).
1496         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1497         * it will return zero.
1498         */
1499        public int getOrc19_ActionByReps() {
1500            XCN[] ret = null;
1501            try {
1502                Type[] t = this.getField(19);
1503                return t.length;  
1504            } catch (ClassCastException cce) {
1505                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1506                throw new RuntimeException(cce);
1507            } catch (HL7Exception he) {
1508                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1509                throw new RuntimeException(he);
1510            }
1511        }
1512    
1513    
1514    
1515        /**
1516         * Inserts a repetition of
1517         * ORC-19: "Action By" at a specific index
1518         *
1519         * @param rep The repetition index (0-indexed)
1520         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1521         */
1522        public XCN insertActionBy(int rep) throws HL7Exception { 
1523            return (XCN) super.insertRepetition(19, rep);
1524        }
1525    
1526    
1527    
1528        /**
1529         * Inserts a repetition of
1530         * ORC-19: "Action By" at a specific index
1531         *
1532         * @param rep The repetition index (0-indexed)
1533         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1534         */
1535        public XCN insertOrc19_ActionBy(int rep) throws HL7Exception { 
1536            return (XCN) super.insertRepetition(19, rep);
1537        }
1538    
1539    
1540        /**
1541         * Removes a repetition of
1542         * ORC-19: "Action By" at a specific index
1543         *
1544         * @param rep The repetition index (0-indexed)
1545         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1546         */
1547        public XCN removeActionBy(int rep) throws HL7Exception { 
1548            return (XCN) super.removeRepetition(19, rep);
1549        }
1550    
1551    
1552        /**
1553         * Removes a repetition of
1554         * ORC-19: "Action By" at a specific index
1555         *
1556         * @param rep The repetition index (0-indexed)
1557         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1558         */
1559        public XCN removeOrc19_ActionBy(int rep) throws HL7Exception { 
1560            return (XCN) super.removeRepetition(19, rep);
1561        }
1562    
1563    
1564    
1565    
1566        /**
1567         * Returns
1568         * ORC-20: "Advanced Beneficiary Notice Code" - creates it if necessary
1569         */
1570        public CE getAdvancedBeneficiaryNoticeCode() { 
1571            CE ret = null;
1572            try {
1573                Type t = this.getField(20, 0);
1574                ret = (CE)t;
1575            } catch (ClassCastException cce) {
1576                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1577                throw new RuntimeException(cce);
1578            } catch (HL7Exception he) {
1579                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1580                throw new RuntimeException(he);
1581            }
1582            return ret;
1583        }
1584    
1585    
1586        /**
1587         * Returns
1588         * ORC-20: "Advanced Beneficiary Notice Code" - creates it if necessary
1589         */
1590        public CE getOrc20_AdvancedBeneficiaryNoticeCode() { 
1591            CE ret = null;
1592            try {
1593                Type t = this.getField(20, 0);
1594                ret = (CE)t;
1595            } catch (ClassCastException cce) {
1596                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1597                throw new RuntimeException(cce);
1598            } catch (HL7Exception he) {
1599                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1600                throw new RuntimeException(he);
1601            }
1602            return ret;
1603        }
1604    
1605    
1606        /**
1607         * Returns all repetitions of Ordering Facility Name (ORC-21).
1608         */
1609        public XON[] getOrderingFacilityName() {
1610            XON[] ret = null;
1611            try {
1612                Type[] t = this.getField(21);  
1613                ret = new XON[t.length];
1614                for (int i = 0; i < ret.length; i++) {
1615                    ret[i] = (XON)t[i];
1616                }
1617            } catch (ClassCastException cce) {
1618                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1619                throw new RuntimeException(cce);
1620            } catch (HL7Exception he) {
1621                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1622                throw new RuntimeException(he);
1623            }
1624            return ret;
1625        }
1626    
1627    
1628        /**
1629         * Returns a count of the current number of repetitions of Ordering Facility Name (ORC-21).
1630         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1631         * it will return zero.
1632         */
1633        public int getOrderingFacilityNameReps() {
1634            XON[] ret = null;
1635            try {
1636                Type[] t = this.getField(21);
1637                return t.length;  
1638            } catch (ClassCastException cce) {
1639                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1640                throw new RuntimeException(cce);
1641            } catch (HL7Exception he) {
1642                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1643                throw new RuntimeException(he);
1644            }
1645        }
1646    
1647    
1648        /**
1649         * Returns a specific repetition of
1650         * ORC-21: "Ordering Facility Name" - creates it if necessary
1651         *
1652         * @param rep The repetition index (0-indexed)
1653         */
1654        public XON getOrderingFacilityName(int rep) { 
1655            XON ret = null;
1656            try {
1657                Type t = this.getField(21, rep);
1658                ret = (XON)t;
1659            } catch (ClassCastException cce) {
1660                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1661                throw new RuntimeException(cce);
1662            } catch (HL7Exception he) {
1663                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1664                throw new RuntimeException(he);
1665            }
1666            return ret;
1667        }
1668    
1669        /**
1670         * Returns a specific repetition of
1671         * ORC-21: "Ordering Facility Name" - creates it if necessary
1672         *
1673         * @param rep The repetition index (0-indexed)
1674         */
1675        public XON getOrc21_OrderingFacilityName(int rep) { 
1676            XON ret = null;
1677            try {
1678                Type t = this.getField(21, rep);
1679                ret = (XON)t;
1680            } catch (ClassCastException cce) {
1681                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1682                throw new RuntimeException(cce);
1683            } catch (HL7Exception he) {
1684                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1685                throw new RuntimeException(he);
1686            }
1687            return ret;
1688        }
1689    
1690    
1691        /**
1692         * Returns a count of the current number of repetitions of Ordering Facility Name (ORC-21).
1693         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1694         * it will return zero.
1695         */
1696        public int getOrc21_OrderingFacilityNameReps() {
1697            XON[] ret = null;
1698            try {
1699                Type[] t = this.getField(21);
1700                return t.length;  
1701            } catch (ClassCastException cce) {
1702                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1703                throw new RuntimeException(cce);
1704            } catch (HL7Exception he) {
1705                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1706                throw new RuntimeException(he);
1707            }
1708        }
1709    
1710    
1711    
1712        /**
1713         * Inserts a repetition of
1714         * ORC-21: "Ordering Facility Name" at a specific index
1715         *
1716         * @param rep The repetition index (0-indexed)
1717         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1718         */
1719        public XON insertOrderingFacilityName(int rep) throws HL7Exception { 
1720            return (XON) super.insertRepetition(21, rep);
1721        }
1722    
1723    
1724    
1725        /**
1726         * Inserts a repetition of
1727         * ORC-21: "Ordering Facility Name" at a specific index
1728         *
1729         * @param rep The repetition index (0-indexed)
1730         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1731         */
1732        public XON insertOrc21_OrderingFacilityName(int rep) throws HL7Exception { 
1733            return (XON) super.insertRepetition(21, rep);
1734        }
1735    
1736    
1737        /**
1738         * Removes a repetition of
1739         * ORC-21: "Ordering Facility Name" at a specific index
1740         *
1741         * @param rep The repetition index (0-indexed)
1742         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1743         */
1744        public XON removeOrderingFacilityName(int rep) throws HL7Exception { 
1745            return (XON) super.removeRepetition(21, rep);
1746        }
1747    
1748    
1749        /**
1750         * Removes a repetition of
1751         * ORC-21: "Ordering Facility Name" at a specific index
1752         *
1753         * @param rep The repetition index (0-indexed)
1754         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1755         */
1756        public XON removeOrc21_OrderingFacilityName(int rep) throws HL7Exception { 
1757            return (XON) super.removeRepetition(21, rep);
1758        }
1759    
1760    
1761    
1762        /**
1763         * Returns all repetitions of Ordering Facility Address (ORC-22).
1764         */
1765        public XAD[] getOrderingFacilityAddress() {
1766            XAD[] ret = null;
1767            try {
1768                Type[] t = this.getField(22);  
1769                ret = new XAD[t.length];
1770                for (int i = 0; i < ret.length; i++) {
1771                    ret[i] = (XAD)t[i];
1772                }
1773            } catch (ClassCastException cce) {
1774                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1775                throw new RuntimeException(cce);
1776            } catch (HL7Exception he) {
1777                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1778                throw new RuntimeException(he);
1779            }
1780            return ret;
1781        }
1782    
1783    
1784        /**
1785         * Returns a count of the current number of repetitions of Ordering Facility Address (ORC-22).
1786         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1787         * it will return zero.
1788         */
1789        public int getOrderingFacilityAddressReps() {
1790            XAD[] ret = null;
1791            try {
1792                Type[] t = this.getField(22);
1793                return t.length;  
1794            } catch (ClassCastException cce) {
1795                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1796                throw new RuntimeException(cce);
1797            } catch (HL7Exception he) {
1798                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1799                throw new RuntimeException(he);
1800            }
1801        }
1802    
1803    
1804        /**
1805         * Returns a specific repetition of
1806         * ORC-22: "Ordering Facility Address" - creates it if necessary
1807         *
1808         * @param rep The repetition index (0-indexed)
1809         */
1810        public XAD getOrderingFacilityAddress(int rep) { 
1811            XAD ret = null;
1812            try {
1813                Type t = this.getField(22, rep);
1814                ret = (XAD)t;
1815            } catch (ClassCastException cce) {
1816                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1817                throw new RuntimeException(cce);
1818            } catch (HL7Exception he) {
1819                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1820                throw new RuntimeException(he);
1821            }
1822            return ret;
1823        }
1824    
1825        /**
1826         * Returns a specific repetition of
1827         * ORC-22: "Ordering Facility Address" - creates it if necessary
1828         *
1829         * @param rep The repetition index (0-indexed)
1830         */
1831        public XAD getOrc22_OrderingFacilityAddress(int rep) { 
1832            XAD ret = null;
1833            try {
1834                Type t = this.getField(22, rep);
1835                ret = (XAD)t;
1836            } catch (ClassCastException cce) {
1837                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1838                throw new RuntimeException(cce);
1839            } catch (HL7Exception he) {
1840                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1841                throw new RuntimeException(he);
1842            }
1843            return ret;
1844        }
1845    
1846    
1847        /**
1848         * Returns a count of the current number of repetitions of Ordering Facility Address (ORC-22).
1849         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1850         * it will return zero.
1851         */
1852        public int getOrc22_OrderingFacilityAddressReps() {
1853            XAD[] ret = null;
1854            try {
1855                Type[] t = this.getField(22);
1856                return t.length;  
1857            } catch (ClassCastException cce) {
1858                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1859                throw new RuntimeException(cce);
1860            } catch (HL7Exception he) {
1861                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1862                throw new RuntimeException(he);
1863            }
1864        }
1865    
1866    
1867    
1868        /**
1869         * Inserts a repetition of
1870         * ORC-22: "Ordering Facility Address" at a specific index
1871         *
1872         * @param rep The repetition index (0-indexed)
1873         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1874         */
1875        public XAD insertOrderingFacilityAddress(int rep) throws HL7Exception { 
1876            return (XAD) super.insertRepetition(22, rep);
1877        }
1878    
1879    
1880    
1881        /**
1882         * Inserts a repetition of
1883         * ORC-22: "Ordering Facility Address" at a specific index
1884         *
1885         * @param rep The repetition index (0-indexed)
1886         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1887         */
1888        public XAD insertOrc22_OrderingFacilityAddress(int rep) throws HL7Exception { 
1889            return (XAD) super.insertRepetition(22, rep);
1890        }
1891    
1892    
1893        /**
1894         * Removes a repetition of
1895         * ORC-22: "Ordering Facility Address" at a specific index
1896         *
1897         * @param rep The repetition index (0-indexed)
1898         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1899         */
1900        public XAD removeOrderingFacilityAddress(int rep) throws HL7Exception { 
1901            return (XAD) super.removeRepetition(22, rep);
1902        }
1903    
1904    
1905        /**
1906         * Removes a repetition of
1907         * ORC-22: "Ordering Facility Address" at a specific index
1908         *
1909         * @param rep The repetition index (0-indexed)
1910         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1911         */
1912        public XAD removeOrc22_OrderingFacilityAddress(int rep) throws HL7Exception { 
1913            return (XAD) super.removeRepetition(22, rep);
1914        }
1915    
1916    
1917    
1918        /**
1919         * Returns all repetitions of Ordering Facility Phone Number (ORC-23).
1920         */
1921        public XTN[] getOrderingFacilityPhoneNumber() {
1922            XTN[] ret = null;
1923            try {
1924                Type[] t = this.getField(23);  
1925                ret = new XTN[t.length];
1926                for (int i = 0; i < ret.length; i++) {
1927                    ret[i] = (XTN)t[i];
1928                }
1929            } catch (ClassCastException cce) {
1930                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1931                throw new RuntimeException(cce);
1932            } catch (HL7Exception he) {
1933                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1934                throw new RuntimeException(he);
1935            }
1936            return ret;
1937        }
1938    
1939    
1940        /**
1941         * Returns a count of the current number of repetitions of Ordering Facility Phone Number (ORC-23).
1942         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1943         * it will return zero.
1944         */
1945        public int getOrderingFacilityPhoneNumberReps() {
1946            XTN[] ret = null;
1947            try {
1948                Type[] t = this.getField(23);
1949                return t.length;  
1950            } catch (ClassCastException cce) {
1951                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1952                throw new RuntimeException(cce);
1953            } catch (HL7Exception he) {
1954                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1955                throw new RuntimeException(he);
1956            }
1957        }
1958    
1959    
1960        /**
1961         * Returns a specific repetition of
1962         * ORC-23: "Ordering Facility Phone Number" - creates it if necessary
1963         *
1964         * @param rep The repetition index (0-indexed)
1965         */
1966        public XTN getOrderingFacilityPhoneNumber(int rep) { 
1967            XTN ret = null;
1968            try {
1969                Type t = this.getField(23, rep);
1970                ret = (XTN)t;
1971            } catch (ClassCastException cce) {
1972                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1973                throw new RuntimeException(cce);
1974            } catch (HL7Exception he) {
1975                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1976                throw new RuntimeException(he);
1977            }
1978            return ret;
1979        }
1980    
1981        /**
1982         * Returns a specific repetition of
1983         * ORC-23: "Ordering Facility Phone Number" - creates it if necessary
1984         *
1985         * @param rep The repetition index (0-indexed)
1986         */
1987        public XTN getOrc23_OrderingFacilityPhoneNumber(int rep) { 
1988            XTN ret = null;
1989            try {
1990                Type t = this.getField(23, rep);
1991                ret = (XTN)t;
1992            } catch (ClassCastException cce) {
1993                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1994                throw new RuntimeException(cce);
1995            } catch (HL7Exception he) {
1996                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1997                throw new RuntimeException(he);
1998            }
1999            return ret;
2000        }
2001    
2002    
2003        /**
2004         * Returns a count of the current number of repetitions of Ordering Facility Phone Number (ORC-23).
2005         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2006         * it will return zero.
2007         */
2008        public int getOrc23_OrderingFacilityPhoneNumberReps() {
2009            XTN[] ret = null;
2010            try {
2011                Type[] t = this.getField(23);
2012                return t.length;  
2013            } catch (ClassCastException cce) {
2014                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2015                throw new RuntimeException(cce);
2016            } catch (HL7Exception he) {
2017                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2018                throw new RuntimeException(he);
2019            }
2020        }
2021    
2022    
2023    
2024        /**
2025         * Inserts a repetition of
2026         * ORC-23: "Ordering Facility Phone Number" at a specific index
2027         *
2028         * @param rep The repetition index (0-indexed)
2029         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2030         */
2031        public XTN insertOrderingFacilityPhoneNumber(int rep) throws HL7Exception { 
2032            return (XTN) super.insertRepetition(23, rep);
2033        }
2034    
2035    
2036    
2037        /**
2038         * Inserts a repetition of
2039         * ORC-23: "Ordering Facility Phone Number" at a specific index
2040         *
2041         * @param rep The repetition index (0-indexed)
2042         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2043         */
2044        public XTN insertOrc23_OrderingFacilityPhoneNumber(int rep) throws HL7Exception { 
2045            return (XTN) super.insertRepetition(23, rep);
2046        }
2047    
2048    
2049        /**
2050         * Removes a repetition of
2051         * ORC-23: "Ordering Facility Phone Number" at a specific index
2052         *
2053         * @param rep The repetition index (0-indexed)
2054         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2055         */
2056        public XTN removeOrderingFacilityPhoneNumber(int rep) throws HL7Exception { 
2057            return (XTN) super.removeRepetition(23, rep);
2058        }
2059    
2060    
2061        /**
2062         * Removes a repetition of
2063         * ORC-23: "Ordering Facility Phone Number" at a specific index
2064         *
2065         * @param rep The repetition index (0-indexed)
2066         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2067         */
2068        public XTN removeOrc23_OrderingFacilityPhoneNumber(int rep) throws HL7Exception { 
2069            return (XTN) super.removeRepetition(23, rep);
2070        }
2071    
2072    
2073    
2074        /**
2075         * Returns all repetitions of Ordering Provider Address (ORC-24).
2076         */
2077        public XAD[] getOrderingProviderAddress() {
2078            XAD[] ret = null;
2079            try {
2080                Type[] t = this.getField(24);  
2081                ret = new XAD[t.length];
2082                for (int i = 0; i < ret.length; i++) {
2083                    ret[i] = (XAD)t[i];
2084                }
2085            } catch (ClassCastException cce) {
2086                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2087                throw new RuntimeException(cce);
2088            } catch (HL7Exception he) {
2089                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2090                throw new RuntimeException(he);
2091            }
2092            return ret;
2093        }
2094    
2095    
2096        /**
2097         * Returns a count of the current number of repetitions of Ordering Provider Address (ORC-24).
2098         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2099         * it will return zero.
2100         */
2101        public int getOrderingProviderAddressReps() {
2102            XAD[] ret = null;
2103            try {
2104                Type[] t = this.getField(24);
2105                return t.length;  
2106            } catch (ClassCastException cce) {
2107                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2108                throw new RuntimeException(cce);
2109            } catch (HL7Exception he) {
2110                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2111                throw new RuntimeException(he);
2112            }
2113        }
2114    
2115    
2116        /**
2117         * Returns a specific repetition of
2118         * ORC-24: "Ordering Provider Address" - creates it if necessary
2119         *
2120         * @param rep The repetition index (0-indexed)
2121         */
2122        public XAD getOrderingProviderAddress(int rep) { 
2123            XAD ret = null;
2124            try {
2125                Type t = this.getField(24, rep);
2126                ret = (XAD)t;
2127            } catch (ClassCastException cce) {
2128                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2129                throw new RuntimeException(cce);
2130            } catch (HL7Exception he) {
2131                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2132                throw new RuntimeException(he);
2133            }
2134            return ret;
2135        }
2136    
2137        /**
2138         * Returns a specific repetition of
2139         * ORC-24: "Ordering Provider Address" - creates it if necessary
2140         *
2141         * @param rep The repetition index (0-indexed)
2142         */
2143        public XAD getOrc24_OrderingProviderAddress(int rep) { 
2144            XAD ret = null;
2145            try {
2146                Type t = this.getField(24, rep);
2147                ret = (XAD)t;
2148            } catch (ClassCastException cce) {
2149                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2150                throw new RuntimeException(cce);
2151            } catch (HL7Exception he) {
2152                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2153                throw new RuntimeException(he);
2154            }
2155            return ret;
2156        }
2157    
2158    
2159        /**
2160         * Returns a count of the current number of repetitions of Ordering Provider Address (ORC-24).
2161         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2162         * it will return zero.
2163         */
2164        public int getOrc24_OrderingProviderAddressReps() {
2165            XAD[] ret = null;
2166            try {
2167                Type[] t = this.getField(24);
2168                return t.length;  
2169            } catch (ClassCastException cce) {
2170                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2171                throw new RuntimeException(cce);
2172            } catch (HL7Exception he) {
2173                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2174                throw new RuntimeException(he);
2175            }
2176        }
2177    
2178    
2179    
2180        /**
2181         * Inserts a repetition of
2182         * ORC-24: "Ordering Provider Address" at a specific index
2183         *
2184         * @param rep The repetition index (0-indexed)
2185         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2186         */
2187        public XAD insertOrderingProviderAddress(int rep) throws HL7Exception { 
2188            return (XAD) super.insertRepetition(24, rep);
2189        }
2190    
2191    
2192    
2193        /**
2194         * Inserts a repetition of
2195         * ORC-24: "Ordering Provider Address" at a specific index
2196         *
2197         * @param rep The repetition index (0-indexed)
2198         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2199         */
2200        public XAD insertOrc24_OrderingProviderAddress(int rep) throws HL7Exception { 
2201            return (XAD) super.insertRepetition(24, rep);
2202        }
2203    
2204    
2205        /**
2206         * Removes a repetition of
2207         * ORC-24: "Ordering Provider Address" at a specific index
2208         *
2209         * @param rep The repetition index (0-indexed)
2210         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2211         */
2212        public XAD removeOrderingProviderAddress(int rep) throws HL7Exception { 
2213            return (XAD) super.removeRepetition(24, rep);
2214        }
2215    
2216    
2217        /**
2218         * Removes a repetition of
2219         * ORC-24: "Ordering Provider Address" at a specific index
2220         *
2221         * @param rep The repetition index (0-indexed)
2222         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2223         */
2224        public XAD removeOrc24_OrderingProviderAddress(int rep) throws HL7Exception { 
2225            return (XAD) super.removeRepetition(24, rep);
2226        }
2227    
2228    
2229    
2230    
2231        /**
2232         * Returns
2233         * ORC-25: "Order Status Modifier" - creates it if necessary
2234         */
2235        public CWE getOrderStatusModifier() { 
2236            CWE ret = null;
2237            try {
2238                Type t = this.getField(25, 0);
2239                ret = (CWE)t;
2240            } catch (ClassCastException cce) {
2241                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2242                throw new RuntimeException(cce);
2243            } catch (HL7Exception he) {
2244                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2245                throw new RuntimeException(he);
2246            }
2247            return ret;
2248        }
2249    
2250    
2251        /**
2252         * Returns
2253         * ORC-25: "Order Status Modifier" - creates it if necessary
2254         */
2255        public CWE getOrc25_OrderStatusModifier() { 
2256            CWE ret = null;
2257            try {
2258                Type t = this.getField(25, 0);
2259                ret = (CWE)t;
2260            } catch (ClassCastException cce) {
2261                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2262                throw new RuntimeException(cce);
2263            } catch (HL7Exception he) {
2264                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2265                throw new RuntimeException(he);
2266            }
2267            return ret;
2268        }
2269    
2270    
2271    
2272    
2273    
2274        /** {@inheritDoc} */   
2275        protected Type createNewTypeWithoutReflection(int field) {
2276           switch (field) {
2277              case 0: return new ID(getMessage(), new Integer( 119 ));
2278              case 1: return new EI(getMessage());
2279              case 2: return new EI(getMessage());
2280              case 3: return new EI(getMessage());
2281              case 4: return new ID(getMessage(), new Integer( 38 ));
2282              case 5: return new ID(getMessage(), new Integer( 121 ));
2283              case 6: return new TQ(getMessage());
2284              case 7: return new EIP(getMessage());
2285              case 8: return new TS(getMessage());
2286              case 9: return new XCN(getMessage());
2287              case 10: return new XCN(getMessage());
2288              case 11: return new XCN(getMessage());
2289              case 12: return new PL(getMessage());
2290              case 13: return new XTN(getMessage());
2291              case 14: return new TS(getMessage());
2292              case 15: return new CE(getMessage());
2293              case 16: return new CE(getMessage());
2294              case 17: return new CE(getMessage());
2295              case 18: return new XCN(getMessage());
2296              case 19: return new CE(getMessage());
2297              case 20: return new XON(getMessage());
2298              case 21: return new XAD(getMessage());
2299              case 22: return new XTN(getMessage());
2300              case 23: return new XAD(getMessage());
2301              case 24: return new CWE(getMessage());
2302              default: return null;
2303           }
2304       }
2305    
2306    
2307    }
2308