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 QRF message segment (Original Style Query Filter). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>QRF-1: Where Subject Filter (ST) <b> repeating</b>
027         * <li>QRF-2: When Data Start Date/Time (TS) <b>optional </b>
028         * <li>QRF-3: When Data End Date/Time (TS) <b>optional </b>
029         * <li>QRF-4: What User Qualifier (ST) <b>optional repeating</b>
030         * <li>QRF-5: Other QRY Subject Filter (ST) <b>optional repeating</b>
031         * <li>QRF-6: Which Date/Time Qualifier (ID) <b>optional repeating</b>
032         * <li>QRF-7: Which Date/Time Status Qualifier (ID) <b>optional repeating</b>
033         * <li>QRF-8: Date/Time Selection Qualifier (ID) <b>optional repeating</b>
034         * <li>QRF-9: When Quantity/Timing Qualifier (TQ) <b>optional </b>
035         * <li>QRF-10: Search Confidence Threshold (NM) <b>optional </b>
036     * </ul>
037     */
038    public class QRF extends AbstractSegment {
039    
040        /** 
041         * Creates a new QRF segment
042         */
043        public QRF(Group parent, ModelClassFactory factory) {
044           super(parent, factory);
045           init(factory);
046        }
047    
048        private void init(ModelClassFactory factory) {
049           try {
050                                      this.add(ST.class, true, 0, 20, new Object[]{ getMessage(), new Integer(0) }, "Where Subject Filter");
051                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "When Data Start Date/Time");
052                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "When Data End Date/Time");
053                                      this.add(ST.class, false, 0, 60, new Object[]{ getMessage(), new Integer(0) }, "What User Qualifier");
054                                      this.add(ST.class, false, 0, 60, new Object[]{ getMessage(), new Integer(0) }, "Other QRY Subject Filter");
055                                      this.add(ID.class, false, 0, 12, new Object[]{ getMessage() }, "Which Date/Time Qualifier");
056                                      this.add(ID.class, false, 0, 12, new Object[]{ getMessage() }, "Which Date/Time Status Qualifier");
057                                      this.add(ID.class, false, 0, 12, new Object[]{ getMessage() }, "Date/Time Selection Qualifier");
058                                      this.add(TQ.class, false, 1, 60, new Object[]{ getMessage(), new Integer(0) }, "When Quantity/Timing Qualifier");
059                                      this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "Search Confidence Threshold");
060           } catch(HL7Exception e) {
061              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating QRF - this is probably a bug in the source code generator.", e);
062           }
063        }
064    
065    
066        /**
067         * Returns all repetitions of Where Subject Filter (QRF-1).
068         */
069        public ST[] getWhereSubjectFilter() {
070            ST[] ret = null;
071            try {
072                Type[] t = this.getField(1);  
073                ret = new ST[t.length];
074                for (int i = 0; i < ret.length; i++) {
075                    ret[i] = (ST)t[i];
076                }
077            } catch (ClassCastException cce) {
078                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
079                throw new RuntimeException(cce);
080            } catch (HL7Exception he) {
081                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
082                throw new RuntimeException(he);
083            }
084            return ret;
085        }
086    
087    
088        /**
089         * Returns a count of the current number of repetitions of Where Subject Filter (QRF-1).
090         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
091         * it will return zero.
092         */
093        public int getWhereSubjectFilterReps() {
094            ST[] ret = null;
095            try {
096                Type[] t = this.getField(1);
097                return t.length;  
098            } catch (ClassCastException cce) {
099                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
100                throw new RuntimeException(cce);
101            } catch (HL7Exception he) {
102                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
103                throw new RuntimeException(he);
104            }
105        }
106    
107    
108        /**
109         * Returns a specific repetition of
110         * QRF-1: "Where Subject Filter" - creates it if necessary
111         *
112         * @param rep The repetition index (0-indexed)
113         */
114        public ST getWhereSubjectFilter(int rep) { 
115            ST ret = null;
116            try {
117                Type t = this.getField(1, rep);
118                ret = (ST)t;
119            } catch (ClassCastException cce) {
120                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
121                throw new RuntimeException(cce);
122            } catch (HL7Exception he) {
123                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
124                throw new RuntimeException(he);
125            }
126            return ret;
127        }
128    
129        /**
130         * Returns a specific repetition of
131         * QRF-1: "Where Subject Filter" - creates it if necessary
132         *
133         * @param rep The repetition index (0-indexed)
134         */
135        public ST getQrf1_WhereSubjectFilter(int rep) { 
136            ST ret = null;
137            try {
138                Type t = this.getField(1, rep);
139                ret = (ST)t;
140            } catch (ClassCastException cce) {
141                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
142                throw new RuntimeException(cce);
143            } catch (HL7Exception he) {
144                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
145                throw new RuntimeException(he);
146            }
147            return ret;
148        }
149    
150    
151        /**
152         * Returns a count of the current number of repetitions of Where Subject Filter (QRF-1).
153         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
154         * it will return zero.
155         */
156        public int getQrf1_WhereSubjectFilterReps() {
157            ST[] ret = null;
158            try {
159                Type[] t = this.getField(1);
160                return t.length;  
161            } catch (ClassCastException cce) {
162                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
163                throw new RuntimeException(cce);
164            } catch (HL7Exception he) {
165                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
166                throw new RuntimeException(he);
167            }
168        }
169    
170    
171    
172        /**
173         * Inserts a repetition of
174         * QRF-1: "Where Subject Filter" at a specific index
175         *
176         * @param rep The repetition index (0-indexed)
177         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
178         */
179        public ST insertWhereSubjectFilter(int rep) throws HL7Exception { 
180            return (ST) super.insertRepetition(1, rep);
181        }
182    
183    
184    
185        /**
186         * Inserts a repetition of
187         * QRF-1: "Where Subject Filter" at a specific index
188         *
189         * @param rep The repetition index (0-indexed)
190         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
191         */
192        public ST insertQrf1_WhereSubjectFilter(int rep) throws HL7Exception { 
193            return (ST) super.insertRepetition(1, rep);
194        }
195    
196    
197        /**
198         * Removes a repetition of
199         * QRF-1: "Where Subject Filter" at a specific index
200         *
201         * @param rep The repetition index (0-indexed)
202         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
203         */
204        public ST removeWhereSubjectFilter(int rep) throws HL7Exception { 
205            return (ST) super.removeRepetition(1, rep);
206        }
207    
208    
209        /**
210         * Removes a repetition of
211         * QRF-1: "Where Subject Filter" at a specific index
212         *
213         * @param rep The repetition index (0-indexed)
214         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
215         */
216        public ST removeQrf1_WhereSubjectFilter(int rep) throws HL7Exception { 
217            return (ST) super.removeRepetition(1, rep);
218        }
219    
220    
221    
222    
223        /**
224         * Returns
225         * QRF-2: "When Data Start Date/Time" - creates it if necessary
226         */
227        public TS getWhenDataStartDateTime() { 
228            TS ret = null;
229            try {
230                Type t = this.getField(2, 0);
231                ret = (TS)t;
232            } catch (ClassCastException cce) {
233                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
234                throw new RuntimeException(cce);
235            } catch (HL7Exception he) {
236                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
237                throw new RuntimeException(he);
238            }
239            return ret;
240        }
241    
242    
243        /**
244         * Returns
245         * QRF-2: "When Data Start Date/Time" - creates it if necessary
246         */
247        public TS getQrf2_WhenDataStartDateTime() { 
248            TS ret = null;
249            try {
250                Type t = this.getField(2, 0);
251                ret = (TS)t;
252            } catch (ClassCastException cce) {
253                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
254                throw new RuntimeException(cce);
255            } catch (HL7Exception he) {
256                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
257                throw new RuntimeException(he);
258            }
259            return ret;
260        }
261    
262    
263    
264        /**
265         * Returns
266         * QRF-3: "When Data End Date/Time" - creates it if necessary
267         */
268        public TS getWhenDataEndDateTime() { 
269            TS ret = null;
270            try {
271                Type t = this.getField(3, 0);
272                ret = (TS)t;
273            } catch (ClassCastException cce) {
274                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
275                throw new RuntimeException(cce);
276            } catch (HL7Exception he) {
277                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
278                throw new RuntimeException(he);
279            }
280            return ret;
281        }
282    
283    
284        /**
285         * Returns
286         * QRF-3: "When Data End Date/Time" - creates it if necessary
287         */
288        public TS getQrf3_WhenDataEndDateTime() { 
289            TS ret = null;
290            try {
291                Type t = this.getField(3, 0);
292                ret = (TS)t;
293            } catch (ClassCastException cce) {
294                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
295                throw new RuntimeException(cce);
296            } catch (HL7Exception he) {
297                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
298                throw new RuntimeException(he);
299            }
300            return ret;
301        }
302    
303    
304        /**
305         * Returns all repetitions of What User Qualifier (QRF-4).
306         */
307        public ST[] getWhatUserQualifier() {
308            ST[] ret = null;
309            try {
310                Type[] t = this.getField(4);  
311                ret = new ST[t.length];
312                for (int i = 0; i < ret.length; i++) {
313                    ret[i] = (ST)t[i];
314                }
315            } catch (ClassCastException cce) {
316                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
317                throw new RuntimeException(cce);
318            } catch (HL7Exception he) {
319                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
320                throw new RuntimeException(he);
321            }
322            return ret;
323        }
324    
325    
326        /**
327         * Returns a count of the current number of repetitions of What User Qualifier (QRF-4).
328         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
329         * it will return zero.
330         */
331        public int getWhatUserQualifierReps() {
332            ST[] ret = null;
333            try {
334                Type[] t = this.getField(4);
335                return t.length;  
336            } catch (ClassCastException cce) {
337                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
338                throw new RuntimeException(cce);
339            } catch (HL7Exception he) {
340                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
341                throw new RuntimeException(he);
342            }
343        }
344    
345    
346        /**
347         * Returns a specific repetition of
348         * QRF-4: "What User Qualifier" - creates it if necessary
349         *
350         * @param rep The repetition index (0-indexed)
351         */
352        public ST getWhatUserQualifier(int rep) { 
353            ST ret = null;
354            try {
355                Type t = this.getField(4, rep);
356                ret = (ST)t;
357            } catch (ClassCastException cce) {
358                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
359                throw new RuntimeException(cce);
360            } catch (HL7Exception he) {
361                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
362                throw new RuntimeException(he);
363            }
364            return ret;
365        }
366    
367        /**
368         * Returns a specific repetition of
369         * QRF-4: "What User Qualifier" - creates it if necessary
370         *
371         * @param rep The repetition index (0-indexed)
372         */
373        public ST getQrf4_WhatUserQualifier(int rep) { 
374            ST ret = null;
375            try {
376                Type t = this.getField(4, rep);
377                ret = (ST)t;
378            } catch (ClassCastException cce) {
379                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
380                throw new RuntimeException(cce);
381            } catch (HL7Exception he) {
382                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
383                throw new RuntimeException(he);
384            }
385            return ret;
386        }
387    
388    
389        /**
390         * Returns a count of the current number of repetitions of What User Qualifier (QRF-4).
391         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
392         * it will return zero.
393         */
394        public int getQrf4_WhatUserQualifierReps() {
395            ST[] ret = null;
396            try {
397                Type[] t = this.getField(4);
398                return t.length;  
399            } catch (ClassCastException cce) {
400                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
401                throw new RuntimeException(cce);
402            } catch (HL7Exception he) {
403                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
404                throw new RuntimeException(he);
405            }
406        }
407    
408    
409    
410        /**
411         * Inserts a repetition of
412         * QRF-4: "What User Qualifier" at a specific index
413         *
414         * @param rep The repetition index (0-indexed)
415         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
416         */
417        public ST insertWhatUserQualifier(int rep) throws HL7Exception { 
418            return (ST) super.insertRepetition(4, rep);
419        }
420    
421    
422    
423        /**
424         * Inserts a repetition of
425         * QRF-4: "What User Qualifier" at a specific index
426         *
427         * @param rep The repetition index (0-indexed)
428         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
429         */
430        public ST insertQrf4_WhatUserQualifier(int rep) throws HL7Exception { 
431            return (ST) super.insertRepetition(4, rep);
432        }
433    
434    
435        /**
436         * Removes a repetition of
437         * QRF-4: "What User Qualifier" at a specific index
438         *
439         * @param rep The repetition index (0-indexed)
440         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
441         */
442        public ST removeWhatUserQualifier(int rep) throws HL7Exception { 
443            return (ST) super.removeRepetition(4, rep);
444        }
445    
446    
447        /**
448         * Removes a repetition of
449         * QRF-4: "What User Qualifier" at a specific index
450         *
451         * @param rep The repetition index (0-indexed)
452         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
453         */
454        public ST removeQrf4_WhatUserQualifier(int rep) throws HL7Exception { 
455            return (ST) super.removeRepetition(4, rep);
456        }
457    
458    
459    
460        /**
461         * Returns all repetitions of Other QRY Subject Filter (QRF-5).
462         */
463        public ST[] getOtherQRYSubjectFilter() {
464            ST[] ret = null;
465            try {
466                Type[] t = this.getField(5);  
467                ret = new ST[t.length];
468                for (int i = 0; i < ret.length; i++) {
469                    ret[i] = (ST)t[i];
470                }
471            } catch (ClassCastException cce) {
472                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
473                throw new RuntimeException(cce);
474            } catch (HL7Exception he) {
475                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
476                throw new RuntimeException(he);
477            }
478            return ret;
479        }
480    
481    
482        /**
483         * Returns a count of the current number of repetitions of Other QRY Subject Filter (QRF-5).
484         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
485         * it will return zero.
486         */
487        public int getOtherQRYSubjectFilterReps() {
488            ST[] ret = null;
489            try {
490                Type[] t = this.getField(5);
491                return t.length;  
492            } catch (ClassCastException cce) {
493                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
494                throw new RuntimeException(cce);
495            } catch (HL7Exception he) {
496                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
497                throw new RuntimeException(he);
498            }
499        }
500    
501    
502        /**
503         * Returns a specific repetition of
504         * QRF-5: "Other QRY Subject Filter" - creates it if necessary
505         *
506         * @param rep The repetition index (0-indexed)
507         */
508        public ST getOtherQRYSubjectFilter(int rep) { 
509            ST ret = null;
510            try {
511                Type t = this.getField(5, rep);
512                ret = (ST)t;
513            } catch (ClassCastException cce) {
514                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
515                throw new RuntimeException(cce);
516            } catch (HL7Exception he) {
517                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
518                throw new RuntimeException(he);
519            }
520            return ret;
521        }
522    
523        /**
524         * Returns a specific repetition of
525         * QRF-5: "Other QRY Subject Filter" - creates it if necessary
526         *
527         * @param rep The repetition index (0-indexed)
528         */
529        public ST getQrf5_OtherQRYSubjectFilter(int rep) { 
530            ST ret = null;
531            try {
532                Type t = this.getField(5, rep);
533                ret = (ST)t;
534            } catch (ClassCastException cce) {
535                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
536                throw new RuntimeException(cce);
537            } catch (HL7Exception he) {
538                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
539                throw new RuntimeException(he);
540            }
541            return ret;
542        }
543    
544    
545        /**
546         * Returns a count of the current number of repetitions of Other QRY Subject Filter (QRF-5).
547         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
548         * it will return zero.
549         */
550        public int getQrf5_OtherQRYSubjectFilterReps() {
551            ST[] ret = null;
552            try {
553                Type[] t = this.getField(5);
554                return t.length;  
555            } catch (ClassCastException cce) {
556                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
557                throw new RuntimeException(cce);
558            } catch (HL7Exception he) {
559                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
560                throw new RuntimeException(he);
561            }
562        }
563    
564    
565    
566        /**
567         * Inserts a repetition of
568         * QRF-5: "Other QRY Subject Filter" at a specific index
569         *
570         * @param rep The repetition index (0-indexed)
571         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
572         */
573        public ST insertOtherQRYSubjectFilter(int rep) throws HL7Exception { 
574            return (ST) super.insertRepetition(5, rep);
575        }
576    
577    
578    
579        /**
580         * Inserts a repetition of
581         * QRF-5: "Other QRY Subject Filter" at a specific index
582         *
583         * @param rep The repetition index (0-indexed)
584         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
585         */
586        public ST insertQrf5_OtherQRYSubjectFilter(int rep) throws HL7Exception { 
587            return (ST) super.insertRepetition(5, rep);
588        }
589    
590    
591        /**
592         * Removes a repetition of
593         * QRF-5: "Other QRY Subject Filter" at a specific index
594         *
595         * @param rep The repetition index (0-indexed)
596         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
597         */
598        public ST removeOtherQRYSubjectFilter(int rep) throws HL7Exception { 
599            return (ST) super.removeRepetition(5, rep);
600        }
601    
602    
603        /**
604         * Removes a repetition of
605         * QRF-5: "Other QRY Subject Filter" at a specific index
606         *
607         * @param rep The repetition index (0-indexed)
608         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
609         */
610        public ST removeQrf5_OtherQRYSubjectFilter(int rep) throws HL7Exception { 
611            return (ST) super.removeRepetition(5, rep);
612        }
613    
614    
615    
616        /**
617         * Returns all repetitions of Which Date/Time Qualifier (QRF-6).
618         */
619        public ID[] getWhichDateTimeQualifier() {
620            ID[] ret = null;
621            try {
622                Type[] t = this.getField(6);  
623                ret = new ID[t.length];
624                for (int i = 0; i < ret.length; i++) {
625                    ret[i] = (ID)t[i];
626                }
627            } catch (ClassCastException cce) {
628                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
629                throw new RuntimeException(cce);
630            } catch (HL7Exception he) {
631                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
632                throw new RuntimeException(he);
633            }
634            return ret;
635        }
636    
637    
638        /**
639         * Returns a count of the current number of repetitions of Which Date/Time Qualifier (QRF-6).
640         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
641         * it will return zero.
642         */
643        public int getWhichDateTimeQualifierReps() {
644            ID[] ret = null;
645            try {
646                Type[] t = this.getField(6);
647                return t.length;  
648            } catch (ClassCastException cce) {
649                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
650                throw new RuntimeException(cce);
651            } catch (HL7Exception he) {
652                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
653                throw new RuntimeException(he);
654            }
655        }
656    
657    
658        /**
659         * Returns a specific repetition of
660         * QRF-6: "Which Date/Time Qualifier" - creates it if necessary
661         *
662         * @param rep The repetition index (0-indexed)
663         */
664        public ID getWhichDateTimeQualifier(int rep) { 
665            ID ret = null;
666            try {
667                Type t = this.getField(6, rep);
668                ret = (ID)t;
669            } catch (ClassCastException cce) {
670                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
671                throw new RuntimeException(cce);
672            } catch (HL7Exception he) {
673                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
674                throw new RuntimeException(he);
675            }
676            return ret;
677        }
678    
679        /**
680         * Returns a specific repetition of
681         * QRF-6: "Which Date/Time Qualifier" - creates it if necessary
682         *
683         * @param rep The repetition index (0-indexed)
684         */
685        public ID getQrf6_WhichDateTimeQualifier(int rep) { 
686            ID ret = null;
687            try {
688                Type t = this.getField(6, rep);
689                ret = (ID)t;
690            } catch (ClassCastException cce) {
691                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
692                throw new RuntimeException(cce);
693            } catch (HL7Exception he) {
694                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
695                throw new RuntimeException(he);
696            }
697            return ret;
698        }
699    
700    
701        /**
702         * Returns a count of the current number of repetitions of Which Date/Time Qualifier (QRF-6).
703         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
704         * it will return zero.
705         */
706        public int getQrf6_WhichDateTimeQualifierReps() {
707            ID[] ret = null;
708            try {
709                Type[] t = this.getField(6);
710                return t.length;  
711            } catch (ClassCastException cce) {
712                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
713                throw new RuntimeException(cce);
714            } catch (HL7Exception he) {
715                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
716                throw new RuntimeException(he);
717            }
718        }
719    
720    
721    
722        /**
723         * Inserts a repetition of
724         * QRF-6: "Which Date/Time Qualifier" at a specific index
725         *
726         * @param rep The repetition index (0-indexed)
727         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
728         */
729        public ID insertWhichDateTimeQualifier(int rep) throws HL7Exception { 
730            return (ID) super.insertRepetition(6, rep);
731        }
732    
733    
734    
735        /**
736         * Inserts a repetition of
737         * QRF-6: "Which Date/Time Qualifier" at a specific index
738         *
739         * @param rep The repetition index (0-indexed)
740         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
741         */
742        public ID insertQrf6_WhichDateTimeQualifier(int rep) throws HL7Exception { 
743            return (ID) super.insertRepetition(6, rep);
744        }
745    
746    
747        /**
748         * Removes a repetition of
749         * QRF-6: "Which Date/Time Qualifier" at a specific index
750         *
751         * @param rep The repetition index (0-indexed)
752         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
753         */
754        public ID removeWhichDateTimeQualifier(int rep) throws HL7Exception { 
755            return (ID) super.removeRepetition(6, rep);
756        }
757    
758    
759        /**
760         * Removes a repetition of
761         * QRF-6: "Which Date/Time Qualifier" at a specific index
762         *
763         * @param rep The repetition index (0-indexed)
764         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
765         */
766        public ID removeQrf6_WhichDateTimeQualifier(int rep) throws HL7Exception { 
767            return (ID) super.removeRepetition(6, rep);
768        }
769    
770    
771    
772        /**
773         * Returns all repetitions of Which Date/Time Status Qualifier (QRF-7).
774         */
775        public ID[] getWhichDateTimeStatusQualifier() {
776            ID[] ret = null;
777            try {
778                Type[] t = this.getField(7);  
779                ret = new ID[t.length];
780                for (int i = 0; i < ret.length; i++) {
781                    ret[i] = (ID)t[i];
782                }
783            } catch (ClassCastException cce) {
784                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
785                throw new RuntimeException(cce);
786            } catch (HL7Exception he) {
787                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
788                throw new RuntimeException(he);
789            }
790            return ret;
791        }
792    
793    
794        /**
795         * Returns a count of the current number of repetitions of Which Date/Time Status Qualifier (QRF-7).
796         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
797         * it will return zero.
798         */
799        public int getWhichDateTimeStatusQualifierReps() {
800            ID[] ret = null;
801            try {
802                Type[] t = this.getField(7);
803                return t.length;  
804            } catch (ClassCastException cce) {
805                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
806                throw new RuntimeException(cce);
807            } catch (HL7Exception he) {
808                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
809                throw new RuntimeException(he);
810            }
811        }
812    
813    
814        /**
815         * Returns a specific repetition of
816         * QRF-7: "Which Date/Time Status Qualifier" - creates it if necessary
817         *
818         * @param rep The repetition index (0-indexed)
819         */
820        public ID getWhichDateTimeStatusQualifier(int rep) { 
821            ID ret = null;
822            try {
823                Type t = this.getField(7, rep);
824                ret = (ID)t;
825            } catch (ClassCastException cce) {
826                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
827                throw new RuntimeException(cce);
828            } catch (HL7Exception he) {
829                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
830                throw new RuntimeException(he);
831            }
832            return ret;
833        }
834    
835        /**
836         * Returns a specific repetition of
837         * QRF-7: "Which Date/Time Status Qualifier" - creates it if necessary
838         *
839         * @param rep The repetition index (0-indexed)
840         */
841        public ID getQrf7_WhichDateTimeStatusQualifier(int rep) { 
842            ID ret = null;
843            try {
844                Type t = this.getField(7, rep);
845                ret = (ID)t;
846            } catch (ClassCastException cce) {
847                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
848                throw new RuntimeException(cce);
849            } catch (HL7Exception he) {
850                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
851                throw new RuntimeException(he);
852            }
853            return ret;
854        }
855    
856    
857        /**
858         * Returns a count of the current number of repetitions of Which Date/Time Status Qualifier (QRF-7).
859         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
860         * it will return zero.
861         */
862        public int getQrf7_WhichDateTimeStatusQualifierReps() {
863            ID[] ret = null;
864            try {
865                Type[] t = this.getField(7);
866                return t.length;  
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        }
875    
876    
877    
878        /**
879         * Inserts a repetition of
880         * QRF-7: "Which Date/Time Status Qualifier" at a specific index
881         *
882         * @param rep The repetition index (0-indexed)
883         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
884         */
885        public ID insertWhichDateTimeStatusQualifier(int rep) throws HL7Exception { 
886            return (ID) super.insertRepetition(7, rep);
887        }
888    
889    
890    
891        /**
892         * Inserts a repetition of
893         * QRF-7: "Which Date/Time Status Qualifier" at a specific index
894         *
895         * @param rep The repetition index (0-indexed)
896         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
897         */
898        public ID insertQrf7_WhichDateTimeStatusQualifier(int rep) throws HL7Exception { 
899            return (ID) super.insertRepetition(7, rep);
900        }
901    
902    
903        /**
904         * Removes a repetition of
905         * QRF-7: "Which Date/Time Status Qualifier" at a specific index
906         *
907         * @param rep The repetition index (0-indexed)
908         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
909         */
910        public ID removeWhichDateTimeStatusQualifier(int rep) throws HL7Exception { 
911            return (ID) super.removeRepetition(7, rep);
912        }
913    
914    
915        /**
916         * Removes a repetition of
917         * QRF-7: "Which Date/Time Status Qualifier" at a specific index
918         *
919         * @param rep The repetition index (0-indexed)
920         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
921         */
922        public ID removeQrf7_WhichDateTimeStatusQualifier(int rep) throws HL7Exception { 
923            return (ID) super.removeRepetition(7, rep);
924        }
925    
926    
927    
928        /**
929         * Returns all repetitions of Date/Time Selection Qualifier (QRF-8).
930         */
931        public ID[] getDateTimeSelectionQualifier() {
932            ID[] ret = null;
933            try {
934                Type[] t = this.getField(8);  
935                ret = new ID[t.length];
936                for (int i = 0; i < ret.length; i++) {
937                    ret[i] = (ID)t[i];
938                }
939            } catch (ClassCastException cce) {
940                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
941                throw new RuntimeException(cce);
942            } catch (HL7Exception he) {
943                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
944                throw new RuntimeException(he);
945            }
946            return ret;
947        }
948    
949    
950        /**
951         * Returns a count of the current number of repetitions of Date/Time Selection Qualifier (QRF-8).
952         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
953         * it will return zero.
954         */
955        public int getDateTimeSelectionQualifierReps() {
956            ID[] ret = null;
957            try {
958                Type[] t = this.getField(8);
959                return t.length;  
960            } catch (ClassCastException cce) {
961                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
962                throw new RuntimeException(cce);
963            } catch (HL7Exception he) {
964                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
965                throw new RuntimeException(he);
966            }
967        }
968    
969    
970        /**
971         * Returns a specific repetition of
972         * QRF-8: "Date/Time Selection Qualifier" - creates it if necessary
973         *
974         * @param rep The repetition index (0-indexed)
975         */
976        public ID getDateTimeSelectionQualifier(int rep) { 
977            ID ret = null;
978            try {
979                Type t = this.getField(8, rep);
980                ret = (ID)t;
981            } catch (ClassCastException cce) {
982                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
983                throw new RuntimeException(cce);
984            } catch (HL7Exception he) {
985                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
986                throw new RuntimeException(he);
987            }
988            return ret;
989        }
990    
991        /**
992         * Returns a specific repetition of
993         * QRF-8: "Date/Time Selection Qualifier" - creates it if necessary
994         *
995         * @param rep The repetition index (0-indexed)
996         */
997        public ID getQrf8_DateTimeSelectionQualifier(int rep) { 
998            ID ret = null;
999            try {
1000                Type t = this.getField(8, rep);
1001                ret = (ID)t;
1002            } catch (ClassCastException cce) {
1003                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1004                throw new RuntimeException(cce);
1005            } catch (HL7Exception he) {
1006                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1007                throw new RuntimeException(he);
1008            }
1009            return ret;
1010        }
1011    
1012    
1013        /**
1014         * Returns a count of the current number of repetitions of Date/Time Selection Qualifier (QRF-8).
1015         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1016         * it will return zero.
1017         */
1018        public int getQrf8_DateTimeSelectionQualifierReps() {
1019            ID[] ret = null;
1020            try {
1021                Type[] t = this.getField(8);
1022                return t.length;  
1023            } catch (ClassCastException cce) {
1024                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1025                throw new RuntimeException(cce);
1026            } catch (HL7Exception he) {
1027                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1028                throw new RuntimeException(he);
1029            }
1030        }
1031    
1032    
1033    
1034        /**
1035         * Inserts a repetition of
1036         * QRF-8: "Date/Time Selection Qualifier" at a specific index
1037         *
1038         * @param rep The repetition index (0-indexed)
1039         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1040         */
1041        public ID insertDateTimeSelectionQualifier(int rep) throws HL7Exception { 
1042            return (ID) super.insertRepetition(8, rep);
1043        }
1044    
1045    
1046    
1047        /**
1048         * Inserts a repetition of
1049         * QRF-8: "Date/Time Selection Qualifier" at a specific index
1050         *
1051         * @param rep The repetition index (0-indexed)
1052         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1053         */
1054        public ID insertQrf8_DateTimeSelectionQualifier(int rep) throws HL7Exception { 
1055            return (ID) super.insertRepetition(8, rep);
1056        }
1057    
1058    
1059        /**
1060         * Removes a repetition of
1061         * QRF-8: "Date/Time Selection Qualifier" at a specific index
1062         *
1063         * @param rep The repetition index (0-indexed)
1064         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1065         */
1066        public ID removeDateTimeSelectionQualifier(int rep) throws HL7Exception { 
1067            return (ID) super.removeRepetition(8, rep);
1068        }
1069    
1070    
1071        /**
1072         * Removes a repetition of
1073         * QRF-8: "Date/Time Selection Qualifier" at a specific index
1074         *
1075         * @param rep The repetition index (0-indexed)
1076         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1077         */
1078        public ID removeQrf8_DateTimeSelectionQualifier(int rep) throws HL7Exception { 
1079            return (ID) super.removeRepetition(8, rep);
1080        }
1081    
1082    
1083    
1084    
1085        /**
1086         * Returns
1087         * QRF-9: "When Quantity/Timing Qualifier" - creates it if necessary
1088         */
1089        public TQ getWhenQuantityTimingQualifier() { 
1090            TQ ret = null;
1091            try {
1092                Type t = this.getField(9, 0);
1093                ret = (TQ)t;
1094            } catch (ClassCastException cce) {
1095                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1096                throw new RuntimeException(cce);
1097            } catch (HL7Exception he) {
1098                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1099                throw new RuntimeException(he);
1100            }
1101            return ret;
1102        }
1103    
1104    
1105        /**
1106         * Returns
1107         * QRF-9: "When Quantity/Timing Qualifier" - creates it if necessary
1108         */
1109        public TQ getQrf9_WhenQuantityTimingQualifier() { 
1110            TQ ret = null;
1111            try {
1112                Type t = this.getField(9, 0);
1113                ret = (TQ)t;
1114            } catch (ClassCastException cce) {
1115                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1116                throw new RuntimeException(cce);
1117            } catch (HL7Exception he) {
1118                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1119                throw new RuntimeException(he);
1120            }
1121            return ret;
1122        }
1123    
1124    
1125    
1126        /**
1127         * Returns
1128         * QRF-10: "Search Confidence Threshold" - creates it if necessary
1129         */
1130        public NM getSearchConfidenceThreshold() { 
1131            NM ret = null;
1132            try {
1133                Type t = this.getField(10, 0);
1134                ret = (NM)t;
1135            } catch (ClassCastException cce) {
1136                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1137                throw new RuntimeException(cce);
1138            } catch (HL7Exception he) {
1139                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1140                throw new RuntimeException(he);
1141            }
1142            return ret;
1143        }
1144    
1145    
1146        /**
1147         * Returns
1148         * QRF-10: "Search Confidence Threshold" - creates it if necessary
1149         */
1150        public NM getQrf10_SearchConfidenceThreshold() { 
1151            NM ret = null;
1152            try {
1153                Type t = this.getField(10, 0);
1154                ret = (NM)t;
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    
1168    
1169        /** {@inheritDoc} */   
1170        protected Type createNewTypeWithoutReflection(int field) {
1171           switch (field) {
1172              case 0: return new ST(getMessage());
1173              case 1: return new TS(getMessage());
1174              case 2: return new TS(getMessage());
1175              case 3: return new ST(getMessage());
1176              case 4: return new ST(getMessage());
1177              case 5: return new ID(getMessage(), new Integer( 156 ));
1178              case 6: return new ID(getMessage(), new Integer( 157 ));
1179              case 7: return new ID(getMessage(), new Integer( 158 ));
1180              case 8: return new TQ(getMessage());
1181              case 9: return new NM(getMessage());
1182              default: return null;
1183           }
1184       }
1185    
1186    
1187    }
1188