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