View Javadoc
1   /*
2    * This class is an auto-generated source file for a HAPI
3    * HL7 v2.x standard structure class.
4    *
5    * For more information, visit: http://hl7api.sourceforge.net/
6    * 
7    * The contents of this file are subject to the Mozilla Public License Version 1.1 
8    * (the "License"); you may not use this file except in compliance with the License. 
9    * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
10   * Software distributed under the License is distributed on an "AS IS" basis, 
11   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
12   * specific language governing rights and limitations under the License. 
13   * 
14   * The Original Code is "[file_name]".  Description: 
15   * "[one_line_description]" 
16   * 
17   * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
18   * 2012.  All Rights Reserved. 
19   * 
20   * Contributor(s): ______________________________________. 
21   * 
22   * Alternatively, the contents of this file may be used under the terms of the 
23   * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
24   * applicable instead of those above.  If you wish to allow use of your version of this 
25   * file only under the terms of the GPL and not to allow others to use your version 
26   * of this file under the MPL, indicate your decision by deleting  the provisions above 
27   * and replace  them with the notice and other provisions required by the GPL License.  
28   * If you do not delete the provisions above, a recipient may use your version of 
29   * this file under either the MPL or the GPL. 
30   * 
31   */
32  
33  
34  package ca.uhn.hl7v2.model.v23.segment;
35  
36  // import ca.uhn.hl7v2.model.v23.group.*;
37  import ca.uhn.hl7v2.model.v23.datatype.*;
38  import ca.uhn.hl7v2.HL7Exception;
39  import ca.uhn.hl7v2.parser.ModelClassFactory;
40  import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
41  import ca.uhn.hl7v2.model.AbstractMessage;
42  import ca.uhn.hl7v2.model.Group;
43  import ca.uhn.hl7v2.model.Type;
44  import ca.uhn.hl7v2.model.AbstractSegment;
45  import ca.uhn.hl7v2.model.Varies;
46  
47  
48  /**
49   *<p>Represents an HL7 PID message segment (Patient Identification). 
50   * This segment has the following fields:</p>
51   * <ul>
52       * <li>PID-1: Set ID - Patient ID (SI) <b>optional </b>
53       * <li>PID-2: Patient ID (External ID) (CX) <b>optional </b>
54       * <li>PID-3: Patient ID (Internal ID) (CX) <b> repeating</b>
55       * <li>PID-4: Alternate Patient ID (CX) <b>optional </b>
56       * <li>PID-5: Patient Name (XPN) <b> repeating</b>
57       * <li>PID-6: Mother's Maiden Name (XPN) <b>optional </b>
58       * <li>PID-7: Date of Birth (TS) <b>optional </b>
59       * <li>PID-8: Sex (IS) <b>optional </b>
60       * <li>PID-9: Patient Alias (XPN) <b>optional repeating</b>
61       * <li>PID-10: Race (IS) <b>optional </b>
62       * <li>PID-11: Patient Address (XAD) <b>optional repeating</b>
63       * <li>PID-12: County Code (IS) <b>optional </b>
64       * <li>PID-13: Phone Number - Home (XTN) <b>optional repeating</b>
65       * <li>PID-14: Phone Number - Business (XTN) <b>optional repeating</b>
66       * <li>PID-15: Primary Language (CE) <b>optional </b>
67       * <li>PID-16: Marital Status (IS) <b>optional repeating</b>
68       * <li>PID-17: Religion (IS) <b>optional </b>
69       * <li>PID-18: Patient Account Number (CX) <b>optional </b>
70       * <li>PID-19: SSN Number - Patient (ST) <b>optional </b>
71       * <li>PID-20: Driver's License Number (DLN) <b>optional </b>
72       * <li>PID-21: Mother's Identifier (CX) <b>optional </b>
73       * <li>PID-22: Ethnic Group (IS) <b>optional </b>
74       * <li>PID-23: Birth Place (ST) <b>optional </b>
75       * <li>PID-24: Multiple Birth Indicator (ID) <b>optional </b>
76       * <li>PID-25: Birth Order (NM) <b>optional </b>
77       * <li>PID-26: Citizenship (IS) <b>optional </b>
78       * <li>PID-27: Veterans Military Status (CE) <b>optional </b>
79       * <li>PID-28: Nationality Code (CE) <b>optional </b>
80       * <li>PID-29: Patient Death Date and Time (TS) <b>optional </b>
81       * <li>PID-30: Patient Death Indicator (ID) <b>optional </b>
82   * </ul>
83   */
84  @SuppressWarnings("unused")
85  public class PID extends AbstractSegment {
86  
87      /** 
88       * Creates a new PID segment
89       */
90      public PID(Group parent, ModelClassFactory factory) {
91         super(parent, factory);
92         init(factory);
93      }
94  
95      private void init(ModelClassFactory factory) {
96         try {
97                                    this.add(SI.class, false, 1, 4, new Object[]{ getMessage() }, "Set ID - Patient ID");
98                                    this.add(CX.class, false, 1, 16, new Object[]{ getMessage() }, "Patient ID (External ID)");
99                                    this.add(CX.class, true, 0, 20, new Object[]{ getMessage() }, "Patient ID (Internal ID)");
100                                   this.add(CX.class, false, 1, 12, new Object[]{ getMessage() }, "Alternate Patient ID");
101                                   this.add(XPN.class, true, -1, 48, new Object[]{ getMessage() }, "Patient Name");
102                                   this.add(XPN.class, false, 1, 48, new Object[]{ getMessage() }, "Mother's Maiden Name");
103                                   this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Date of Birth");
104                                               this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(1) }, "Sex");
105                                   this.add(XPN.class, false, 0, 48, new Object[]{ getMessage() }, "Patient Alias");
106                                               this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(5) }, "Race");
107                                   this.add(XAD.class, false, 0, 106, new Object[]{ getMessage() }, "Patient Address");
108                                               this.add(IS.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "County Code");
109                                   this.add(XTN.class, false, 0, 40, new Object[]{ getMessage() }, "Phone Number - Home");
110                                   this.add(XTN.class, false, 0, 40, new Object[]{ getMessage() }, "Phone Number - Business");
111                                   this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Primary Language");
112                                               this.add(IS.class, false, 0, 1, new Object[]{ getMessage(), new Integer(2) }, "Marital Status");
113                                               this.add(IS.class, false, 1, 3, new Object[]{ getMessage(), new Integer(6) }, "Religion");
114                                   this.add(CX.class, false, 1, 20, new Object[]{ getMessage() }, "Patient Account Number");
115                                   this.add(ST.class, false, 1, 16, new Object[]{ getMessage() }, "SSN Number - Patient");
116                                   this.add(DLN.class, false, 1, 25, new Object[]{ getMessage() }, "Driver's License Number");
117                                   this.add(CX.class, false, 1, 20, new Object[]{ getMessage() }, "Mother's Identifier");
118                                               this.add(IS.class, false, 1, 1, new Object[]{ getMessage(), new Integer(189) }, "Ethnic Group");
119                                   this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Birth Place");
120                                               this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(136) }, "Multiple Birth Indicator");
121                                   this.add(NM.class, false, 1, 2, new Object[]{ getMessage() }, "Birth Order");
122                                               this.add(IS.class, false, 1, 4, new Object[]{ getMessage(), new Integer(171) }, "Citizenship");
123                                   this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Veterans Military Status");
124                                   this.add(CE.class, false, 1, 80, new Object[]{ getMessage() }, "Nationality Code");
125                                   this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Patient Death Date and Time");
126                                               this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Patient Death Indicator");
127        } catch(HL7Exception e) {
128           log.error("Unexpected error creating PID - this is probably a bug in the source code generator.", e);
129        }
130     }
131 
132 
133 
134     /**
135      * Returns
136      * PID-1: "Set ID - Patient ID" - creates it if necessary
137      */
138     public SI getSetIDPatientID() { 
139 		SI retVal = this.getTypedField(1, 0);
140 		return retVal;
141     }
142     
143     /**
144      * Returns
145      * PID-1: "Set ID - Patient ID" - creates it if necessary
146      */
147     public SI getPid1_SetIDPatientID() { 
148 		SI retVal = this.getTypedField(1, 0);
149 		return retVal;
150     }
151 
152 
153 
154     /**
155      * Returns
156      * PID-2: "Patient ID (External ID)" - creates it if necessary
157      */
158     public CX getPatientIDExternalID() { 
159 		CX retVal = this.getTypedField(2, 0);
160 		return retVal;
161     }
162     
163     /**
164      * Returns
165      * PID-2: "Patient ID (External ID)" - creates it if necessary
166      */
167     public CX getPid2_PatientIDExternalID() { 
168 		CX retVal = this.getTypedField(2, 0);
169 		return retVal;
170     }
171 
172 
173     /**
174      * Returns all repetitions of Patient ID (Internal ID) (PID-3).
175      */
176     public CX[] getPatientIDInternalID() {
177     	CX[] retVal = this.getTypedField(3, new CX[0]);
178     	return retVal;
179     }
180 
181 
182     /**
183      * Returns all repetitions of Patient ID (Internal ID) (PID-3).
184      */
185     public CX[] getPid3_PatientIDInternalID() {
186     	CX[] retVal = this.getTypedField(3, new CX[0]);
187     	return retVal;
188     }
189 
190 
191     /**
192      * Returns a count of the current number of repetitions of Patient ID (Internal ID) (PID-3).
193      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
194      * it will return zero.
195      */
196     public int getPatientIDInternalIDReps() {
197     	return this.getReps(3);
198     }
199 
200 
201     /**
202      * Returns a specific repetition of
203      * PID-3: "Patient ID (Internal ID)" - creates it if necessary
204      *
205      * @param rep The repetition index (0-indexed)
206      */
207     public CX getPatientIDInternalID(int rep) { 
208 		CX retVal = this.getTypedField(3, rep);
209 		return retVal;
210     }
211 
212     /**
213      * Returns a specific repetition of
214      * PID-3: "Patient ID (Internal ID)" - creates it if necessary
215      *
216      * @param rep The repetition index (0-indexed)
217      */
218     public CX getPid3_PatientIDInternalID(int rep) { 
219 		CX retVal = this.getTypedField(3, rep);
220 		return retVal;
221     }
222 
223     /**
224      * Returns a count of the current number of repetitions of Patient ID (Internal ID) (PID-3).
225      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
226      * it will return zero.
227      */
228     public int getPid3_PatientIDInternalIDReps() {
229     	return this.getReps(3);
230     }
231 
232 
233     /**
234      * Inserts a repetition of
235      * PID-3: "Patient ID (Internal ID)" at a specific index
236      *
237      * @param rep The repetition index (0-indexed)
238      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
239      */
240     public CX insertPatientIDInternalID(int rep) throws HL7Exception { 
241         return (CX) super.insertRepetition(3, rep);
242     }
243 
244 
245     /**
246      * Inserts a repetition of
247      * PID-3: "Patient ID (Internal ID)" at a specific index
248      *
249      * @param rep The repetition index (0-indexed)
250      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
251      */
252     public CX insertPid3_PatientIDInternalID(int rep) throws HL7Exception { 
253         return (CX) super.insertRepetition(3, rep);
254     }
255 
256 
257     /**
258      * Removes a repetition of
259      * PID-3: "Patient ID (Internal ID)" at a specific index
260      *
261      * @param rep The repetition index (0-indexed)
262      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
263      */
264     public CX removePatientIDInternalID(int rep) throws HL7Exception { 
265         return (CX) super.removeRepetition(3, rep);
266     }
267 
268 
269     /**
270      * Removes a repetition of
271      * PID-3: "Patient ID (Internal ID)" at a specific index
272      *
273      * @param rep The repetition index (0-indexed)
274      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
275      */
276     public CX removePid3_PatientIDInternalID(int rep) throws HL7Exception { 
277         return (CX) super.removeRepetition(3, rep);
278     }
279 
280 
281 
282 
283     /**
284      * Returns
285      * PID-4: "Alternate Patient ID" - creates it if necessary
286      */
287     public CX getAlternatePatientID() { 
288 		CX retVal = this.getTypedField(4, 0);
289 		return retVal;
290     }
291     
292     /**
293      * Returns
294      * PID-4: "Alternate Patient ID" - creates it if necessary
295      */
296     public CX getPid4_AlternatePatientID() { 
297 		CX retVal = this.getTypedField(4, 0);
298 		return retVal;
299     }
300 
301 
302     /**
303      * Returns all repetitions of Patient Name (PID-5).
304      */
305     public XPN[] getPatientName() {
306     	XPN[] retVal = this.getTypedField(5, new XPN[0]);
307     	return retVal;
308     }
309 
310 
311     /**
312      * Returns all repetitions of Patient Name (PID-5).
313      */
314     public XPN[] getPid5_PatientName() {
315     	XPN[] retVal = this.getTypedField(5, new XPN[0]);
316     	return retVal;
317     }
318 
319 
320     /**
321      * Returns a count of the current number of repetitions of Patient Name (PID-5).
322      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
323      * it will return zero.
324      */
325     public int getPatientNameReps() {
326     	return this.getReps(5);
327     }
328 
329 
330     /**
331      * Returns a specific repetition of
332      * PID-5: "Patient Name" - creates it if necessary
333      *
334      * @param rep The repetition index (0-indexed)
335      */
336     public XPN getPatientName(int rep) { 
337 		XPN retVal = this.getTypedField(5, rep);
338 		return retVal;
339     }
340 
341     /**
342      * Returns a specific repetition of
343      * PID-5: "Patient Name" - creates it if necessary
344      *
345      * @param rep The repetition index (0-indexed)
346      */
347     public XPN getPid5_PatientName(int rep) { 
348 		XPN retVal = this.getTypedField(5, rep);
349 		return retVal;
350     }
351 
352     /**
353      * Returns a count of the current number of repetitions of Patient Name (PID-5).
354      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
355      * it will return zero.
356      */
357     public int getPid5_PatientNameReps() {
358     	return this.getReps(5);
359     }
360 
361 
362     /**
363      * Inserts a repetition of
364      * PID-5: "Patient Name" at a specific index
365      *
366      * @param rep The repetition index (0-indexed)
367      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
368      */
369     public XPN insertPatientName(int rep) throws HL7Exception { 
370         return (XPN) super.insertRepetition(5, rep);
371     }
372 
373 
374     /**
375      * Inserts a repetition of
376      * PID-5: "Patient Name" at a specific index
377      *
378      * @param rep The repetition index (0-indexed)
379      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
380      */
381     public XPN insertPid5_PatientName(int rep) throws HL7Exception { 
382         return (XPN) super.insertRepetition(5, rep);
383     }
384 
385 
386     /**
387      * Removes a repetition of
388      * PID-5: "Patient Name" at a specific index
389      *
390      * @param rep The repetition index (0-indexed)
391      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
392      */
393     public XPN removePatientName(int rep) throws HL7Exception { 
394         return (XPN) super.removeRepetition(5, rep);
395     }
396 
397 
398     /**
399      * Removes a repetition of
400      * PID-5: "Patient Name" at a specific index
401      *
402      * @param rep The repetition index (0-indexed)
403      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
404      */
405     public XPN removePid5_PatientName(int rep) throws HL7Exception { 
406         return (XPN) super.removeRepetition(5, rep);
407     }
408 
409 
410 
411 
412     /**
413      * Returns
414      * PID-6: "Mother's Maiden Name" - creates it if necessary
415      */
416     public XPN getMotherSMaidenName() { 
417 		XPN retVal = this.getTypedField(6, 0);
418 		return retVal;
419     }
420     
421     /**
422      * Returns
423      * PID-6: "Mother's Maiden Name" - creates it if necessary
424      */
425     public XPN getPid6_MotherSMaidenName() { 
426 		XPN retVal = this.getTypedField(6, 0);
427 		return retVal;
428     }
429 
430 
431 
432     /**
433      * Returns
434      * PID-7: "Date of Birth" - creates it if necessary
435      */
436     public TS getDateOfBirth() { 
437 		TS retVal = this.getTypedField(7, 0);
438 		return retVal;
439     }
440     
441     /**
442      * Returns
443      * PID-7: "Date of Birth" - creates it if necessary
444      */
445     public TS getPid7_DateOfBirth() { 
446 		TS retVal = this.getTypedField(7, 0);
447 		return retVal;
448     }
449 
450 
451 
452     /**
453      * Returns
454      * PID-8: "Sex" - creates it if necessary
455      */
456     public IS getSex() { 
457 		IS retVal = this.getTypedField(8, 0);
458 		return retVal;
459     }
460     
461     /**
462      * Returns
463      * PID-8: "Sex" - creates it if necessary
464      */
465     public IS getPid8_Sex() { 
466 		IS retVal = this.getTypedField(8, 0);
467 		return retVal;
468     }
469 
470 
471     /**
472      * Returns all repetitions of Patient Alias (PID-9).
473      */
474     public XPN[] getPatientAlias() {
475     	XPN[] retVal = this.getTypedField(9, new XPN[0]);
476     	return retVal;
477     }
478 
479 
480     /**
481      * Returns all repetitions of Patient Alias (PID-9).
482      */
483     public XPN[] getPid9_PatientAlias() {
484     	XPN[] retVal = this.getTypedField(9, new XPN[0]);
485     	return retVal;
486     }
487 
488 
489     /**
490      * Returns a count of the current number of repetitions of Patient Alias (PID-9).
491      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
492      * it will return zero.
493      */
494     public int getPatientAliasReps() {
495     	return this.getReps(9);
496     }
497 
498 
499     /**
500      * Returns a specific repetition of
501      * PID-9: "Patient Alias" - creates it if necessary
502      *
503      * @param rep The repetition index (0-indexed)
504      */
505     public XPN getPatientAlias(int rep) { 
506 		XPN retVal = this.getTypedField(9, rep);
507 		return retVal;
508     }
509 
510     /**
511      * Returns a specific repetition of
512      * PID-9: "Patient Alias" - creates it if necessary
513      *
514      * @param rep The repetition index (0-indexed)
515      */
516     public XPN getPid9_PatientAlias(int rep) { 
517 		XPN retVal = this.getTypedField(9, rep);
518 		return retVal;
519     }
520 
521     /**
522      * Returns a count of the current number of repetitions of Patient Alias (PID-9).
523      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
524      * it will return zero.
525      */
526     public int getPid9_PatientAliasReps() {
527     	return this.getReps(9);
528     }
529 
530 
531     /**
532      * Inserts a repetition of
533      * PID-9: "Patient Alias" at a specific index
534      *
535      * @param rep The repetition index (0-indexed)
536      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
537      */
538     public XPN insertPatientAlias(int rep) throws HL7Exception { 
539         return (XPN) super.insertRepetition(9, rep);
540     }
541 
542 
543     /**
544      * Inserts a repetition of
545      * PID-9: "Patient Alias" at a specific index
546      *
547      * @param rep The repetition index (0-indexed)
548      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
549      */
550     public XPN insertPid9_PatientAlias(int rep) throws HL7Exception { 
551         return (XPN) super.insertRepetition(9, rep);
552     }
553 
554 
555     /**
556      * Removes a repetition of
557      * PID-9: "Patient Alias" at a specific index
558      *
559      * @param rep The repetition index (0-indexed)
560      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
561      */
562     public XPN removePatientAlias(int rep) throws HL7Exception { 
563         return (XPN) super.removeRepetition(9, rep);
564     }
565 
566 
567     /**
568      * Removes a repetition of
569      * PID-9: "Patient Alias" at a specific index
570      *
571      * @param rep The repetition index (0-indexed)
572      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
573      */
574     public XPN removePid9_PatientAlias(int rep) throws HL7Exception { 
575         return (XPN) super.removeRepetition(9, rep);
576     }
577 
578 
579 
580 
581     /**
582      * Returns
583      * PID-10: "Race" - creates it if necessary
584      */
585     public IS getRace() { 
586 		IS retVal = this.getTypedField(10, 0);
587 		return retVal;
588     }
589     
590     /**
591      * Returns
592      * PID-10: "Race" - creates it if necessary
593      */
594     public IS getPid10_Race() { 
595 		IS retVal = this.getTypedField(10, 0);
596 		return retVal;
597     }
598 
599 
600     /**
601      * Returns all repetitions of Patient Address (PID-11).
602      */
603     public XAD[] getPatientAddress() {
604     	XAD[] retVal = this.getTypedField(11, new XAD[0]);
605     	return retVal;
606     }
607 
608 
609     /**
610      * Returns all repetitions of Patient Address (PID-11).
611      */
612     public XAD[] getPid11_PatientAddress() {
613     	XAD[] retVal = this.getTypedField(11, new XAD[0]);
614     	return retVal;
615     }
616 
617 
618     /**
619      * Returns a count of the current number of repetitions of Patient Address (PID-11).
620      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
621      * it will return zero.
622      */
623     public int getPatientAddressReps() {
624     	return this.getReps(11);
625     }
626 
627 
628     /**
629      * Returns a specific repetition of
630      * PID-11: "Patient Address" - creates it if necessary
631      *
632      * @param rep The repetition index (0-indexed)
633      */
634     public XAD getPatientAddress(int rep) { 
635 		XAD retVal = this.getTypedField(11, rep);
636 		return retVal;
637     }
638 
639     /**
640      * Returns a specific repetition of
641      * PID-11: "Patient Address" - creates it if necessary
642      *
643      * @param rep The repetition index (0-indexed)
644      */
645     public XAD getPid11_PatientAddress(int rep) { 
646 		XAD retVal = this.getTypedField(11, rep);
647 		return retVal;
648     }
649 
650     /**
651      * Returns a count of the current number of repetitions of Patient Address (PID-11).
652      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
653      * it will return zero.
654      */
655     public int getPid11_PatientAddressReps() {
656     	return this.getReps(11);
657     }
658 
659 
660     /**
661      * Inserts a repetition of
662      * PID-11: "Patient Address" at a specific index
663      *
664      * @param rep The repetition index (0-indexed)
665      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
666      */
667     public XAD insertPatientAddress(int rep) throws HL7Exception { 
668         return (XAD) super.insertRepetition(11, rep);
669     }
670 
671 
672     /**
673      * Inserts a repetition of
674      * PID-11: "Patient Address" at a specific index
675      *
676      * @param rep The repetition index (0-indexed)
677      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
678      */
679     public XAD insertPid11_PatientAddress(int rep) throws HL7Exception { 
680         return (XAD) super.insertRepetition(11, rep);
681     }
682 
683 
684     /**
685      * Removes a repetition of
686      * PID-11: "Patient Address" at a specific index
687      *
688      * @param rep The repetition index (0-indexed)
689      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
690      */
691     public XAD removePatientAddress(int rep) throws HL7Exception { 
692         return (XAD) super.removeRepetition(11, rep);
693     }
694 
695 
696     /**
697      * Removes a repetition of
698      * PID-11: "Patient Address" at a specific index
699      *
700      * @param rep The repetition index (0-indexed)
701      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
702      */
703     public XAD removePid11_PatientAddress(int rep) throws HL7Exception { 
704         return (XAD) super.removeRepetition(11, rep);
705     }
706 
707 
708 
709 
710     /**
711      * Returns
712      * PID-12: "County Code" - creates it if necessary
713      */
714     public IS getCountyCode() { 
715 		IS retVal = this.getTypedField(12, 0);
716 		return retVal;
717     }
718     
719     /**
720      * Returns
721      * PID-12: "County Code" - creates it if necessary
722      */
723     public IS getPid12_CountyCode() { 
724 		IS retVal = this.getTypedField(12, 0);
725 		return retVal;
726     }
727 
728 
729     /**
730      * Returns all repetitions of Phone Number - Home (PID-13).
731      */
732     public XTN[] getPhoneNumberHome() {
733     	XTN[] retVal = this.getTypedField(13, new XTN[0]);
734     	return retVal;
735     }
736 
737 
738     /**
739      * Returns all repetitions of Phone Number - Home (PID-13).
740      */
741     public XTN[] getPid13_PhoneNumberHome() {
742     	XTN[] retVal = this.getTypedField(13, new XTN[0]);
743     	return retVal;
744     }
745 
746 
747     /**
748      * Returns a count of the current number of repetitions of Phone Number - Home (PID-13).
749      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
750      * it will return zero.
751      */
752     public int getPhoneNumberHomeReps() {
753     	return this.getReps(13);
754     }
755 
756 
757     /**
758      * Returns a specific repetition of
759      * PID-13: "Phone Number - Home" - creates it if necessary
760      *
761      * @param rep The repetition index (0-indexed)
762      */
763     public XTN getPhoneNumberHome(int rep) { 
764 		XTN retVal = this.getTypedField(13, rep);
765 		return retVal;
766     }
767 
768     /**
769      * Returns a specific repetition of
770      * PID-13: "Phone Number - Home" - creates it if necessary
771      *
772      * @param rep The repetition index (0-indexed)
773      */
774     public XTN getPid13_PhoneNumberHome(int rep) { 
775 		XTN retVal = this.getTypedField(13, rep);
776 		return retVal;
777     }
778 
779     /**
780      * Returns a count of the current number of repetitions of Phone Number - Home (PID-13).
781      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
782      * it will return zero.
783      */
784     public int getPid13_PhoneNumberHomeReps() {
785     	return this.getReps(13);
786     }
787 
788 
789     /**
790      * Inserts a repetition of
791      * PID-13: "Phone Number - Home" 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 insertPhoneNumberHome(int rep) throws HL7Exception { 
797         return (XTN) super.insertRepetition(13, rep);
798     }
799 
800 
801     /**
802      * Inserts a repetition of
803      * PID-13: "Phone Number - Home" 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 insertPid13_PhoneNumberHome(int rep) throws HL7Exception { 
809         return (XTN) super.insertRepetition(13, rep);
810     }
811 
812 
813     /**
814      * Removes a repetition of
815      * PID-13: "Phone Number - Home" 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 removePhoneNumberHome(int rep) throws HL7Exception { 
821         return (XTN) super.removeRepetition(13, rep);
822     }
823 
824 
825     /**
826      * Removes a repetition of
827      * PID-13: "Phone Number - Home" at a specific index
828      *
829      * @param rep The repetition index (0-indexed)
830      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
831      */
832     public XTN removePid13_PhoneNumberHome(int rep) throws HL7Exception { 
833         return (XTN) super.removeRepetition(13, rep);
834     }
835 
836 
837 
838     /**
839      * Returns all repetitions of Phone Number - Business (PID-14).
840      */
841     public XTN[] getPhoneNumberBusiness() {
842     	XTN[] retVal = this.getTypedField(14, new XTN[0]);
843     	return retVal;
844     }
845 
846 
847     /**
848      * Returns all repetitions of Phone Number - Business (PID-14).
849      */
850     public XTN[] getPid14_PhoneNumberBusiness() {
851     	XTN[] retVal = this.getTypedField(14, new XTN[0]);
852     	return retVal;
853     }
854 
855 
856     /**
857      * Returns a count of the current number of repetitions of Phone Number - Business (PID-14).
858      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
859      * it will return zero.
860      */
861     public int getPhoneNumberBusinessReps() {
862     	return this.getReps(14);
863     }
864 
865 
866     /**
867      * Returns a specific repetition of
868      * PID-14: "Phone Number - Business" - creates it if necessary
869      *
870      * @param rep The repetition index (0-indexed)
871      */
872     public XTN getPhoneNumberBusiness(int rep) { 
873 		XTN retVal = this.getTypedField(14, rep);
874 		return retVal;
875     }
876 
877     /**
878      * Returns a specific repetition of
879      * PID-14: "Phone Number - Business" - creates it if necessary
880      *
881      * @param rep The repetition index (0-indexed)
882      */
883     public XTN getPid14_PhoneNumberBusiness(int rep) { 
884 		XTN retVal = this.getTypedField(14, rep);
885 		return retVal;
886     }
887 
888     /**
889      * Returns a count of the current number of repetitions of Phone Number - Business (PID-14).
890      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
891      * it will return zero.
892      */
893     public int getPid14_PhoneNumberBusinessReps() {
894     	return this.getReps(14);
895     }
896 
897 
898     /**
899      * Inserts a repetition of
900      * PID-14: "Phone Number - Business" at a specific index
901      *
902      * @param rep The repetition index (0-indexed)
903      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
904      */
905     public XTN insertPhoneNumberBusiness(int rep) throws HL7Exception { 
906         return (XTN) super.insertRepetition(14, rep);
907     }
908 
909 
910     /**
911      * Inserts a repetition of
912      * PID-14: "Phone Number - Business" at a specific index
913      *
914      * @param rep The repetition index (0-indexed)
915      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
916      */
917     public XTN insertPid14_PhoneNumberBusiness(int rep) throws HL7Exception { 
918         return (XTN) super.insertRepetition(14, rep);
919     }
920 
921 
922     /**
923      * Removes a repetition of
924      * PID-14: "Phone Number - Business" at a specific index
925      *
926      * @param rep The repetition index (0-indexed)
927      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
928      */
929     public XTN removePhoneNumberBusiness(int rep) throws HL7Exception { 
930         return (XTN) super.removeRepetition(14, rep);
931     }
932 
933 
934     /**
935      * Removes a repetition of
936      * PID-14: "Phone Number - Business" at a specific index
937      *
938      * @param rep The repetition index (0-indexed)
939      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
940      */
941     public XTN removePid14_PhoneNumberBusiness(int rep) throws HL7Exception { 
942         return (XTN) super.removeRepetition(14, rep);
943     }
944 
945 
946 
947 
948     /**
949      * Returns
950      * PID-15: "Primary Language" - creates it if necessary
951      */
952     public CE getPrimaryLanguage() { 
953 		CE retVal = this.getTypedField(15, 0);
954 		return retVal;
955     }
956     
957     /**
958      * Returns
959      * PID-15: "Primary Language" - creates it if necessary
960      */
961     public CE getPid15_PrimaryLanguage() { 
962 		CE retVal = this.getTypedField(15, 0);
963 		return retVal;
964     }
965 
966 
967     /**
968      * Returns all repetitions of Marital Status (PID-16).
969      */
970     public IS[] getMaritalStatus() {
971     	IS[] retVal = this.getTypedField(16, new IS[0]);
972     	return retVal;
973     }
974 
975 
976     /**
977      * Returns all repetitions of Marital Status (PID-16).
978      */
979     public IS[] getPid16_MaritalStatus() {
980     	IS[] retVal = this.getTypedField(16, new IS[0]);
981     	return retVal;
982     }
983 
984 
985     /**
986      * Returns a count of the current number of repetitions of Marital Status (PID-16).
987      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
988      * it will return zero.
989      */
990     public int getMaritalStatusReps() {
991     	return this.getReps(16);
992     }
993 
994 
995     /**
996      * Returns a specific repetition of
997      * PID-16: "Marital Status" - creates it if necessary
998      *
999      * @param rep The repetition index (0-indexed)
1000      */
1001     public IS getMaritalStatus(int rep) { 
1002 		IS retVal = this.getTypedField(16, rep);
1003 		return retVal;
1004     }
1005 
1006     /**
1007      * Returns a specific repetition of
1008      * PID-16: "Marital Status" - creates it if necessary
1009      *
1010      * @param rep The repetition index (0-indexed)
1011      */
1012     public IS getPid16_MaritalStatus(int rep) { 
1013 		IS retVal = this.getTypedField(16, rep);
1014 		return retVal;
1015     }
1016 
1017     /**
1018      * Returns a count of the current number of repetitions of Marital Status (PID-16).
1019      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1020      * it will return zero.
1021      */
1022     public int getPid16_MaritalStatusReps() {
1023     	return this.getReps(16);
1024     }
1025 
1026 
1027     /**
1028      * Inserts a repetition of
1029      * PID-16: "Marital Status" at a specific index
1030      *
1031      * @param rep The repetition index (0-indexed)
1032      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1033      */
1034     public IS insertMaritalStatus(int rep) throws HL7Exception { 
1035         return (IS) super.insertRepetition(16, rep);
1036     }
1037 
1038 
1039     /**
1040      * Inserts a repetition of
1041      * PID-16: "Marital Status" at a specific index
1042      *
1043      * @param rep The repetition index (0-indexed)
1044      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1045      */
1046     public IS insertPid16_MaritalStatus(int rep) throws HL7Exception { 
1047         return (IS) super.insertRepetition(16, rep);
1048     }
1049 
1050 
1051     /**
1052      * Removes a repetition of
1053      * PID-16: "Marital Status" at a specific index
1054      *
1055      * @param rep The repetition index (0-indexed)
1056      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1057      */
1058     public IS removeMaritalStatus(int rep) throws HL7Exception { 
1059         return (IS) super.removeRepetition(16, rep);
1060     }
1061 
1062 
1063     /**
1064      * Removes a repetition of
1065      * PID-16: "Marital Status" at a specific index
1066      *
1067      * @param rep The repetition index (0-indexed)
1068      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1069      */
1070     public IS removePid16_MaritalStatus(int rep) throws HL7Exception { 
1071         return (IS) super.removeRepetition(16, rep);
1072     }
1073 
1074 
1075 
1076 
1077     /**
1078      * Returns
1079      * PID-17: "Religion" - creates it if necessary
1080      */
1081     public IS getReligion() { 
1082 		IS retVal = this.getTypedField(17, 0);
1083 		return retVal;
1084     }
1085     
1086     /**
1087      * Returns
1088      * PID-17: "Religion" - creates it if necessary
1089      */
1090     public IS getPid17_Religion() { 
1091 		IS retVal = this.getTypedField(17, 0);
1092 		return retVal;
1093     }
1094 
1095 
1096 
1097     /**
1098      * Returns
1099      * PID-18: "Patient Account Number" - creates it if necessary
1100      */
1101     public CX getPatientAccountNumber() { 
1102 		CX retVal = this.getTypedField(18, 0);
1103 		return retVal;
1104     }
1105     
1106     /**
1107      * Returns
1108      * PID-18: "Patient Account Number" - creates it if necessary
1109      */
1110     public CX getPid18_PatientAccountNumber() { 
1111 		CX retVal = this.getTypedField(18, 0);
1112 		return retVal;
1113     }
1114 
1115 
1116 
1117     /**
1118      * Returns
1119      * PID-19: "SSN Number - Patient" - creates it if necessary
1120      */
1121     public ST getSSNNumberPatient() { 
1122 		ST retVal = this.getTypedField(19, 0);
1123 		return retVal;
1124     }
1125     
1126     /**
1127      * Returns
1128      * PID-19: "SSN Number - Patient" - creates it if necessary
1129      */
1130     public ST getPid19_SSNNumberPatient() { 
1131 		ST retVal = this.getTypedField(19, 0);
1132 		return retVal;
1133     }
1134 
1135 
1136 
1137     /**
1138      * Returns
1139      * PID-20: "Driver's License Number" - creates it if necessary
1140      */
1141     public DLN getDriverSLicenseNumber() { 
1142 		DLN retVal = this.getTypedField(20, 0);
1143 		return retVal;
1144     }
1145     
1146     /**
1147      * Returns
1148      * PID-20: "Driver's License Number" - creates it if necessary
1149      */
1150     public DLN getPid20_DriverSLicenseNumber() { 
1151 		DLN retVal = this.getTypedField(20, 0);
1152 		return retVal;
1153     }
1154 
1155 
1156 
1157     /**
1158      * Returns
1159      * PID-21: "Mother's Identifier" - creates it if necessary
1160      */
1161     public CX getMotherSIdentifier() { 
1162 		CX retVal = this.getTypedField(21, 0);
1163 		return retVal;
1164     }
1165     
1166     /**
1167      * Returns
1168      * PID-21: "Mother's Identifier" - creates it if necessary
1169      */
1170     public CX getPid21_MotherSIdentifier() { 
1171 		CX retVal = this.getTypedField(21, 0);
1172 		return retVal;
1173     }
1174 
1175 
1176 
1177     /**
1178      * Returns
1179      * PID-22: "Ethnic Group" - creates it if necessary
1180      */
1181     public IS getEthnicGroup() { 
1182 		IS retVal = this.getTypedField(22, 0);
1183 		return retVal;
1184     }
1185     
1186     /**
1187      * Returns
1188      * PID-22: "Ethnic Group" - creates it if necessary
1189      */
1190     public IS getPid22_EthnicGroup() { 
1191 		IS retVal = this.getTypedField(22, 0);
1192 		return retVal;
1193     }
1194 
1195 
1196 
1197     /**
1198      * Returns
1199      * PID-23: "Birth Place" - creates it if necessary
1200      */
1201     public ST getBirthPlace() { 
1202 		ST retVal = this.getTypedField(23, 0);
1203 		return retVal;
1204     }
1205     
1206     /**
1207      * Returns
1208      * PID-23: "Birth Place" - creates it if necessary
1209      */
1210     public ST getPid23_BirthPlace() { 
1211 		ST retVal = this.getTypedField(23, 0);
1212 		return retVal;
1213     }
1214 
1215 
1216 
1217     /**
1218      * Returns
1219      * PID-24: "Multiple Birth Indicator" - creates it if necessary
1220      */
1221     public ID getMultipleBirthIndicator() { 
1222 		ID retVal = this.getTypedField(24, 0);
1223 		return retVal;
1224     }
1225     
1226     /**
1227      * Returns
1228      * PID-24: "Multiple Birth Indicator" - creates it if necessary
1229      */
1230     public ID getPid24_MultipleBirthIndicator() { 
1231 		ID retVal = this.getTypedField(24, 0);
1232 		return retVal;
1233     }
1234 
1235 
1236 
1237     /**
1238      * Returns
1239      * PID-25: "Birth Order" - creates it if necessary
1240      */
1241     public NM getBirthOrder() { 
1242 		NM retVal = this.getTypedField(25, 0);
1243 		return retVal;
1244     }
1245     
1246     /**
1247      * Returns
1248      * PID-25: "Birth Order" - creates it if necessary
1249      */
1250     public NM getPid25_BirthOrder() { 
1251 		NM retVal = this.getTypedField(25, 0);
1252 		return retVal;
1253     }
1254 
1255 
1256 
1257     /**
1258      * Returns
1259      * PID-26: "Citizenship" - creates it if necessary
1260      */
1261     public IS getCitizenship() { 
1262 		IS retVal = this.getTypedField(26, 0);
1263 		return retVal;
1264     }
1265     
1266     /**
1267      * Returns
1268      * PID-26: "Citizenship" - creates it if necessary
1269      */
1270     public IS getPid26_Citizenship() { 
1271 		IS retVal = this.getTypedField(26, 0);
1272 		return retVal;
1273     }
1274 
1275 
1276 
1277     /**
1278      * Returns
1279      * PID-27: "Veterans Military Status" - creates it if necessary
1280      */
1281     public CE getVeteransMilitaryStatus() { 
1282 		CE retVal = this.getTypedField(27, 0);
1283 		return retVal;
1284     }
1285     
1286     /**
1287      * Returns
1288      * PID-27: "Veterans Military Status" - creates it if necessary
1289      */
1290     public CE getPid27_VeteransMilitaryStatus() { 
1291 		CE retVal = this.getTypedField(27, 0);
1292 		return retVal;
1293     }
1294 
1295 
1296 
1297     /**
1298      * Returns
1299      * PID-28: "Nationality Code" - creates it if necessary
1300      */
1301     public CE getNationalityCode() { 
1302 		CE retVal = this.getTypedField(28, 0);
1303 		return retVal;
1304     }
1305     
1306     /**
1307      * Returns
1308      * PID-28: "Nationality Code" - creates it if necessary
1309      */
1310     public CE getPid28_NationalityCode() { 
1311 		CE retVal = this.getTypedField(28, 0);
1312 		return retVal;
1313     }
1314 
1315 
1316 
1317     /**
1318      * Returns
1319      * PID-29: "Patient Death Date and Time" - creates it if necessary
1320      */
1321     public TS getPatientDeathDateAndTime() { 
1322 		TS retVal = this.getTypedField(29, 0);
1323 		return retVal;
1324     }
1325     
1326     /**
1327      * Returns
1328      * PID-29: "Patient Death Date and Time" - creates it if necessary
1329      */
1330     public TS getPid29_PatientDeathDateAndTime() { 
1331 		TS retVal = this.getTypedField(29, 0);
1332 		return retVal;
1333     }
1334 
1335 
1336 
1337     /**
1338      * Returns
1339      * PID-30: "Patient Death Indicator" - creates it if necessary
1340      */
1341     public ID getPatientDeathIndicator() { 
1342 		ID retVal = this.getTypedField(30, 0);
1343 		return retVal;
1344     }
1345     
1346     /**
1347      * Returns
1348      * PID-30: "Patient Death Indicator" - creates it if necessary
1349      */
1350     public ID getPid30_PatientDeathIndicator() { 
1351 		ID retVal = this.getTypedField(30, 0);
1352 		return retVal;
1353     }
1354 
1355 
1356 
1357 
1358 
1359     /** {@inheritDoc} */   
1360     protected Type createNewTypeWithoutReflection(int field) {
1361        switch (field) {
1362           case 0: return new SI(getMessage());
1363           case 1: return new CX(getMessage());
1364           case 2: return new CX(getMessage());
1365           case 3: return new CX(getMessage());
1366           case 4: return new XPN(getMessage());
1367           case 5: return new XPN(getMessage());
1368           case 6: return new TS(getMessage());
1369           case 7: return new IS(getMessage(), new Integer( 1 ));
1370           case 8: return new XPN(getMessage());
1371           case 9: return new IS(getMessage(), new Integer( 5 ));
1372           case 10: return new XAD(getMessage());
1373           case 11: return new IS(getMessage(), new Integer( 0 ));
1374           case 12: return new XTN(getMessage());
1375           case 13: return new XTN(getMessage());
1376           case 14: return new CE(getMessage());
1377           case 15: return new IS(getMessage(), new Integer( 2 ));
1378           case 16: return new IS(getMessage(), new Integer( 6 ));
1379           case 17: return new CX(getMessage());
1380           case 18: return new ST(getMessage());
1381           case 19: return new DLN(getMessage());
1382           case 20: return new CX(getMessage());
1383           case 21: return new IS(getMessage(), new Integer( 189 ));
1384           case 22: return new ST(getMessage());
1385           case 23: return new ID(getMessage(), new Integer( 136 ));
1386           case 24: return new NM(getMessage());
1387           case 25: return new IS(getMessage(), new Integer( 171 ));
1388           case 26: return new CE(getMessage());
1389           case 27: return new CE(getMessage());
1390           case 28: return new TS(getMessage());
1391           case 29: return new ID(getMessage(), new Integer( 136 ));
1392           default: return null;
1393        }
1394    }
1395 
1396 
1397 }
1398