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 OM2 message segment (Numeric Observation). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>OM2-1: Sequence Number - Test/ Observation Master File (NM) <b>optional </b>
027         * <li>OM2-2: Units of Measure (CE) <b>optional </b>
028         * <li>OM2-3: Range of Decimal Precision (NM) <b>optional repeating</b>
029         * <li>OM2-4: Corresponding SI Units of Measure (CE) <b>optional </b>
030         * <li>OM2-5: SI Conversion Factor (TX) <b>optional </b>
031         * <li>OM2-6: Reference (Normal) Range - Ordinal and Continuous Observations (RFR) <b>optional </b>
032         * <li>OM2-7: Critical Range for Ordinal and Continuous Observations (NR) <b>optional </b>
033         * <li>OM2-8: Absolute Range for Ordinal and Continuous Observations (RFR) <b>optional </b>
034         * <li>OM2-9: Delta Check Criteria (DLT) <b>optional repeating</b>
035         * <li>OM2-10: Minimum Meaningful Increments (NM) <b>optional </b>
036     * </ul>
037     */
038    public class OM2 extends AbstractSegment {
039    
040        /** 
041         * Creates a new OM2 segment
042         */
043        public OM2(Group parent, ModelClassFactory factory) {
044           super(parent, factory);
045           init(factory);
046        }
047    
048        private void init(ModelClassFactory factory) {
049           try {
050                                      this.add(NM.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Sequence Number - Test/ Observation Master File");
051                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(9999) }, "Units of Measure");
052                                      this.add(NM.class, false, 0, 10, new Object[]{ getMessage(), new Integer(0) }, "Range of Decimal Precision");
053                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(9999) }, "Corresponding SI Units of Measure");
054                                      this.add(TX.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "SI Conversion Factor");
055                                      this.add(RFR.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Reference (Normal) Range - Ordinal and Continuous Observations");
056                                      this.add(NR.class, false, 1, 205, new Object[]{ getMessage(), new Integer(0) }, "Critical Range for Ordinal and Continuous Observations");
057                                      this.add(RFR.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Absolute Range for Ordinal and Continuous Observations");
058                                      this.add(DLT.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Delta Check Criteria");
059                                      this.add(NM.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Minimum Meaningful Increments");
060           } catch(HL7Exception e) {
061              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating OM2 - this is probably a bug in the source code generator.", e);
062           }
063        }
064    
065    
066    
067        /**
068         * Returns
069         * OM2-1: "Sequence Number - Test/ Observation Master File" - creates it if necessary
070         */
071        public NM getSequenceNumberTestObservationMasterFile() { 
072            NM ret = null;
073            try {
074                Type t = this.getField(1, 0);
075                ret = (NM)t;
076            } catch (ClassCastException cce) {
077                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
078                throw new RuntimeException(cce);
079            } catch (HL7Exception he) {
080                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
081                throw new RuntimeException(he);
082            }
083            return ret;
084        }
085    
086    
087        /**
088         * Returns
089         * OM2-1: "Sequence Number - Test/ Observation Master File" - creates it if necessary
090         */
091        public NM getOm21_SequenceNumberTestObservationMasterFile() { 
092            NM ret = null;
093            try {
094                Type t = this.getField(1, 0);
095                ret = (NM)t;
096            } catch (ClassCastException cce) {
097                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
098                throw new RuntimeException(cce);
099            } catch (HL7Exception he) {
100                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
101                throw new RuntimeException(he);
102            }
103            return ret;
104        }
105    
106    
107    
108        /**
109         * Returns
110         * OM2-2: "Units of Measure" - creates it if necessary
111         */
112        public CE getUnitsOfMeasure() { 
113            CE ret = null;
114            try {
115                Type t = this.getField(2, 0);
116                ret = (CE)t;
117            } catch (ClassCastException cce) {
118                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
119                throw new RuntimeException(cce);
120            } catch (HL7Exception he) {
121                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
122                throw new RuntimeException(he);
123            }
124            return ret;
125        }
126    
127    
128        /**
129         * Returns
130         * OM2-2: "Units of Measure" - creates it if necessary
131         */
132        public CE getOm22_UnitsOfMeasure() { 
133            CE ret = null;
134            try {
135                Type t = this.getField(2, 0);
136                ret = (CE)t;
137            } catch (ClassCastException cce) {
138                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
139                throw new RuntimeException(cce);
140            } catch (HL7Exception he) {
141                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
142                throw new RuntimeException(he);
143            }
144            return ret;
145        }
146    
147    
148        /**
149         * Returns all repetitions of Range of Decimal Precision (OM2-3).
150         */
151        public NM[] getRangeOfDecimalPrecision() {
152            NM[] ret = null;
153            try {
154                Type[] t = this.getField(3);  
155                ret = new NM[t.length];
156                for (int i = 0; i < ret.length; i++) {
157                    ret[i] = (NM)t[i];
158                }
159            } catch (ClassCastException cce) {
160                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
161                throw new RuntimeException(cce);
162            } catch (HL7Exception he) {
163                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
164                throw new RuntimeException(he);
165            }
166            return ret;
167        }
168    
169    
170        /**
171         * Returns a count of the current number of repetitions of Range of Decimal Precision (OM2-3).
172         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
173         * it will return zero.
174         */
175        public int getRangeOfDecimalPrecisionReps() {
176            NM[] ret = null;
177            try {
178                Type[] t = this.getField(3);
179                return t.length;  
180            } catch (ClassCastException cce) {
181                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
182                throw new RuntimeException(cce);
183            } catch (HL7Exception he) {
184                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
185                throw new RuntimeException(he);
186            }
187        }
188    
189    
190        /**
191         * Returns a specific repetition of
192         * OM2-3: "Range of Decimal Precision" - creates it if necessary
193         *
194         * @param rep The repetition index (0-indexed)
195         */
196        public NM getRangeOfDecimalPrecision(int rep) { 
197            NM ret = null;
198            try {
199                Type t = this.getField(3, rep);
200                ret = (NM)t;
201            } catch (ClassCastException cce) {
202                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
203                throw new RuntimeException(cce);
204            } catch (HL7Exception he) {
205                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
206                throw new RuntimeException(he);
207            }
208            return ret;
209        }
210    
211        /**
212         * Returns a specific repetition of
213         * OM2-3: "Range of Decimal Precision" - creates it if necessary
214         *
215         * @param rep The repetition index (0-indexed)
216         */
217        public NM getOm23_RangeOfDecimalPrecision(int rep) { 
218            NM ret = null;
219            try {
220                Type t = this.getField(3, rep);
221                ret = (NM)t;
222            } catch (ClassCastException cce) {
223                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
224                throw new RuntimeException(cce);
225            } catch (HL7Exception he) {
226                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
227                throw new RuntimeException(he);
228            }
229            return ret;
230        }
231    
232    
233        /**
234         * Returns a count of the current number of repetitions of Range of Decimal Precision (OM2-3).
235         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
236         * it will return zero.
237         */
238        public int getOm23_RangeOfDecimalPrecisionReps() {
239            NM[] ret = null;
240            try {
241                Type[] t = this.getField(3);
242                return t.length;  
243            } catch (ClassCastException cce) {
244                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
245                throw new RuntimeException(cce);
246            } catch (HL7Exception he) {
247                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
248                throw new RuntimeException(he);
249            }
250        }
251    
252    
253    
254        /**
255         * Inserts a repetition of
256         * OM2-3: "Range of Decimal Precision" at a specific index
257         *
258         * @param rep The repetition index (0-indexed)
259         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
260         */
261        public NM insertRangeOfDecimalPrecision(int rep) throws HL7Exception { 
262            return (NM) super.insertRepetition(3, rep);
263        }
264    
265    
266    
267        /**
268         * Inserts a repetition of
269         * OM2-3: "Range of Decimal Precision" at a specific index
270         *
271         * @param rep The repetition index (0-indexed)
272         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
273         */
274        public NM insertOm23_RangeOfDecimalPrecision(int rep) throws HL7Exception { 
275            return (NM) super.insertRepetition(3, rep);
276        }
277    
278    
279        /**
280         * Removes a repetition of
281         * OM2-3: "Range of Decimal Precision" at a specific index
282         *
283         * @param rep The repetition index (0-indexed)
284         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
285         */
286        public NM removeRangeOfDecimalPrecision(int rep) throws HL7Exception { 
287            return (NM) super.removeRepetition(3, rep);
288        }
289    
290    
291        /**
292         * Removes a repetition of
293         * OM2-3: "Range of Decimal Precision" at a specific index
294         *
295         * @param rep The repetition index (0-indexed)
296         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
297         */
298        public NM removeOm23_RangeOfDecimalPrecision(int rep) throws HL7Exception { 
299            return (NM) super.removeRepetition(3, rep);
300        }
301    
302    
303    
304    
305        /**
306         * Returns
307         * OM2-4: "Corresponding SI Units of Measure" - creates it if necessary
308         */
309        public CE getCorrespondingSIUnitsOfMeasure() { 
310            CE ret = null;
311            try {
312                Type t = this.getField(4, 0);
313                ret = (CE)t;
314            } catch (ClassCastException cce) {
315                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
316                throw new RuntimeException(cce);
317            } catch (HL7Exception he) {
318                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
319                throw new RuntimeException(he);
320            }
321            return ret;
322        }
323    
324    
325        /**
326         * Returns
327         * OM2-4: "Corresponding SI Units of Measure" - creates it if necessary
328         */
329        public CE getOm24_CorrespondingSIUnitsOfMeasure() { 
330            CE ret = null;
331            try {
332                Type t = this.getField(4, 0);
333                ret = (CE)t;
334            } catch (ClassCastException cce) {
335                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
336                throw new RuntimeException(cce);
337            } catch (HL7Exception he) {
338                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
339                throw new RuntimeException(he);
340            }
341            return ret;
342        }
343    
344    
345    
346        /**
347         * Returns
348         * OM2-5: "SI Conversion Factor" - creates it if necessary
349         */
350        public TX getSIConversionFactor() { 
351            TX ret = null;
352            try {
353                Type t = this.getField(5, 0);
354                ret = (TX)t;
355            } catch (ClassCastException cce) {
356                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
357                throw new RuntimeException(cce);
358            } catch (HL7Exception he) {
359                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
360                throw new RuntimeException(he);
361            }
362            return ret;
363        }
364    
365    
366        /**
367         * Returns
368         * OM2-5: "SI Conversion Factor" - creates it if necessary
369         */
370        public TX getOm25_SIConversionFactor() { 
371            TX ret = null;
372            try {
373                Type t = this.getField(5, 0);
374                ret = (TX)t;
375            } catch (ClassCastException cce) {
376                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
377                throw new RuntimeException(cce);
378            } catch (HL7Exception he) {
379                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
380                throw new RuntimeException(he);
381            }
382            return ret;
383        }
384    
385    
386    
387        /**
388         * Returns
389         * OM2-6: "Reference (Normal) Range - Ordinal and Continuous Observations" - creates it if necessary
390         */
391        public RFR getReferenceNormalRangeOrdinalAndContinuousObservations() { 
392            RFR ret = null;
393            try {
394                Type t = this.getField(6, 0);
395                ret = (RFR)t;
396            } catch (ClassCastException cce) {
397                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
398                throw new RuntimeException(cce);
399            } catch (HL7Exception he) {
400                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
401                throw new RuntimeException(he);
402            }
403            return ret;
404        }
405    
406    
407        /**
408         * Returns
409         * OM2-6: "Reference (Normal) Range - Ordinal and Continuous Observations" - creates it if necessary
410         */
411        public RFR getOm26_ReferenceNormalRangeOrdinalAndContinuousObservations() { 
412            RFR ret = null;
413            try {
414                Type t = this.getField(6, 0);
415                ret = (RFR)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        /**
429         * Returns
430         * OM2-7: "Critical Range for Ordinal and Continuous Observations" - creates it if necessary
431         */
432        public NR getCriticalRangeForOrdinalAndContinuousObservations() { 
433            NR ret = null;
434            try {
435                Type t = this.getField(7, 0);
436                ret = (NR)t;
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            return ret;
445        }
446    
447    
448        /**
449         * Returns
450         * OM2-7: "Critical Range for Ordinal and Continuous Observations" - creates it if necessary
451         */
452        public NR getOm27_CriticalRangeForOrdinalAndContinuousObservations() { 
453            NR ret = null;
454            try {
455                Type t = this.getField(7, 0);
456                ret = (NR)t;
457            } catch (ClassCastException cce) {
458                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
459                throw new RuntimeException(cce);
460            } catch (HL7Exception he) {
461                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
462                throw new RuntimeException(he);
463            }
464            return ret;
465        }
466    
467    
468    
469        /**
470         * Returns
471         * OM2-8: "Absolute Range for Ordinal and Continuous Observations" - creates it if necessary
472         */
473        public RFR getAbsoluteRangeForOrdinalAndContinuousObservations() { 
474            RFR ret = null;
475            try {
476                Type t = this.getField(8, 0);
477                ret = (RFR)t;
478            } catch (ClassCastException cce) {
479                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
480                throw new RuntimeException(cce);
481            } catch (HL7Exception he) {
482                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
483                throw new RuntimeException(he);
484            }
485            return ret;
486        }
487    
488    
489        /**
490         * Returns
491         * OM2-8: "Absolute Range for Ordinal and Continuous Observations" - creates it if necessary
492         */
493        public RFR getOm28_AbsoluteRangeForOrdinalAndContinuousObservations() { 
494            RFR ret = null;
495            try {
496                Type t = this.getField(8, 0);
497                ret = (RFR)t;
498            } catch (ClassCastException cce) {
499                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
500                throw new RuntimeException(cce);
501            } catch (HL7Exception he) {
502                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
503                throw new RuntimeException(he);
504            }
505            return ret;
506        }
507    
508    
509        /**
510         * Returns all repetitions of Delta Check Criteria (OM2-9).
511         */
512        public DLT[] getDeltaCheckCriteria() {
513            DLT[] ret = null;
514            try {
515                Type[] t = this.getField(9);  
516                ret = new DLT[t.length];
517                for (int i = 0; i < ret.length; i++) {
518                    ret[i] = (DLT)t[i];
519                }
520            } catch (ClassCastException cce) {
521                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
522                throw new RuntimeException(cce);
523            } catch (HL7Exception he) {
524                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
525                throw new RuntimeException(he);
526            }
527            return ret;
528        }
529    
530    
531        /**
532         * Returns a count of the current number of repetitions of Delta Check Criteria (OM2-9).
533         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
534         * it will return zero.
535         */
536        public int getDeltaCheckCriteriaReps() {
537            DLT[] ret = null;
538            try {
539                Type[] t = this.getField(9);
540                return t.length;  
541            } catch (ClassCastException cce) {
542                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
543                throw new RuntimeException(cce);
544            } catch (HL7Exception he) {
545                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
546                throw new RuntimeException(he);
547            }
548        }
549    
550    
551        /**
552         * Returns a specific repetition of
553         * OM2-9: "Delta Check Criteria" - creates it if necessary
554         *
555         * @param rep The repetition index (0-indexed)
556         */
557        public DLT getDeltaCheckCriteria(int rep) { 
558            DLT ret = null;
559            try {
560                Type t = this.getField(9, rep);
561                ret = (DLT)t;
562            } catch (ClassCastException cce) {
563                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
564                throw new RuntimeException(cce);
565            } catch (HL7Exception he) {
566                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
567                throw new RuntimeException(he);
568            }
569            return ret;
570        }
571    
572        /**
573         * Returns a specific repetition of
574         * OM2-9: "Delta Check Criteria" - creates it if necessary
575         *
576         * @param rep The repetition index (0-indexed)
577         */
578        public DLT getOm29_DeltaCheckCriteria(int rep) { 
579            DLT ret = null;
580            try {
581                Type t = this.getField(9, rep);
582                ret = (DLT)t;
583            } catch (ClassCastException cce) {
584                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
585                throw new RuntimeException(cce);
586            } catch (HL7Exception he) {
587                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
588                throw new RuntimeException(he);
589            }
590            return ret;
591        }
592    
593    
594        /**
595         * Returns a count of the current number of repetitions of Delta Check Criteria (OM2-9).
596         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
597         * it will return zero.
598         */
599        public int getOm29_DeltaCheckCriteriaReps() {
600            DLT[] ret = null;
601            try {
602                Type[] t = this.getField(9);
603                return t.length;  
604            } catch (ClassCastException cce) {
605                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
606                throw new RuntimeException(cce);
607            } catch (HL7Exception he) {
608                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
609                throw new RuntimeException(he);
610            }
611        }
612    
613    
614    
615        /**
616         * Inserts a repetition of
617         * OM2-9: "Delta Check Criteria" at a specific index
618         *
619         * @param rep The repetition index (0-indexed)
620         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
621         */
622        public DLT insertDeltaCheckCriteria(int rep) throws HL7Exception { 
623            return (DLT) super.insertRepetition(9, rep);
624        }
625    
626    
627    
628        /**
629         * Inserts a repetition of
630         * OM2-9: "Delta Check Criteria" at a specific index
631         *
632         * @param rep The repetition index (0-indexed)
633         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
634         */
635        public DLT insertOm29_DeltaCheckCriteria(int rep) throws HL7Exception { 
636            return (DLT) super.insertRepetition(9, rep);
637        }
638    
639    
640        /**
641         * Removes a repetition of
642         * OM2-9: "Delta Check Criteria" at a specific index
643         *
644         * @param rep The repetition index (0-indexed)
645         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
646         */
647        public DLT removeDeltaCheckCriteria(int rep) throws HL7Exception { 
648            return (DLT) super.removeRepetition(9, rep);
649        }
650    
651    
652        /**
653         * Removes a repetition of
654         * OM2-9: "Delta Check Criteria" at a specific index
655         *
656         * @param rep The repetition index (0-indexed)
657         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
658         */
659        public DLT removeOm29_DeltaCheckCriteria(int rep) throws HL7Exception { 
660            return (DLT) super.removeRepetition(9, rep);
661        }
662    
663    
664    
665    
666        /**
667         * Returns
668         * OM2-10: "Minimum Meaningful Increments" - creates it if necessary
669         */
670        public NM getMinimumMeaningfulIncrements() { 
671            NM ret = null;
672            try {
673                Type t = this.getField(10, 0);
674                ret = (NM)t;
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            return ret;
683        }
684    
685    
686        /**
687         * Returns
688         * OM2-10: "Minimum Meaningful Increments" - creates it if necessary
689         */
690        public NM getOm210_MinimumMeaningfulIncrements() { 
691            NM ret = null;
692            try {
693                Type t = this.getField(10, 0);
694                ret = (NM)t;
695            } catch (ClassCastException cce) {
696                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
697                throw new RuntimeException(cce);
698            } catch (HL7Exception he) {
699                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
700                throw new RuntimeException(he);
701            }
702            return ret;
703        }
704    
705    
706    
707    
708    
709        /** {@inheritDoc} */   
710        protected Type createNewTypeWithoutReflection(int field) {
711           switch (field) {
712              case 0: return new NM(getMessage());
713              case 1: return new CE(getMessage());
714              case 2: return new NM(getMessage());
715              case 3: return new CE(getMessage());
716              case 4: return new TX(getMessage());
717              case 5: return new RFR(getMessage());
718              case 6: return new NR(getMessage());
719              case 7: return new RFR(getMessage());
720              case 8: return new DLT(getMessage());
721              case 9: return new NM(getMessage());
722              default: return null;
723           }
724       }
725    
726    
727    }
728