001    /*
002     * This class is an auto-generated source file for a HAPI
003     * HL7 v2.x standard structure class.
004     *
005     * For more information, visit: http://hl7api.sourceforge.net/
006     */
007    
008    package ca.uhn.hl7v2.model.v24.segment;
009    
010    // import ca.uhn.hl7v2.model.v24.group.*;
011    import ca.uhn.hl7v2.model.v24.datatype.*;
012    import ca.uhn.log.HapiLogFactory;
013    import ca.uhn.hl7v2.HL7Exception;
014    import ca.uhn.hl7v2.parser.ModelClassFactory;
015    import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
016    import ca.uhn.hl7v2.model.AbstractMessage;
017    import ca.uhn.hl7v2.model.Group;
018    import ca.uhn.hl7v2.model.Type;
019    import ca.uhn.hl7v2.model.AbstractSegment;
020    import ca.uhn.hl7v2.model.Varies;
021    
022    /**
023     *<p>Represents an HL7 PID message segment (Patient identification). 
024     * This segment has the following fields:</p>
025     * <ul>
026         * <li>PID-1: Set ID - PID (SI) <b>optional </b>
027         * <li>PID-2: Patient ID (CX) <b>optional </b>
028         * <li>PID-3: Patient Identifier List (CX) <b> repeating</b>
029         * <li>PID-4: Alternate Patient ID - PID (CX) <b>optional repeating</b>
030         * <li>PID-5: Patient Name (XPN) <b> repeating</b>
031         * <li>PID-6: Mother's Maiden Name (XPN) <b>optional repeating</b>
032         * <li>PID-7: Date/Time Of Birth (TS) <b>optional </b>
033         * <li>PID-8: Administrative Sex (IS) <b>optional </b>
034         * <li>PID-9: Patient Alias (XPN) <b>optional repeating</b>
035         * <li>PID-10: Race (CE) <b>optional repeating</b>
036         * <li>PID-11: Patient Address (XAD) <b>optional repeating</b>
037         * <li>PID-12: County Code (IS) <b>optional </b>
038         * <li>PID-13: Phone Number - Home (XTN) <b>optional repeating</b>
039         * <li>PID-14: Phone Number - Business (XTN) <b>optional repeating</b>
040         * <li>PID-15: Primary Language (CE) <b>optional </b>
041         * <li>PID-16: Marital Status (CE) <b>optional </b>
042         * <li>PID-17: Religion (CE) <b>optional </b>
043         * <li>PID-18: Patient Account Number (CX) <b>optional </b>
044         * <li>PID-19: SSN Number - Patient (ST) <b>optional </b>
045         * <li>PID-20: Driver's License Number - Patient (DLN) <b>optional </b>
046         * <li>PID-21: Mother's Identifier (CX) <b>optional repeating</b>
047         * <li>PID-22: Ethnic Group (CE) <b>optional repeating</b>
048         * <li>PID-23: Birth Place (ST) <b>optional </b>
049         * <li>PID-24: Multiple Birth Indicator (ID) <b>optional </b>
050         * <li>PID-25: Birth Order (NM) <b>optional </b>
051         * <li>PID-26: Citizenship (CE) <b>optional repeating</b>
052         * <li>PID-27: Veterans Military Status (CE) <b>optional </b>
053         * <li>PID-28: Nationality (CE) <b>optional </b>
054         * <li>PID-29: Patient Death Date and Time (TS) <b>optional </b>
055         * <li>PID-30: Patient Death Indicator (ID) <b>optional </b>
056         * <li>PID-31: Identity Unknown Indicator (ID) <b>optional </b>
057         * <li>PID-32: Identity Reliability Code (IS) <b>optional repeating</b>
058         * <li>PID-33: Last Update Date/Time (TS) <b>optional </b>
059         * <li>PID-34: Last Update Facility (HD) <b>optional </b>
060         * <li>PID-35: Species Code (CE) <b>optional </b>
061         * <li>PID-36: Breed Code (CE) <b>optional </b>
062         * <li>PID-37: Strain (ST) <b>optional </b>
063         * <li>PID-38: Production Class Code (CE) <b>optional </b>
064     * </ul>
065     */
066    public class PID extends AbstractSegment {
067    
068        /** 
069         * Creates a new PID segment
070         */
071        public PID(Group parent, ModelClassFactory factory) {
072           super(parent, factory);
073           init(factory);
074        }
075    
076        private void init(ModelClassFactory factory) {
077           try {
078                                      this.add(SI.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "Set ID - PID");
079                                      this.add(CX.class, false, 1, 20, new Object[]{ getMessage(), new Integer(0) }, "Patient ID");
080                                      this.add(CX.class, true, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Patient Identifier List");
081                                      this.add(CX.class, false, 0, 20, new Object[]{ getMessage(), new Integer(0) }, "Alternate Patient ID - PID");
082                                      this.add(XPN.class, true, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Patient Name");
083                                      this.add(XPN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Mother's Maiden Name");
084                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Date/Time Of Birth");
085                                      this.add(IS.class, false, 1, 1, new Object[]{ getMessage() }, "Administrative Sex");
086                                      this.add(XPN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Patient Alias");
087                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(5) }, "Race");
088                                      this.add(XAD.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Patient Address");
089                                      this.add(IS.class, false, 1, 4, new Object[]{ getMessage() }, "County Code");
090                                      this.add(XTN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Phone Number - Home");
091                                      this.add(XTN.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Phone Number - Business");
092                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(296) }, "Primary Language");
093                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(2) }, "Marital Status");
094                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(6) }, "Religion");
095                                      this.add(CX.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Patient Account Number");
096                                      this.add(ST.class, false, 1, 16, new Object[]{ getMessage(), new Integer(0) }, "SSN Number - Patient");
097                                      this.add(DLN.class, false, 1, 25, new Object[]{ getMessage(), new Integer(0) }, "Driver's License Number - Patient");
098                                      this.add(CX.class, false, 0, 250, new Object[]{ getMessage(), new Integer(0) }, "Mother's Identifier");
099                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(189) }, "Ethnic Group");
100                                      this.add(ST.class, false, 1, 250, new Object[]{ getMessage(), new Integer(0) }, "Birth Place");
101                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Multiple Birth Indicator");
102                                      this.add(NM.class, false, 1, 2, new Object[]{ getMessage(), new Integer(0) }, "Birth Order");
103                                      this.add(CE.class, false, 0, 250, new Object[]{ getMessage(), new Integer(171) }, "Citizenship");
104                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(172) }, "Veterans Military Status");
105                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(212) }, "Nationality");
106                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Patient Death Date and Time");
107                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Patient Death Indicator");
108                                      this.add(ID.class, false, 1, 1, new Object[]{ getMessage() }, "Identity Unknown Indicator");
109                                      this.add(IS.class, false, 0, 20, new Object[]{ getMessage() }, "Identity Reliability Code");
110                                      this.add(TS.class, false, 1, 26, new Object[]{ getMessage(), new Integer(0) }, "Last Update Date/Time");
111                                      this.add(HD.class, false, 1, 40, new Object[]{ getMessage(), new Integer(0) }, "Last Update Facility");
112                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(446) }, "Species Code");
113                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(447) }, "Breed Code");
114                                      this.add(ST.class, false, 1, 80, new Object[]{ getMessage(), new Integer(0) }, "Strain");
115                                      this.add(CE.class, false, 1, 250, new Object[]{ getMessage(), new Integer(429) }, "Production Class Code");
116           } catch(HL7Exception e) {
117              HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected error creating PID - this is probably a bug in the source code generator.", e);
118           }
119        }
120    
121    
122    
123        /**
124         * Returns
125         * PID-1: "Set ID - PID" - creates it if necessary
126         */
127        public SI getSetIDPID() { 
128            SI ret = null;
129            try {
130                Type t = this.getField(1, 0);
131                ret = (SI)t;
132            } catch (ClassCastException cce) {
133                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
134                throw new RuntimeException(cce);
135            } catch (HL7Exception he) {
136                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
137                throw new RuntimeException(he);
138            }
139            return ret;
140        }
141    
142    
143        /**
144         * Returns
145         * PID-1: "Set ID - PID" - creates it if necessary
146         */
147        public SI getPid1_SetIDPID() { 
148            SI ret = null;
149            try {
150                Type t = this.getField(1, 0);
151                ret = (SI)t;
152            } catch (ClassCastException cce) {
153                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
154                throw new RuntimeException(cce);
155            } catch (HL7Exception he) {
156                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
157                throw new RuntimeException(he);
158            }
159            return ret;
160        }
161    
162    
163    
164        /**
165         * Returns
166         * PID-2: "Patient ID" - creates it if necessary
167         */
168        public CX getPatientID() { 
169            CX ret = null;
170            try {
171                Type t = this.getField(2, 0);
172                ret = (CX)t;
173            } catch (ClassCastException cce) {
174                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
175                throw new RuntimeException(cce);
176            } catch (HL7Exception he) {
177                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
178                throw new RuntimeException(he);
179            }
180            return ret;
181        }
182    
183    
184        /**
185         * Returns
186         * PID-2: "Patient ID" - creates it if necessary
187         */
188        public CX getPid2_PatientID() { 
189            CX ret = null;
190            try {
191                Type t = this.getField(2, 0);
192                ret = (CX)t;
193            } catch (ClassCastException cce) {
194                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
195                throw new RuntimeException(cce);
196            } catch (HL7Exception he) {
197                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
198                throw new RuntimeException(he);
199            }
200            return ret;
201        }
202    
203    
204        /**
205         * Returns all repetitions of Patient Identifier List (PID-3).
206         */
207        public CX[] getPatientIdentifierList() {
208            CX[] ret = null;
209            try {
210                Type[] t = this.getField(3);  
211                ret = new CX[t.length];
212                for (int i = 0; i < ret.length; i++) {
213                    ret[i] = (CX)t[i];
214                }
215            } catch (ClassCastException cce) {
216                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
217                throw new RuntimeException(cce);
218            } catch (HL7Exception he) {
219                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
220                throw new RuntimeException(he);
221            }
222            return ret;
223        }
224    
225    
226        /**
227         * Returns a count of the current number of repetitions of Patient Identifier List (PID-3).
228         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
229         * it will return zero.
230         */
231        public int getPatientIdentifierListReps() {
232            CX[] ret = null;
233            try {
234                Type[] t = this.getField(3);
235                return t.length;  
236            } catch (ClassCastException cce) {
237                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
238                throw new RuntimeException(cce);
239            } catch (HL7Exception he) {
240                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
241                throw new RuntimeException(he);
242            }
243        }
244    
245    
246        /**
247         * Returns a specific repetition of
248         * PID-3: "Patient Identifier List" - creates it if necessary
249         *
250         * @param rep The repetition index (0-indexed)
251         */
252        public CX getPatientIdentifierList(int rep) { 
253            CX ret = null;
254            try {
255                Type t = this.getField(3, rep);
256                ret = (CX)t;
257            } catch (ClassCastException cce) {
258                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
259                throw new RuntimeException(cce);
260            } catch (HL7Exception he) {
261                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
262                throw new RuntimeException(he);
263            }
264            return ret;
265        }
266    
267        /**
268         * Returns a specific repetition of
269         * PID-3: "Patient Identifier List" - creates it if necessary
270         *
271         * @param rep The repetition index (0-indexed)
272         */
273        public CX getPid3_PatientIdentifierList(int rep) { 
274            CX ret = null;
275            try {
276                Type t = this.getField(3, rep);
277                ret = (CX)t;
278            } catch (ClassCastException cce) {
279                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
280                throw new RuntimeException(cce);
281            } catch (HL7Exception he) {
282                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
283                throw new RuntimeException(he);
284            }
285            return ret;
286        }
287    
288    
289        /**
290         * Returns a count of the current number of repetitions of Patient Identifier List (PID-3).
291         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
292         * it will return zero.
293         */
294        public int getPid3_PatientIdentifierListReps() {
295            CX[] ret = null;
296            try {
297                Type[] t = this.getField(3);
298                return t.length;  
299            } catch (ClassCastException cce) {
300                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
301                throw new RuntimeException(cce);
302            } catch (HL7Exception he) {
303                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
304                throw new RuntimeException(he);
305            }
306        }
307    
308    
309    
310        /**
311         * Inserts a repetition of
312         * PID-3: "Patient Identifier List" at a specific index
313         *
314         * @param rep The repetition index (0-indexed)
315         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
316         */
317        public CX insertPatientIdentifierList(int rep) throws HL7Exception { 
318            return (CX) super.insertRepetition(3, rep);
319        }
320    
321    
322    
323        /**
324         * Inserts a repetition of
325         * PID-3: "Patient Identifier List" at a specific index
326         *
327         * @param rep The repetition index (0-indexed)
328         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
329         */
330        public CX insertPid3_PatientIdentifierList(int rep) throws HL7Exception { 
331            return (CX) super.insertRepetition(3, rep);
332        }
333    
334    
335        /**
336         * Removes a repetition of
337         * PID-3: "Patient Identifier List" at a specific index
338         *
339         * @param rep The repetition index (0-indexed)
340         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
341         */
342        public CX removePatientIdentifierList(int rep) throws HL7Exception { 
343            return (CX) super.removeRepetition(3, rep);
344        }
345    
346    
347        /**
348         * Removes a repetition of
349         * PID-3: "Patient Identifier List" at a specific index
350         *
351         * @param rep The repetition index (0-indexed)
352         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
353         */
354        public CX removePid3_PatientIdentifierList(int rep) throws HL7Exception { 
355            return (CX) super.removeRepetition(3, rep);
356        }
357    
358    
359    
360        /**
361         * Returns all repetitions of Alternate Patient ID - PID (PID-4).
362         */
363        public CX[] getAlternatePatientIDPID() {
364            CX[] ret = null;
365            try {
366                Type[] t = this.getField(4);  
367                ret = new CX[t.length];
368                for (int i = 0; i < ret.length; i++) {
369                    ret[i] = (CX)t[i];
370                }
371            } catch (ClassCastException cce) {
372                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
373                throw new RuntimeException(cce);
374            } catch (HL7Exception he) {
375                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
376                throw new RuntimeException(he);
377            }
378            return ret;
379        }
380    
381    
382        /**
383         * Returns a count of the current number of repetitions of Alternate Patient ID - PID (PID-4).
384         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
385         * it will return zero.
386         */
387        public int getAlternatePatientIDPIDReps() {
388            CX[] ret = null;
389            try {
390                Type[] t = this.getField(4);
391                return t.length;  
392            } catch (ClassCastException cce) {
393                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
394                throw new RuntimeException(cce);
395            } catch (HL7Exception he) {
396                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
397                throw new RuntimeException(he);
398            }
399        }
400    
401    
402        /**
403         * Returns a specific repetition of
404         * PID-4: "Alternate Patient ID - PID" - creates it if necessary
405         *
406         * @param rep The repetition index (0-indexed)
407         */
408        public CX getAlternatePatientIDPID(int rep) { 
409            CX ret = null;
410            try {
411                Type t = this.getField(4, rep);
412                ret = (CX)t;
413            } catch (ClassCastException cce) {
414                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
415                throw new RuntimeException(cce);
416            } catch (HL7Exception he) {
417                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
418                throw new RuntimeException(he);
419            }
420            return ret;
421        }
422    
423        /**
424         * Returns a specific repetition of
425         * PID-4: "Alternate Patient ID - PID" - creates it if necessary
426         *
427         * @param rep The repetition index (0-indexed)
428         */
429        public CX getPid4_AlternatePatientIDPID(int rep) { 
430            CX ret = null;
431            try {
432                Type t = this.getField(4, rep);
433                ret = (CX)t;
434            } catch (ClassCastException cce) {
435                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
436                throw new RuntimeException(cce);
437            } catch (HL7Exception he) {
438                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
439                throw new RuntimeException(he);
440            }
441            return ret;
442        }
443    
444    
445        /**
446         * Returns a count of the current number of repetitions of Alternate Patient ID - PID (PID-4).
447         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
448         * it will return zero.
449         */
450        public int getPid4_AlternatePatientIDPIDReps() {
451            CX[] ret = null;
452            try {
453                Type[] t = this.getField(4);
454                return t.length;  
455            } catch (ClassCastException cce) {
456                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
457                throw new RuntimeException(cce);
458            } catch (HL7Exception he) {
459                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
460                throw new RuntimeException(he);
461            }
462        }
463    
464    
465    
466        /**
467         * Inserts a repetition of
468         * PID-4: "Alternate Patient ID - PID" at a specific index
469         *
470         * @param rep The repetition index (0-indexed)
471         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
472         */
473        public CX insertAlternatePatientIDPID(int rep) throws HL7Exception { 
474            return (CX) super.insertRepetition(4, rep);
475        }
476    
477    
478    
479        /**
480         * Inserts a repetition of
481         * PID-4: "Alternate Patient ID - PID" at a specific index
482         *
483         * @param rep The repetition index (0-indexed)
484         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
485         */
486        public CX insertPid4_AlternatePatientIDPID(int rep) throws HL7Exception { 
487            return (CX) super.insertRepetition(4, rep);
488        }
489    
490    
491        /**
492         * Removes a repetition of
493         * PID-4: "Alternate Patient ID - PID" at a specific index
494         *
495         * @param rep The repetition index (0-indexed)
496         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
497         */
498        public CX removeAlternatePatientIDPID(int rep) throws HL7Exception { 
499            return (CX) super.removeRepetition(4, rep);
500        }
501    
502    
503        /**
504         * Removes a repetition of
505         * PID-4: "Alternate Patient ID - PID" at a specific index
506         *
507         * @param rep The repetition index (0-indexed)
508         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
509         */
510        public CX removePid4_AlternatePatientIDPID(int rep) throws HL7Exception { 
511            return (CX) super.removeRepetition(4, rep);
512        }
513    
514    
515    
516        /**
517         * Returns all repetitions of Patient Name (PID-5).
518         */
519        public XPN[] getPatientName() {
520            XPN[] ret = null;
521            try {
522                Type[] t = this.getField(5);  
523                ret = new XPN[t.length];
524                for (int i = 0; i < ret.length; i++) {
525                    ret[i] = (XPN)t[i];
526                }
527            } catch (ClassCastException cce) {
528                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
529                throw new RuntimeException(cce);
530            } catch (HL7Exception he) {
531                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
532                throw new RuntimeException(he);
533            }
534            return ret;
535        }
536    
537    
538        /**
539         * Returns a count of the current number of repetitions of Patient Name (PID-5).
540         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
541         * it will return zero.
542         */
543        public int getPatientNameReps() {
544            XPN[] ret = null;
545            try {
546                Type[] t = this.getField(5);
547                return t.length;  
548            } catch (ClassCastException cce) {
549                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
550                throw new RuntimeException(cce);
551            } catch (HL7Exception he) {
552                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
553                throw new RuntimeException(he);
554            }
555        }
556    
557    
558        /**
559         * Returns a specific repetition of
560         * PID-5: "Patient Name" - creates it if necessary
561         *
562         * @param rep The repetition index (0-indexed)
563         */
564        public XPN getPatientName(int rep) { 
565            XPN ret = null;
566            try {
567                Type t = this.getField(5, rep);
568                ret = (XPN)t;
569            } catch (ClassCastException cce) {
570                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
571                throw new RuntimeException(cce);
572            } catch (HL7Exception he) {
573                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
574                throw new RuntimeException(he);
575            }
576            return ret;
577        }
578    
579        /**
580         * Returns a specific repetition of
581         * PID-5: "Patient Name" - creates it if necessary
582         *
583         * @param rep The repetition index (0-indexed)
584         */
585        public XPN getPid5_PatientName(int rep) { 
586            XPN ret = null;
587            try {
588                Type t = this.getField(5, rep);
589                ret = (XPN)t;
590            } catch (ClassCastException cce) {
591                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
592                throw new RuntimeException(cce);
593            } catch (HL7Exception he) {
594                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
595                throw new RuntimeException(he);
596            }
597            return ret;
598        }
599    
600    
601        /**
602         * Returns a count of the current number of repetitions of Patient Name (PID-5).
603         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
604         * it will return zero.
605         */
606        public int getPid5_PatientNameReps() {
607            XPN[] ret = null;
608            try {
609                Type[] t = this.getField(5);
610                return t.length;  
611            } catch (ClassCastException cce) {
612                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
613                throw new RuntimeException(cce);
614            } catch (HL7Exception he) {
615                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
616                throw new RuntimeException(he);
617            }
618        }
619    
620    
621    
622        /**
623         * Inserts a repetition of
624         * PID-5: "Patient Name" at a specific index
625         *
626         * @param rep The repetition index (0-indexed)
627         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
628         */
629        public XPN insertPatientName(int rep) throws HL7Exception { 
630            return (XPN) super.insertRepetition(5, rep);
631        }
632    
633    
634    
635        /**
636         * Inserts a repetition of
637         * PID-5: "Patient Name" at a specific index
638         *
639         * @param rep The repetition index (0-indexed)
640         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
641         */
642        public XPN insertPid5_PatientName(int rep) throws HL7Exception { 
643            return (XPN) super.insertRepetition(5, rep);
644        }
645    
646    
647        /**
648         * Removes a repetition of
649         * PID-5: "Patient Name" at a specific index
650         *
651         * @param rep The repetition index (0-indexed)
652         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
653         */
654        public XPN removePatientName(int rep) throws HL7Exception { 
655            return (XPN) super.removeRepetition(5, rep);
656        }
657    
658    
659        /**
660         * Removes a repetition of
661         * PID-5: "Patient Name" at a specific index
662         *
663         * @param rep The repetition index (0-indexed)
664         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
665         */
666        public XPN removePid5_PatientName(int rep) throws HL7Exception { 
667            return (XPN) super.removeRepetition(5, rep);
668        }
669    
670    
671    
672        /**
673         * Returns all repetitions of Mother's Maiden Name (PID-6).
674         */
675        public XPN[] getMotherSMaidenName() {
676            XPN[] ret = null;
677            try {
678                Type[] t = this.getField(6);  
679                ret = new XPN[t.length];
680                for (int i = 0; i < ret.length; i++) {
681                    ret[i] = (XPN)t[i];
682                }
683            } catch (ClassCastException cce) {
684                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
685                throw new RuntimeException(cce);
686            } catch (HL7Exception he) {
687                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
688                throw new RuntimeException(he);
689            }
690            return ret;
691        }
692    
693    
694        /**
695         * Returns a count of the current number of repetitions of Mother's Maiden Name (PID-6).
696         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
697         * it will return zero.
698         */
699        public int getMotherSMaidenNameReps() {
700            XPN[] ret = null;
701            try {
702                Type[] t = this.getField(6);
703                return t.length;  
704            } catch (ClassCastException cce) {
705                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
706                throw new RuntimeException(cce);
707            } catch (HL7Exception he) {
708                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
709                throw new RuntimeException(he);
710            }
711        }
712    
713    
714        /**
715         * Returns a specific repetition of
716         * PID-6: "Mother's Maiden Name" - creates it if necessary
717         *
718         * @param rep The repetition index (0-indexed)
719         */
720        public XPN getMotherSMaidenName(int rep) { 
721            XPN ret = null;
722            try {
723                Type t = this.getField(6, rep);
724                ret = (XPN)t;
725            } catch (ClassCastException cce) {
726                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
727                throw new RuntimeException(cce);
728            } catch (HL7Exception he) {
729                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
730                throw new RuntimeException(he);
731            }
732            return ret;
733        }
734    
735        /**
736         * Returns a specific repetition of
737         * PID-6: "Mother's Maiden Name" - creates it if necessary
738         *
739         * @param rep The repetition index (0-indexed)
740         */
741        public XPN getPid6_MotherSMaidenName(int rep) { 
742            XPN ret = null;
743            try {
744                Type t = this.getField(6, rep);
745                ret = (XPN)t;
746            } catch (ClassCastException cce) {
747                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
748                throw new RuntimeException(cce);
749            } catch (HL7Exception he) {
750                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
751                throw new RuntimeException(he);
752            }
753            return ret;
754        }
755    
756    
757        /**
758         * Returns a count of the current number of repetitions of Mother's Maiden Name (PID-6).
759         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
760         * it will return zero.
761         */
762        public int getPid6_MotherSMaidenNameReps() {
763            XPN[] ret = null;
764            try {
765                Type[] t = this.getField(6);
766                return t.length;  
767            } catch (ClassCastException cce) {
768                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
769                throw new RuntimeException(cce);
770            } catch (HL7Exception he) {
771                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
772                throw new RuntimeException(he);
773            }
774        }
775    
776    
777    
778        /**
779         * Inserts a repetition of
780         * PID-6: "Mother's Maiden Name" at a specific index
781         *
782         * @param rep The repetition index (0-indexed)
783         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
784         */
785        public XPN insertMotherSMaidenName(int rep) throws HL7Exception { 
786            return (XPN) super.insertRepetition(6, rep);
787        }
788    
789    
790    
791        /**
792         * Inserts a repetition of
793         * PID-6: "Mother's Maiden Name" at a specific index
794         *
795         * @param rep The repetition index (0-indexed)
796         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
797         */
798        public XPN insertPid6_MotherSMaidenName(int rep) throws HL7Exception { 
799            return (XPN) super.insertRepetition(6, rep);
800        }
801    
802    
803        /**
804         * Removes a repetition of
805         * PID-6: "Mother's Maiden Name" at a specific index
806         *
807         * @param rep The repetition index (0-indexed)
808         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
809         */
810        public XPN removeMotherSMaidenName(int rep) throws HL7Exception { 
811            return (XPN) super.removeRepetition(6, rep);
812        }
813    
814    
815        /**
816         * Removes a repetition of
817         * PID-6: "Mother's Maiden Name" at a specific index
818         *
819         * @param rep The repetition index (0-indexed)
820         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
821         */
822        public XPN removePid6_MotherSMaidenName(int rep) throws HL7Exception { 
823            return (XPN) super.removeRepetition(6, rep);
824        }
825    
826    
827    
828    
829        /**
830         * Returns
831         * PID-7: "Date/Time Of Birth" - creates it if necessary
832         */
833        public TS getDateTimeOfBirth() { 
834            TS ret = null;
835            try {
836                Type t = this.getField(7, 0);
837                ret = (TS)t;
838            } catch (ClassCastException cce) {
839                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
840                throw new RuntimeException(cce);
841            } catch (HL7Exception he) {
842                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
843                throw new RuntimeException(he);
844            }
845            return ret;
846        }
847    
848    
849        /**
850         * Returns
851         * PID-7: "Date/Time Of Birth" - creates it if necessary
852         */
853        public TS getPid7_DateTimeOfBirth() { 
854            TS ret = null;
855            try {
856                Type t = this.getField(7, 0);
857                ret = (TS)t;
858            } catch (ClassCastException cce) {
859                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
860                throw new RuntimeException(cce);
861            } catch (HL7Exception he) {
862                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
863                throw new RuntimeException(he);
864            }
865            return ret;
866        }
867    
868    
869    
870        /**
871         * Returns
872         * PID-8: "Administrative Sex" - creates it if necessary
873         */
874        public IS getAdministrativeSex() { 
875            IS ret = null;
876            try {
877                Type t = this.getField(8, 0);
878                ret = (IS)t;
879            } catch (ClassCastException cce) {
880                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
881                throw new RuntimeException(cce);
882            } catch (HL7Exception he) {
883                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
884                throw new RuntimeException(he);
885            }
886            return ret;
887        }
888    
889    
890        /**
891         * Returns
892         * PID-8: "Administrative Sex" - creates it if necessary
893         */
894        public IS getPid8_AdministrativeSex() { 
895            IS ret = null;
896            try {
897                Type t = this.getField(8, 0);
898                ret = (IS)t;
899            } catch (ClassCastException cce) {
900                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
901                throw new RuntimeException(cce);
902            } catch (HL7Exception he) {
903                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
904                throw new RuntimeException(he);
905            }
906            return ret;
907        }
908    
909    
910        /**
911         * Returns all repetitions of Patient Alias (PID-9).
912         */
913        public XPN[] getPatientAlias() {
914            XPN[] ret = null;
915            try {
916                Type[] t = this.getField(9);  
917                ret = new XPN[t.length];
918                for (int i = 0; i < ret.length; i++) {
919                    ret[i] = (XPN)t[i];
920                }
921            } catch (ClassCastException cce) {
922                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
923                throw new RuntimeException(cce);
924            } catch (HL7Exception he) {
925                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
926                throw new RuntimeException(he);
927            }
928            return ret;
929        }
930    
931    
932        /**
933         * Returns a count of the current number of repetitions of Patient Alias (PID-9).
934         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
935         * it will return zero.
936         */
937        public int getPatientAliasReps() {
938            XPN[] ret = null;
939            try {
940                Type[] t = this.getField(9);
941                return t.length;  
942            } catch (ClassCastException cce) {
943                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
944                throw new RuntimeException(cce);
945            } catch (HL7Exception he) {
946                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
947                throw new RuntimeException(he);
948            }
949        }
950    
951    
952        /**
953         * Returns a specific repetition of
954         * PID-9: "Patient Alias" - creates it if necessary
955         *
956         * @param rep The repetition index (0-indexed)
957         */
958        public XPN getPatientAlias(int rep) { 
959            XPN ret = null;
960            try {
961                Type t = this.getField(9, rep);
962                ret = (XPN)t;
963            } catch (ClassCastException cce) {
964                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
965                throw new RuntimeException(cce);
966            } catch (HL7Exception he) {
967                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
968                throw new RuntimeException(he);
969            }
970            return ret;
971        }
972    
973        /**
974         * Returns a specific repetition of
975         * PID-9: "Patient Alias" - creates it if necessary
976         *
977         * @param rep The repetition index (0-indexed)
978         */
979        public XPN getPid9_PatientAlias(int rep) { 
980            XPN ret = null;
981            try {
982                Type t = this.getField(9, rep);
983                ret = (XPN)t;
984            } catch (ClassCastException cce) {
985                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
986                throw new RuntimeException(cce);
987            } catch (HL7Exception he) {
988                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
989                throw new RuntimeException(he);
990            }
991            return ret;
992        }
993    
994    
995        /**
996         * Returns a count of the current number of repetitions of Patient Alias (PID-9).
997         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
998         * it will return zero.
999         */
1000        public int getPid9_PatientAliasReps() {
1001            XPN[] ret = null;
1002            try {
1003                Type[] t = this.getField(9);
1004                return t.length;  
1005            } catch (ClassCastException cce) {
1006                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1007                throw new RuntimeException(cce);
1008            } catch (HL7Exception he) {
1009                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1010                throw new RuntimeException(he);
1011            }
1012        }
1013    
1014    
1015    
1016        /**
1017         * Inserts a repetition of
1018         * PID-9: "Patient Alias" at a specific index
1019         *
1020         * @param rep The repetition index (0-indexed)
1021         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1022         */
1023        public XPN insertPatientAlias(int rep) throws HL7Exception { 
1024            return (XPN) super.insertRepetition(9, rep);
1025        }
1026    
1027    
1028    
1029        /**
1030         * Inserts a repetition of
1031         * PID-9: "Patient Alias" at a specific index
1032         *
1033         * @param rep The repetition index (0-indexed)
1034         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1035         */
1036        public XPN insertPid9_PatientAlias(int rep) throws HL7Exception { 
1037            return (XPN) super.insertRepetition(9, rep);
1038        }
1039    
1040    
1041        /**
1042         * Removes a repetition of
1043         * PID-9: "Patient Alias" at a specific index
1044         *
1045         * @param rep The repetition index (0-indexed)
1046         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1047         */
1048        public XPN removePatientAlias(int rep) throws HL7Exception { 
1049            return (XPN) super.removeRepetition(9, rep);
1050        }
1051    
1052    
1053        /**
1054         * Removes a repetition of
1055         * PID-9: "Patient Alias" at a specific index
1056         *
1057         * @param rep The repetition index (0-indexed)
1058         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1059         */
1060        public XPN removePid9_PatientAlias(int rep) throws HL7Exception { 
1061            return (XPN) super.removeRepetition(9, rep);
1062        }
1063    
1064    
1065    
1066        /**
1067         * Returns all repetitions of Race (PID-10).
1068         */
1069        public CE[] getRace() {
1070            CE[] ret = null;
1071            try {
1072                Type[] t = this.getField(10);  
1073                ret = new CE[t.length];
1074                for (int i = 0; i < ret.length; i++) {
1075                    ret[i] = (CE)t[i];
1076                }
1077            } catch (ClassCastException cce) {
1078                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1079                throw new RuntimeException(cce);
1080            } catch (HL7Exception he) {
1081                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1082                throw new RuntimeException(he);
1083            }
1084            return ret;
1085        }
1086    
1087    
1088        /**
1089         * Returns a count of the current number of repetitions of Race (PID-10).
1090         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1091         * it will return zero.
1092         */
1093        public int getRaceReps() {
1094            CE[] ret = null;
1095            try {
1096                Type[] t = this.getField(10);
1097                return t.length;  
1098            } catch (ClassCastException cce) {
1099                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1100                throw new RuntimeException(cce);
1101            } catch (HL7Exception he) {
1102                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1103                throw new RuntimeException(he);
1104            }
1105        }
1106    
1107    
1108        /**
1109         * Returns a specific repetition of
1110         * PID-10: "Race" - creates it if necessary
1111         *
1112         * @param rep The repetition index (0-indexed)
1113         */
1114        public CE getRace(int rep) { 
1115            CE ret = null;
1116            try {
1117                Type t = this.getField(10, rep);
1118                ret = (CE)t;
1119            } catch (ClassCastException cce) {
1120                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1121                throw new RuntimeException(cce);
1122            } catch (HL7Exception he) {
1123                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1124                throw new RuntimeException(he);
1125            }
1126            return ret;
1127        }
1128    
1129        /**
1130         * Returns a specific repetition of
1131         * PID-10: "Race" - creates it if necessary
1132         *
1133         * @param rep The repetition index (0-indexed)
1134         */
1135        public CE getPid10_Race(int rep) { 
1136            CE ret = null;
1137            try {
1138                Type t = this.getField(10, rep);
1139                ret = (CE)t;
1140            } catch (ClassCastException cce) {
1141                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1142                throw new RuntimeException(cce);
1143            } catch (HL7Exception he) {
1144                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1145                throw new RuntimeException(he);
1146            }
1147            return ret;
1148        }
1149    
1150    
1151        /**
1152         * Returns a count of the current number of repetitions of Race (PID-10).
1153         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1154         * it will return zero.
1155         */
1156        public int getPid10_RaceReps() {
1157            CE[] ret = null;
1158            try {
1159                Type[] t = this.getField(10);
1160                return t.length;  
1161            } catch (ClassCastException cce) {
1162                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1163                throw new RuntimeException(cce);
1164            } catch (HL7Exception he) {
1165                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1166                throw new RuntimeException(he);
1167            }
1168        }
1169    
1170    
1171    
1172        /**
1173         * Inserts a repetition of
1174         * PID-10: "Race" at a specific index
1175         *
1176         * @param rep The repetition index (0-indexed)
1177         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1178         */
1179        public CE insertRace(int rep) throws HL7Exception { 
1180            return (CE) super.insertRepetition(10, rep);
1181        }
1182    
1183    
1184    
1185        /**
1186         * Inserts a repetition of
1187         * PID-10: "Race" at a specific index
1188         *
1189         * @param rep The repetition index (0-indexed)
1190         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1191         */
1192        public CE insertPid10_Race(int rep) throws HL7Exception { 
1193            return (CE) super.insertRepetition(10, rep);
1194        }
1195    
1196    
1197        /**
1198         * Removes a repetition of
1199         * PID-10: "Race" at a specific index
1200         *
1201         * @param rep The repetition index (0-indexed)
1202         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1203         */
1204        public CE removeRace(int rep) throws HL7Exception { 
1205            return (CE) super.removeRepetition(10, rep);
1206        }
1207    
1208    
1209        /**
1210         * Removes a repetition of
1211         * PID-10: "Race" at a specific index
1212         *
1213         * @param rep The repetition index (0-indexed)
1214         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1215         */
1216        public CE removePid10_Race(int rep) throws HL7Exception { 
1217            return (CE) super.removeRepetition(10, rep);
1218        }
1219    
1220    
1221    
1222        /**
1223         * Returns all repetitions of Patient Address (PID-11).
1224         */
1225        public XAD[] getPatientAddress() {
1226            XAD[] ret = null;
1227            try {
1228                Type[] t = this.getField(11);  
1229                ret = new XAD[t.length];
1230                for (int i = 0; i < ret.length; i++) {
1231                    ret[i] = (XAD)t[i];
1232                }
1233            } catch (ClassCastException cce) {
1234                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1235                throw new RuntimeException(cce);
1236            } catch (HL7Exception he) {
1237                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1238                throw new RuntimeException(he);
1239            }
1240            return ret;
1241        }
1242    
1243    
1244        /**
1245         * Returns a count of the current number of repetitions of Patient Address (PID-11).
1246         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1247         * it will return zero.
1248         */
1249        public int getPatientAddressReps() {
1250            XAD[] ret = null;
1251            try {
1252                Type[] t = this.getField(11);
1253                return t.length;  
1254            } catch (ClassCastException cce) {
1255                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1256                throw new RuntimeException(cce);
1257            } catch (HL7Exception he) {
1258                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1259                throw new RuntimeException(he);
1260            }
1261        }
1262    
1263    
1264        /**
1265         * Returns a specific repetition of
1266         * PID-11: "Patient Address" - creates it if necessary
1267         *
1268         * @param rep The repetition index (0-indexed)
1269         */
1270        public XAD getPatientAddress(int rep) { 
1271            XAD ret = null;
1272            try {
1273                Type t = this.getField(11, rep);
1274                ret = (XAD)t;
1275            } catch (ClassCastException cce) {
1276                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1277                throw new RuntimeException(cce);
1278            } catch (HL7Exception he) {
1279                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1280                throw new RuntimeException(he);
1281            }
1282            return ret;
1283        }
1284    
1285        /**
1286         * Returns a specific repetition of
1287         * PID-11: "Patient Address" - creates it if necessary
1288         *
1289         * @param rep The repetition index (0-indexed)
1290         */
1291        public XAD getPid11_PatientAddress(int rep) { 
1292            XAD ret = null;
1293            try {
1294                Type t = this.getField(11, rep);
1295                ret = (XAD)t;
1296            } catch (ClassCastException cce) {
1297                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1298                throw new RuntimeException(cce);
1299            } catch (HL7Exception he) {
1300                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1301                throw new RuntimeException(he);
1302            }
1303            return ret;
1304        }
1305    
1306    
1307        /**
1308         * Returns a count of the current number of repetitions of Patient Address (PID-11).
1309         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1310         * it will return zero.
1311         */
1312        public int getPid11_PatientAddressReps() {
1313            XAD[] ret = null;
1314            try {
1315                Type[] t = this.getField(11);
1316                return t.length;  
1317            } catch (ClassCastException cce) {
1318                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1319                throw new RuntimeException(cce);
1320            } catch (HL7Exception he) {
1321                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1322                throw new RuntimeException(he);
1323            }
1324        }
1325    
1326    
1327    
1328        /**
1329         * Inserts a repetition of
1330         * PID-11: "Patient Address" at a specific index
1331         *
1332         * @param rep The repetition index (0-indexed)
1333         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1334         */
1335        public XAD insertPatientAddress(int rep) throws HL7Exception { 
1336            return (XAD) super.insertRepetition(11, rep);
1337        }
1338    
1339    
1340    
1341        /**
1342         * Inserts a repetition of
1343         * PID-11: "Patient Address" at a specific index
1344         *
1345         * @param rep The repetition index (0-indexed)
1346         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1347         */
1348        public XAD insertPid11_PatientAddress(int rep) throws HL7Exception { 
1349            return (XAD) super.insertRepetition(11, rep);
1350        }
1351    
1352    
1353        /**
1354         * Removes a repetition of
1355         * PID-11: "Patient Address" at a specific index
1356         *
1357         * @param rep The repetition index (0-indexed)
1358         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1359         */
1360        public XAD removePatientAddress(int rep) throws HL7Exception { 
1361            return (XAD) super.removeRepetition(11, rep);
1362        }
1363    
1364    
1365        /**
1366         * Removes a repetition of
1367         * PID-11: "Patient Address" at a specific index
1368         *
1369         * @param rep The repetition index (0-indexed)
1370         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1371         */
1372        public XAD removePid11_PatientAddress(int rep) throws HL7Exception { 
1373            return (XAD) super.removeRepetition(11, rep);
1374        }
1375    
1376    
1377    
1378    
1379        /**
1380         * Returns
1381         * PID-12: "County Code" - creates it if necessary
1382         */
1383        public IS getCountyCode() { 
1384            IS ret = null;
1385            try {
1386                Type t = this.getField(12, 0);
1387                ret = (IS)t;
1388            } catch (ClassCastException cce) {
1389                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1390                throw new RuntimeException(cce);
1391            } catch (HL7Exception he) {
1392                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1393                throw new RuntimeException(he);
1394            }
1395            return ret;
1396        }
1397    
1398    
1399        /**
1400         * Returns
1401         * PID-12: "County Code" - creates it if necessary
1402         */
1403        public IS getPid12_CountyCode() { 
1404            IS ret = null;
1405            try {
1406                Type t = this.getField(12, 0);
1407                ret = (IS)t;
1408            } catch (ClassCastException cce) {
1409                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1410                throw new RuntimeException(cce);
1411            } catch (HL7Exception he) {
1412                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1413                throw new RuntimeException(he);
1414            }
1415            return ret;
1416        }
1417    
1418    
1419        /**
1420         * Returns all repetitions of Phone Number - Home (PID-13).
1421         */
1422        public XTN[] getPhoneNumberHome() {
1423            XTN[] ret = null;
1424            try {
1425                Type[] t = this.getField(13);  
1426                ret = new XTN[t.length];
1427                for (int i = 0; i < ret.length; i++) {
1428                    ret[i] = (XTN)t[i];
1429                }
1430            } catch (ClassCastException cce) {
1431                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1432                throw new RuntimeException(cce);
1433            } catch (HL7Exception he) {
1434                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1435                throw new RuntimeException(he);
1436            }
1437            return ret;
1438        }
1439    
1440    
1441        /**
1442         * Returns a count of the current number of repetitions of Phone Number - Home (PID-13).
1443         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1444         * it will return zero.
1445         */
1446        public int getPhoneNumberHomeReps() {
1447            XTN[] ret = null;
1448            try {
1449                Type[] t = this.getField(13);
1450                return t.length;  
1451            } catch (ClassCastException cce) {
1452                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1453                throw new RuntimeException(cce);
1454            } catch (HL7Exception he) {
1455                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1456                throw new RuntimeException(he);
1457            }
1458        }
1459    
1460    
1461        /**
1462         * Returns a specific repetition of
1463         * PID-13: "Phone Number - Home" - creates it if necessary
1464         *
1465         * @param rep The repetition index (0-indexed)
1466         */
1467        public XTN getPhoneNumberHome(int rep) { 
1468            XTN ret = null;
1469            try {
1470                Type t = this.getField(13, rep);
1471                ret = (XTN)t;
1472            } catch (ClassCastException cce) {
1473                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1474                throw new RuntimeException(cce);
1475            } catch (HL7Exception he) {
1476                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1477                throw new RuntimeException(he);
1478            }
1479            return ret;
1480        }
1481    
1482        /**
1483         * Returns a specific repetition of
1484         * PID-13: "Phone Number - Home" - creates it if necessary
1485         *
1486         * @param rep The repetition index (0-indexed)
1487         */
1488        public XTN getPid13_PhoneNumberHome(int rep) { 
1489            XTN ret = null;
1490            try {
1491                Type t = this.getField(13, rep);
1492                ret = (XTN)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 a count of the current number of repetitions of Phone Number - Home (PID-13).
1506         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1507         * it will return zero.
1508         */
1509        public int getPid13_PhoneNumberHomeReps() {
1510            XTN[] ret = null;
1511            try {
1512                Type[] t = this.getField(13);
1513                return t.length;  
1514            } catch (ClassCastException cce) {
1515                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1516                throw new RuntimeException(cce);
1517            } catch (HL7Exception he) {
1518                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1519                throw new RuntimeException(he);
1520            }
1521        }
1522    
1523    
1524    
1525        /**
1526         * Inserts a repetition of
1527         * PID-13: "Phone Number - Home" at a specific index
1528         *
1529         * @param rep The repetition index (0-indexed)
1530         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1531         */
1532        public XTN insertPhoneNumberHome(int rep) throws HL7Exception { 
1533            return (XTN) super.insertRepetition(13, rep);
1534        }
1535    
1536    
1537    
1538        /**
1539         * Inserts a repetition of
1540         * PID-13: "Phone Number - Home" at a specific index
1541         *
1542         * @param rep The repetition index (0-indexed)
1543         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1544         */
1545        public XTN insertPid13_PhoneNumberHome(int rep) throws HL7Exception { 
1546            return (XTN) super.insertRepetition(13, rep);
1547        }
1548    
1549    
1550        /**
1551         * Removes a repetition of
1552         * PID-13: "Phone Number - Home" at a specific index
1553         *
1554         * @param rep The repetition index (0-indexed)
1555         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1556         */
1557        public XTN removePhoneNumberHome(int rep) throws HL7Exception { 
1558            return (XTN) super.removeRepetition(13, rep);
1559        }
1560    
1561    
1562        /**
1563         * Removes a repetition of
1564         * PID-13: "Phone Number - Home" at a specific index
1565         *
1566         * @param rep The repetition index (0-indexed)
1567         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1568         */
1569        public XTN removePid13_PhoneNumberHome(int rep) throws HL7Exception { 
1570            return (XTN) super.removeRepetition(13, rep);
1571        }
1572    
1573    
1574    
1575        /**
1576         * Returns all repetitions of Phone Number - Business (PID-14).
1577         */
1578        public XTN[] getPhoneNumberBusiness() {
1579            XTN[] ret = null;
1580            try {
1581                Type[] t = this.getField(14);  
1582                ret = new XTN[t.length];
1583                for (int i = 0; i < ret.length; i++) {
1584                    ret[i] = (XTN)t[i];
1585                }
1586            } catch (ClassCastException cce) {
1587                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1588                throw new RuntimeException(cce);
1589            } catch (HL7Exception he) {
1590                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1591                throw new RuntimeException(he);
1592            }
1593            return ret;
1594        }
1595    
1596    
1597        /**
1598         * Returns a count of the current number of repetitions of Phone Number - Business (PID-14).
1599         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1600         * it will return zero.
1601         */
1602        public int getPhoneNumberBusinessReps() {
1603            XTN[] ret = null;
1604            try {
1605                Type[] t = this.getField(14);
1606                return t.length;  
1607            } catch (ClassCastException cce) {
1608                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1609                throw new RuntimeException(cce);
1610            } catch (HL7Exception he) {
1611                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1612                throw new RuntimeException(he);
1613            }
1614        }
1615    
1616    
1617        /**
1618         * Returns a specific repetition of
1619         * PID-14: "Phone Number - Business" - creates it if necessary
1620         *
1621         * @param rep The repetition index (0-indexed)
1622         */
1623        public XTN getPhoneNumberBusiness(int rep) { 
1624            XTN ret = null;
1625            try {
1626                Type t = this.getField(14, rep);
1627                ret = (XTN)t;
1628            } catch (ClassCastException cce) {
1629                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1630                throw new RuntimeException(cce);
1631            } catch (HL7Exception he) {
1632                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1633                throw new RuntimeException(he);
1634            }
1635            return ret;
1636        }
1637    
1638        /**
1639         * Returns a specific repetition of
1640         * PID-14: "Phone Number - Business" - creates it if necessary
1641         *
1642         * @param rep The repetition index (0-indexed)
1643         */
1644        public XTN getPid14_PhoneNumberBusiness(int rep) { 
1645            XTN ret = null;
1646            try {
1647                Type t = this.getField(14, rep);
1648                ret = (XTN)t;
1649            } catch (ClassCastException cce) {
1650                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1651                throw new RuntimeException(cce);
1652            } catch (HL7Exception he) {
1653                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1654                throw new RuntimeException(he);
1655            }
1656            return ret;
1657        }
1658    
1659    
1660        /**
1661         * Returns a count of the current number of repetitions of Phone Number - Business (PID-14).
1662         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1663         * it will return zero.
1664         */
1665        public int getPid14_PhoneNumberBusinessReps() {
1666            XTN[] ret = null;
1667            try {
1668                Type[] t = this.getField(14);
1669                return t.length;  
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        }
1678    
1679    
1680    
1681        /**
1682         * Inserts a repetition of
1683         * PID-14: "Phone Number - Business" at a specific index
1684         *
1685         * @param rep The repetition index (0-indexed)
1686         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1687         */
1688        public XTN insertPhoneNumberBusiness(int rep) throws HL7Exception { 
1689            return (XTN) super.insertRepetition(14, rep);
1690        }
1691    
1692    
1693    
1694        /**
1695         * Inserts a repetition of
1696         * PID-14: "Phone Number - Business" at a specific index
1697         *
1698         * @param rep The repetition index (0-indexed)
1699         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1700         */
1701        public XTN insertPid14_PhoneNumberBusiness(int rep) throws HL7Exception { 
1702            return (XTN) super.insertRepetition(14, rep);
1703        }
1704    
1705    
1706        /**
1707         * Removes a repetition of
1708         * PID-14: "Phone Number - Business" at a specific index
1709         *
1710         * @param rep The repetition index (0-indexed)
1711         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1712         */
1713        public XTN removePhoneNumberBusiness(int rep) throws HL7Exception { 
1714            return (XTN) super.removeRepetition(14, rep);
1715        }
1716    
1717    
1718        /**
1719         * Removes a repetition of
1720         * PID-14: "Phone Number - Business" at a specific index
1721         *
1722         * @param rep The repetition index (0-indexed)
1723         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1724         */
1725        public XTN removePid14_PhoneNumberBusiness(int rep) throws HL7Exception { 
1726            return (XTN) super.removeRepetition(14, rep);
1727        }
1728    
1729    
1730    
1731    
1732        /**
1733         * Returns
1734         * PID-15: "Primary Language" - creates it if necessary
1735         */
1736        public CE getPrimaryLanguage() { 
1737            CE ret = null;
1738            try {
1739                Type t = this.getField(15, 0);
1740                ret = (CE)t;
1741            } catch (ClassCastException cce) {
1742                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1743                throw new RuntimeException(cce);
1744            } catch (HL7Exception he) {
1745                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1746                throw new RuntimeException(he);
1747            }
1748            return ret;
1749        }
1750    
1751    
1752        /**
1753         * Returns
1754         * PID-15: "Primary Language" - creates it if necessary
1755         */
1756        public CE getPid15_PrimaryLanguage() { 
1757            CE ret = null;
1758            try {
1759                Type t = this.getField(15, 0);
1760                ret = (CE)t;
1761            } catch (ClassCastException cce) {
1762                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1763                throw new RuntimeException(cce);
1764            } catch (HL7Exception he) {
1765                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1766                throw new RuntimeException(he);
1767            }
1768            return ret;
1769        }
1770    
1771    
1772    
1773        /**
1774         * Returns
1775         * PID-16: "Marital Status" - creates it if necessary
1776         */
1777        public CE getMaritalStatus() { 
1778            CE ret = null;
1779            try {
1780                Type t = this.getField(16, 0);
1781                ret = (CE)t;
1782            } catch (ClassCastException cce) {
1783                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1784                throw new RuntimeException(cce);
1785            } catch (HL7Exception he) {
1786                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1787                throw new RuntimeException(he);
1788            }
1789            return ret;
1790        }
1791    
1792    
1793        /**
1794         * Returns
1795         * PID-16: "Marital Status" - creates it if necessary
1796         */
1797        public CE getPid16_MaritalStatus() { 
1798            CE ret = null;
1799            try {
1800                Type t = this.getField(16, 0);
1801                ret = (CE)t;
1802            } catch (ClassCastException cce) {
1803                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1804                throw new RuntimeException(cce);
1805            } catch (HL7Exception he) {
1806                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1807                throw new RuntimeException(he);
1808            }
1809            return ret;
1810        }
1811    
1812    
1813    
1814        /**
1815         * Returns
1816         * PID-17: "Religion" - creates it if necessary
1817         */
1818        public CE getReligion() { 
1819            CE ret = null;
1820            try {
1821                Type t = this.getField(17, 0);
1822                ret = (CE)t;
1823            } catch (ClassCastException cce) {
1824                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1825                throw new RuntimeException(cce);
1826            } catch (HL7Exception he) {
1827                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1828                throw new RuntimeException(he);
1829            }
1830            return ret;
1831        }
1832    
1833    
1834        /**
1835         * Returns
1836         * PID-17: "Religion" - creates it if necessary
1837         */
1838        public CE getPid17_Religion() { 
1839            CE ret = null;
1840            try {
1841                Type t = this.getField(17, 0);
1842                ret = (CE)t;
1843            } catch (ClassCastException cce) {
1844                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1845                throw new RuntimeException(cce);
1846            } catch (HL7Exception he) {
1847                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1848                throw new RuntimeException(he);
1849            }
1850            return ret;
1851        }
1852    
1853    
1854    
1855        /**
1856         * Returns
1857         * PID-18: "Patient Account Number" - creates it if necessary
1858         */
1859        public CX getPatientAccountNumber() { 
1860            CX ret = null;
1861            try {
1862                Type t = this.getField(18, 0);
1863                ret = (CX)t;
1864            } catch (ClassCastException cce) {
1865                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1866                throw new RuntimeException(cce);
1867            } catch (HL7Exception he) {
1868                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1869                throw new RuntimeException(he);
1870            }
1871            return ret;
1872        }
1873    
1874    
1875        /**
1876         * Returns
1877         * PID-18: "Patient Account Number" - creates it if necessary
1878         */
1879        public CX getPid18_PatientAccountNumber() { 
1880            CX ret = null;
1881            try {
1882                Type t = this.getField(18, 0);
1883                ret = (CX)t;
1884            } catch (ClassCastException cce) {
1885                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1886                throw new RuntimeException(cce);
1887            } catch (HL7Exception he) {
1888                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1889                throw new RuntimeException(he);
1890            }
1891            return ret;
1892        }
1893    
1894    
1895    
1896        /**
1897         * Returns
1898         * PID-19: "SSN Number - Patient" - creates it if necessary
1899         */
1900        public ST getSSNNumberPatient() { 
1901            ST ret = null;
1902            try {
1903                Type t = this.getField(19, 0);
1904                ret = (ST)t;
1905            } catch (ClassCastException cce) {
1906                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1907                throw new RuntimeException(cce);
1908            } catch (HL7Exception he) {
1909                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1910                throw new RuntimeException(he);
1911            }
1912            return ret;
1913        }
1914    
1915    
1916        /**
1917         * Returns
1918         * PID-19: "SSN Number - Patient" - creates it if necessary
1919         */
1920        public ST getPid19_SSNNumberPatient() { 
1921            ST ret = null;
1922            try {
1923                Type t = this.getField(19, 0);
1924                ret = (ST)t;
1925            } catch (ClassCastException cce) {
1926                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1927                throw new RuntimeException(cce);
1928            } catch (HL7Exception he) {
1929                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1930                throw new RuntimeException(he);
1931            }
1932            return ret;
1933        }
1934    
1935    
1936    
1937        /**
1938         * Returns
1939         * PID-20: "Driver's License Number - Patient" - creates it if necessary
1940         */
1941        public DLN getDriverSLicenseNumberPatient() { 
1942            DLN ret = null;
1943            try {
1944                Type t = this.getField(20, 0);
1945                ret = (DLN)t;
1946            } catch (ClassCastException cce) {
1947                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1948                throw new RuntimeException(cce);
1949            } catch (HL7Exception he) {
1950                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1951                throw new RuntimeException(he);
1952            }
1953            return ret;
1954        }
1955    
1956    
1957        /**
1958         * Returns
1959         * PID-20: "Driver's License Number - Patient" - creates it if necessary
1960         */
1961        public DLN getPid20_DriverSLicenseNumberPatient() { 
1962            DLN ret = null;
1963            try {
1964                Type t = this.getField(20, 0);
1965                ret = (DLN)t;
1966            } catch (ClassCastException cce) {
1967                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1968                throw new RuntimeException(cce);
1969            } catch (HL7Exception he) {
1970                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1971                throw new RuntimeException(he);
1972            }
1973            return ret;
1974        }
1975    
1976    
1977        /**
1978         * Returns all repetitions of Mother's Identifier (PID-21).
1979         */
1980        public CX[] getMotherSIdentifier() {
1981            CX[] ret = null;
1982            try {
1983                Type[] t = this.getField(21);  
1984                ret = new CX[t.length];
1985                for (int i = 0; i < ret.length; i++) {
1986                    ret[i] = (CX)t[i];
1987                }
1988            } catch (ClassCastException cce) {
1989                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
1990                throw new RuntimeException(cce);
1991            } catch (HL7Exception he) {
1992                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
1993                throw new RuntimeException(he);
1994            }
1995            return ret;
1996        }
1997    
1998    
1999        /**
2000         * Returns a count of the current number of repetitions of Mother's Identifier (PID-21).
2001         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2002         * it will return zero.
2003         */
2004        public int getMotherSIdentifierReps() {
2005            CX[] ret = null;
2006            try {
2007                Type[] t = this.getField(21);
2008                return t.length;  
2009            } catch (ClassCastException cce) {
2010                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2011                throw new RuntimeException(cce);
2012            } catch (HL7Exception he) {
2013                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2014                throw new RuntimeException(he);
2015            }
2016        }
2017    
2018    
2019        /**
2020         * Returns a specific repetition of
2021         * PID-21: "Mother's Identifier" - creates it if necessary
2022         *
2023         * @param rep The repetition index (0-indexed)
2024         */
2025        public CX getMotherSIdentifier(int rep) { 
2026            CX ret = null;
2027            try {
2028                Type t = this.getField(21, rep);
2029                ret = (CX)t;
2030            } catch (ClassCastException cce) {
2031                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2032                throw new RuntimeException(cce);
2033            } catch (HL7Exception he) {
2034                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2035                throw new RuntimeException(he);
2036            }
2037            return ret;
2038        }
2039    
2040        /**
2041         * Returns a specific repetition of
2042         * PID-21: "Mother's Identifier" - creates it if necessary
2043         *
2044         * @param rep The repetition index (0-indexed)
2045         */
2046        public CX getPid21_MotherSIdentifier(int rep) { 
2047            CX ret = null;
2048            try {
2049                Type t = this.getField(21, rep);
2050                ret = (CX)t;
2051            } catch (ClassCastException cce) {
2052                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2053                throw new RuntimeException(cce);
2054            } catch (HL7Exception he) {
2055                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2056                throw new RuntimeException(he);
2057            }
2058            return ret;
2059        }
2060    
2061    
2062        /**
2063         * Returns a count of the current number of repetitions of Mother's Identifier (PID-21).
2064         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2065         * it will return zero.
2066         */
2067        public int getPid21_MotherSIdentifierReps() {
2068            CX[] ret = null;
2069            try {
2070                Type[] t = this.getField(21);
2071                return t.length;  
2072            } catch (ClassCastException cce) {
2073                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2074                throw new RuntimeException(cce);
2075            } catch (HL7Exception he) {
2076                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2077                throw new RuntimeException(he);
2078            }
2079        }
2080    
2081    
2082    
2083        /**
2084         * Inserts a repetition of
2085         * PID-21: "Mother's Identifier" at a specific index
2086         *
2087         * @param rep The repetition index (0-indexed)
2088         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2089         */
2090        public CX insertMotherSIdentifier(int rep) throws HL7Exception { 
2091            return (CX) super.insertRepetition(21, rep);
2092        }
2093    
2094    
2095    
2096        /**
2097         * Inserts a repetition of
2098         * PID-21: "Mother's Identifier" at a specific index
2099         *
2100         * @param rep The repetition index (0-indexed)
2101         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2102         */
2103        public CX insertPid21_MotherSIdentifier(int rep) throws HL7Exception { 
2104            return (CX) super.insertRepetition(21, rep);
2105        }
2106    
2107    
2108        /**
2109         * Removes a repetition of
2110         * PID-21: "Mother's Identifier" at a specific index
2111         *
2112         * @param rep The repetition index (0-indexed)
2113         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2114         */
2115        public CX removeMotherSIdentifier(int rep) throws HL7Exception { 
2116            return (CX) super.removeRepetition(21, rep);
2117        }
2118    
2119    
2120        /**
2121         * Removes a repetition of
2122         * PID-21: "Mother's Identifier" at a specific index
2123         *
2124         * @param rep The repetition index (0-indexed)
2125         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2126         */
2127        public CX removePid21_MotherSIdentifier(int rep) throws HL7Exception { 
2128            return (CX) super.removeRepetition(21, rep);
2129        }
2130    
2131    
2132    
2133        /**
2134         * Returns all repetitions of Ethnic Group (PID-22).
2135         */
2136        public CE[] getEthnicGroup() {
2137            CE[] ret = null;
2138            try {
2139                Type[] t = this.getField(22);  
2140                ret = new CE[t.length];
2141                for (int i = 0; i < ret.length; i++) {
2142                    ret[i] = (CE)t[i];
2143                }
2144            } catch (ClassCastException cce) {
2145                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2146                throw new RuntimeException(cce);
2147            } catch (HL7Exception he) {
2148                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2149                throw new RuntimeException(he);
2150            }
2151            return ret;
2152        }
2153    
2154    
2155        /**
2156         * Returns a count of the current number of repetitions of Ethnic Group (PID-22).
2157         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2158         * it will return zero.
2159         */
2160        public int getEthnicGroupReps() {
2161            CE[] ret = null;
2162            try {
2163                Type[] t = this.getField(22);
2164                return t.length;  
2165            } catch (ClassCastException cce) {
2166                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2167                throw new RuntimeException(cce);
2168            } catch (HL7Exception he) {
2169                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2170                throw new RuntimeException(he);
2171            }
2172        }
2173    
2174    
2175        /**
2176         * Returns a specific repetition of
2177         * PID-22: "Ethnic Group" - creates it if necessary
2178         *
2179         * @param rep The repetition index (0-indexed)
2180         */
2181        public CE getEthnicGroup(int rep) { 
2182            CE ret = null;
2183            try {
2184                Type t = this.getField(22, rep);
2185                ret = (CE)t;
2186            } catch (ClassCastException cce) {
2187                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2188                throw new RuntimeException(cce);
2189            } catch (HL7Exception he) {
2190                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2191                throw new RuntimeException(he);
2192            }
2193            return ret;
2194        }
2195    
2196        /**
2197         * Returns a specific repetition of
2198         * PID-22: "Ethnic Group" - creates it if necessary
2199         *
2200         * @param rep The repetition index (0-indexed)
2201         */
2202        public CE getPid22_EthnicGroup(int rep) { 
2203            CE ret = null;
2204            try {
2205                Type t = this.getField(22, rep);
2206                ret = (CE)t;
2207            } catch (ClassCastException cce) {
2208                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2209                throw new RuntimeException(cce);
2210            } catch (HL7Exception he) {
2211                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2212                throw new RuntimeException(he);
2213            }
2214            return ret;
2215        }
2216    
2217    
2218        /**
2219         * Returns a count of the current number of repetitions of Ethnic Group (PID-22).
2220         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2221         * it will return zero.
2222         */
2223        public int getPid22_EthnicGroupReps() {
2224            CE[] ret = null;
2225            try {
2226                Type[] t = this.getField(22);
2227                return t.length;  
2228            } catch (ClassCastException cce) {
2229                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2230                throw new RuntimeException(cce);
2231            } catch (HL7Exception he) {
2232                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2233                throw new RuntimeException(he);
2234            }
2235        }
2236    
2237    
2238    
2239        /**
2240         * Inserts a repetition of
2241         * PID-22: "Ethnic Group" at a specific index
2242         *
2243         * @param rep The repetition index (0-indexed)
2244         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2245         */
2246        public CE insertEthnicGroup(int rep) throws HL7Exception { 
2247            return (CE) super.insertRepetition(22, rep);
2248        }
2249    
2250    
2251    
2252        /**
2253         * Inserts a repetition of
2254         * PID-22: "Ethnic Group" at a specific index
2255         *
2256         * @param rep The repetition index (0-indexed)
2257         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2258         */
2259        public CE insertPid22_EthnicGroup(int rep) throws HL7Exception { 
2260            return (CE) super.insertRepetition(22, rep);
2261        }
2262    
2263    
2264        /**
2265         * Removes a repetition of
2266         * PID-22: "Ethnic Group" at a specific index
2267         *
2268         * @param rep The repetition index (0-indexed)
2269         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2270         */
2271        public CE removeEthnicGroup(int rep) throws HL7Exception { 
2272            return (CE) super.removeRepetition(22, rep);
2273        }
2274    
2275    
2276        /**
2277         * Removes a repetition of
2278         * PID-22: "Ethnic Group" at a specific index
2279         *
2280         * @param rep The repetition index (0-indexed)
2281         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2282         */
2283        public CE removePid22_EthnicGroup(int rep) throws HL7Exception { 
2284            return (CE) super.removeRepetition(22, rep);
2285        }
2286    
2287    
2288    
2289    
2290        /**
2291         * Returns
2292         * PID-23: "Birth Place" - creates it if necessary
2293         */
2294        public ST getBirthPlace() { 
2295            ST ret = null;
2296            try {
2297                Type t = this.getField(23, 0);
2298                ret = (ST)t;
2299            } catch (ClassCastException cce) {
2300                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2301                throw new RuntimeException(cce);
2302            } catch (HL7Exception he) {
2303                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2304                throw new RuntimeException(he);
2305            }
2306            return ret;
2307        }
2308    
2309    
2310        /**
2311         * Returns
2312         * PID-23: "Birth Place" - creates it if necessary
2313         */
2314        public ST getPid23_BirthPlace() { 
2315            ST ret = null;
2316            try {
2317                Type t = this.getField(23, 0);
2318                ret = (ST)t;
2319            } catch (ClassCastException cce) {
2320                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2321                throw new RuntimeException(cce);
2322            } catch (HL7Exception he) {
2323                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2324                throw new RuntimeException(he);
2325            }
2326            return ret;
2327        }
2328    
2329    
2330    
2331        /**
2332         * Returns
2333         * PID-24: "Multiple Birth Indicator" - creates it if necessary
2334         */
2335        public ID getMultipleBirthIndicator() { 
2336            ID ret = null;
2337            try {
2338                Type t = this.getField(24, 0);
2339                ret = (ID)t;
2340            } catch (ClassCastException cce) {
2341                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2342                throw new RuntimeException(cce);
2343            } catch (HL7Exception he) {
2344                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2345                throw new RuntimeException(he);
2346            }
2347            return ret;
2348        }
2349    
2350    
2351        /**
2352         * Returns
2353         * PID-24: "Multiple Birth Indicator" - creates it if necessary
2354         */
2355        public ID getPid24_MultipleBirthIndicator() { 
2356            ID ret = null;
2357            try {
2358                Type t = this.getField(24, 0);
2359                ret = (ID)t;
2360            } catch (ClassCastException cce) {
2361                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2362                throw new RuntimeException(cce);
2363            } catch (HL7Exception he) {
2364                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2365                throw new RuntimeException(he);
2366            }
2367            return ret;
2368        }
2369    
2370    
2371    
2372        /**
2373         * Returns
2374         * PID-25: "Birth Order" - creates it if necessary
2375         */
2376        public NM getBirthOrder() { 
2377            NM ret = null;
2378            try {
2379                Type t = this.getField(25, 0);
2380                ret = (NM)t;
2381            } catch (ClassCastException cce) {
2382                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2383                throw new RuntimeException(cce);
2384            } catch (HL7Exception he) {
2385                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2386                throw new RuntimeException(he);
2387            }
2388            return ret;
2389        }
2390    
2391    
2392        /**
2393         * Returns
2394         * PID-25: "Birth Order" - creates it if necessary
2395         */
2396        public NM getPid25_BirthOrder() { 
2397            NM ret = null;
2398            try {
2399                Type t = this.getField(25, 0);
2400                ret = (NM)t;
2401            } catch (ClassCastException cce) {
2402                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2403                throw new RuntimeException(cce);
2404            } catch (HL7Exception he) {
2405                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2406                throw new RuntimeException(he);
2407            }
2408            return ret;
2409        }
2410    
2411    
2412        /**
2413         * Returns all repetitions of Citizenship (PID-26).
2414         */
2415        public CE[] getCitizenship() {
2416            CE[] ret = null;
2417            try {
2418                Type[] t = this.getField(26);  
2419                ret = new CE[t.length];
2420                for (int i = 0; i < ret.length; i++) {
2421                    ret[i] = (CE)t[i];
2422                }
2423            } catch (ClassCastException cce) {
2424                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2425                throw new RuntimeException(cce);
2426            } catch (HL7Exception he) {
2427                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2428                throw new RuntimeException(he);
2429            }
2430            return ret;
2431        }
2432    
2433    
2434        /**
2435         * Returns a count of the current number of repetitions of Citizenship (PID-26).
2436         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2437         * it will return zero.
2438         */
2439        public int getCitizenshipReps() {
2440            CE[] ret = null;
2441            try {
2442                Type[] t = this.getField(26);
2443                return t.length;  
2444            } catch (ClassCastException cce) {
2445                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2446                throw new RuntimeException(cce);
2447            } catch (HL7Exception he) {
2448                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2449                throw new RuntimeException(he);
2450            }
2451        }
2452    
2453    
2454        /**
2455         * Returns a specific repetition of
2456         * PID-26: "Citizenship" - creates it if necessary
2457         *
2458         * @param rep The repetition index (0-indexed)
2459         */
2460        public CE getCitizenship(int rep) { 
2461            CE ret = null;
2462            try {
2463                Type t = this.getField(26, rep);
2464                ret = (CE)t;
2465            } catch (ClassCastException cce) {
2466                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2467                throw new RuntimeException(cce);
2468            } catch (HL7Exception he) {
2469                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2470                throw new RuntimeException(he);
2471            }
2472            return ret;
2473        }
2474    
2475        /**
2476         * Returns a specific repetition of
2477         * PID-26: "Citizenship" - creates it if necessary
2478         *
2479         * @param rep The repetition index (0-indexed)
2480         */
2481        public CE getPid26_Citizenship(int rep) { 
2482            CE ret = null;
2483            try {
2484                Type t = this.getField(26, rep);
2485                ret = (CE)t;
2486            } catch (ClassCastException cce) {
2487                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2488                throw new RuntimeException(cce);
2489            } catch (HL7Exception he) {
2490                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2491                throw new RuntimeException(he);
2492            }
2493            return ret;
2494        }
2495    
2496    
2497        /**
2498         * Returns a count of the current number of repetitions of Citizenship (PID-26).
2499         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2500         * it will return zero.
2501         */
2502        public int getPid26_CitizenshipReps() {
2503            CE[] ret = null;
2504            try {
2505                Type[] t = this.getField(26);
2506                return t.length;  
2507            } catch (ClassCastException cce) {
2508                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2509                throw new RuntimeException(cce);
2510            } catch (HL7Exception he) {
2511                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2512                throw new RuntimeException(he);
2513            }
2514        }
2515    
2516    
2517    
2518        /**
2519         * Inserts a repetition of
2520         * PID-26: "Citizenship" at a specific index
2521         *
2522         * @param rep The repetition index (0-indexed)
2523         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2524         */
2525        public CE insertCitizenship(int rep) throws HL7Exception { 
2526            return (CE) super.insertRepetition(26, rep);
2527        }
2528    
2529    
2530    
2531        /**
2532         * Inserts a repetition of
2533         * PID-26: "Citizenship" at a specific index
2534         *
2535         * @param rep The repetition index (0-indexed)
2536         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2537         */
2538        public CE insertPid26_Citizenship(int rep) throws HL7Exception { 
2539            return (CE) super.insertRepetition(26, rep);
2540        }
2541    
2542    
2543        /**
2544         * Removes a repetition of
2545         * PID-26: "Citizenship" at a specific index
2546         *
2547         * @param rep The repetition index (0-indexed)
2548         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2549         */
2550        public CE removeCitizenship(int rep) throws HL7Exception { 
2551            return (CE) super.removeRepetition(26, rep);
2552        }
2553    
2554    
2555        /**
2556         * Removes a repetition of
2557         * PID-26: "Citizenship" at a specific index
2558         *
2559         * @param rep The repetition index (0-indexed)
2560         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2561         */
2562        public CE removePid26_Citizenship(int rep) throws HL7Exception { 
2563            return (CE) super.removeRepetition(26, rep);
2564        }
2565    
2566    
2567    
2568    
2569        /**
2570         * Returns
2571         * PID-27: "Veterans Military Status" - creates it if necessary
2572         */
2573        public CE getVeteransMilitaryStatus() { 
2574            CE ret = null;
2575            try {
2576                Type t = this.getField(27, 0);
2577                ret = (CE)t;
2578            } catch (ClassCastException cce) {
2579                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2580                throw new RuntimeException(cce);
2581            } catch (HL7Exception he) {
2582                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2583                throw new RuntimeException(he);
2584            }
2585            return ret;
2586        }
2587    
2588    
2589        /**
2590         * Returns
2591         * PID-27: "Veterans Military Status" - creates it if necessary
2592         */
2593        public CE getPid27_VeteransMilitaryStatus() { 
2594            CE ret = null;
2595            try {
2596                Type t = this.getField(27, 0);
2597                ret = (CE)t;
2598            } catch (ClassCastException cce) {
2599                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2600                throw new RuntimeException(cce);
2601            } catch (HL7Exception he) {
2602                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2603                throw new RuntimeException(he);
2604            }
2605            return ret;
2606        }
2607    
2608    
2609    
2610        /**
2611         * Returns
2612         * PID-28: "Nationality" - creates it if necessary
2613         */
2614        public CE getNationality() { 
2615            CE ret = null;
2616            try {
2617                Type t = this.getField(28, 0);
2618                ret = (CE)t;
2619            } catch (ClassCastException cce) {
2620                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2621                throw new RuntimeException(cce);
2622            } catch (HL7Exception he) {
2623                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2624                throw new RuntimeException(he);
2625            }
2626            return ret;
2627        }
2628    
2629    
2630        /**
2631         * Returns
2632         * PID-28: "Nationality" - creates it if necessary
2633         */
2634        public CE getPid28_Nationality() { 
2635            CE ret = null;
2636            try {
2637                Type t = this.getField(28, 0);
2638                ret = (CE)t;
2639            } catch (ClassCastException cce) {
2640                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2641                throw new RuntimeException(cce);
2642            } catch (HL7Exception he) {
2643                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2644                throw new RuntimeException(he);
2645            }
2646            return ret;
2647        }
2648    
2649    
2650    
2651        /**
2652         * Returns
2653         * PID-29: "Patient Death Date and Time" - creates it if necessary
2654         */
2655        public TS getPatientDeathDateAndTime() { 
2656            TS ret = null;
2657            try {
2658                Type t = this.getField(29, 0);
2659                ret = (TS)t;
2660            } catch (ClassCastException cce) {
2661                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2662                throw new RuntimeException(cce);
2663            } catch (HL7Exception he) {
2664                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2665                throw new RuntimeException(he);
2666            }
2667            return ret;
2668        }
2669    
2670    
2671        /**
2672         * Returns
2673         * PID-29: "Patient Death Date and Time" - creates it if necessary
2674         */
2675        public TS getPid29_PatientDeathDateAndTime() { 
2676            TS ret = null;
2677            try {
2678                Type t = this.getField(29, 0);
2679                ret = (TS)t;
2680            } catch (ClassCastException cce) {
2681                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2682                throw new RuntimeException(cce);
2683            } catch (HL7Exception he) {
2684                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2685                throw new RuntimeException(he);
2686            }
2687            return ret;
2688        }
2689    
2690    
2691    
2692        /**
2693         * Returns
2694         * PID-30: "Patient Death Indicator" - creates it if necessary
2695         */
2696        public ID getPatientDeathIndicator() { 
2697            ID ret = null;
2698            try {
2699                Type t = this.getField(30, 0);
2700                ret = (ID)t;
2701            } catch (ClassCastException cce) {
2702                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2703                throw new RuntimeException(cce);
2704            } catch (HL7Exception he) {
2705                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2706                throw new RuntimeException(he);
2707            }
2708            return ret;
2709        }
2710    
2711    
2712        /**
2713         * Returns
2714         * PID-30: "Patient Death Indicator" - creates it if necessary
2715         */
2716        public ID getPid30_PatientDeathIndicator() { 
2717            ID ret = null;
2718            try {
2719                Type t = this.getField(30, 0);
2720                ret = (ID)t;
2721            } catch (ClassCastException cce) {
2722                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2723                throw new RuntimeException(cce);
2724            } catch (HL7Exception he) {
2725                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2726                throw new RuntimeException(he);
2727            }
2728            return ret;
2729        }
2730    
2731    
2732    
2733        /**
2734         * Returns
2735         * PID-31: "Identity Unknown Indicator" - creates it if necessary
2736         */
2737        public ID getIdentityUnknownIndicator() { 
2738            ID ret = null;
2739            try {
2740                Type t = this.getField(31, 0);
2741                ret = (ID)t;
2742            } catch (ClassCastException cce) {
2743                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2744                throw new RuntimeException(cce);
2745            } catch (HL7Exception he) {
2746                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2747                throw new RuntimeException(he);
2748            }
2749            return ret;
2750        }
2751    
2752    
2753        /**
2754         * Returns
2755         * PID-31: "Identity Unknown Indicator" - creates it if necessary
2756         */
2757        public ID getPid31_IdentityUnknownIndicator() { 
2758            ID ret = null;
2759            try {
2760                Type t = this.getField(31, 0);
2761                ret = (ID)t;
2762            } catch (ClassCastException cce) {
2763                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2764                throw new RuntimeException(cce);
2765            } catch (HL7Exception he) {
2766                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2767                throw new RuntimeException(he);
2768            }
2769            return ret;
2770        }
2771    
2772    
2773        /**
2774         * Returns all repetitions of Identity Reliability Code (PID-32).
2775         */
2776        public IS[] getIdentityReliabilityCode() {
2777            IS[] ret = null;
2778            try {
2779                Type[] t = this.getField(32);  
2780                ret = new IS[t.length];
2781                for (int i = 0; i < ret.length; i++) {
2782                    ret[i] = (IS)t[i];
2783                }
2784            } catch (ClassCastException cce) {
2785                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2786                throw new RuntimeException(cce);
2787            } catch (HL7Exception he) {
2788                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2789                throw new RuntimeException(he);
2790            }
2791            return ret;
2792        }
2793    
2794    
2795        /**
2796         * Returns a count of the current number of repetitions of Identity Reliability Code (PID-32).
2797         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2798         * it will return zero.
2799         */
2800        public int getIdentityReliabilityCodeReps() {
2801            IS[] ret = null;
2802            try {
2803                Type[] t = this.getField(32);
2804                return t.length;  
2805            } catch (ClassCastException cce) {
2806                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2807                throw new RuntimeException(cce);
2808            } catch (HL7Exception he) {
2809                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2810                throw new RuntimeException(he);
2811            }
2812        }
2813    
2814    
2815        /**
2816         * Returns a specific repetition of
2817         * PID-32: "Identity Reliability Code" - creates it if necessary
2818         *
2819         * @param rep The repetition index (0-indexed)
2820         */
2821        public IS getIdentityReliabilityCode(int rep) { 
2822            IS ret = null;
2823            try {
2824                Type t = this.getField(32, rep);
2825                ret = (IS)t;
2826            } catch (ClassCastException cce) {
2827                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2828                throw new RuntimeException(cce);
2829            } catch (HL7Exception he) {
2830                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2831                throw new RuntimeException(he);
2832            }
2833            return ret;
2834        }
2835    
2836        /**
2837         * Returns a specific repetition of
2838         * PID-32: "Identity Reliability Code" - creates it if necessary
2839         *
2840         * @param rep The repetition index (0-indexed)
2841         */
2842        public IS getPid32_IdentityReliabilityCode(int rep) { 
2843            IS ret = null;
2844            try {
2845                Type t = this.getField(32, rep);
2846                ret = (IS)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         * Returns a count of the current number of repetitions of Identity Reliability Code (PID-32).
2860         * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
2861         * it will return zero.
2862         */
2863        public int getPid32_IdentityReliabilityCodeReps() {
2864            IS[] ret = null;
2865            try {
2866                Type[] t = this.getField(32);
2867                return t.length;  
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        }
2876    
2877    
2878    
2879        /**
2880         * Inserts a repetition of
2881         * PID-32: "Identity Reliability Code" at a specific index
2882         *
2883         * @param rep The repetition index (0-indexed)
2884         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2885         */
2886        public IS insertIdentityReliabilityCode(int rep) throws HL7Exception { 
2887            return (IS) super.insertRepetition(32, rep);
2888        }
2889    
2890    
2891    
2892        /**
2893         * Inserts a repetition of
2894         * PID-32: "Identity Reliability Code" at a specific index
2895         *
2896         * @param rep The repetition index (0-indexed)
2897         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2898         */
2899        public IS insertPid32_IdentityReliabilityCode(int rep) throws HL7Exception { 
2900            return (IS) super.insertRepetition(32, rep);
2901        }
2902    
2903    
2904        /**
2905         * Removes a repetition of
2906         * PID-32: "Identity Reliability Code" at a specific index
2907         *
2908         * @param rep The repetition index (0-indexed)
2909         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2910         */
2911        public IS removeIdentityReliabilityCode(int rep) throws HL7Exception { 
2912            return (IS) super.removeRepetition(32, rep);
2913        }
2914    
2915    
2916        /**
2917         * Removes a repetition of
2918         * PID-32: "Identity Reliability Code" at a specific index
2919         *
2920         * @param rep The repetition index (0-indexed)
2921         * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
2922         */
2923        public IS removePid32_IdentityReliabilityCode(int rep) throws HL7Exception { 
2924            return (IS) super.removeRepetition(32, rep);
2925        }
2926    
2927    
2928    
2929    
2930        /**
2931         * Returns
2932         * PID-33: "Last Update Date/Time" - creates it if necessary
2933         */
2934        public TS getLastUpdateDateTime() { 
2935            TS ret = null;
2936            try {
2937                Type t = this.getField(33, 0);
2938                ret = (TS)t;
2939            } catch (ClassCastException cce) {
2940                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2941                throw new RuntimeException(cce);
2942            } catch (HL7Exception he) {
2943                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2944                throw new RuntimeException(he);
2945            }
2946            return ret;
2947        }
2948    
2949    
2950        /**
2951         * Returns
2952         * PID-33: "Last Update Date/Time" - creates it if necessary
2953         */
2954        public TS getPid33_LastUpdateDateTime() { 
2955            TS ret = null;
2956            try {
2957                Type t = this.getField(33, 0);
2958                ret = (TS)t;
2959            } catch (ClassCastException cce) {
2960                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2961                throw new RuntimeException(cce);
2962            } catch (HL7Exception he) {
2963                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2964                throw new RuntimeException(he);
2965            }
2966            return ret;
2967        }
2968    
2969    
2970    
2971        /**
2972         * Returns
2973         * PID-34: "Last Update Facility" - creates it if necessary
2974         */
2975        public HD getLastUpdateFacility() { 
2976            HD ret = null;
2977            try {
2978                Type t = this.getField(34, 0);
2979                ret = (HD)t;
2980            } catch (ClassCastException cce) {
2981                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
2982                throw new RuntimeException(cce);
2983            } catch (HL7Exception he) {
2984                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
2985                throw new RuntimeException(he);
2986            }
2987            return ret;
2988        }
2989    
2990    
2991        /**
2992         * Returns
2993         * PID-34: "Last Update Facility" - creates it if necessary
2994         */
2995        public HD getPid34_LastUpdateFacility() { 
2996            HD ret = null;
2997            try {
2998                Type t = this.getField(34, 0);
2999                ret = (HD)t;
3000            } catch (ClassCastException cce) {
3001                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3002                throw new RuntimeException(cce);
3003            } catch (HL7Exception he) {
3004                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3005                throw new RuntimeException(he);
3006            }
3007            return ret;
3008        }
3009    
3010    
3011    
3012        /**
3013         * Returns
3014         * PID-35: "Species Code" - creates it if necessary
3015         */
3016        public CE getSpeciesCode() { 
3017            CE ret = null;
3018            try {
3019                Type t = this.getField(35, 0);
3020                ret = (CE)t;
3021            } catch (ClassCastException cce) {
3022                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3023                throw new RuntimeException(cce);
3024            } catch (HL7Exception he) {
3025                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3026                throw new RuntimeException(he);
3027            }
3028            return ret;
3029        }
3030    
3031    
3032        /**
3033         * Returns
3034         * PID-35: "Species Code" - creates it if necessary
3035         */
3036        public CE getPid35_SpeciesCode() { 
3037            CE ret = null;
3038            try {
3039                Type t = this.getField(35, 0);
3040                ret = (CE)t;
3041            } catch (ClassCastException cce) {
3042                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3043                throw new RuntimeException(cce);
3044            } catch (HL7Exception he) {
3045                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3046                throw new RuntimeException(he);
3047            }
3048            return ret;
3049        }
3050    
3051    
3052    
3053        /**
3054         * Returns
3055         * PID-36: "Breed Code" - creates it if necessary
3056         */
3057        public CE getBreedCode() { 
3058            CE ret = null;
3059            try {
3060                Type t = this.getField(36, 0);
3061                ret = (CE)t;
3062            } catch (ClassCastException cce) {
3063                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3064                throw new RuntimeException(cce);
3065            } catch (HL7Exception he) {
3066                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3067                throw new RuntimeException(he);
3068            }
3069            return ret;
3070        }
3071    
3072    
3073        /**
3074         * Returns
3075         * PID-36: "Breed Code" - creates it if necessary
3076         */
3077        public CE getPid36_BreedCode() { 
3078            CE ret = null;
3079            try {
3080                Type t = this.getField(36, 0);
3081                ret = (CE)t;
3082            } catch (ClassCastException cce) {
3083                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3084                throw new RuntimeException(cce);
3085            } catch (HL7Exception he) {
3086                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3087                throw new RuntimeException(he);
3088            }
3089            return ret;
3090        }
3091    
3092    
3093    
3094        /**
3095         * Returns
3096         * PID-37: "Strain" - creates it if necessary
3097         */
3098        public ST getStrain() { 
3099            ST ret = null;
3100            try {
3101                Type t = this.getField(37, 0);
3102                ret = (ST)t;
3103            } catch (ClassCastException cce) {
3104                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3105                throw new RuntimeException(cce);
3106            } catch (HL7Exception he) {
3107                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3108                throw new RuntimeException(he);
3109            }
3110            return ret;
3111        }
3112    
3113    
3114        /**
3115         * Returns
3116         * PID-37: "Strain" - creates it if necessary
3117         */
3118        public ST getPid37_Strain() { 
3119            ST ret = null;
3120            try {
3121                Type t = this.getField(37, 0);
3122                ret = (ST)t;
3123            } catch (ClassCastException cce) {
3124                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3125                throw new RuntimeException(cce);
3126            } catch (HL7Exception he) {
3127                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3128                throw new RuntimeException(he);
3129            }
3130            return ret;
3131        }
3132    
3133    
3134    
3135        /**
3136         * Returns
3137         * PID-38: "Production Class Code" - creates it if necessary
3138         */
3139        public CE getProductionClassCode() { 
3140            CE ret = null;
3141            try {
3142                Type t = this.getField(38, 0);
3143                ret = (CE)t;
3144            } catch (ClassCastException cce) {
3145                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3146                throw new RuntimeException(cce);
3147            } catch (HL7Exception he) {
3148                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3149                throw new RuntimeException(he);
3150            }
3151            return ret;
3152        }
3153    
3154    
3155        /**
3156         * Returns
3157         * PID-38: "Production Class Code" - creates it if necessary
3158         */
3159        public CE getPid38_ProductionClassCode() { 
3160            CE ret = null;
3161            try {
3162                Type t = this.getField(38, 0);
3163                ret = (CE)t;
3164            } catch (ClassCastException cce) {
3165                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", cce);
3166                throw new RuntimeException(cce);
3167            } catch (HL7Exception he) {
3168                HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value.  This is a bug.", he);
3169                throw new RuntimeException(he);
3170            }
3171            return ret;
3172        }
3173    
3174    
3175    
3176    
3177    
3178        /** {@inheritDoc} */   
3179        protected Type createNewTypeWithoutReflection(int field) {
3180           switch (field) {
3181              case 0: return new SI(getMessage());
3182              case 1: return new CX(getMessage());
3183              case 2: return new CX(getMessage());
3184              case 3: return new CX(getMessage());
3185              case 4: return new XPN(getMessage());
3186              case 5: return new XPN(getMessage());
3187              case 6: return new TS(getMessage());
3188              case 7: return new IS(getMessage(), new Integer( 1 ));
3189              case 8: return new XPN(getMessage());
3190              case 9: return new CE(getMessage());
3191              case 10: return new XAD(getMessage());
3192              case 11: return new IS(getMessage(), new Integer( 289 ));
3193              case 12: return new XTN(getMessage());
3194              case 13: return new XTN(getMessage());
3195              case 14: return new CE(getMessage());
3196              case 15: return new CE(getMessage());
3197              case 16: return new CE(getMessage());
3198              case 17: return new CX(getMessage());
3199              case 18: return new ST(getMessage());
3200              case 19: return new DLN(getMessage());
3201              case 20: return new CX(getMessage());
3202              case 21: return new CE(getMessage());
3203              case 22: return new ST(getMessage());
3204              case 23: return new ID(getMessage(), new Integer( 136 ));
3205              case 24: return new NM(getMessage());
3206              case 25: return new CE(getMessage());
3207              case 26: return new CE(getMessage());
3208              case 27: return new CE(getMessage());
3209              case 28: return new TS(getMessage());
3210              case 29: return new ID(getMessage(), new Integer( 136 ));
3211              case 30: return new ID(getMessage(), new Integer( 136 ));
3212              case 31: return new IS(getMessage(), new Integer( 445 ));
3213              case 32: return new TS(getMessage());
3214              case 33: return new HD(getMessage());
3215              case 34: return new CE(getMessage());
3216              case 35: return new CE(getMessage());
3217              case 36: return new ST(getMessage());
3218              case 37: return new CE(getMessage());
3219              default: return null;
3220           }
3221       }
3222    
3223    
3224    }
3225