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 OM7 message segment (Additional Basic Attributes). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>OM7-1: Sequence Number - Test/ Observation Master File (NM) <b> </b>
027         * <li>OM7-2: Universal Service Identifier (CE) <b> </b>
028         * <li>OM7-3: Category Identifier (CE) <b>optional repeating</b>
029         * <li>OM7-4: Category Description (TX) <b>optional </b>
030         * <li>OM7-5: Category Synonym (ST) <b>optional repeating</b>
031         * <li>OM7-6: Effective Test/Service Start Date/Time (TS) <b>optional </b>
032         * <li>OM7-7: Effective Test/Service End Date/Time (TS) <b>optional </b>
033         * <li>OM7-8: Test/Service Default Duration Quantity (NM) <b>optional </b>
034         * <li>OM7-9: Test/Service Default Duration Units (CE) <b>optional </b>
035         * <li>OM7-10: Test/Service Default Frequency (IS) <b>optional </b>
036         * <li>OM7-11: Consent Indicator (ID) <b>optional </b>
037         * <li>OM7-12: Consent Identifier (CE) <b>optional </b>
038         * <li>OM7-13: Consent Effective Start Date/Time (TS) <b>optional </b>
039         * <li>OM7-14: Consent Effective End Date/Time (TS) <b>optional </b>
040         * <li>OM7-15: Consent Interval Quantity (NM) <b>optional </b>
041         * <li>OM7-16: Consent Interval Units (CE) <b>optional </b>
042         * <li>OM7-17: Consent Waiting Period Quantity (NM) <b>optional </b>
043         * <li>OM7-18: Consent Waiting Period Units (CE) <b>optional </b>
044         * <li>OM7-19: Effective Date/Time of Change (TS) <b>optional </b>
045         * <li>OM7-20: Entered By (XCN) <b>optional </b>
046         * <li>OM7-21: Orderable-at Location (PL) <b>optional repeating</b>
047         * <li>OM7-22: Formulary Status (IS) <b>optional </b>
048         * <li>OM7-23: Special Order Indicator (ID) <b>optional </b>
049         * <li>OM7-24: Primary Key Value - CDM (CE) <b>optional repeating</b>
050     * </ul>
051     */
052    public class OM7 extends AbstractSegment {
053    
054        /** 
055         * Creates a new OM7 segment
056         */
057        public OM7(Group parent, ModelClassFactory factory) {
058           super(parent, factory);
059           init(factory);
060        }
061    
062        private void init(ModelClassFactory factory) {
063           try {
064                                      this.add(NM.class, true, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Sequence Number - Test/ Observation Master File");
065                                      this.add(CE.class, true, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Universal Service Identifier");
066                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(412) }, "Category Identifier");
067                                      this.add(TX.class, false, 1, 200, new Object[]{ getMessage(), new Integer(0) }, "Category Description");
068                                      this.add(ST.class, false, 0, 200, new Object[]{ getMessage(), new Integer(0) }, "Category Synonym");
069                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Effective Test/Service Start Date/Time");
070                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Effective Test/Service End Date/Time");
071                                      this.add(NM.class, false, 1, 5, new Object[]{ getMessage(), new Integer(0) }, "Test/Service Default Duration Quantity");
072                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(9999) }, "Test/Service Default Duration Units");
073                                      this.add(IS.class, false, 1, 60, new Object[]{ getMessage() }, "Test/Service Default Frequency");
074                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Consent Indicator");
075                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(413) }, "Consent Identifier");
076                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Consent Effective Start Date/Time");
077                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Consent Effective End Date/Time");
078                                      this.add(NM.class, false, 1, 5, new Object[]{ getMessage(), new Integer(0) }, "Consent Interval Quantity");
079                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(414) }, "Consent Interval Units");
080                                      this.add(NM.class, false, 1, 5, new Object[]{ getMessage(), new Integer(0) }, "Consent Waiting Period Quantity");
081                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(414) }, "Consent Waiting Period Units");
082                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Effective Date/Time of Change");
083                                      this.add(XCN.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Entered By");
084                                      this.add(PL.class, false, 0, 200, new Object[]{ getMessage(), new Integer(0) }, "Orderable-at Location");
085                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Formulary Status");
086                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Special Order Indicator");
087                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(132) }, "Primary Key Value - CDM");
088           } catch(HL7Exception e) {
089              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating OM7 - this is probably a bug in the source code generator.", e);
090           }
091        }
092    
093    
094    
095        /**
096         * Returns
097         * OM7-1: "Sequence Number - Test/ Observation Master File" - creates it if necessary
098         */
099        public NM getSequenceNumberTestObservationMasterFile() { 
100            NM ret = null;
101            try {
102                Type t = this.getField(1, 0);
103                ret = (NM)t;
104            } catch (ClassCastException cce) {
105                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
106                throw new RuntimeException(cce);
107            } catch (HL7Exception he) {
108                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
109                throw new RuntimeException(he);
110            }
111            return ret;
112        }
113    
114    
115        /**
116         * Returns
117         * OM7-1: "Sequence Number - Test/ Observation Master File" - creates it if necessary
118         */
119        public NM getOm71_SequenceNumberTestObservationMasterFile() { 
120            NM ret = null;
121            try {
122                Type t = this.getField(1, 0);
123                ret = (NM)t;
124            } catch (ClassCastException cce) {
125                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
126                throw new RuntimeException(cce);
127            } catch (HL7Exception he) {
128                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
129                throw new RuntimeException(he);
130            }
131            return ret;
132        }
133    
134    
135    
136        /**
137         * Returns
138         * OM7-2: "Universal Service Identifier" - creates it if necessary
139         */
140        public CE getUniversalServiceIdentifier() { 
141            CE ret = null;
142            try {
143                Type t = this.getField(2, 0);
144                ret = (CE)t;
145            } catch (ClassCastException cce) {
146                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
147                throw new RuntimeException(cce);
148            } catch (HL7Exception he) {
149                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
150                throw new RuntimeException(he);
151            }
152            return ret;
153        }
154    
155    
156        /**
157         * Returns
158         * OM7-2: "Universal Service Identifier" - creates it if necessary
159         */
160        public CE getOm72_UniversalServiceIdentifier() { 
161            CE ret = null;
162            try {
163                Type t = this.getField(2, 0);
164                ret = (CE)t;
165            } catch (ClassCastException cce) {
166                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
167                throw new RuntimeException(cce);
168            } catch (HL7Exception he) {
169                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
170                throw new RuntimeException(he);
171            }
172            return ret;
173        }
174    
175    
176        /**
177         * Returns all repetitions of Category Identifier (OM7-3).
178         */
179        public CE[] getCategoryIdentifier() {
180            CE[] ret = null;
181            try {
182                Type[] t = this.getField(3);  
183                ret = new CE[t.length];
184                for (int i = 0; i < ret.length; i++) {
185                    ret[i] = (CE)t[i];
186                }
187            } catch (ClassCastException cce) {
188                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
189                throw new RuntimeException(cce);
190            } catch (HL7Exception he) {
191                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
192                throw new RuntimeException(he);
193            }
194            return ret;
195        }
196    
197    
198        /**
199         * Returns a count of the current number of repetitions of Category Identifier (OM7-3).
200         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
201         * it will return zero.
202         */
203        public int getCategoryIdentifierReps() {
204            CE[] ret = null;
205            try {
206                Type[] t = this.getField(3);
207                return t.length;  
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        }
216    
217    
218        /**
219         * Returns a specific repetition of
220         * OM7-3: "Category Identifier" - creates it if necessary
221         *
222         * @param rep The repetition index (0-indexed)
223         */
224        public CE getCategoryIdentifier(int rep) { 
225            CE ret = null;
226            try {
227                Type t = this.getField(3, rep);
228                ret = (CE)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         * Returns a specific repetition of
241         * OM7-3: "Category Identifier" - creates it if necessary
242         *
243         * @param rep The repetition index (0-indexed)
244         */
245        public CE getOm73_CategoryIdentifier(int rep) { 
246            CE ret = null;
247            try {
248                Type t = this.getField(3, rep);
249                ret = (CE)t;
250            } catch (ClassCastException cce) {
251                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
252                throw new RuntimeException(cce);
253            } catch (HL7Exception he) {
254                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
255                throw new RuntimeException(he);
256            }
257            return ret;
258        }
259    
260    
261        /**
262         * Returns a count of the current number of repetitions of Category Identifier (OM7-3).
263         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
264         * it will return zero.
265         */
266        public int getOm73_CategoryIdentifierReps() {
267            CE[] ret = null;
268            try {
269                Type[] t = this.getField(3);
270                return t.length;  
271            } catch (ClassCastException cce) {
272                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
273                throw new RuntimeException(cce);
274            } catch (HL7Exception he) {
275                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
276                throw new RuntimeException(he);
277            }
278        }
279    
280    
281    
282        /**
283         * Inserts a repetition of
284         * OM7-3: "Category Identifier" at a specific index
285         *
286         * @param rep The repetition index (0-indexed)
287         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
288         */
289        public CE insertCategoryIdentifier(int rep) throws HL7Exception { 
290            return (CE) super.insertRepetition(3, rep);
291        }
292    
293    
294    
295        /**
296         * Inserts a repetition of
297         * OM7-3: "Category Identifier" at a specific index
298         *
299         * @param rep The repetition index (0-indexed)
300         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
301         */
302        public CE insertOm73_CategoryIdentifier(int rep) throws HL7Exception { 
303            return (CE) super.insertRepetition(3, rep);
304        }
305    
306    
307        /**
308         * Removes a repetition of
309         * OM7-3: "Category Identifier" at a specific index
310         *
311         * @param rep The repetition index (0-indexed)
312         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
313         */
314        public CE removeCategoryIdentifier(int rep) throws HL7Exception { 
315            return (CE) super.removeRepetition(3, rep);
316        }
317    
318    
319        /**
320         * Removes a repetition of
321         * OM7-3: "Category Identifier" at a specific index
322         *
323         * @param rep The repetition index (0-indexed)
324         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
325         */
326        public CE removeOm73_CategoryIdentifier(int rep) throws HL7Exception { 
327            return (CE) super.removeRepetition(3, rep);
328        }
329    
330    
331    
332    
333        /**
334         * Returns
335         * OM7-4: "Category Description" - creates it if necessary
336         */
337        public TX getCategoryDescription() { 
338            TX ret = null;
339            try {
340                Type t = this.getField(4, 0);
341                ret = (TX)t;
342            } catch (ClassCastException cce) {
343                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
344                throw new RuntimeException(cce);
345            } catch (HL7Exception he) {
346                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
347                throw new RuntimeException(he);
348            }
349            return ret;
350        }
351    
352    
353        /**
354         * Returns
355         * OM7-4: "Category Description" - creates it if necessary
356         */
357        public TX getOm74_CategoryDescription() { 
358            TX ret = null;
359            try {
360                Type t = this.getField(4, 0);
361                ret = (TX)t;
362            } catch (ClassCastException cce) {
363                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
364                throw new RuntimeException(cce);
365            } catch (HL7Exception he) {
366                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
367                throw new RuntimeException(he);
368            }
369            return ret;
370        }
371    
372    
373        /**
374         * Returns all repetitions of Category Synonym (OM7-5).
375         */
376        public ST[] getCategorySynonym() {
377            ST[] ret = null;
378            try {
379                Type[] t = this.getField(5);  
380                ret = new ST[t.length];
381                for (int i = 0; i < ret.length; i++) {
382                    ret[i] = (ST)t[i];
383                }
384            } catch (ClassCastException cce) {
385                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
386                throw new RuntimeException(cce);
387            } catch (HL7Exception he) {
388                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
389                throw new RuntimeException(he);
390            }
391            return ret;
392        }
393    
394    
395        /**
396         * Returns a count of the current number of repetitions of Category Synonym (OM7-5).
397         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
398         * it will return zero.
399         */
400        public int getCategorySynonymReps() {
401            ST[] ret = null;
402            try {
403                Type[] t = this.getField(5);
404                return t.length;  
405            } catch (ClassCastException cce) {
406                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
407                throw new RuntimeException(cce);
408            } catch (HL7Exception he) {
409                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
410                throw new RuntimeException(he);
411            }
412        }
413    
414    
415        /**
416         * Returns a specific repetition of
417         * OM7-5: "Category Synonym" - creates it if necessary
418         *
419         * @param rep The repetition index (0-indexed)
420         */
421        public ST getCategorySynonym(int rep) { 
422            ST ret = null;
423            try {
424                Type t = this.getField(5, rep);
425                ret = (ST)t;
426            } catch (ClassCastException cce) {
427                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
428                throw new RuntimeException(cce);
429            } catch (HL7Exception he) {
430                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
431                throw new RuntimeException(he);
432            }
433            return ret;
434        }
435    
436        /**
437         * Returns a specific repetition of
438         * OM7-5: "Category Synonym" - creates it if necessary
439         *
440         * @param rep The repetition index (0-indexed)
441         */
442        public ST getOm75_CategorySynonym(int rep) { 
443            ST ret = null;
444            try {
445                Type t = this.getField(5, rep);
446                ret = (ST)t;
447            } catch (ClassCastException cce) {
448                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
449                throw new RuntimeException(cce);
450            } catch (HL7Exception he) {
451                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
452                throw new RuntimeException(he);
453            }
454            return ret;
455        }
456    
457    
458        /**
459         * Returns a count of the current number of repetitions of Category Synonym (OM7-5).
460         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
461         * it will return zero.
462         */
463        public int getOm75_CategorySynonymReps() {
464            ST[] ret = null;
465            try {
466                Type[] t = this.getField(5);
467                return t.length;  
468            } catch (ClassCastException cce) {
469                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
470                throw new RuntimeException(cce);
471            } catch (HL7Exception he) {
472                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
473                throw new RuntimeException(he);
474            }
475        }
476    
477    
478    
479        /**
480         * Inserts a repetition of
481         * OM7-5: "Category Synonym" at a specific index
482         *
483         * @param rep The repetition index (0-indexed)
484         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
485         */
486        public ST insertCategorySynonym(int rep) throws HL7Exception { 
487            return (ST) super.insertRepetition(5, rep);
488        }
489    
490    
491    
492        /**
493         * Inserts a repetition of
494         * OM7-5: "Category Synonym" at a specific index
495         *
496         * @param rep The repetition index (0-indexed)
497         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
498         */
499        public ST insertOm75_CategorySynonym(int rep) throws HL7Exception { 
500            return (ST) super.insertRepetition(5, rep);
501        }
502    
503    
504        /**
505         * Removes a repetition of
506         * OM7-5: "Category Synonym" at a specific index
507         *
508         * @param rep The repetition index (0-indexed)
509         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
510         */
511        public ST removeCategorySynonym(int rep) throws HL7Exception { 
512            return (ST) super.removeRepetition(5, rep);
513        }
514    
515    
516        /**
517         * Removes a repetition of
518         * OM7-5: "Category Synonym" at a specific index
519         *
520         * @param rep The repetition index (0-indexed)
521         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
522         */
523        public ST removeOm75_CategorySynonym(int rep) throws HL7Exception { 
524            return (ST) super.removeRepetition(5, rep);
525        }
526    
527    
528    
529    
530        /**
531         * Returns
532         * OM7-6: "Effective Test/Service Start Date/Time" - creates it if necessary
533         */
534        public TS getEffectiveTestServiceStartDateTime() { 
535            TS ret = null;
536            try {
537                Type t = this.getField(6, 0);
538                ret = (TS)t;
539            } catch (ClassCastException cce) {
540                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
541                throw new RuntimeException(cce);
542            } catch (HL7Exception he) {
543                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
544                throw new RuntimeException(he);
545            }
546            return ret;
547        }
548    
549    
550        /**
551         * Returns
552         * OM7-6: "Effective Test/Service Start Date/Time" - creates it if necessary
553         */
554        public TS getOm76_EffectiveTestServiceStartDateTime() { 
555            TS ret = null;
556            try {
557                Type t = this.getField(6, 0);
558                ret = (TS)t;
559            } catch (ClassCastException cce) {
560                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
561                throw new RuntimeException(cce);
562            } catch (HL7Exception he) {
563                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
564                throw new RuntimeException(he);
565            }
566            return ret;
567        }
568    
569    
570    
571        /**
572         * Returns
573         * OM7-7: "Effective Test/Service End Date/Time" - creates it if necessary
574         */
575        public TS getEffectiveTestServiceEndDateTime() { 
576            TS ret = null;
577            try {
578                Type t = this.getField(7, 0);
579                ret = (TS)t;
580            } catch (ClassCastException cce) {
581                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
582                throw new RuntimeException(cce);
583            } catch (HL7Exception he) {
584                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
585                throw new RuntimeException(he);
586            }
587            return ret;
588        }
589    
590    
591        /**
592         * Returns
593         * OM7-7: "Effective Test/Service End Date/Time" - creates it if necessary
594         */
595        public TS getOm77_EffectiveTestServiceEndDateTime() { 
596            TS ret = null;
597            try {
598                Type t = this.getField(7, 0);
599                ret = (TS)t;
600            } catch (ClassCastException cce) {
601                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
602                throw new RuntimeException(cce);
603            } catch (HL7Exception he) {
604                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
605                throw new RuntimeException(he);
606            }
607            return ret;
608        }
609    
610    
611    
612        /**
613         * Returns
614         * OM7-8: "Test/Service Default Duration Quantity" - creates it if necessary
615         */
616        public NM getTestServiceDefaultDurationQuantity() { 
617            NM ret = null;
618            try {
619                Type t = this.getField(8, 0);
620                ret = (NM)t;
621            } catch (ClassCastException cce) {
622                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
623                throw new RuntimeException(cce);
624            } catch (HL7Exception he) {
625                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
626                throw new RuntimeException(he);
627            }
628            return ret;
629        }
630    
631    
632        /**
633         * Returns
634         * OM7-8: "Test/Service Default Duration Quantity" - creates it if necessary
635         */
636        public NM getOm78_TestServiceDefaultDurationQuantity() { 
637            NM ret = null;
638            try {
639                Type t = this.getField(8, 0);
640                ret = (NM)t;
641            } catch (ClassCastException cce) {
642                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
643                throw new RuntimeException(cce);
644            } catch (HL7Exception he) {
645                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
646                throw new RuntimeException(he);
647            }
648            return ret;
649        }
650    
651    
652    
653        /**
654         * Returns
655         * OM7-9: "Test/Service Default Duration Units" - creates it if necessary
656         */
657        public CE getTestServiceDefaultDurationUnits() { 
658            CE ret = null;
659            try {
660                Type t = this.getField(9, 0);
661                ret = (CE)t;
662            } catch (ClassCastException cce) {
663                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
664                throw new RuntimeException(cce);
665            } catch (HL7Exception he) {
666                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
667                throw new RuntimeException(he);
668            }
669            return ret;
670        }
671    
672    
673        /**
674         * Returns
675         * OM7-9: "Test/Service Default Duration Units" - creates it if necessary
676         */
677        public CE getOm79_TestServiceDefaultDurationUnits() { 
678            CE ret = null;
679            try {
680                Type t = this.getField(9, 0);
681                ret = (CE)t;
682            } catch (ClassCastException cce) {
683                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
684                throw new RuntimeException(cce);
685            } catch (HL7Exception he) {
686                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
687                throw new RuntimeException(he);
688            }
689            return ret;
690        }
691    
692    
693    
694        /**
695         * Returns
696         * OM7-10: "Test/Service Default Frequency" - creates it if necessary
697         */
698        public IS getTestServiceDefaultFrequency() { 
699            IS ret = null;
700            try {
701                Type t = this.getField(10, 0);
702                ret = (IS)t;
703            } catch (ClassCastException cce) {
704                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
705                throw new RuntimeException(cce);
706            } catch (HL7Exception he) {
707                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
708                throw new RuntimeException(he);
709            }
710            return ret;
711        }
712    
713    
714        /**
715         * Returns
716         * OM7-10: "Test/Service Default Frequency" - creates it if necessary
717         */
718        public IS getOm710_TestServiceDefaultFrequency() { 
719            IS ret = null;
720            try {
721                Type t = this.getField(10, 0);
722                ret = (IS)t;
723            } catch (ClassCastException cce) {
724                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
725                throw new RuntimeException(cce);
726            } catch (HL7Exception he) {
727                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
728                throw new RuntimeException(he);
729            }
730            return ret;
731        }
732    
733    
734    
735        /**
736         * Returns
737         * OM7-11: "Consent Indicator" - creates it if necessary
738         */
739        public ID getConsentIndicator() { 
740            ID ret = null;
741            try {
742                Type t = this.getField(11, 0);
743                ret = (ID)t;
744            } catch (ClassCastException cce) {
745                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
746                throw new RuntimeException(cce);
747            } catch (HL7Exception he) {
748                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
749                throw new RuntimeException(he);
750            }
751            return ret;
752        }
753    
754    
755        /**
756         * Returns
757         * OM7-11: "Consent Indicator" - creates it if necessary
758         */
759        public ID getOm711_ConsentIndicator() { 
760            ID ret = null;
761            try {
762                Type t = this.getField(11, 0);
763                ret = (ID)t;
764            } catch (ClassCastException cce) {
765                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
766                throw new RuntimeException(cce);
767            } catch (HL7Exception he) {
768                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
769                throw new RuntimeException(he);
770            }
771            return ret;
772        }
773    
774    
775    
776        /**
777         * Returns
778         * OM7-12: "Consent Identifier" - creates it if necessary
779         */
780        public CE getConsentIdentifier() { 
781            CE ret = null;
782            try {
783                Type t = this.getField(12, 0);
784                ret = (CE)t;
785            } catch (ClassCastException cce) {
786                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
787                throw new RuntimeException(cce);
788            } catch (HL7Exception he) {
789                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
790                throw new RuntimeException(he);
791            }
792            return ret;
793        }
794    
795    
796        /**
797         * Returns
798         * OM7-12: "Consent Identifier" - creates it if necessary
799         */
800        public CE getOm712_ConsentIdentifier() { 
801            CE ret = null;
802            try {
803                Type t = this.getField(12, 0);
804                ret = (CE)t;
805            } catch (ClassCastException cce) {
806                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
807                throw new RuntimeException(cce);
808            } catch (HL7Exception he) {
809                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
810                throw new RuntimeException(he);
811            }
812            return ret;
813        }
814    
815    
816    
817        /**
818         * Returns
819         * OM7-13: "Consent Effective Start Date/Time" - creates it if necessary
820         */
821        public TS getConsentEffectiveStartDateTime() { 
822            TS ret = null;
823            try {
824                Type t = this.getField(13, 0);
825                ret = (TS)t;
826            } catch (ClassCastException cce) {
827                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
828                throw new RuntimeException(cce);
829            } catch (HL7Exception he) {
830                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
831                throw new RuntimeException(he);
832            }
833            return ret;
834        }
835    
836    
837        /**
838         * Returns
839         * OM7-13: "Consent Effective Start Date/Time" - creates it if necessary
840         */
841        public TS getOm713_ConsentEffectiveStartDateTime() { 
842            TS ret = null;
843            try {
844                Type t = this.getField(13, 0);
845                ret = (TS)t;
846            } catch (ClassCastException cce) {
847                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
848                throw new RuntimeException(cce);
849            } catch (HL7Exception he) {
850                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
851                throw new RuntimeException(he);
852            }
853            return ret;
854        }
855    
856    
857    
858        /**
859         * Returns
860         * OM7-14: "Consent Effective End Date/Time" - creates it if necessary
861         */
862        public TS getConsentEffectiveEndDateTime() { 
863            TS ret = null;
864            try {
865                Type t = this.getField(14, 0);
866                ret = (TS)t;
867            } catch (ClassCastException cce) {
868                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
869                throw new RuntimeException(cce);
870            } catch (HL7Exception he) {
871                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
872                throw new RuntimeException(he);
873            }
874            return ret;
875        }
876    
877    
878        /**
879         * Returns
880         * OM7-14: "Consent Effective End Date/Time" - creates it if necessary
881         */
882        public TS getOm714_ConsentEffectiveEndDateTime() { 
883            TS ret = null;
884            try {
885                Type t = this.getField(14, 0);
886                ret = (TS)t;
887            } catch (ClassCastException cce) {
888                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
889                throw new RuntimeException(cce);
890            } catch (HL7Exception he) {
891                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
892                throw new RuntimeException(he);
893            }
894            return ret;
895        }
896    
897    
898    
899        /**
900         * Returns
901         * OM7-15: "Consent Interval Quantity" - creates it if necessary
902         */
903        public NM getConsentIntervalQuantity() { 
904            NM ret = null;
905            try {
906                Type t = this.getField(15, 0);
907                ret = (NM)t;
908            } catch (ClassCastException cce) {
909                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
910                throw new RuntimeException(cce);
911            } catch (HL7Exception he) {
912                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
913                throw new RuntimeException(he);
914            }
915            return ret;
916        }
917    
918    
919        /**
920         * Returns
921         * OM7-15: "Consent Interval Quantity" - creates it if necessary
922         */
923        public NM getOm715_ConsentIntervalQuantity() { 
924            NM ret = null;
925            try {
926                Type t = this.getField(15, 0);
927                ret = (NM)t;
928            } catch (ClassCastException cce) {
929                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
930                throw new RuntimeException(cce);
931            } catch (HL7Exception he) {
932                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
933                throw new RuntimeException(he);
934            }
935            return ret;
936        }
937    
938    
939    
940        /**
941         * Returns
942         * OM7-16: "Consent Interval Units" - creates it if necessary
943         */
944        public CE getConsentIntervalUnits() { 
945            CE ret = null;
946            try {
947                Type t = this.getField(16, 0);
948                ret = (CE)t;
949            } catch (ClassCastException cce) {
950                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
951                throw new RuntimeException(cce);
952            } catch (HL7Exception he) {
953                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
954                throw new RuntimeException(he);
955            }
956            return ret;
957        }
958    
959    
960        /**
961         * Returns
962         * OM7-16: "Consent Interval Units" - creates it if necessary
963         */
964        public CE getOm716_ConsentIntervalUnits() { 
965            CE ret = null;
966            try {
967                Type t = this.getField(16, 0);
968                ret = (CE)t;
969            } catch (ClassCastException cce) {
970                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
971                throw new RuntimeException(cce);
972            } catch (HL7Exception he) {
973                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
974                throw new RuntimeException(he);
975            }
976            return ret;
977        }
978    
979    
980    
981        /**
982         * Returns
983         * OM7-17: "Consent Waiting Period Quantity" - creates it if necessary
984         */
985        public NM getConsentWaitingPeriodQuantity() { 
986            NM ret = null;
987            try {
988                Type t = this.getField(17, 0);
989                ret = (NM)t;
990            } catch (ClassCastException cce) {
991                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
992                throw new RuntimeException(cce);
993            } catch (HL7Exception he) {
994                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
995                throw new RuntimeException(he);
996            }
997            return ret;
998        }
999    
1000    
1001        /**
1002         * Returns
1003         * OM7-17: "Consent Waiting Period Quantity" - creates it if necessary
1004         */
1005        public NM getOm717_ConsentWaitingPeriodQuantity() { 
1006            NM ret = null;
1007            try {
1008                Type t = this.getField(17, 0);
1009                ret = (NM)t;
1010            } catch (ClassCastException cce) {
1011                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1012                throw new RuntimeException(cce);
1013            } catch (HL7Exception he) {
1014                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1015                throw new RuntimeException(he);
1016            }
1017            return ret;
1018        }
1019    
1020    
1021    
1022        /**
1023         * Returns
1024         * OM7-18: "Consent Waiting Period Units" - creates it if necessary
1025         */
1026        public CE getConsentWaitingPeriodUnits() { 
1027            CE ret = null;
1028            try {
1029                Type t = this.getField(18, 0);
1030                ret = (CE)t;
1031            } catch (ClassCastException cce) {
1032                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1033                throw new RuntimeException(cce);
1034            } catch (HL7Exception he) {
1035                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1036                throw new RuntimeException(he);
1037            }
1038            return ret;
1039        }
1040    
1041    
1042        /**
1043         * Returns
1044         * OM7-18: "Consent Waiting Period Units" - creates it if necessary
1045         */
1046        public CE getOm718_ConsentWaitingPeriodUnits() { 
1047            CE ret = null;
1048            try {
1049                Type t = this.getField(18, 0);
1050                ret = (CE)t;
1051            } catch (ClassCastException cce) {
1052                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1053                throw new RuntimeException(cce);
1054            } catch (HL7Exception he) {
1055                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1056                throw new RuntimeException(he);
1057            }
1058            return ret;
1059        }
1060    
1061    
1062    
1063        /**
1064         * Returns
1065         * OM7-19: "Effective Date/Time of Change" - creates it if necessary
1066         */
1067        public TS getEffectiveDateTimeOfChange() { 
1068            TS ret = null;
1069            try {
1070                Type t = this.getField(19, 0);
1071                ret = (TS)t;
1072            } catch (ClassCastException cce) {
1073                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1074                throw new RuntimeException(cce);
1075            } catch (HL7Exception he) {
1076                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1077                throw new RuntimeException(he);
1078            }
1079            return ret;
1080        }
1081    
1082    
1083        /**
1084         * Returns
1085         * OM7-19: "Effective Date/Time of Change" - creates it if necessary
1086         */
1087        public TS getOm719_EffectiveDateTimeOfChange() { 
1088            TS ret = null;
1089            try {
1090                Type t = this.getField(19, 0);
1091                ret = (TS)t;
1092            } catch (ClassCastException cce) {
1093                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1094                throw new RuntimeException(cce);
1095            } catch (HL7Exception he) {
1096                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1097                throw new RuntimeException(he);
1098            }
1099            return ret;
1100        }
1101    
1102    
1103    
1104        /**
1105         * Returns
1106         * OM7-20: "Entered By" - creates it if necessary
1107         */
1108        public XCN getEnteredBy() { 
1109            XCN ret = null;
1110            try {
1111                Type t = this.getField(20, 0);
1112                ret = (XCN)t;
1113            } catch (ClassCastException cce) {
1114                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1115                throw new RuntimeException(cce);
1116            } catch (HL7Exception he) {
1117                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1118                throw new RuntimeException(he);
1119            }
1120            return ret;
1121        }
1122    
1123    
1124        /**
1125         * Returns
1126         * OM7-20: "Entered By" - creates it if necessary
1127         */
1128        public XCN getOm720_EnteredBy() { 
1129            XCN ret = null;
1130            try {
1131                Type t = this.getField(20, 0);
1132                ret = (XCN)t;
1133            } catch (ClassCastException cce) {
1134                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1135                throw new RuntimeException(cce);
1136            } catch (HL7Exception he) {
1137                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1138                throw new RuntimeException(he);
1139            }
1140            return ret;
1141        }
1142    
1143    
1144        /**
1145         * Returns all repetitions of Orderable-at Location (OM7-21).
1146         */
1147        public PL[] getOrderableAtLocation() {
1148            PL[] ret = null;
1149            try {
1150                Type[] t = this.getField(21);  
1151                ret = new PL[t.length];
1152                for (int i = 0; i < ret.length; i++) {
1153                    ret[i] = (PL)t[i];
1154                }
1155            } catch (ClassCastException cce) {
1156                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1157                throw new RuntimeException(cce);
1158            } catch (HL7Exception he) {
1159                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1160                throw new RuntimeException(he);
1161            }
1162            return ret;
1163        }
1164    
1165    
1166        /**
1167         * Returns a count of the current number of repetitions of Orderable-at Location (OM7-21).
1168         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1169         * it will return zero.
1170         */
1171        public int getOrderableAtLocationReps() {
1172            PL[] ret = null;
1173            try {
1174                Type[] t = this.getField(21);
1175                return t.length;  
1176            } catch (ClassCastException cce) {
1177                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1178                throw new RuntimeException(cce);
1179            } catch (HL7Exception he) {
1180                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1181                throw new RuntimeException(he);
1182            }
1183        }
1184    
1185    
1186        /**
1187         * Returns a specific repetition of
1188         * OM7-21: "Orderable-at Location" - creates it if necessary
1189         *
1190         * @param rep The repetition index (0-indexed)
1191         */
1192        public PL getOrderableAtLocation(int rep) { 
1193            PL ret = null;
1194            try {
1195                Type t = this.getField(21, rep);
1196                ret = (PL)t;
1197            } catch (ClassCastException cce) {
1198                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1199                throw new RuntimeException(cce);
1200            } catch (HL7Exception he) {
1201                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1202                throw new RuntimeException(he);
1203            }
1204            return ret;
1205        }
1206    
1207        /**
1208         * Returns a specific repetition of
1209         * OM7-21: "Orderable-at Location" - creates it if necessary
1210         *
1211         * @param rep The repetition index (0-indexed)
1212         */
1213        public PL getOm721_OrderableAtLocation(int rep) { 
1214            PL ret = null;
1215            try {
1216                Type t = this.getField(21, rep);
1217                ret = (PL)t;
1218            } catch (ClassCastException cce) {
1219                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1220                throw new RuntimeException(cce);
1221            } catch (HL7Exception he) {
1222                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1223                throw new RuntimeException(he);
1224            }
1225            return ret;
1226        }
1227    
1228    
1229        /**
1230         * Returns a count of the current number of repetitions of Orderable-at Location (OM7-21).
1231         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1232         * it will return zero.
1233         */
1234        public int getOm721_OrderableAtLocationReps() {
1235            PL[] ret = null;
1236            try {
1237                Type[] t = this.getField(21);
1238                return t.length;  
1239            } catch (ClassCastException cce) {
1240                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1241                throw new RuntimeException(cce);
1242            } catch (HL7Exception he) {
1243                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1244                throw new RuntimeException(he);
1245            }
1246        }
1247    
1248    
1249    
1250        /**
1251         * Inserts a repetition of
1252         * OM7-21: "Orderable-at Location" at a specific index
1253         *
1254         * @param rep The repetition index (0-indexed)
1255         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1256         */
1257        public PL insertOrderableAtLocation(int rep) throws HL7Exception { 
1258            return (PL) super.insertRepetition(21, rep);
1259        }
1260    
1261    
1262    
1263        /**
1264         * Inserts a repetition of
1265         * OM7-21: "Orderable-at Location" at a specific index
1266         *
1267         * @param rep The repetition index (0-indexed)
1268         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1269         */
1270        public PL insertOm721_OrderableAtLocation(int rep) throws HL7Exception { 
1271            return (PL) super.insertRepetition(21, rep);
1272        }
1273    
1274    
1275        /**
1276         * Removes a repetition of
1277         * OM7-21: "Orderable-at Location" at a specific index
1278         *
1279         * @param rep The repetition index (0-indexed)
1280         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1281         */
1282        public PL removeOrderableAtLocation(int rep) throws HL7Exception { 
1283            return (PL) super.removeRepetition(21, rep);
1284        }
1285    
1286    
1287        /**
1288         * Removes a repetition of
1289         * OM7-21: "Orderable-at Location" at a specific index
1290         *
1291         * @param rep The repetition index (0-indexed)
1292         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1293         */
1294        public PL removeOm721_OrderableAtLocation(int rep) throws HL7Exception { 
1295            return (PL) super.removeRepetition(21, rep);
1296        }
1297    
1298    
1299    
1300    
1301        /**
1302         * Returns
1303         * OM7-22: "Formulary Status" - creates it if necessary
1304         */
1305        public IS getFormularyStatus() { 
1306            IS ret = null;
1307            try {
1308                Type t = this.getField(22, 0);
1309                ret = (IS)t;
1310            } catch (ClassCastException cce) {
1311                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1312                throw new RuntimeException(cce);
1313            } catch (HL7Exception he) {
1314                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1315                throw new RuntimeException(he);
1316            }
1317            return ret;
1318        }
1319    
1320    
1321        /**
1322         * Returns
1323         * OM7-22: "Formulary Status" - creates it if necessary
1324         */
1325        public IS getOm722_FormularyStatus() { 
1326            IS ret = null;
1327            try {
1328                Type t = this.getField(22, 0);
1329                ret = (IS)t;
1330            } catch (ClassCastException cce) {
1331                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1332                throw new RuntimeException(cce);
1333            } catch (HL7Exception he) {
1334                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1335                throw new RuntimeException(he);
1336            }
1337            return ret;
1338        }
1339    
1340    
1341    
1342        /**
1343         * Returns
1344         * OM7-23: "Special Order Indicator" - creates it if necessary
1345         */
1346        public ID getSpecialOrderIndicator() { 
1347            ID ret = null;
1348            try {
1349                Type t = this.getField(23, 0);
1350                ret = (ID)t;
1351            } catch (ClassCastException cce) {
1352                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1353                throw new RuntimeException(cce);
1354            } catch (HL7Exception he) {
1355                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1356                throw new RuntimeException(he);
1357            }
1358            return ret;
1359        }
1360    
1361    
1362        /**
1363         * Returns
1364         * OM7-23: "Special Order Indicator" - creates it if necessary
1365         */
1366        public ID getOm723_SpecialOrderIndicator() { 
1367            ID ret = null;
1368            try {
1369                Type t = this.getField(23, 0);
1370                ret = (ID)t;
1371            } catch (ClassCastException cce) {
1372                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1373                throw new RuntimeException(cce);
1374            } catch (HL7Exception he) {
1375                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1376                throw new RuntimeException(he);
1377            }
1378            return ret;
1379        }
1380    
1381    
1382        /**
1383         * Returns all repetitions of Primary Key Value - CDM (OM7-24).
1384         */
1385        public CE[] getPrimaryKeyValueCDM() {
1386            CE[] ret = null;
1387            try {
1388                Type[] t = this.getField(24);  
1389                ret = new CE[t.length];
1390                for (int i = 0; i < ret.length; i++) {
1391                    ret[i] = (CE)t[i];
1392                }
1393            } catch (ClassCastException cce) {
1394                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1395                throw new RuntimeException(cce);
1396            } catch (HL7Exception he) {
1397                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1398                throw new RuntimeException(he);
1399            }
1400            return ret;
1401        }
1402    
1403    
1404        /**
1405         * Returns a count of the current number of repetitions of Primary Key Value - CDM (OM7-24).
1406         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1407         * it will return zero.
1408         */
1409        public int getPrimaryKeyValueCDMReps() {
1410            CE[] ret = null;
1411            try {
1412                Type[] t = this.getField(24);
1413                return t.length;  
1414            } catch (ClassCastException cce) {
1415                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1416                throw new RuntimeException(cce);
1417            } catch (HL7Exception he) {
1418                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1419                throw new RuntimeException(he);
1420            }
1421        }
1422    
1423    
1424        /**
1425         * Returns a specific repetition of
1426         * OM7-24: "Primary Key Value - CDM" - creates it if necessary
1427         *
1428         * @param rep The repetition index (0-indexed)
1429         */
1430        public CE getPrimaryKeyValueCDM(int rep) { 
1431            CE ret = null;
1432            try {
1433                Type t = this.getField(24, rep);
1434                ret = (CE)t;
1435            } catch (ClassCastException cce) {
1436                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1437                throw new RuntimeException(cce);
1438            } catch (HL7Exception he) {
1439                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1440                throw new RuntimeException(he);
1441            }
1442            return ret;
1443        }
1444    
1445        /**
1446         * Returns a specific repetition of
1447         * OM7-24: "Primary Key Value - CDM" - creates it if necessary
1448         *
1449         * @param rep The repetition index (0-indexed)
1450         */
1451        public CE getOm724_PrimaryKeyValueCDM(int rep) { 
1452            CE ret = null;
1453            try {
1454                Type t = this.getField(24, rep);
1455                ret = (CE)t;
1456            } catch (ClassCastException cce) {
1457                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1458                throw new RuntimeException(cce);
1459            } catch (HL7Exception he) {
1460                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1461                throw new RuntimeException(he);
1462            }
1463            return ret;
1464        }
1465    
1466    
1467        /**
1468         * Returns a count of the current number of repetitions of Primary Key Value - CDM (OM7-24).
1469         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1470         * it will return zero.
1471         */
1472        public int getOm724_PrimaryKeyValueCDMReps() {
1473            CE[] ret = null;
1474            try {
1475                Type[] t = this.getField(24);
1476                return t.length;  
1477            } catch (ClassCastException cce) {
1478                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1479                throw new RuntimeException(cce);
1480            } catch (HL7Exception he) {
1481                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1482                throw new RuntimeException(he);
1483            }
1484        }
1485    
1486    
1487    
1488        /**
1489         * Inserts a repetition of
1490         * OM7-24: "Primary Key Value - CDM" at a specific index
1491         *
1492         * @param rep The repetition index (0-indexed)
1493         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1494         */
1495        public CE insertPrimaryKeyValueCDM(int rep) throws HL7Exception { 
1496            return (CE) super.insertRepetition(24, rep);
1497        }
1498    
1499    
1500    
1501        /**
1502         * Inserts a repetition of
1503         * OM7-24: "Primary Key Value - CDM" at a specific index
1504         *
1505         * @param rep The repetition index (0-indexed)
1506         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1507         */
1508        public CE insertOm724_PrimaryKeyValueCDM(int rep) throws HL7Exception { 
1509            return (CE) super.insertRepetition(24, rep);
1510        }
1511    
1512    
1513        /**
1514         * Removes a repetition of
1515         * OM7-24: "Primary Key Value - CDM" at a specific index
1516         *
1517         * @param rep The repetition index (0-indexed)
1518         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1519         */
1520        public CE removePrimaryKeyValueCDM(int rep) throws HL7Exception { 
1521            return (CE) super.removeRepetition(24, rep);
1522        }
1523    
1524    
1525        /**
1526         * Removes a repetition of
1527         * OM7-24: "Primary Key Value - CDM" at a specific index
1528         *
1529         * @param rep The repetition index (0-indexed)
1530         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1531         */
1532        public CE removeOm724_PrimaryKeyValueCDM(int rep) throws HL7Exception { 
1533            return (CE) super.removeRepetition(24, rep);
1534        }
1535    
1536    
1537    
1538    
1539    
1540    
1541        /** {@inheritDoc} */   
1542        protected Type createNewTypeWithoutReflection(int field) {
1543           switch (field) {
1544              case 0: return new NM(getMessage());
1545              case 1: return new CE(getMessage());
1546              case 2: return new CE(getMessage());
1547              case 3: return new TX(getMessage());
1548              case 4: return new ST(getMessage());
1549              case 5: return new TS(getMessage());
1550              case 6: return new TS(getMessage());
1551              case 7: return new NM(getMessage());
1552              case 8: return new CE(getMessage());
1553              case 9: return new IS(getMessage(), new Integer( 335 ));
1554              case 10: return new ID(getMessage(), new Integer( 136 ));
1555              case 11: return new CE(getMessage());
1556              case 12: return new TS(getMessage());
1557              case 13: return new TS(getMessage());
1558              case 14: return new NM(getMessage());
1559              case 15: return new CE(getMessage());
1560              case 16: return new NM(getMessage());
1561              case 17: return new CE(getMessage());
1562              case 18: return new TS(getMessage());
1563              case 19: return new XCN(getMessage());
1564              case 20: return new PL(getMessage());
1565              case 21: return new IS(getMessage(), new Integer( 473 ));
1566              case 22: return new ID(getMessage(), new Integer( 136 ));
1567              case 23: return new CE(getMessage());
1568              default: return null;
1569           }
1570       }
1571    
1572    
1573    }
1574