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