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