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.v231.segment;
009    
010    // import ca.uhn.hl7v2.model.v231.group.*;
011    import ca.uhn.hl7v2.model.v231.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 PV1 message segment (PV1 - patient visit segment-). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>PV1-1: Set ID - PV1 (SI) <b>optional </b>
027         * <li>PV1-2: Patient Class (IS) <b> </b>
028         * <li>PV1-3: Assigned Patient Location (PL) <b>optional </b>
029         * <li>PV1-4: Admission Type (IS) <b>optional </b>
030         * <li>PV1-5: Preadmit Number (CX) <b>optional </b>
031         * <li>PV1-6: Prior Patient Location (PL) <b>optional </b>
032         * <li>PV1-7: Attending Doctor (XCN) <b>optional repeating</b>
033         * <li>PV1-8: Referring Doctor (XCN) <b>optional repeating</b>
034         * <li>PV1-9: Consulting Doctor (XCN) <b>optional repeating</b>
035         * <li>PV1-10: Hospital Service (IS) <b>optional </b>
036         * <li>PV1-11: Temporary Location (PL) <b>optional </b>
037         * <li>PV1-12: Preadmit Test Indicator (IS) <b>optional </b>
038         * <li>PV1-13: Re-admission Indicator (IS) <b>optional </b>
039         * <li>PV1-14: Admit Source (IS) <b>optional </b>
040         * <li>PV1-15: Ambulatory Status (IS) <b>optional repeating</b>
041         * <li>PV1-16: VIP Indicator (IS) <b>optional </b>
042         * <li>PV1-17: Admitting Doctor (XCN) <b>optional repeating</b>
043         * <li>PV1-18: Patient Type (IS) <b>optional </b>
044         * <li>PV1-19: Visit Number (CX) <b>optional </b>
045         * <li>PV1-20: Financial Class (FC) <b>optional repeating</b>
046         * <li>PV1-21: Charge Price Indicator (IS) <b>optional </b>
047         * <li>PV1-22: Courtesy Code (IS) <b>optional </b>
048         * <li>PV1-23: Credit Rating (IS) <b>optional </b>
049         * <li>PV1-24: Contract Code (IS) <b>optional repeating</b>
050         * <li>PV1-25: Contract Effective Date (DT) <b>optional repeating</b>
051         * <li>PV1-26: Contract Amount (NM) <b>optional repeating</b>
052         * <li>PV1-27: Contract Period (NM) <b>optional repeating</b>
053         * <li>PV1-28: Interest Code (IS) <b>optional </b>
054         * <li>PV1-29: Transfer to Bad Debt Code (IS) <b>optional </b>
055         * <li>PV1-30: Transfer to Bad Debt Date (DT) <b>optional </b>
056         * <li>PV1-31: Bad Debt Agency Code (IS) <b>optional </b>
057         * <li>PV1-32: Bad Debt Transfer Amount (NM) <b>optional </b>
058         * <li>PV1-33: Bad Debt Recovery Amount (NM) <b>optional </b>
059         * <li>PV1-34: Delete Account Indicator (IS) <b>optional </b>
060         * <li>PV1-35: Delete Account Date (DT) <b>optional </b>
061         * <li>PV1-36: Discharge Disposition (IS) <b>optional </b>
062         * <li>PV1-37: Discharged to Location (DLD) <b>optional </b>
063         * <li>PV1-38: Diet Type (CE) <b>optional </b>
064         * <li>PV1-39: Servicing Facility (IS) <b>optional </b>
065         * <li>PV1-40: Bed Status (IS) <b>optional </b>
066         * <li>PV1-41: Account Status (IS) <b>optional </b>
067         * <li>PV1-42: Pending Location (PL) <b>optional </b>
068         * <li>PV1-43: Prior Temporary Location (PL) <b>optional </b>
069         * <li>PV1-44: Admit Date/Time (TS) <b>optional </b>
070         * <li>PV1-45: Discharge Date/Time (TS) <b>optional </b>
071         * <li>PV1-46: Current Patient Balance (NM) <b>optional </b>
072         * <li>PV1-47: Total Charges (NM) <b>optional </b>
073         * <li>PV1-48: Total Adjustments (NM) <b>optional </b>
074         * <li>PV1-49: Total Payments (NM) <b>optional </b>
075         * <li>PV1-50: Alternate Visit ID (CX) <b>optional </b>
076         * <li>PV1-51: Visit Indicator (IS) <b>optional </b>
077         * <li>PV1-52: Other Healthcare Provider (XCN) <b>optional repeating</b>
078     * </ul>
079     */
080    public class PV1 extends AbstractSegment {
081    
082        /** 
083         * Creates a new PV1 segment
084         */
085        public PV1(Group parent, ModelClassFactory factory) {
086           super(parent, factory);
087           init(factory);
088        }
089    
090        private void init(ModelClassFactory factory) {
091           try {
092                                      this.add(SI.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Set ID - PV1");
093                                      this.add(IS.class, true, 1, 1, new Object[]{ getMessage() }, "Patient Class");
094                                      this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "Assigned Patient Location");
095                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Admission Type");
096                                      this.add(CX.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Preadmit Number");
097                                      this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "Prior Patient Location");
098                                      this.add(XCN.class, false, 0, 60, new Object[]{ getMessage(), new Integer(10) }, "Attending Doctor");
099                                      this.add(XCN.class, false, 0, 60, new Object[]{ getMessage(), new Integer(10) }, "Referring Doctor");
100                                      this.add(XCN.class, false, 0, 60, new Object[]{ getMessage(), new Integer(10) }, "Consulting Doctor");
101                                      this.add(IS.class, false, 1, 3, new Object[]{ getMessage() }, "Hospital Service");
102                                      this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "Temporary Location");
103                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Preadmit Test Indicator");
104                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Re-admission Indicator");
105                                      this.add(IS.class, false, 1, 3, new Object[]{ getMessage() }, "Admit Source");
106                                      this.add(IS.class, false, 0, 2, new Object[]{ getMessage() }, "Ambulatory Status");
107                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "VIP Indicator");
108                                      this.add(XCN.class, false, 0, 60, new Object[]{ getMessage(), new Integer(10) }, "Admitting Doctor");
109                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Patient Type");
110                                      this.add(CX.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Visit Number");
111                                      this.add(FC.class, false, 0, 50, new Object[]{ getMessage(), new Integer(64) }, "Financial Class");
112                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Charge Price Indicator");
113                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Courtesy Code");
114                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Credit Rating");
115                                      this.add(IS.class, false, 0, 2, new Object[]{ getMessage() }, "Contract Code");
116                                      this.add(DT.class, false, 0, 8, new Object[]{ getMessage(), new Integer(0) }, "Contract Effective Date");
117                                      this.add(NM.class, false, 0, 12, new Object[]{ getMessage(), new Integer(0) }, "Contract Amount");
118                                      this.add(NM.class, false, 0, 3, new Object[]{ getMessage(), new Integer(0) }, "Contract Period");
119                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Interest Code");
120                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Transfer to Bad Debt Code");
121                                      this.add(DT.class, false, 1, 8, new Object[]{ getMessage(), new Integer(0) }, "Transfer to Bad Debt Date");
122                                      this.add(IS.class, false, 1, 10, new Object[]{ getMessage() }, "Bad Debt Agency Code");
123                                      this.add(NM.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Bad Debt Transfer Amount");
124                                      this.add(NM.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Bad Debt Recovery Amount");
125                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Delete Account Indicator");
126                                      this.add(DT.class, false, 1, 8, new Object[]{ getMessage(), new Integer(0) }, "Delete Account Date");
127                                      this.add(IS.class, false, 1, 3, new Object[]{ getMessage() }, "Discharge Disposition");
128                                      this.add(DLD.class, false, 1, 25, new Object[]{ getMessage(), new Integer(113) }, "Discharged to Location");
129                                      this.add(CE.class, false, 1, 80, new Object[]{ getMessage(), new Integer(114) }, "Diet Type");
130                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Servicing Facility");
131                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Bed Status");
132                                      this.add(IS.class, false, 1, 2, new Object[]{ getMessage() }, "Account Status");
133                                      this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "Pending Location");
134                                      this.add(PL.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "Prior Temporary Location");
135                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Admit Date/Time");
136                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Discharge Date/Time");
137                                      this.add(NM.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Current Patient Balance");
138                                      this.add(NM.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Total Charges");
139                                      this.add(NM.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Total Adjustments");
140                                      this.add(NM.class, false, 1, 12, new Object[]{ getMessage(), new Integer(0) }, "Total Payments");
141                                      this.add(CX.class, false, 1, 20, new Object[]{ getMessage(), new Integer(203) }, "Alternate Visit ID");
142                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Visit Indicator");
143                                      this.add(XCN.class, false, 0, 60, new Object[]{ getMessage(), new Integer(10) }, "Other Healthcare Provider");
144           } catch(HL7Exception e) {
145              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PV1 - this is probably a bug in the source code generator.", e);
146           }
147        }
148    
149    
150    
151        /**
152         * Returns
153         * PV1-1: "Set ID - PV1" - creates it if necessary
154         */
155        public SI getSetIDPV1() { 
156            SI ret = null;
157            try {
158                Type t = this.getField(1, 0);
159                ret = (SI)t;
160            } catch (ClassCastException cce) {
161                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
162                throw new RuntimeException(cce);
163            } catch (HL7Exception he) {
164                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
165                throw new RuntimeException(he);
166            }
167            return ret;
168        }
169    
170    
171        /**
172         * Returns
173         * PV1-1: "Set ID - PV1" - creates it if necessary
174         */
175        public SI getPv11_SetIDPV1() { 
176            SI ret = null;
177            try {
178                Type t = this.getField(1, 0);
179                ret = (SI)t;
180            } catch (ClassCastException cce) {
181                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
182                throw new RuntimeException(cce);
183            } catch (HL7Exception he) {
184                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
185                throw new RuntimeException(he);
186            }
187            return ret;
188        }
189    
190    
191    
192        /**
193         * Returns
194         * PV1-2: "Patient Class" - creates it if necessary
195         */
196        public IS getPatientClass() { 
197            IS ret = null;
198            try {
199                Type t = this.getField(2, 0);
200                ret = (IS)t;
201            } catch (ClassCastException cce) {
202                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
203                throw new RuntimeException(cce);
204            } catch (HL7Exception he) {
205                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
206                throw new RuntimeException(he);
207            }
208            return ret;
209        }
210    
211    
212        /**
213         * Returns
214         * PV1-2: "Patient Class" - creates it if necessary
215         */
216        public IS getPv12_PatientClass() { 
217            IS ret = null;
218            try {
219                Type t = this.getField(2, 0);
220                ret = (IS)t;
221            } catch (ClassCastException cce) {
222                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
223                throw new RuntimeException(cce);
224            } catch (HL7Exception he) {
225                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
226                throw new RuntimeException(he);
227            }
228            return ret;
229        }
230    
231    
232    
233        /**
234         * Returns
235         * PV1-3: "Assigned Patient Location" - creates it if necessary
236         */
237        public PL getAssignedPatientLocation() { 
238            PL ret = null;
239            try {
240                Type t = this.getField(3, 0);
241                ret = (PL)t;
242            } catch (ClassCastException cce) {
243                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
244                throw new RuntimeException(cce);
245            } catch (HL7Exception he) {
246                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
247                throw new RuntimeException(he);
248            }
249            return ret;
250        }
251    
252    
253        /**
254         * Returns
255         * PV1-3: "Assigned Patient Location" - creates it if necessary
256         */
257        public PL getPv13_AssignedPatientLocation() { 
258            PL ret = null;
259            try {
260                Type t = this.getField(3, 0);
261                ret = (PL)t;
262            } catch (ClassCastException cce) {
263                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
264                throw new RuntimeException(cce);
265            } catch (HL7Exception he) {
266                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
267                throw new RuntimeException(he);
268            }
269            return ret;
270        }
271    
272    
273    
274        /**
275         * Returns
276         * PV1-4: "Admission Type" - creates it if necessary
277         */
278        public IS getAdmissionType() { 
279            IS ret = null;
280            try {
281                Type t = this.getField(4, 0);
282                ret = (IS)t;
283            } catch (ClassCastException cce) {
284                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
285                throw new RuntimeException(cce);
286            } catch (HL7Exception he) {
287                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
288                throw new RuntimeException(he);
289            }
290            return ret;
291        }
292    
293    
294        /**
295         * Returns
296         * PV1-4: "Admission Type" - creates it if necessary
297         */
298        public IS getPv14_AdmissionType() { 
299            IS ret = null;
300            try {
301                Type t = this.getField(4, 0);
302                ret = (IS)t;
303            } catch (ClassCastException cce) {
304                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
305                throw new RuntimeException(cce);
306            } catch (HL7Exception he) {
307                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
308                throw new RuntimeException(he);
309            }
310            return ret;
311        }
312    
313    
314    
315        /**
316         * Returns
317         * PV1-5: "Preadmit Number" - creates it if necessary
318         */
319        public CX getPreadmitNumber() { 
320            CX ret = null;
321            try {
322                Type t = this.getField(5, 0);
323                ret = (CX)t;
324            } catch (ClassCastException cce) {
325                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
326                throw new RuntimeException(cce);
327            } catch (HL7Exception he) {
328                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
329                throw new RuntimeException(he);
330            }
331            return ret;
332        }
333    
334    
335        /**
336         * Returns
337         * PV1-5: "Preadmit Number" - creates it if necessary
338         */
339        public CX getPv15_PreadmitNumber() { 
340            CX ret = null;
341            try {
342                Type t = this.getField(5, 0);
343                ret = (CX)t;
344            } catch (ClassCastException cce) {
345                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
346                throw new RuntimeException(cce);
347            } catch (HL7Exception he) {
348                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
349                throw new RuntimeException(he);
350            }
351            return ret;
352        }
353    
354    
355    
356        /**
357         * Returns
358         * PV1-6: "Prior Patient Location" - creates it if necessary
359         */
360        public PL getPriorPatientLocation() { 
361            PL ret = null;
362            try {
363                Type t = this.getField(6, 0);
364                ret = (PL)t;
365            } catch (ClassCastException cce) {
366                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
367                throw new RuntimeException(cce);
368            } catch (HL7Exception he) {
369                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
370                throw new RuntimeException(he);
371            }
372            return ret;
373        }
374    
375    
376        /**
377         * Returns
378         * PV1-6: "Prior Patient Location" - creates it if necessary
379         */
380        public PL getPv16_PriorPatientLocation() { 
381            PL ret = null;
382            try {
383                Type t = this.getField(6, 0);
384                ret = (PL)t;
385            } catch (ClassCastException cce) {
386                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
387                throw new RuntimeException(cce);
388            } catch (HL7Exception he) {
389                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
390                throw new RuntimeException(he);
391            }
392            return ret;
393        }
394    
395    
396        /**
397         * Returns all repetitions of Attending Doctor (PV1-7).
398         */
399        public XCN[] getAttendingDoctor() {
400            XCN[] ret = null;
401            try {
402                Type[] t = this.getField(7);  
403                ret = new XCN[t.length];
404                for (int i = 0; i < ret.length; i++) {
405                    ret[i] = (XCN)t[i];
406                }
407            } catch (ClassCastException cce) {
408                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
409                throw new RuntimeException(cce);
410            } catch (HL7Exception he) {
411                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
412                throw new RuntimeException(he);
413            }
414            return ret;
415        }
416    
417    
418        /**
419         * Returns a count of the current number of repetitions of Attending Doctor (PV1-7).
420         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
421         * it will return zero.
422         */
423        public int getAttendingDoctorReps() {
424            XCN[] ret = null;
425            try {
426                Type[] t = this.getField(7);
427                return t.length;  
428            } catch (ClassCastException cce) {
429                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
430                throw new RuntimeException(cce);
431            } catch (HL7Exception he) {
432                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
433                throw new RuntimeException(he);
434            }
435        }
436    
437    
438        /**
439         * Returns a specific repetition of
440         * PV1-7: "Attending Doctor" - creates it if necessary
441         *
442         * @param rep The repetition index (0-indexed)
443         */
444        public XCN getAttendingDoctor(int rep) { 
445            XCN ret = null;
446            try {
447                Type t = this.getField(7, rep);
448                ret = (XCN)t;
449            } catch (ClassCastException cce) {
450                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
451                throw new RuntimeException(cce);
452            } catch (HL7Exception he) {
453                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
454                throw new RuntimeException(he);
455            }
456            return ret;
457        }
458    
459        /**
460         * Returns a specific repetition of
461         * PV1-7: "Attending Doctor" - creates it if necessary
462         *
463         * @param rep The repetition index (0-indexed)
464         */
465        public XCN getPv17_AttendingDoctor(int rep) { 
466            XCN ret = null;
467            try {
468                Type t = this.getField(7, rep);
469                ret = (XCN)t;
470            } catch (ClassCastException cce) {
471                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
472                throw new RuntimeException(cce);
473            } catch (HL7Exception he) {
474                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
475                throw new RuntimeException(he);
476            }
477            return ret;
478        }
479    
480    
481        /**
482         * Returns a count of the current number of repetitions of Attending Doctor (PV1-7).
483         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
484         * it will return zero.
485         */
486        public int getPv17_AttendingDoctorReps() {
487            XCN[] ret = null;
488            try {
489                Type[] t = this.getField(7);
490                return t.length;  
491            } catch (ClassCastException cce) {
492                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
493                throw new RuntimeException(cce);
494            } catch (HL7Exception he) {
495                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
496                throw new RuntimeException(he);
497            }
498        }
499    
500    
501    
502        /**
503         * Inserts a repetition of
504         * PV1-7: "Attending Doctor" at a specific index
505         *
506         * @param rep The repetition index (0-indexed)
507         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
508         */
509        public XCN insertAttendingDoctor(int rep) throws HL7Exception { 
510            return (XCN) super.insertRepetition(7, rep);
511        }
512    
513    
514    
515        /**
516         * Inserts a repetition of
517         * PV1-7: "Attending Doctor" at a specific index
518         *
519         * @param rep The repetition index (0-indexed)
520         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
521         */
522        public XCN insertPv17_AttendingDoctor(int rep) throws HL7Exception { 
523            return (XCN) super.insertRepetition(7, rep);
524        }
525    
526    
527        /**
528         * Removes a repetition of
529         * PV1-7: "Attending Doctor" at a specific index
530         *
531         * @param rep The repetition index (0-indexed)
532         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
533         */
534        public XCN removeAttendingDoctor(int rep) throws HL7Exception { 
535            return (XCN) super.removeRepetition(7, rep);
536        }
537    
538    
539        /**
540         * Removes a repetition of
541         * PV1-7: "Attending Doctor" at a specific index
542         *
543         * @param rep The repetition index (0-indexed)
544         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
545         */
546        public XCN removePv17_AttendingDoctor(int rep) throws HL7Exception { 
547            return (XCN) super.removeRepetition(7, rep);
548        }
549    
550    
551    
552        /**
553         * Returns all repetitions of Referring Doctor (PV1-8).
554         */
555        public XCN[] getReferringDoctor() {
556            XCN[] ret = null;
557            try {
558                Type[] t = this.getField(8);  
559                ret = new XCN[t.length];
560                for (int i = 0; i < ret.length; i++) {
561                    ret[i] = (XCN)t[i];
562                }
563            } catch (ClassCastException cce) {
564                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
565                throw new RuntimeException(cce);
566            } catch (HL7Exception he) {
567                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
568                throw new RuntimeException(he);
569            }
570            return ret;
571        }
572    
573    
574        /**
575         * Returns a count of the current number of repetitions of Referring Doctor (PV1-8).
576         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
577         * it will return zero.
578         */
579        public int getReferringDoctorReps() {
580            XCN[] ret = null;
581            try {
582                Type[] t = this.getField(8);
583                return t.length;  
584            } catch (ClassCastException cce) {
585                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
586                throw new RuntimeException(cce);
587            } catch (HL7Exception he) {
588                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
589                throw new RuntimeException(he);
590            }
591        }
592    
593    
594        /**
595         * Returns a specific repetition of
596         * PV1-8: "Referring Doctor" - creates it if necessary
597         *
598         * @param rep The repetition index (0-indexed)
599         */
600        public XCN getReferringDoctor(int rep) { 
601            XCN ret = null;
602            try {
603                Type t = this.getField(8, rep);
604                ret = (XCN)t;
605            } catch (ClassCastException cce) {
606                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
607                throw new RuntimeException(cce);
608            } catch (HL7Exception he) {
609                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
610                throw new RuntimeException(he);
611            }
612            return ret;
613        }
614    
615        /**
616         * Returns a specific repetition of
617         * PV1-8: "Referring Doctor" - creates it if necessary
618         *
619         * @param rep The repetition index (0-indexed)
620         */
621        public XCN getPv18_ReferringDoctor(int rep) { 
622            XCN ret = null;
623            try {
624                Type t = this.getField(8, rep);
625                ret = (XCN)t;
626            } catch (ClassCastException cce) {
627                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
628                throw new RuntimeException(cce);
629            } catch (HL7Exception he) {
630                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
631                throw new RuntimeException(he);
632            }
633            return ret;
634        }
635    
636    
637        /**
638         * Returns a count of the current number of repetitions of Referring Doctor (PV1-8).
639         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
640         * it will return zero.
641         */
642        public int getPv18_ReferringDoctorReps() {
643            XCN[] ret = null;
644            try {
645                Type[] t = this.getField(8);
646                return t.length;  
647            } catch (ClassCastException cce) {
648                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
649                throw new RuntimeException(cce);
650            } catch (HL7Exception he) {
651                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
652                throw new RuntimeException(he);
653            }
654        }
655    
656    
657    
658        /**
659         * Inserts a repetition of
660         * PV1-8: "Referring Doctor" at a specific index
661         *
662         * @param rep The repetition index (0-indexed)
663         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
664         */
665        public XCN insertReferringDoctor(int rep) throws HL7Exception { 
666            return (XCN) super.insertRepetition(8, rep);
667        }
668    
669    
670    
671        /**
672         * Inserts a repetition of
673         * PV1-8: "Referring Doctor" at a specific index
674         *
675         * @param rep The repetition index (0-indexed)
676         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
677         */
678        public XCN insertPv18_ReferringDoctor(int rep) throws HL7Exception { 
679            return (XCN) super.insertRepetition(8, rep);
680        }
681    
682    
683        /**
684         * Removes a repetition of
685         * PV1-8: "Referring Doctor" at a specific index
686         *
687         * @param rep The repetition index (0-indexed)
688         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
689         */
690        public XCN removeReferringDoctor(int rep) throws HL7Exception { 
691            return (XCN) super.removeRepetition(8, rep);
692        }
693    
694    
695        /**
696         * Removes a repetition of
697         * PV1-8: "Referring Doctor" at a specific index
698         *
699         * @param rep The repetition index (0-indexed)
700         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
701         */
702        public XCN removePv18_ReferringDoctor(int rep) throws HL7Exception { 
703            return (XCN) super.removeRepetition(8, rep);
704        }
705    
706    
707    
708        /**
709         * Returns all repetitions of Consulting Doctor (PV1-9).
710         */
711        public XCN[] getConsultingDoctor() {
712            XCN[] ret = null;
713            try {
714                Type[] t = this.getField(9);  
715                ret = new XCN[t.length];
716                for (int i = 0; i < ret.length; i++) {
717                    ret[i] = (XCN)t[i];
718                }
719            } catch (ClassCastException cce) {
720                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
721                throw new RuntimeException(cce);
722            } catch (HL7Exception he) {
723                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
724                throw new RuntimeException(he);
725            }
726            return ret;
727        }
728    
729    
730        /**
731         * Returns a count of the current number of repetitions of Consulting Doctor (PV1-9).
732         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
733         * it will return zero.
734         */
735        public int getConsultingDoctorReps() {
736            XCN[] ret = null;
737            try {
738                Type[] t = this.getField(9);
739                return t.length;  
740            } catch (ClassCastException cce) {
741                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
742                throw new RuntimeException(cce);
743            } catch (HL7Exception he) {
744                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
745                throw new RuntimeException(he);
746            }
747        }
748    
749    
750        /**
751         * Returns a specific repetition of
752         * PV1-9: "Consulting Doctor" - creates it if necessary
753         *
754         * @param rep The repetition index (0-indexed)
755         */
756        public XCN getConsultingDoctor(int rep) { 
757            XCN ret = null;
758            try {
759                Type t = this.getField(9, rep);
760                ret = (XCN)t;
761            } catch (ClassCastException cce) {
762                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
763                throw new RuntimeException(cce);
764            } catch (HL7Exception he) {
765                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
766                throw new RuntimeException(he);
767            }
768            return ret;
769        }
770    
771        /**
772         * Returns a specific repetition of
773         * PV1-9: "Consulting Doctor" - creates it if necessary
774         *
775         * @param rep The repetition index (0-indexed)
776         */
777        public XCN getPv19_ConsultingDoctor(int rep) { 
778            XCN ret = null;
779            try {
780                Type t = this.getField(9, rep);
781                ret = (XCN)t;
782            } catch (ClassCastException cce) {
783                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
784                throw new RuntimeException(cce);
785            } catch (HL7Exception he) {
786                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
787                throw new RuntimeException(he);
788            }
789            return ret;
790        }
791    
792    
793        /**
794         * Returns a count of the current number of repetitions of Consulting Doctor (PV1-9).
795         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
796         * it will return zero.
797         */
798        public int getPv19_ConsultingDoctorReps() {
799            XCN[] ret = null;
800            try {
801                Type[] t = this.getField(9);
802                return t.length;  
803            } catch (ClassCastException cce) {
804                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
805                throw new RuntimeException(cce);
806            } catch (HL7Exception he) {
807                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
808                throw new RuntimeException(he);
809            }
810        }
811    
812    
813    
814        /**
815         * Inserts a repetition of
816         * PV1-9: "Consulting Doctor" at a specific index
817         *
818         * @param rep The repetition index (0-indexed)
819         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
820         */
821        public XCN insertConsultingDoctor(int rep) throws HL7Exception { 
822            return (XCN) super.insertRepetition(9, rep);
823        }
824    
825    
826    
827        /**
828         * Inserts a repetition of
829         * PV1-9: "Consulting Doctor" at a specific index
830         *
831         * @param rep The repetition index (0-indexed)
832         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
833         */
834        public XCN insertPv19_ConsultingDoctor(int rep) throws HL7Exception { 
835            return (XCN) super.insertRepetition(9, rep);
836        }
837    
838    
839        /**
840         * Removes a repetition of
841         * PV1-9: "Consulting Doctor" at a specific index
842         *
843         * @param rep The repetition index (0-indexed)
844         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
845         */
846        public XCN removeConsultingDoctor(int rep) throws HL7Exception { 
847            return (XCN) super.removeRepetition(9, rep);
848        }
849    
850    
851        /**
852         * Removes a repetition of
853         * PV1-9: "Consulting Doctor" at a specific index
854         *
855         * @param rep The repetition index (0-indexed)
856         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
857         */
858        public XCN removePv19_ConsultingDoctor(int rep) throws HL7Exception { 
859            return (XCN) super.removeRepetition(9, rep);
860        }
861    
862    
863    
864    
865        /**
866         * Returns
867         * PV1-10: "Hospital Service" - creates it if necessary
868         */
869        public IS getHospitalService() { 
870            IS ret = null;
871            try {
872                Type t = this.getField(10, 0);
873                ret = (IS)t;
874            } catch (ClassCastException cce) {
875                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
876                throw new RuntimeException(cce);
877            } catch (HL7Exception he) {
878                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
879                throw new RuntimeException(he);
880            }
881            return ret;
882        }
883    
884    
885        /**
886         * Returns
887         * PV1-10: "Hospital Service" - creates it if necessary
888         */
889        public IS getPv110_HospitalService() { 
890            IS ret = null;
891            try {
892                Type t = this.getField(10, 0);
893                ret = (IS)t;
894            } catch (ClassCastException cce) {
895                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
896                throw new RuntimeException(cce);
897            } catch (HL7Exception he) {
898                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
899                throw new RuntimeException(he);
900            }
901            return ret;
902        }
903    
904    
905    
906        /**
907         * Returns
908         * PV1-11: "Temporary Location" - creates it if necessary
909         */
910        public PL getTemporaryLocation() { 
911            PL ret = null;
912            try {
913                Type t = this.getField(11, 0);
914                ret = (PL)t;
915            } catch (ClassCastException cce) {
916                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
917                throw new RuntimeException(cce);
918            } catch (HL7Exception he) {
919                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
920                throw new RuntimeException(he);
921            }
922            return ret;
923        }
924    
925    
926        /**
927         * Returns
928         * PV1-11: "Temporary Location" - creates it if necessary
929         */
930        public PL getPv111_TemporaryLocation() { 
931            PL ret = null;
932            try {
933                Type t = this.getField(11, 0);
934                ret = (PL)t;
935            } catch (ClassCastException cce) {
936                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
937                throw new RuntimeException(cce);
938            } catch (HL7Exception he) {
939                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
940                throw new RuntimeException(he);
941            }
942            return ret;
943        }
944    
945    
946    
947        /**
948         * Returns
949         * PV1-12: "Preadmit Test Indicator" - creates it if necessary
950         */
951        public IS getPreadmitTestIndicator() { 
952            IS ret = null;
953            try {
954                Type t = this.getField(12, 0);
955                ret = (IS)t;
956            } catch (ClassCastException cce) {
957                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
958                throw new RuntimeException(cce);
959            } catch (HL7Exception he) {
960                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
961                throw new RuntimeException(he);
962            }
963            return ret;
964        }
965    
966    
967        /**
968         * Returns
969         * PV1-12: "Preadmit Test Indicator" - creates it if necessary
970         */
971        public IS getPv112_PreadmitTestIndicator() { 
972            IS ret = null;
973            try {
974                Type t = this.getField(12, 0);
975                ret = (IS)t;
976            } catch (ClassCastException cce) {
977                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
978                throw new RuntimeException(cce);
979            } catch (HL7Exception he) {
980                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
981                throw new RuntimeException(he);
982            }
983            return ret;
984        }
985    
986    
987    
988        /**
989         * Returns
990         * PV1-13: "Re-admission Indicator" - creates it if necessary
991         */
992        public IS getReAdmissionIndicator() { 
993            IS ret = null;
994            try {
995                Type t = this.getField(13, 0);
996                ret = (IS)t;
997            } catch (ClassCastException cce) {
998                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
999                throw new RuntimeException(cce);
1000            } catch (HL7Exception he) {
1001                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1002                throw new RuntimeException(he);
1003            }
1004            return ret;
1005        }
1006    
1007    
1008        /**
1009         * Returns
1010         * PV1-13: "Re-admission Indicator" - creates it if necessary
1011         */
1012        public IS getPv113_ReAdmissionIndicator() { 
1013            IS ret = null;
1014            try {
1015                Type t = this.getField(13, 0);
1016                ret = (IS)t;
1017            } catch (ClassCastException cce) {
1018                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1019                throw new RuntimeException(cce);
1020            } catch (HL7Exception he) {
1021                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1022                throw new RuntimeException(he);
1023            }
1024            return ret;
1025        }
1026    
1027    
1028    
1029        /**
1030         * Returns
1031         * PV1-14: "Admit Source" - creates it if necessary
1032         */
1033        public IS getAdmitSource() { 
1034            IS ret = null;
1035            try {
1036                Type t = this.getField(14, 0);
1037                ret = (IS)t;
1038            } catch (ClassCastException cce) {
1039                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1040                throw new RuntimeException(cce);
1041            } catch (HL7Exception he) {
1042                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1043                throw new RuntimeException(he);
1044            }
1045            return ret;
1046        }
1047    
1048    
1049        /**
1050         * Returns
1051         * PV1-14: "Admit Source" - creates it if necessary
1052         */
1053        public IS getPv114_AdmitSource() { 
1054            IS ret = null;
1055            try {
1056                Type t = this.getField(14, 0);
1057                ret = (IS)t;
1058            } catch (ClassCastException cce) {
1059                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1060                throw new RuntimeException(cce);
1061            } catch (HL7Exception he) {
1062                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1063                throw new RuntimeException(he);
1064            }
1065            return ret;
1066        }
1067    
1068    
1069        /**
1070         * Returns all repetitions of Ambulatory Status (PV1-15).
1071         */
1072        public IS[] getAmbulatoryStatus() {
1073            IS[] ret = null;
1074            try {
1075                Type[] t = this.getField(15);  
1076                ret = new IS[t.length];
1077                for (int i = 0; i < ret.length; i++) {
1078                    ret[i] = (IS)t[i];
1079                }
1080            } catch (ClassCastException cce) {
1081                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1082                throw new RuntimeException(cce);
1083            } catch (HL7Exception he) {
1084                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1085                throw new RuntimeException(he);
1086            }
1087            return ret;
1088        }
1089    
1090    
1091        /**
1092         * Returns a count of the current number of repetitions of Ambulatory Status (PV1-15).
1093         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1094         * it will return zero.
1095         */
1096        public int getAmbulatoryStatusReps() {
1097            IS[] ret = null;
1098            try {
1099                Type[] t = this.getField(15);
1100                return t.length;  
1101            } catch (ClassCastException cce) {
1102                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1103                throw new RuntimeException(cce);
1104            } catch (HL7Exception he) {
1105                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1106                throw new RuntimeException(he);
1107            }
1108        }
1109    
1110    
1111        /**
1112         * Returns a specific repetition of
1113         * PV1-15: "Ambulatory Status" - creates it if necessary
1114         *
1115         * @param rep The repetition index (0-indexed)
1116         */
1117        public IS getAmbulatoryStatus(int rep) { 
1118            IS ret = null;
1119            try {
1120                Type t = this.getField(15, rep);
1121                ret = (IS)t;
1122            } catch (ClassCastException cce) {
1123                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1124                throw new RuntimeException(cce);
1125            } catch (HL7Exception he) {
1126                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1127                throw new RuntimeException(he);
1128            }
1129            return ret;
1130        }
1131    
1132        /**
1133         * Returns a specific repetition of
1134         * PV1-15: "Ambulatory Status" - creates it if necessary
1135         *
1136         * @param rep The repetition index (0-indexed)
1137         */
1138        public IS getPv115_AmbulatoryStatus(int rep) { 
1139            IS ret = null;
1140            try {
1141                Type t = this.getField(15, rep);
1142                ret = (IS)t;
1143            } catch (ClassCastException cce) {
1144                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1145                throw new RuntimeException(cce);
1146            } catch (HL7Exception he) {
1147                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1148                throw new RuntimeException(he);
1149            }
1150            return ret;
1151        }
1152    
1153    
1154        /**
1155         * Returns a count of the current number of repetitions of Ambulatory Status (PV1-15).
1156         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1157         * it will return zero.
1158         */
1159        public int getPv115_AmbulatoryStatusReps() {
1160            IS[] ret = null;
1161            try {
1162                Type[] t = this.getField(15);
1163                return t.length;  
1164            } catch (ClassCastException cce) {
1165                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1166                throw new RuntimeException(cce);
1167            } catch (HL7Exception he) {
1168                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1169                throw new RuntimeException(he);
1170            }
1171        }
1172    
1173    
1174    
1175        /**
1176         * Inserts a repetition of
1177         * PV1-15: "Ambulatory Status" at a specific index
1178         *
1179         * @param rep The repetition index (0-indexed)
1180         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1181         */
1182        public IS insertAmbulatoryStatus(int rep) throws HL7Exception { 
1183            return (IS) super.insertRepetition(15, rep);
1184        }
1185    
1186    
1187    
1188        /**
1189         * Inserts a repetition of
1190         * PV1-15: "Ambulatory Status" at a specific index
1191         *
1192         * @param rep The repetition index (0-indexed)
1193         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1194         */
1195        public IS insertPv115_AmbulatoryStatus(int rep) throws HL7Exception { 
1196            return (IS) super.insertRepetition(15, rep);
1197        }
1198    
1199    
1200        /**
1201         * Removes a repetition of
1202         * PV1-15: "Ambulatory Status" at a specific index
1203         *
1204         * @param rep The repetition index (0-indexed)
1205         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1206         */
1207        public IS removeAmbulatoryStatus(int rep) throws HL7Exception { 
1208            return (IS) super.removeRepetition(15, rep);
1209        }
1210    
1211    
1212        /**
1213         * Removes a repetition of
1214         * PV1-15: "Ambulatory Status" at a specific index
1215         *
1216         * @param rep The repetition index (0-indexed)
1217         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1218         */
1219        public IS removePv115_AmbulatoryStatus(int rep) throws HL7Exception { 
1220            return (IS) super.removeRepetition(15, rep);
1221        }
1222    
1223    
1224    
1225    
1226        /**
1227         * Returns
1228         * PV1-16: "VIP Indicator" - creates it if necessary
1229         */
1230        public IS getVIPIndicator() { 
1231            IS ret = null;
1232            try {
1233                Type t = this.getField(16, 0);
1234                ret = (IS)t;
1235            } catch (ClassCastException cce) {
1236                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1237                throw new RuntimeException(cce);
1238            } catch (HL7Exception he) {
1239                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1240                throw new RuntimeException(he);
1241            }
1242            return ret;
1243        }
1244    
1245    
1246        /**
1247         * Returns
1248         * PV1-16: "VIP Indicator" - creates it if necessary
1249         */
1250        public IS getPv116_VIPIndicator() { 
1251            IS ret = null;
1252            try {
1253                Type t = this.getField(16, 0);
1254                ret = (IS)t;
1255            } catch (ClassCastException cce) {
1256                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1257                throw new RuntimeException(cce);
1258            } catch (HL7Exception he) {
1259                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1260                throw new RuntimeException(he);
1261            }
1262            return ret;
1263        }
1264    
1265    
1266        /**
1267         * Returns all repetitions of Admitting Doctor (PV1-17).
1268         */
1269        public XCN[] getAdmittingDoctor() {
1270            XCN[] ret = null;
1271            try {
1272                Type[] t = this.getField(17);  
1273                ret = new XCN[t.length];
1274                for (int i = 0; i < ret.length; i++) {
1275                    ret[i] = (XCN)t[i];
1276                }
1277            } catch (ClassCastException cce) {
1278                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1279                throw new RuntimeException(cce);
1280            } catch (HL7Exception he) {
1281                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1282                throw new RuntimeException(he);
1283            }
1284            return ret;
1285        }
1286    
1287    
1288        /**
1289         * Returns a count of the current number of repetitions of Admitting Doctor (PV1-17).
1290         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1291         * it will return zero.
1292         */
1293        public int getAdmittingDoctorReps() {
1294            XCN[] ret = null;
1295            try {
1296                Type[] t = this.getField(17);
1297                return t.length;  
1298            } catch (ClassCastException cce) {
1299                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1300                throw new RuntimeException(cce);
1301            } catch (HL7Exception he) {
1302                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1303                throw new RuntimeException(he);
1304            }
1305        }
1306    
1307    
1308        /**
1309         * Returns a specific repetition of
1310         * PV1-17: "Admitting Doctor" - creates it if necessary
1311         *
1312         * @param rep The repetition index (0-indexed)
1313         */
1314        public XCN getAdmittingDoctor(int rep) { 
1315            XCN ret = null;
1316            try {
1317                Type t = this.getField(17, rep);
1318                ret = (XCN)t;
1319            } catch (ClassCastException cce) {
1320                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1321                throw new RuntimeException(cce);
1322            } catch (HL7Exception he) {
1323                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1324                throw new RuntimeException(he);
1325            }
1326            return ret;
1327        }
1328    
1329        /**
1330         * Returns a specific repetition of
1331         * PV1-17: "Admitting Doctor" - creates it if necessary
1332         *
1333         * @param rep The repetition index (0-indexed)
1334         */
1335        public XCN getPv117_AdmittingDoctor(int rep) { 
1336            XCN ret = null;
1337            try {
1338                Type t = this.getField(17, rep);
1339                ret = (XCN)t;
1340            } catch (ClassCastException cce) {
1341                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1342                throw new RuntimeException(cce);
1343            } catch (HL7Exception he) {
1344                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1345                throw new RuntimeException(he);
1346            }
1347            return ret;
1348        }
1349    
1350    
1351        /**
1352         * Returns a count of the current number of repetitions of Admitting Doctor (PV1-17).
1353         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1354         * it will return zero.
1355         */
1356        public int getPv117_AdmittingDoctorReps() {
1357            XCN[] ret = null;
1358            try {
1359                Type[] t = this.getField(17);
1360                return t.length;  
1361            } catch (ClassCastException cce) {
1362                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1363                throw new RuntimeException(cce);
1364            } catch (HL7Exception he) {
1365                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1366                throw new RuntimeException(he);
1367            }
1368        }
1369    
1370    
1371    
1372        /**
1373         * Inserts a repetition of
1374         * PV1-17: "Admitting Doctor" at a specific index
1375         *
1376         * @param rep The repetition index (0-indexed)
1377         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1378         */
1379        public XCN insertAdmittingDoctor(int rep) throws HL7Exception { 
1380            return (XCN) super.insertRepetition(17, rep);
1381        }
1382    
1383    
1384    
1385        /**
1386         * Inserts a repetition of
1387         * PV1-17: "Admitting Doctor" at a specific index
1388         *
1389         * @param rep The repetition index (0-indexed)
1390         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1391         */
1392        public XCN insertPv117_AdmittingDoctor(int rep) throws HL7Exception { 
1393            return (XCN) super.insertRepetition(17, rep);
1394        }
1395    
1396    
1397        /**
1398         * Removes a repetition of
1399         * PV1-17: "Admitting Doctor" at a specific index
1400         *
1401         * @param rep The repetition index (0-indexed)
1402         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1403         */
1404        public XCN removeAdmittingDoctor(int rep) throws HL7Exception { 
1405            return (XCN) super.removeRepetition(17, rep);
1406        }
1407    
1408    
1409        /**
1410         * Removes a repetition of
1411         * PV1-17: "Admitting Doctor" at a specific index
1412         *
1413         * @param rep The repetition index (0-indexed)
1414         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1415         */
1416        public XCN removePv117_AdmittingDoctor(int rep) throws HL7Exception { 
1417            return (XCN) super.removeRepetition(17, rep);
1418        }
1419    
1420    
1421    
1422    
1423        /**
1424         * Returns
1425         * PV1-18: "Patient Type" - creates it if necessary
1426         */
1427        public IS getPatientType() { 
1428            IS ret = null;
1429            try {
1430                Type t = this.getField(18, 0);
1431                ret = (IS)t;
1432            } catch (ClassCastException cce) {
1433                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1434                throw new RuntimeException(cce);
1435            } catch (HL7Exception he) {
1436                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1437                throw new RuntimeException(he);
1438            }
1439            return ret;
1440        }
1441    
1442    
1443        /**
1444         * Returns
1445         * PV1-18: "Patient Type" - creates it if necessary
1446         */
1447        public IS getPv118_PatientType() { 
1448            IS ret = null;
1449            try {
1450                Type t = this.getField(18, 0);
1451                ret = (IS)t;
1452            } catch (ClassCastException cce) {
1453                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1454                throw new RuntimeException(cce);
1455            } catch (HL7Exception he) {
1456                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1457                throw new RuntimeException(he);
1458            }
1459            return ret;
1460        }
1461    
1462    
1463    
1464        /**
1465         * Returns
1466         * PV1-19: "Visit Number" - creates it if necessary
1467         */
1468        public CX getVisitNumber() { 
1469            CX ret = null;
1470            try {
1471                Type t = this.getField(19, 0);
1472                ret = (CX)t;
1473            } catch (ClassCastException cce) {
1474                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1475                throw new RuntimeException(cce);
1476            } catch (HL7Exception he) {
1477                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1478                throw new RuntimeException(he);
1479            }
1480            return ret;
1481        }
1482    
1483    
1484        /**
1485         * Returns
1486         * PV1-19: "Visit Number" - creates it if necessary
1487         */
1488        public CX getPv119_VisitNumber() { 
1489            CX ret = null;
1490            try {
1491                Type t = this.getField(19, 0);
1492                ret = (CX)t;
1493            } catch (ClassCastException cce) {
1494                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1495                throw new RuntimeException(cce);
1496            } catch (HL7Exception he) {
1497                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1498                throw new RuntimeException(he);
1499            }
1500            return ret;
1501        }
1502    
1503    
1504        /**
1505         * Returns all repetitions of Financial Class (PV1-20).
1506         */
1507        public FC[] getFinancialClass() {
1508            FC[] ret = null;
1509            try {
1510                Type[] t = this.getField(20);  
1511                ret = new FC[t.length];
1512                for (int i = 0; i < ret.length; i++) {
1513                    ret[i] = (FC)t[i];
1514                }
1515            } catch (ClassCastException cce) {
1516                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1517                throw new RuntimeException(cce);
1518            } catch (HL7Exception he) {
1519                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1520                throw new RuntimeException(he);
1521            }
1522            return ret;
1523        }
1524    
1525    
1526        /**
1527         * Returns a count of the current number of repetitions of Financial Class (PV1-20).
1528         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1529         * it will return zero.
1530         */
1531        public int getFinancialClassReps() {
1532            FC[] ret = null;
1533            try {
1534                Type[] t = this.getField(20);
1535                return t.length;  
1536            } catch (ClassCastException cce) {
1537                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1538                throw new RuntimeException(cce);
1539            } catch (HL7Exception he) {
1540                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1541                throw new RuntimeException(he);
1542            }
1543        }
1544    
1545    
1546        /**
1547         * Returns a specific repetition of
1548         * PV1-20: "Financial Class" - creates it if necessary
1549         *
1550         * @param rep The repetition index (0-indexed)
1551         */
1552        public FC getFinancialClass(int rep) { 
1553            FC ret = null;
1554            try {
1555                Type t = this.getField(20, rep);
1556                ret = (FC)t;
1557            } catch (ClassCastException cce) {
1558                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1559                throw new RuntimeException(cce);
1560            } catch (HL7Exception he) {
1561                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1562                throw new RuntimeException(he);
1563            }
1564            return ret;
1565        }
1566    
1567        /**
1568         * Returns a specific repetition of
1569         * PV1-20: "Financial Class" - creates it if necessary
1570         *
1571         * @param rep The repetition index (0-indexed)
1572         */
1573        public FC getPv120_FinancialClass(int rep) { 
1574            FC ret = null;
1575            try {
1576                Type t = this.getField(20, rep);
1577                ret = (FC)t;
1578            } catch (ClassCastException cce) {
1579                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1580                throw new RuntimeException(cce);
1581            } catch (HL7Exception he) {
1582                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1583                throw new RuntimeException(he);
1584            }
1585            return ret;
1586        }
1587    
1588    
1589        /**
1590         * Returns a count of the current number of repetitions of Financial Class (PV1-20).
1591         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1592         * it will return zero.
1593         */
1594        public int getPv120_FinancialClassReps() {
1595            FC[] ret = null;
1596            try {
1597                Type[] t = this.getField(20);
1598                return t.length;  
1599            } catch (ClassCastException cce) {
1600                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1601                throw new RuntimeException(cce);
1602            } catch (HL7Exception he) {
1603                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1604                throw new RuntimeException(he);
1605            }
1606        }
1607    
1608    
1609    
1610        /**
1611         * Inserts a repetition of
1612         * PV1-20: "Financial Class" at a specific index
1613         *
1614         * @param rep The repetition index (0-indexed)
1615         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1616         */
1617        public FC insertFinancialClass(int rep) throws HL7Exception { 
1618            return (FC) super.insertRepetition(20, rep);
1619        }
1620    
1621    
1622    
1623        /**
1624         * Inserts a repetition of
1625         * PV1-20: "Financial Class" at a specific index
1626         *
1627         * @param rep The repetition index (0-indexed)
1628         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1629         */
1630        public FC insertPv120_FinancialClass(int rep) throws HL7Exception { 
1631            return (FC) super.insertRepetition(20, rep);
1632        }
1633    
1634    
1635        /**
1636         * Removes a repetition of
1637         * PV1-20: "Financial Class" at a specific index
1638         *
1639         * @param rep The repetition index (0-indexed)
1640         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1641         */
1642        public FC removeFinancialClass(int rep) throws HL7Exception { 
1643            return (FC) super.removeRepetition(20, rep);
1644        }
1645    
1646    
1647        /**
1648         * Removes a repetition of
1649         * PV1-20: "Financial Class" at a specific index
1650         *
1651         * @param rep The repetition index (0-indexed)
1652         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1653         */
1654        public FC removePv120_FinancialClass(int rep) throws HL7Exception { 
1655            return (FC) super.removeRepetition(20, rep);
1656        }
1657    
1658    
1659    
1660    
1661        /**
1662         * Returns
1663         * PV1-21: "Charge Price Indicator" - creates it if necessary
1664         */
1665        public IS getChargePriceIndicator() { 
1666            IS ret = null;
1667            try {
1668                Type t = this.getField(21, 0);
1669                ret = (IS)t;
1670            } catch (ClassCastException cce) {
1671                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1672                throw new RuntimeException(cce);
1673            } catch (HL7Exception he) {
1674                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1675                throw new RuntimeException(he);
1676            }
1677            return ret;
1678        }
1679    
1680    
1681        /**
1682         * Returns
1683         * PV1-21: "Charge Price Indicator" - creates it if necessary
1684         */
1685        public IS getPv121_ChargePriceIndicator() { 
1686            IS ret = null;
1687            try {
1688                Type t = this.getField(21, 0);
1689                ret = (IS)t;
1690            } catch (ClassCastException cce) {
1691                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1692                throw new RuntimeException(cce);
1693            } catch (HL7Exception he) {
1694                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1695                throw new RuntimeException(he);
1696            }
1697            return ret;
1698        }
1699    
1700    
1701    
1702        /**
1703         * Returns
1704         * PV1-22: "Courtesy Code" - creates it if necessary
1705         */
1706        public IS getCourtesyCode() { 
1707            IS ret = null;
1708            try {
1709                Type t = this.getField(22, 0);
1710                ret = (IS)t;
1711            } catch (ClassCastException cce) {
1712                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1713                throw new RuntimeException(cce);
1714            } catch (HL7Exception he) {
1715                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1716                throw new RuntimeException(he);
1717            }
1718            return ret;
1719        }
1720    
1721    
1722        /**
1723         * Returns
1724         * PV1-22: "Courtesy Code" - creates it if necessary
1725         */
1726        public IS getPv122_CourtesyCode() { 
1727            IS ret = null;
1728            try {
1729                Type t = this.getField(22, 0);
1730                ret = (IS)t;
1731            } catch (ClassCastException cce) {
1732                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1733                throw new RuntimeException(cce);
1734            } catch (HL7Exception he) {
1735                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1736                throw new RuntimeException(he);
1737            }
1738            return ret;
1739        }
1740    
1741    
1742    
1743        /**
1744         * Returns
1745         * PV1-23: "Credit Rating" - creates it if necessary
1746         */
1747        public IS getCreditRating() { 
1748            IS ret = null;
1749            try {
1750                Type t = this.getField(23, 0);
1751                ret = (IS)t;
1752            } catch (ClassCastException cce) {
1753                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1754                throw new RuntimeException(cce);
1755            } catch (HL7Exception he) {
1756                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1757                throw new RuntimeException(he);
1758            }
1759            return ret;
1760        }
1761    
1762    
1763        /**
1764         * Returns
1765         * PV1-23: "Credit Rating" - creates it if necessary
1766         */
1767        public IS getPv123_CreditRating() { 
1768            IS ret = null;
1769            try {
1770                Type t = this.getField(23, 0);
1771                ret = (IS)t;
1772            } catch (ClassCastException cce) {
1773                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1774                throw new RuntimeException(cce);
1775            } catch (HL7Exception he) {
1776                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1777                throw new RuntimeException(he);
1778            }
1779            return ret;
1780        }
1781    
1782    
1783        /**
1784         * Returns all repetitions of Contract Code (PV1-24).
1785         */
1786        public IS[] getContractCode() {
1787            IS[] ret = null;
1788            try {
1789                Type[] t = this.getField(24);  
1790                ret = new IS[t.length];
1791                for (int i = 0; i < ret.length; i++) {
1792                    ret[i] = (IS)t[i];
1793                }
1794            } catch (ClassCastException cce) {
1795                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1796                throw new RuntimeException(cce);
1797            } catch (HL7Exception he) {
1798                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1799                throw new RuntimeException(he);
1800            }
1801            return ret;
1802        }
1803    
1804    
1805        /**
1806         * Returns a count of the current number of repetitions of Contract Code (PV1-24).
1807         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1808         * it will return zero.
1809         */
1810        public int getContractCodeReps() {
1811            IS[] ret = null;
1812            try {
1813                Type[] t = this.getField(24);
1814                return t.length;  
1815            } catch (ClassCastException cce) {
1816                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1817                throw new RuntimeException(cce);
1818            } catch (HL7Exception he) {
1819                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1820                throw new RuntimeException(he);
1821            }
1822        }
1823    
1824    
1825        /**
1826         * Returns a specific repetition of
1827         * PV1-24: "Contract Code" - creates it if necessary
1828         *
1829         * @param rep The repetition index (0-indexed)
1830         */
1831        public IS getContractCode(int rep) { 
1832            IS ret = null;
1833            try {
1834                Type t = this.getField(24, rep);
1835                ret = (IS)t;
1836            } catch (ClassCastException cce) {
1837                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1838                throw new RuntimeException(cce);
1839            } catch (HL7Exception he) {
1840                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1841                throw new RuntimeException(he);
1842            }
1843            return ret;
1844        }
1845    
1846        /**
1847         * Returns a specific repetition of
1848         * PV1-24: "Contract Code" - creates it if necessary
1849         *
1850         * @param rep The repetition index (0-indexed)
1851         */
1852        public IS getPv124_ContractCode(int rep) { 
1853            IS ret = null;
1854            try {
1855                Type t = this.getField(24, rep);
1856                ret = (IS)t;
1857            } catch (ClassCastException cce) {
1858                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1859                throw new RuntimeException(cce);
1860            } catch (HL7Exception he) {
1861                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1862                throw new RuntimeException(he);
1863            }
1864            return ret;
1865        }
1866    
1867    
1868        /**
1869         * Returns a count of the current number of repetitions of Contract Code (PV1-24).
1870         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1871         * it will return zero.
1872         */
1873        public int getPv124_ContractCodeReps() {
1874            IS[] ret = null;
1875            try {
1876                Type[] t = this.getField(24);
1877                return t.length;  
1878            } catch (ClassCastException cce) {
1879                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1880                throw new RuntimeException(cce);
1881            } catch (HL7Exception he) {
1882                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1883                throw new RuntimeException(he);
1884            }
1885        }
1886    
1887    
1888    
1889        /**
1890         * Inserts a repetition of
1891         * PV1-24: "Contract Code" at a specific index
1892         *
1893         * @param rep The repetition index (0-indexed)
1894         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1895         */
1896        public IS insertContractCode(int rep) throws HL7Exception { 
1897            return (IS) super.insertRepetition(24, rep);
1898        }
1899    
1900    
1901    
1902        /**
1903         * Inserts a repetition of
1904         * PV1-24: "Contract Code" at a specific index
1905         *
1906         * @param rep The repetition index (0-indexed)
1907         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1908         */
1909        public IS insertPv124_ContractCode(int rep) throws HL7Exception { 
1910            return (IS) super.insertRepetition(24, rep);
1911        }
1912    
1913    
1914        /**
1915         * Removes a repetition of
1916         * PV1-24: "Contract Code" at a specific index
1917         *
1918         * @param rep The repetition index (0-indexed)
1919         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1920         */
1921        public IS removeContractCode(int rep) throws HL7Exception { 
1922            return (IS) super.removeRepetition(24, rep);
1923        }
1924    
1925    
1926        /**
1927         * Removes a repetition of
1928         * PV1-24: "Contract Code" at a specific index
1929         *
1930         * @param rep The repetition index (0-indexed)
1931         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1932         */
1933        public IS removePv124_ContractCode(int rep) throws HL7Exception { 
1934            return (IS) super.removeRepetition(24, rep);
1935        }
1936    
1937    
1938    
1939        /**
1940         * Returns all repetitions of Contract Effective Date (PV1-25).
1941         */
1942        public DT[] getContractEffectiveDate() {
1943            DT[] ret = null;
1944            try {
1945                Type[] t = this.getField(25);  
1946                ret = new DT[t.length];
1947                for (int i = 0; i < ret.length; i++) {
1948                    ret[i] = (DT)t[i];
1949                }
1950            } catch (ClassCastException cce) {
1951                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1952                throw new RuntimeException(cce);
1953            } catch (HL7Exception he) {
1954                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1955                throw new RuntimeException(he);
1956            }
1957            return ret;
1958        }
1959    
1960    
1961        /**
1962         * Returns a count of the current number of repetitions of Contract Effective Date (PV1-25).
1963         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1964         * it will return zero.
1965         */
1966        public int getContractEffectiveDateReps() {
1967            DT[] ret = null;
1968            try {
1969                Type[] t = this.getField(25);
1970                return t.length;  
1971            } catch (ClassCastException cce) {
1972                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1973                throw new RuntimeException(cce);
1974            } catch (HL7Exception he) {
1975                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1976                throw new RuntimeException(he);
1977            }
1978        }
1979    
1980    
1981        /**
1982         * Returns a specific repetition of
1983         * PV1-25: "Contract Effective Date" - creates it if necessary
1984         *
1985         * @param rep The repetition index (0-indexed)
1986         */
1987        public DT getContractEffectiveDate(int rep) { 
1988            DT ret = null;
1989            try {
1990                Type t = this.getField(25, rep);
1991                ret = (DT)t;
1992            } catch (ClassCastException cce) {
1993                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1994                throw new RuntimeException(cce);
1995            } catch (HL7Exception he) {
1996                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1997                throw new RuntimeException(he);
1998            }
1999            return ret;
2000        }
2001    
2002        /**
2003         * Returns a specific repetition of
2004         * PV1-25: "Contract Effective Date" - creates it if necessary
2005         *
2006         * @param rep The repetition index (0-indexed)
2007         */
2008        public DT getPv125_ContractEffectiveDate(int rep) { 
2009            DT ret = null;
2010            try {
2011                Type t = this.getField(25, rep);
2012                ret = (DT)t;
2013            } catch (ClassCastException cce) {
2014                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2015                throw new RuntimeException(cce);
2016            } catch (HL7Exception he) {
2017                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2018                throw new RuntimeException(he);
2019            }
2020            return ret;
2021        }
2022    
2023    
2024        /**
2025         * Returns a count of the current number of repetitions of Contract Effective Date (PV1-25).
2026         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2027         * it will return zero.
2028         */
2029        public int getPv125_ContractEffectiveDateReps() {
2030            DT[] ret = null;
2031            try {
2032                Type[] t = this.getField(25);
2033                return t.length;  
2034            } catch (ClassCastException cce) {
2035                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2036                throw new RuntimeException(cce);
2037            } catch (HL7Exception he) {
2038                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2039                throw new RuntimeException(he);
2040            }
2041        }
2042    
2043    
2044    
2045        /**
2046         * Inserts a repetition of
2047         * PV1-25: "Contract Effective Date" at a specific index
2048         *
2049         * @param rep The repetition index (0-indexed)
2050         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2051         */
2052        public DT insertContractEffectiveDate(int rep) throws HL7Exception { 
2053            return (DT) super.insertRepetition(25, rep);
2054        }
2055    
2056    
2057    
2058        /**
2059         * Inserts a repetition of
2060         * PV1-25: "Contract Effective Date" at a specific index
2061         *
2062         * @param rep The repetition index (0-indexed)
2063         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2064         */
2065        public DT insertPv125_ContractEffectiveDate(int rep) throws HL7Exception { 
2066            return (DT) super.insertRepetition(25, rep);
2067        }
2068    
2069    
2070        /**
2071         * Removes a repetition of
2072         * PV1-25: "Contract Effective Date" at a specific index
2073         *
2074         * @param rep The repetition index (0-indexed)
2075         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2076         */
2077        public DT removeContractEffectiveDate(int rep) throws HL7Exception { 
2078            return (DT) super.removeRepetition(25, rep);
2079        }
2080    
2081    
2082        /**
2083         * Removes a repetition of
2084         * PV1-25: "Contract Effective Date" at a specific index
2085         *
2086         * @param rep The repetition index (0-indexed)
2087         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2088         */
2089        public DT removePv125_ContractEffectiveDate(int rep) throws HL7Exception { 
2090            return (DT) super.removeRepetition(25, rep);
2091        }
2092    
2093    
2094    
2095        /**
2096         * Returns all repetitions of Contract Amount (PV1-26).
2097         */
2098        public NM[] getContractAmount() {
2099            NM[] ret = null;
2100            try {
2101                Type[] t = this.getField(26);  
2102                ret = new NM[t.length];
2103                for (int i = 0; i < ret.length; i++) {
2104                    ret[i] = (NM)t[i];
2105                }
2106            } catch (ClassCastException cce) {
2107                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2108                throw new RuntimeException(cce);
2109            } catch (HL7Exception he) {
2110                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2111                throw new RuntimeException(he);
2112            }
2113            return ret;
2114        }
2115    
2116    
2117        /**
2118         * Returns a count of the current number of repetitions of Contract Amount (PV1-26).
2119         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2120         * it will return zero.
2121         */
2122        public int getContractAmountReps() {
2123            NM[] ret = null;
2124            try {
2125                Type[] t = this.getField(26);
2126                return t.length;  
2127            } catch (ClassCastException cce) {
2128                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2129                throw new RuntimeException(cce);
2130            } catch (HL7Exception he) {
2131                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2132                throw new RuntimeException(he);
2133            }
2134        }
2135    
2136    
2137        /**
2138         * Returns a specific repetition of
2139         * PV1-26: "Contract Amount" - creates it if necessary
2140         *
2141         * @param rep The repetition index (0-indexed)
2142         */
2143        public NM getContractAmount(int rep) { 
2144            NM ret = null;
2145            try {
2146                Type t = this.getField(26, rep);
2147                ret = (NM)t;
2148            } catch (ClassCastException cce) {
2149                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2150                throw new RuntimeException(cce);
2151            } catch (HL7Exception he) {
2152                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2153                throw new RuntimeException(he);
2154            }
2155            return ret;
2156        }
2157    
2158        /**
2159         * Returns a specific repetition of
2160         * PV1-26: "Contract Amount" - creates it if necessary
2161         *
2162         * @param rep The repetition index (0-indexed)
2163         */
2164        public NM getPv126_ContractAmount(int rep) { 
2165            NM ret = null;
2166            try {
2167                Type t = this.getField(26, rep);
2168                ret = (NM)t;
2169            } catch (ClassCastException cce) {
2170                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2171                throw new RuntimeException(cce);
2172            } catch (HL7Exception he) {
2173                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2174                throw new RuntimeException(he);
2175            }
2176            return ret;
2177        }
2178    
2179    
2180        /**
2181         * Returns a count of the current number of repetitions of Contract Amount (PV1-26).
2182         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2183         * it will return zero.
2184         */
2185        public int getPv126_ContractAmountReps() {
2186            NM[] ret = null;
2187            try {
2188                Type[] t = this.getField(26);
2189                return t.length;  
2190            } catch (ClassCastException cce) {
2191                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2192                throw new RuntimeException(cce);
2193            } catch (HL7Exception he) {
2194                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2195                throw new RuntimeException(he);
2196            }
2197        }
2198    
2199    
2200    
2201        /**
2202         * Inserts a repetition of
2203         * PV1-26: "Contract Amount" at a specific index
2204         *
2205         * @param rep The repetition index (0-indexed)
2206         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2207         */
2208        public NM insertContractAmount(int rep) throws HL7Exception { 
2209            return (NM) super.insertRepetition(26, rep);
2210        }
2211    
2212    
2213    
2214        /**
2215         * Inserts a repetition of
2216         * PV1-26: "Contract Amount" at a specific index
2217         *
2218         * @param rep The repetition index (0-indexed)
2219         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2220         */
2221        public NM insertPv126_ContractAmount(int rep) throws HL7Exception { 
2222            return (NM) super.insertRepetition(26, rep);
2223        }
2224    
2225    
2226        /**
2227         * Removes a repetition of
2228         * PV1-26: "Contract Amount" at a specific index
2229         *
2230         * @param rep The repetition index (0-indexed)
2231         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2232         */
2233        public NM removeContractAmount(int rep) throws HL7Exception { 
2234            return (NM) super.removeRepetition(26, rep);
2235        }
2236    
2237    
2238        /**
2239         * Removes a repetition of
2240         * PV1-26: "Contract Amount" at a specific index
2241         *
2242         * @param rep The repetition index (0-indexed)
2243         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2244         */
2245        public NM removePv126_ContractAmount(int rep) throws HL7Exception { 
2246            return (NM) super.removeRepetition(26, rep);
2247        }
2248    
2249    
2250    
2251        /**
2252         * Returns all repetitions of Contract Period (PV1-27).
2253         */
2254        public NM[] getContractPeriod() {
2255            NM[] ret = null;
2256            try {
2257                Type[] t = this.getField(27);  
2258                ret = new NM[t.length];
2259                for (int i = 0; i < ret.length; i++) {
2260                    ret[i] = (NM)t[i];
2261                }
2262            } catch (ClassCastException cce) {
2263                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2264                throw new RuntimeException(cce);
2265            } catch (HL7Exception he) {
2266                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2267                throw new RuntimeException(he);
2268            }
2269            return ret;
2270        }
2271    
2272    
2273        /**
2274         * Returns a count of the current number of repetitions of Contract Period (PV1-27).
2275         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2276         * it will return zero.
2277         */
2278        public int getContractPeriodReps() {
2279            NM[] ret = null;
2280            try {
2281                Type[] t = this.getField(27);
2282                return t.length;  
2283            } catch (ClassCastException cce) {
2284                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2285                throw new RuntimeException(cce);
2286            } catch (HL7Exception he) {
2287                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2288                throw new RuntimeException(he);
2289            }
2290        }
2291    
2292    
2293        /**
2294         * Returns a specific repetition of
2295         * PV1-27: "Contract Period" - creates it if necessary
2296         *
2297         * @param rep The repetition index (0-indexed)
2298         */
2299        public NM getContractPeriod(int rep) { 
2300            NM ret = null;
2301            try {
2302                Type t = this.getField(27, rep);
2303                ret = (NM)t;
2304            } catch (ClassCastException cce) {
2305                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2306                throw new RuntimeException(cce);
2307            } catch (HL7Exception he) {
2308                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2309                throw new RuntimeException(he);
2310            }
2311            return ret;
2312        }
2313    
2314        /**
2315         * Returns a specific repetition of
2316         * PV1-27: "Contract Period" - creates it if necessary
2317         *
2318         * @param rep The repetition index (0-indexed)
2319         */
2320        public NM getPv127_ContractPeriod(int rep) { 
2321            NM ret = null;
2322            try {
2323                Type t = this.getField(27, rep);
2324                ret = (NM)t;
2325            } catch (ClassCastException cce) {
2326                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2327                throw new RuntimeException(cce);
2328            } catch (HL7Exception he) {
2329                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2330                throw new RuntimeException(he);
2331            }
2332            return ret;
2333        }
2334    
2335    
2336        /**
2337         * Returns a count of the current number of repetitions of Contract Period (PV1-27).
2338         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2339         * it will return zero.
2340         */
2341        public int getPv127_ContractPeriodReps() {
2342            NM[] ret = null;
2343            try {
2344                Type[] t = this.getField(27);
2345                return t.length;  
2346            } catch (ClassCastException cce) {
2347                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2348                throw new RuntimeException(cce);
2349            } catch (HL7Exception he) {
2350                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2351                throw new RuntimeException(he);
2352            }
2353        }
2354    
2355    
2356    
2357        /**
2358         * Inserts a repetition of
2359         * PV1-27: "Contract Period" at a specific index
2360         *
2361         * @param rep The repetition index (0-indexed)
2362         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2363         */
2364        public NM insertContractPeriod(int rep) throws HL7Exception { 
2365            return (NM) super.insertRepetition(27, rep);
2366        }
2367    
2368    
2369    
2370        /**
2371         * Inserts a repetition of
2372         * PV1-27: "Contract Period" at a specific index
2373         *
2374         * @param rep The repetition index (0-indexed)
2375         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2376         */
2377        public NM insertPv127_ContractPeriod(int rep) throws HL7Exception { 
2378            return (NM) super.insertRepetition(27, rep);
2379        }
2380    
2381    
2382        /**
2383         * Removes a repetition of
2384         * PV1-27: "Contract Period" at a specific index
2385         *
2386         * @param rep The repetition index (0-indexed)
2387         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2388         */
2389        public NM removeContractPeriod(int rep) throws HL7Exception { 
2390            return (NM) super.removeRepetition(27, rep);
2391        }
2392    
2393    
2394        /**
2395         * Removes a repetition of
2396         * PV1-27: "Contract Period" at a specific index
2397         *
2398         * @param rep The repetition index (0-indexed)
2399         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2400         */
2401        public NM removePv127_ContractPeriod(int rep) throws HL7Exception { 
2402            return (NM) super.removeRepetition(27, rep);
2403        }
2404    
2405    
2406    
2407    
2408        /**
2409         * Returns
2410         * PV1-28: "Interest Code" - creates it if necessary
2411         */
2412        public IS getInterestCode() { 
2413            IS ret = null;
2414            try {
2415                Type t = this.getField(28, 0);
2416                ret = (IS)t;
2417            } catch (ClassCastException cce) {
2418                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2419                throw new RuntimeException(cce);
2420            } catch (HL7Exception he) {
2421                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2422                throw new RuntimeException(he);
2423            }
2424            return ret;
2425        }
2426    
2427    
2428        /**
2429         * Returns
2430         * PV1-28: "Interest Code" - creates it if necessary
2431         */
2432        public IS getPv128_InterestCode() { 
2433            IS ret = null;
2434            try {
2435                Type t = this.getField(28, 0);
2436                ret = (IS)t;
2437            } catch (ClassCastException cce) {
2438                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2439                throw new RuntimeException(cce);
2440            } catch (HL7Exception he) {
2441                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2442                throw new RuntimeException(he);
2443            }
2444            return ret;
2445        }
2446    
2447    
2448    
2449        /**
2450         * Returns
2451         * PV1-29: "Transfer to Bad Debt Code" - creates it if necessary
2452         */
2453        public IS getTransferToBadDebtCode() { 
2454            IS ret = null;
2455            try {
2456                Type t = this.getField(29, 0);
2457                ret = (IS)t;
2458            } catch (ClassCastException cce) {
2459                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2460                throw new RuntimeException(cce);
2461            } catch (HL7Exception he) {
2462                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2463                throw new RuntimeException(he);
2464            }
2465            return ret;
2466        }
2467    
2468    
2469        /**
2470         * Returns
2471         * PV1-29: "Transfer to Bad Debt Code" - creates it if necessary
2472         */
2473        public IS getPv129_TransferToBadDebtCode() { 
2474            IS ret = null;
2475            try {
2476                Type t = this.getField(29, 0);
2477                ret = (IS)t;
2478            } catch (ClassCastException cce) {
2479                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2480                throw new RuntimeException(cce);
2481            } catch (HL7Exception he) {
2482                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2483                throw new RuntimeException(he);
2484            }
2485            return ret;
2486        }
2487    
2488    
2489    
2490        /**
2491         * Returns
2492         * PV1-30: "Transfer to Bad Debt Date" - creates it if necessary
2493         */
2494        public DT getTransferToBadDebtDate() { 
2495            DT ret = null;
2496            try {
2497                Type t = this.getField(30, 0);
2498                ret = (DT)t;
2499            } catch (ClassCastException cce) {
2500                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2501                throw new RuntimeException(cce);
2502            } catch (HL7Exception he) {
2503                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2504                throw new RuntimeException(he);
2505            }
2506            return ret;
2507        }
2508    
2509    
2510        /**
2511         * Returns
2512         * PV1-30: "Transfer to Bad Debt Date" - creates it if necessary
2513         */
2514        public DT getPv130_TransferToBadDebtDate() { 
2515            DT ret = null;
2516            try {
2517                Type t = this.getField(30, 0);
2518                ret = (DT)t;
2519            } catch (ClassCastException cce) {
2520                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2521                throw new RuntimeException(cce);
2522            } catch (HL7Exception he) {
2523                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2524                throw new RuntimeException(he);
2525            }
2526            return ret;
2527        }
2528    
2529    
2530    
2531        /**
2532         * Returns
2533         * PV1-31: "Bad Debt Agency Code" - creates it if necessary
2534         */
2535        public IS getBadDebtAgencyCode() { 
2536            IS ret = null;
2537            try {
2538                Type t = this.getField(31, 0);
2539                ret = (IS)t;
2540            } catch (ClassCastException cce) {
2541                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2542                throw new RuntimeException(cce);
2543            } catch (HL7Exception he) {
2544                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2545                throw new RuntimeException(he);
2546            }
2547            return ret;
2548        }
2549    
2550    
2551        /**
2552         * Returns
2553         * PV1-31: "Bad Debt Agency Code" - creates it if necessary
2554         */
2555        public IS getPv131_BadDebtAgencyCode() { 
2556            IS ret = null;
2557            try {
2558                Type t = this.getField(31, 0);
2559                ret = (IS)t;
2560            } catch (ClassCastException cce) {
2561                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2562                throw new RuntimeException(cce);
2563            } catch (HL7Exception he) {
2564                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2565                throw new RuntimeException(he);
2566            }
2567            return ret;
2568        }
2569    
2570    
2571    
2572        /**
2573         * Returns
2574         * PV1-32: "Bad Debt Transfer Amount" - creates it if necessary
2575         */
2576        public NM getBadDebtTransferAmount() { 
2577            NM ret = null;
2578            try {
2579                Type t = this.getField(32, 0);
2580                ret = (NM)t;
2581            } catch (ClassCastException cce) {
2582                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2583                throw new RuntimeException(cce);
2584            } catch (HL7Exception he) {
2585                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2586                throw new RuntimeException(he);
2587            }
2588            return ret;
2589        }
2590    
2591    
2592        /**
2593         * Returns
2594         * PV1-32: "Bad Debt Transfer Amount" - creates it if necessary
2595         */
2596        public NM getPv132_BadDebtTransferAmount() { 
2597            NM ret = null;
2598            try {
2599                Type t = this.getField(32, 0);
2600                ret = (NM)t;
2601            } catch (ClassCastException cce) {
2602                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2603                throw new RuntimeException(cce);
2604            } catch (HL7Exception he) {
2605                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2606                throw new RuntimeException(he);
2607            }
2608            return ret;
2609        }
2610    
2611    
2612    
2613        /**
2614         * Returns
2615         * PV1-33: "Bad Debt Recovery Amount" - creates it if necessary
2616         */
2617        public NM getBadDebtRecoveryAmount() { 
2618            NM ret = null;
2619            try {
2620                Type t = this.getField(33, 0);
2621                ret = (NM)t;
2622            } catch (ClassCastException cce) {
2623                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2624                throw new RuntimeException(cce);
2625            } catch (HL7Exception he) {
2626                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2627                throw new RuntimeException(he);
2628            }
2629            return ret;
2630        }
2631    
2632    
2633        /**
2634         * Returns
2635         * PV1-33: "Bad Debt Recovery Amount" - creates it if necessary
2636         */
2637        public NM getPv133_BadDebtRecoveryAmount() { 
2638            NM ret = null;
2639            try {
2640                Type t = this.getField(33, 0);
2641                ret = (NM)t;
2642            } catch (ClassCastException cce) {
2643                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2644                throw new RuntimeException(cce);
2645            } catch (HL7Exception he) {
2646                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2647                throw new RuntimeException(he);
2648            }
2649            return ret;
2650        }
2651    
2652    
2653    
2654        /**
2655         * Returns
2656         * PV1-34: "Delete Account Indicator" - creates it if necessary
2657         */
2658        public IS getDeleteAccountIndicator() { 
2659            IS ret = null;
2660            try {
2661                Type t = this.getField(34, 0);
2662                ret = (IS)t;
2663            } catch (ClassCastException cce) {
2664                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2665                throw new RuntimeException(cce);
2666            } catch (HL7Exception he) {
2667                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2668                throw new RuntimeException(he);
2669            }
2670            return ret;
2671        }
2672    
2673    
2674        /**
2675         * Returns
2676         * PV1-34: "Delete Account Indicator" - creates it if necessary
2677         */
2678        public IS getPv134_DeleteAccountIndicator() { 
2679            IS ret = null;
2680            try {
2681                Type t = this.getField(34, 0);
2682                ret = (IS)t;
2683            } catch (ClassCastException cce) {
2684                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2685                throw new RuntimeException(cce);
2686            } catch (HL7Exception he) {
2687                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2688                throw new RuntimeException(he);
2689            }
2690            return ret;
2691        }
2692    
2693    
2694    
2695        /**
2696         * Returns
2697         * PV1-35: "Delete Account Date" - creates it if necessary
2698         */
2699        public DT getDeleteAccountDate() { 
2700            DT ret = null;
2701            try {
2702                Type t = this.getField(35, 0);
2703                ret = (DT)t;
2704            } catch (ClassCastException cce) {
2705                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2706                throw new RuntimeException(cce);
2707            } catch (HL7Exception he) {
2708                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2709                throw new RuntimeException(he);
2710            }
2711            return ret;
2712        }
2713    
2714    
2715        /**
2716         * Returns
2717         * PV1-35: "Delete Account Date" - creates it if necessary
2718         */
2719        public DT getPv135_DeleteAccountDate() { 
2720            DT ret = null;
2721            try {
2722                Type t = this.getField(35, 0);
2723                ret = (DT)t;
2724            } catch (ClassCastException cce) {
2725                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2726                throw new RuntimeException(cce);
2727            } catch (HL7Exception he) {
2728                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2729                throw new RuntimeException(he);
2730            }
2731            return ret;
2732        }
2733    
2734    
2735    
2736        /**
2737         * Returns
2738         * PV1-36: "Discharge Disposition" - creates it if necessary
2739         */
2740        public IS getDischargeDisposition() { 
2741            IS ret = null;
2742            try {
2743                Type t = this.getField(36, 0);
2744                ret = (IS)t;
2745            } catch (ClassCastException cce) {
2746                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2747                throw new RuntimeException(cce);
2748            } catch (HL7Exception he) {
2749                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2750                throw new RuntimeException(he);
2751            }
2752            return ret;
2753        }
2754    
2755    
2756        /**
2757         * Returns
2758         * PV1-36: "Discharge Disposition" - creates it if necessary
2759         */
2760        public IS getPv136_DischargeDisposition() { 
2761            IS ret = null;
2762            try {
2763                Type t = this.getField(36, 0);
2764                ret = (IS)t;
2765            } catch (ClassCastException cce) {
2766                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2767                throw new RuntimeException(cce);
2768            } catch (HL7Exception he) {
2769                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2770                throw new RuntimeException(he);
2771            }
2772            return ret;
2773        }
2774    
2775    
2776    
2777        /**
2778         * Returns
2779         * PV1-37: "Discharged to Location" - creates it if necessary
2780         */
2781        public DLD getDischargedToLocation() { 
2782            DLD ret = null;
2783            try {
2784                Type t = this.getField(37, 0);
2785                ret = (DLD)t;
2786            } catch (ClassCastException cce) {
2787                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2788                throw new RuntimeException(cce);
2789            } catch (HL7Exception he) {
2790                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2791                throw new RuntimeException(he);
2792            }
2793            return ret;
2794        }
2795    
2796    
2797        /**
2798         * Returns
2799         * PV1-37: "Discharged to Location" - creates it if necessary
2800         */
2801        public DLD getPv137_DischargedToLocation() { 
2802            DLD ret = null;
2803            try {
2804                Type t = this.getField(37, 0);
2805                ret = (DLD)t;
2806            } catch (ClassCastException cce) {
2807                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2808                throw new RuntimeException(cce);
2809            } catch (HL7Exception he) {
2810                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2811                throw new RuntimeException(he);
2812            }
2813            return ret;
2814        }
2815    
2816    
2817    
2818        /**
2819         * Returns
2820         * PV1-38: "Diet Type" - creates it if necessary
2821         */
2822        public CE getDietType() { 
2823            CE ret = null;
2824            try {
2825                Type t = this.getField(38, 0);
2826                ret = (CE)t;
2827            } catch (ClassCastException cce) {
2828                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2829                throw new RuntimeException(cce);
2830            } catch (HL7Exception he) {
2831                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2832                throw new RuntimeException(he);
2833            }
2834            return ret;
2835        }
2836    
2837    
2838        /**
2839         * Returns
2840         * PV1-38: "Diet Type" - creates it if necessary
2841         */
2842        public CE getPv138_DietType() { 
2843            CE ret = null;
2844            try {
2845                Type t = this.getField(38, 0);
2846                ret = (CE)t;
2847            } catch (ClassCastException cce) {
2848                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2849                throw new RuntimeException(cce);
2850            } catch (HL7Exception he) {
2851                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2852                throw new RuntimeException(he);
2853            }
2854            return ret;
2855        }
2856    
2857    
2858    
2859        /**
2860         * Returns
2861         * PV1-39: "Servicing Facility" - creates it if necessary
2862         */
2863        public IS getServicingFacility() { 
2864            IS ret = null;
2865            try {
2866                Type t = this.getField(39, 0);
2867                ret = (IS)t;
2868            } catch (ClassCastException cce) {
2869                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2870                throw new RuntimeException(cce);
2871            } catch (HL7Exception he) {
2872                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2873                throw new RuntimeException(he);
2874            }
2875            return ret;
2876        }
2877    
2878    
2879        /**
2880         * Returns
2881         * PV1-39: "Servicing Facility" - creates it if necessary
2882         */
2883        public IS getPv139_ServicingFacility() { 
2884            IS ret = null;
2885            try {
2886                Type t = this.getField(39, 0);
2887                ret = (IS)t;
2888            } catch (ClassCastException cce) {
2889                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2890                throw new RuntimeException(cce);
2891            } catch (HL7Exception he) {
2892                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2893                throw new RuntimeException(he);
2894            }
2895            return ret;
2896        }
2897    
2898    
2899    
2900        /**
2901         * Returns
2902         * PV1-40: "Bed Status" - creates it if necessary
2903         */
2904        public IS getBedStatus() { 
2905            IS ret = null;
2906            try {
2907                Type t = this.getField(40, 0);
2908                ret = (IS)t;
2909            } catch (ClassCastException cce) {
2910                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2911                throw new RuntimeException(cce);
2912            } catch (HL7Exception he) {
2913                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2914                throw new RuntimeException(he);
2915            }
2916            return ret;
2917        }
2918    
2919    
2920        /**
2921         * Returns
2922         * PV1-40: "Bed Status" - creates it if necessary
2923         */
2924        public IS getPv140_BedStatus() { 
2925            IS ret = null;
2926            try {
2927                Type t = this.getField(40, 0);
2928                ret = (IS)t;
2929            } catch (ClassCastException cce) {
2930                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2931                throw new RuntimeException(cce);
2932            } catch (HL7Exception he) {
2933                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2934                throw new RuntimeException(he);
2935            }
2936            return ret;
2937        }
2938    
2939    
2940    
2941        /**
2942         * Returns
2943         * PV1-41: "Account Status" - creates it if necessary
2944         */
2945        public IS getAccountStatus() { 
2946            IS ret = null;
2947            try {
2948                Type t = this.getField(41, 0);
2949                ret = (IS)t;
2950            } catch (ClassCastException cce) {
2951                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2952                throw new RuntimeException(cce);
2953            } catch (HL7Exception he) {
2954                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2955                throw new RuntimeException(he);
2956            }
2957            return ret;
2958        }
2959    
2960    
2961        /**
2962         * Returns
2963         * PV1-41: "Account Status" - creates it if necessary
2964         */
2965        public IS getPv141_AccountStatus() { 
2966            IS ret = null;
2967            try {
2968                Type t = this.getField(41, 0);
2969                ret = (IS)t;
2970            } catch (ClassCastException cce) {
2971                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2972                throw new RuntimeException(cce);
2973            } catch (HL7Exception he) {
2974                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2975                throw new RuntimeException(he);
2976            }
2977            return ret;
2978        }
2979    
2980    
2981    
2982        /**
2983         * Returns
2984         * PV1-42: "Pending Location" - creates it if necessary
2985         */
2986        public PL getPendingLocation() { 
2987            PL ret = null;
2988            try {
2989                Type t = this.getField(42, 0);
2990                ret = (PL)t;
2991            } catch (ClassCastException cce) {
2992                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2993                throw new RuntimeException(cce);
2994            } catch (HL7Exception he) {
2995                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2996                throw new RuntimeException(he);
2997            }
2998            return ret;
2999        }
3000    
3001    
3002        /**
3003         * Returns
3004         * PV1-42: "Pending Location" - creates it if necessary
3005         */
3006        public PL getPv142_PendingLocation() { 
3007            PL ret = null;
3008            try {
3009                Type t = this.getField(42, 0);
3010                ret = (PL)t;
3011            } catch (ClassCastException cce) {
3012                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3013                throw new RuntimeException(cce);
3014            } catch (HL7Exception he) {
3015                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3016                throw new RuntimeException(he);
3017            }
3018            return ret;
3019        }
3020    
3021    
3022    
3023        /**
3024         * Returns
3025         * PV1-43: "Prior Temporary Location" - creates it if necessary
3026         */
3027        public PL getPriorTemporaryLocation() { 
3028            PL ret = null;
3029            try {
3030                Type t = this.getField(43, 0);
3031                ret = (PL)t;
3032            } catch (ClassCastException cce) {
3033                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3034                throw new RuntimeException(cce);
3035            } catch (HL7Exception he) {
3036                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3037                throw new RuntimeException(he);
3038            }
3039            return ret;
3040        }
3041    
3042    
3043        /**
3044         * Returns
3045         * PV1-43: "Prior Temporary Location" - creates it if necessary
3046         */
3047        public PL getPv143_PriorTemporaryLocation() { 
3048            PL ret = null;
3049            try {
3050                Type t = this.getField(43, 0);
3051                ret = (PL)t;
3052            } catch (ClassCastException cce) {
3053                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3054                throw new RuntimeException(cce);
3055            } catch (HL7Exception he) {
3056                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3057                throw new RuntimeException(he);
3058            }
3059            return ret;
3060        }
3061    
3062    
3063    
3064        /**
3065         * Returns
3066         * PV1-44: "Admit Date/Time" - creates it if necessary
3067         */
3068        public TS getAdmitDateTime() { 
3069            TS ret = null;
3070            try {
3071                Type t = this.getField(44, 0);
3072                ret = (TS)t;
3073            } catch (ClassCastException cce) {
3074                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3075                throw new RuntimeException(cce);
3076            } catch (HL7Exception he) {
3077                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3078                throw new RuntimeException(he);
3079            }
3080            return ret;
3081        }
3082    
3083    
3084        /**
3085         * Returns
3086         * PV1-44: "Admit Date/Time" - creates it if necessary
3087         */
3088        public TS getPv144_AdmitDateTime() { 
3089            TS ret = null;
3090            try {
3091                Type t = this.getField(44, 0);
3092                ret = (TS)t;
3093            } catch (ClassCastException cce) {
3094                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3095                throw new RuntimeException(cce);
3096            } catch (HL7Exception he) {
3097                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3098                throw new RuntimeException(he);
3099            }
3100            return ret;
3101        }
3102    
3103    
3104    
3105        /**
3106         * Returns
3107         * PV1-45: "Discharge Date/Time" - creates it if necessary
3108         */
3109        public TS getDischargeDateTime() { 
3110            TS ret = null;
3111            try {
3112                Type t = this.getField(45, 0);
3113                ret = (TS)t;
3114            } catch (ClassCastException cce) {
3115                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3116                throw new RuntimeException(cce);
3117            } catch (HL7Exception he) {
3118                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3119                throw new RuntimeException(he);
3120            }
3121            return ret;
3122        }
3123    
3124    
3125        /**
3126         * Returns
3127         * PV1-45: "Discharge Date/Time" - creates it if necessary
3128         */
3129        public TS getPv145_DischargeDateTime() { 
3130            TS ret = null;
3131            try {
3132                Type t = this.getField(45, 0);
3133                ret = (TS)t;
3134            } catch (ClassCastException cce) {
3135                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3136                throw new RuntimeException(cce);
3137            } catch (HL7Exception he) {
3138                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3139                throw new RuntimeException(he);
3140            }
3141            return ret;
3142        }
3143    
3144    
3145    
3146        /**
3147         * Returns
3148         * PV1-46: "Current Patient Balance" - creates it if necessary
3149         */
3150        public NM getCurrentPatientBalance() { 
3151            NM ret = null;
3152            try {
3153                Type t = this.getField(46, 0);
3154                ret = (NM)t;
3155            } catch (ClassCastException cce) {
3156                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3157                throw new RuntimeException(cce);
3158            } catch (HL7Exception he) {
3159                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3160                throw new RuntimeException(he);
3161            }
3162            return ret;
3163        }
3164    
3165    
3166        /**
3167         * Returns
3168         * PV1-46: "Current Patient Balance" - creates it if necessary
3169         */
3170        public NM getPv146_CurrentPatientBalance() { 
3171            NM ret = null;
3172            try {
3173                Type t = this.getField(46, 0);
3174                ret = (NM)t;
3175            } catch (ClassCastException cce) {
3176                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3177                throw new RuntimeException(cce);
3178            } catch (HL7Exception he) {
3179                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3180                throw new RuntimeException(he);
3181            }
3182            return ret;
3183        }
3184    
3185    
3186    
3187        /**
3188         * Returns
3189         * PV1-47: "Total Charges" - creates it if necessary
3190         */
3191        public NM getTotalCharges() { 
3192            NM ret = null;
3193            try {
3194                Type t = this.getField(47, 0);
3195                ret = (NM)t;
3196            } catch (ClassCastException cce) {
3197                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3198                throw new RuntimeException(cce);
3199            } catch (HL7Exception he) {
3200                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3201                throw new RuntimeException(he);
3202            }
3203            return ret;
3204        }
3205    
3206    
3207        /**
3208         * Returns
3209         * PV1-47: "Total Charges" - creates it if necessary
3210         */
3211        public NM getPv147_TotalCharges() { 
3212            NM ret = null;
3213            try {
3214                Type t = this.getField(47, 0);
3215                ret = (NM)t;
3216            } catch (ClassCastException cce) {
3217                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3218                throw new RuntimeException(cce);
3219            } catch (HL7Exception he) {
3220                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3221                throw new RuntimeException(he);
3222            }
3223            return ret;
3224        }
3225    
3226    
3227    
3228        /**
3229         * Returns
3230         * PV1-48: "Total Adjustments" - creates it if necessary
3231         */
3232        public NM getTotalAdjustments() { 
3233            NM ret = null;
3234            try {
3235                Type t = this.getField(48, 0);
3236                ret = (NM)t;
3237            } catch (ClassCastException cce) {
3238                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3239                throw new RuntimeException(cce);
3240            } catch (HL7Exception he) {
3241                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3242                throw new RuntimeException(he);
3243            }
3244            return ret;
3245        }
3246    
3247    
3248        /**
3249         * Returns
3250         * PV1-48: "Total Adjustments" - creates it if necessary
3251         */
3252        public NM getPv148_TotalAdjustments() { 
3253            NM ret = null;
3254            try {
3255                Type t = this.getField(48, 0);
3256                ret = (NM)t;
3257            } catch (ClassCastException cce) {
3258                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3259                throw new RuntimeException(cce);
3260            } catch (HL7Exception he) {
3261                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3262                throw new RuntimeException(he);
3263            }
3264            return ret;
3265        }
3266    
3267    
3268    
3269        /**
3270         * Returns
3271         * PV1-49: "Total Payments" - creates it if necessary
3272         */
3273        public NM getTotalPayments() { 
3274            NM ret = null;
3275            try {
3276                Type t = this.getField(49, 0);
3277                ret = (NM)t;
3278            } catch (ClassCastException cce) {
3279                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3280                throw new RuntimeException(cce);
3281            } catch (HL7Exception he) {
3282                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3283                throw new RuntimeException(he);
3284            }
3285            return ret;
3286        }
3287    
3288    
3289        /**
3290         * Returns
3291         * PV1-49: "Total Payments" - creates it if necessary
3292         */
3293        public NM getPv149_TotalPayments() { 
3294            NM ret = null;
3295            try {
3296                Type t = this.getField(49, 0);
3297                ret = (NM)t;
3298            } catch (ClassCastException cce) {
3299                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3300                throw new RuntimeException(cce);
3301            } catch (HL7Exception he) {
3302                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3303                throw new RuntimeException(he);
3304            }
3305            return ret;
3306        }
3307    
3308    
3309    
3310        /**
3311         * Returns
3312         * PV1-50: "Alternate Visit ID" - creates it if necessary
3313         */
3314        public CX getAlternateVisitID() { 
3315            CX ret = null;
3316            try {
3317                Type t = this.getField(50, 0);
3318                ret = (CX)t;
3319            } catch (ClassCastException cce) {
3320                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3321                throw new RuntimeException(cce);
3322            } catch (HL7Exception he) {
3323                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3324                throw new RuntimeException(he);
3325            }
3326            return ret;
3327        }
3328    
3329    
3330        /**
3331         * Returns
3332         * PV1-50: "Alternate Visit ID" - creates it if necessary
3333         */
3334        public CX getPv150_AlternateVisitID() { 
3335            CX ret = null;
3336            try {
3337                Type t = this.getField(50, 0);
3338                ret = (CX)t;
3339            } catch (ClassCastException cce) {
3340                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3341                throw new RuntimeException(cce);
3342            } catch (HL7Exception he) {
3343                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3344                throw new RuntimeException(he);
3345            }
3346            return ret;
3347        }
3348    
3349    
3350    
3351        /**
3352         * Returns
3353         * PV1-51: "Visit Indicator" - creates it if necessary
3354         */
3355        public IS getVisitIndicator() { 
3356            IS ret = null;
3357            try {
3358                Type t = this.getField(51, 0);
3359                ret = (IS)t;
3360            } catch (ClassCastException cce) {
3361                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3362                throw new RuntimeException(cce);
3363            } catch (HL7Exception he) {
3364                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3365                throw new RuntimeException(he);
3366            }
3367            return ret;
3368        }
3369    
3370    
3371        /**
3372         * Returns
3373         * PV1-51: "Visit Indicator" - creates it if necessary
3374         */
3375        public IS getPv151_VisitIndicator() { 
3376            IS ret = null;
3377            try {
3378                Type t = this.getField(51, 0);
3379                ret = (IS)t;
3380            } catch (ClassCastException cce) {
3381                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3382                throw new RuntimeException(cce);
3383            } catch (HL7Exception he) {
3384                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3385                throw new RuntimeException(he);
3386            }
3387            return ret;
3388        }
3389    
3390    
3391        /**
3392         * Returns all repetitions of Other Healthcare Provider (PV1-52).
3393         */
3394        public XCN[] getOtherHealthcareProvider() {
3395            XCN[] ret = null;
3396            try {
3397                Type[] t = this.getField(52);  
3398                ret = new XCN[t.length];
3399                for (int i = 0; i < ret.length; i++) {
3400                    ret[i] = (XCN)t[i];
3401                }
3402            } catch (ClassCastException cce) {
3403                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3404                throw new RuntimeException(cce);
3405            } catch (HL7Exception he) {
3406                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3407                throw new RuntimeException(he);
3408            }
3409            return ret;
3410        }
3411    
3412    
3413        /**
3414         * Returns a count of the current number of repetitions of Other Healthcare Provider (PV1-52).
3415         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
3416         * it will return zero.
3417         */
3418        public int getOtherHealthcareProviderReps() {
3419            XCN[] ret = null;
3420            try {
3421                Type[] t = this.getField(52);
3422                return t.length;  
3423            } catch (ClassCastException cce) {
3424                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3425                throw new RuntimeException(cce);
3426            } catch (HL7Exception he) {
3427                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3428                throw new RuntimeException(he);
3429            }
3430        }
3431    
3432    
3433        /**
3434         * Returns a specific repetition of
3435         * PV1-52: "Other Healthcare Provider" - creates it if necessary
3436         *
3437         * @param rep The repetition index (0-indexed)
3438         */
3439        public XCN getOtherHealthcareProvider(int rep) { 
3440            XCN ret = null;
3441            try {
3442                Type t = this.getField(52, rep);
3443                ret = (XCN)t;
3444            } catch (ClassCastException cce) {
3445                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3446                throw new RuntimeException(cce);
3447            } catch (HL7Exception he) {
3448                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3449                throw new RuntimeException(he);
3450            }
3451            return ret;
3452        }
3453    
3454        /**
3455         * Returns a specific repetition of
3456         * PV1-52: "Other Healthcare Provider" - creates it if necessary
3457         *
3458         * @param rep The repetition index (0-indexed)
3459         */
3460        public XCN getPv152_OtherHealthcareProvider(int rep) { 
3461            XCN ret = null;
3462            try {
3463                Type t = this.getField(52, rep);
3464                ret = (XCN)t;
3465            } catch (ClassCastException cce) {
3466                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3467                throw new RuntimeException(cce);
3468            } catch (HL7Exception he) {
3469                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3470                throw new RuntimeException(he);
3471            }
3472            return ret;
3473        }
3474    
3475    
3476        /**
3477         * Returns a count of the current number of repetitions of Other Healthcare Provider (PV1-52).
3478         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
3479         * it will return zero.
3480         */
3481        public int getPv152_OtherHealthcareProviderReps() {
3482            XCN[] ret = null;
3483            try {
3484                Type[] t = this.getField(52);
3485                return t.length;  
3486            } catch (ClassCastException cce) {
3487                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3488                throw new RuntimeException(cce);
3489            } catch (HL7Exception he) {
3490                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3491                throw new RuntimeException(he);
3492            }
3493        }
3494    
3495    
3496    
3497        /**
3498         * Inserts a repetition of
3499         * PV1-52: "Other Healthcare Provider" at a specific index
3500         *
3501         * @param rep The repetition index (0-indexed)
3502         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
3503         */
3504        public XCN insertOtherHealthcareProvider(int rep) throws HL7Exception { 
3505            return (XCN) super.insertRepetition(52, rep);
3506        }
3507    
3508    
3509    
3510        /**
3511         * Inserts a repetition of
3512         * PV1-52: "Other Healthcare Provider" at a specific index
3513         *
3514         * @param rep The repetition index (0-indexed)
3515         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
3516         */
3517        public XCN insertPv152_OtherHealthcareProvider(int rep) throws HL7Exception { 
3518            return (XCN) super.insertRepetition(52, rep);
3519        }
3520    
3521    
3522        /**
3523         * Removes a repetition of
3524         * PV1-52: "Other Healthcare Provider" at a specific index
3525         *
3526         * @param rep The repetition index (0-indexed)
3527         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
3528         */
3529        public XCN removeOtherHealthcareProvider(int rep) throws HL7Exception { 
3530            return (XCN) super.removeRepetition(52, rep);
3531        }
3532    
3533    
3534        /**
3535         * Removes a repetition of
3536         * PV1-52: "Other Healthcare Provider" at a specific index
3537         *
3538         * @param rep The repetition index (0-indexed)
3539         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
3540         */
3541        public XCN removePv152_OtherHealthcareProvider(int rep) throws HL7Exception { 
3542            return (XCN) super.removeRepetition(52, rep);
3543        }
3544    
3545    
3546    
3547    
3548    
3549    
3550        /** {@inheritDoc} */   
3551        protected Type createNewTypeWithoutReflection(int field) {
3552           switch (field) {
3553              case 0: return new SI(getMessage());
3554              case 1: return new IS(getMessage(), new Integer( 4 ));
3555              case 2: return new PL(getMessage());
3556              case 3: return new IS(getMessage(), new Integer( 7 ));
3557              case 4: return new CX(getMessage());
3558              case 5: return new PL(getMessage());
3559              case 6: return new XCN(getMessage());
3560              case 7: return new XCN(getMessage());
3561              case 8: return new XCN(getMessage());
3562              case 9: return new IS(getMessage(), new Integer( 69 ));
3563              case 10: return new PL(getMessage());
3564              case 11: return new IS(getMessage(), new Integer( 87 ));
3565              case 12: return new IS(getMessage(), new Integer( 92 ));
3566              case 13: return new IS(getMessage(), new Integer( 23 ));
3567              case 14: return new IS(getMessage(), new Integer( 9 ));
3568              case 15: return new IS(getMessage(), new Integer( 99 ));
3569              case 16: return new XCN(getMessage());
3570              case 17: return new IS(getMessage(), new Integer( 18 ));
3571              case 18: return new CX(getMessage());
3572              case 19: return new FC(getMessage());
3573              case 20: return new IS(getMessage(), new Integer( 32 ));
3574              case 21: return new IS(getMessage(), new Integer( 45 ));
3575              case 22: return new IS(getMessage(), new Integer( 46 ));
3576              case 23: return new IS(getMessage(), new Integer( 44 ));
3577              case 24: return new DT(getMessage());
3578              case 25: return new NM(getMessage());
3579              case 26: return new NM(getMessage());
3580              case 27: return new IS(getMessage(), new Integer( 73 ));
3581              case 28: return new IS(getMessage(), new Integer( 110 ));
3582              case 29: return new DT(getMessage());
3583              case 30: return new IS(getMessage(), new Integer( 21 ));
3584              case 31: return new NM(getMessage());
3585              case 32: return new NM(getMessage());
3586              case 33: return new IS(getMessage(), new Integer( 111 ));
3587              case 34: return new DT(getMessage());
3588              case 35: return new IS(getMessage(), new Integer( 112 ));
3589              case 36: return new DLD(getMessage());
3590              case 37: return new CE(getMessage());
3591              case 38: return new IS(getMessage(), new Integer( 115 ));
3592              case 39: return new IS(getMessage(), new Integer( 116 ));
3593              case 40: return new IS(getMessage(), new Integer( 117 ));
3594              case 41: return new PL(getMessage());
3595              case 42: return new PL(getMessage());
3596              case 43: return new TS(getMessage());
3597              case 44: return new TS(getMessage());
3598              case 45: return new NM(getMessage());
3599              case 46: return new NM(getMessage());
3600              case 47: return new NM(getMessage());
3601              case 48: return new NM(getMessage());
3602              case 49: return new CX(getMessage());
3603              case 50: return new IS(getMessage(), new Integer( 326 ));
3604              case 51: return new XCN(getMessage());
3605              default: return null;
3606           }
3607       }
3608    
3609    
3610    }
3611