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 * The contents of this file are subject to the Mozilla Public License Version 1.1 
008 * (the "License"); you may not use this file except in compliance with the License. 
009 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
010 * Software distributed under the License is distributed on an "AS IS" basis, 
011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
012 * specific language governing rights and limitations under the License. 
013 * 
014 * The Original Code is "[file_name]".  Description: 
015 * "[one_line_description]" 
016 * 
017 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
018 * 2012.  All Rights Reserved. 
019 * 
020 * Contributor(s): ______________________________________. 
021 * 
022 * Alternatively, the contents of this file may be used under the terms of the 
023 * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
024 * applicable instead of those above.  If you wish to allow use of your version of this 
025 * file only under the terms of the GPL and not to allow others to use your version 
026 * of this file under the MPL, indicate your decision by deleting  the provisions above 
027 * and replace  them with the notice and other provisions required by the GPL License.  
028 * If you do not delete the provisions above, a recipient may use your version of 
029 * this file under either the MPL or the GPL. 
030 * 
031 */
032
033
034package ca.uhn.hl7v2.model.v22.segment;
035
036// import ca.uhn.hl7v2.model.v22.group.*;
037import ca.uhn.hl7v2.model.v22.datatype.*;
038import ca.uhn.hl7v2.HL7Exception;
039import ca.uhn.hl7v2.parser.ModelClassFactory;
040import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
041import ca.uhn.hl7v2.model.AbstractMessage;
042import ca.uhn.hl7v2.model.Group;
043import ca.uhn.hl7v2.model.Type;
044import ca.uhn.hl7v2.model.AbstractSegment;
045import ca.uhn.hl7v2.model.Varies;
046
047/**
048 *<p>Represents an HL7 PID message segment (PATIENT IDENTIFICATION). 
049 * This segment has the following fields:</p>
050 * <ul>
051     * <li>PID-1: Set ID - Patient ID (SI) <b>optional </b>
052     * <li>PID-2: Patient ID (External ID) (CK) <b>optional </b>
053     * <li>PID-3: Patient ID (Internal ID) (CM_PAT_ID) <b> repeating</b>
054     * <li>PID-4: Alternate Patient ID (ST) <b>optional </b>
055     * <li>PID-5: Patient Name (PN) <b> </b>
056     * <li>PID-6: Mother's Maiden Name (ST) <b>optional </b>
057     * <li>PID-7: Date of Birth (TS) <b>optional </b>
058     * <li>PID-8: Sex (ID) <b>optional </b>
059     * <li>PID-9: Patient Alias (PN) <b>optional repeating</b>
060     * <li>PID-10: Race (ID) <b>optional </b>
061     * <li>PID-11: Patient Address (AD) <b>optional repeating</b>
062     * <li>PID-12: County code (ID) <b>optional </b>
063     * <li>PID-13: Phone Number - Home (TN) <b>optional repeating</b>
064     * <li>PID-14: Phone Number - Business (TN) <b>optional repeating</b>
065     * <li>PID-15: Language - Patient (ST) <b>optional </b>
066     * <li>PID-16: Marital Status (ID) <b>optional </b>
067     * <li>PID-17: Religion (ID) <b>optional </b>
068     * <li>PID-18: Patient Account Number (CK) <b>optional </b>
069     * <li>PID-19: Social security number - patient (ST) <b>optional </b>
070     * <li>PID-20: Driver's license number - patient (CM_LICENSE_NO) <b>optional </b>
071     * <li>PID-21: Mother's Identifier (CK) <b>optional </b>
072     * <li>PID-22: Ethnic Group (ID) <b>optional </b>
073     * <li>PID-23: Birth Place (ST) <b>optional </b>
074     * <li>PID-24: Multiple Birth Indicator (ID) <b>optional </b>
075     * <li>PID-25: Birth Order (NM) <b>optional </b>
076     * <li>PID-26: Citizenship (ID) <b>optional repeating</b>
077     * <li>PID-27: Veterans Military Status (ST) <b>optional </b>
078 * </ul>
079 */
080@SuppressWarnings("unused")
081public class PID extends AbstractSegment {
082
083    /** 
084     * Creates a new PID segment
085     */
086    public PID(Group parent, ModelClassFactory factory) {
087       super(parent, factory);
088       init(factory);
089    }
090
091    private void init(ModelClassFactory factory) {
092       try {
093                                  this.add(SI.class, false, 1, 4, new Object[]{ getMessage() }, "Set ID - Patient ID");
094                                  this.add(CK.class, false, 1, 16, new Object[]{ getMessage() }, "Patient ID (External ID)");
095                                  this.add(CM_PAT_ID.class, true, 0, 20, new Object[]{ getMessage() }, "Patient ID (Internal ID)");
096                                  this.add(ST.class, false, 1, 12, new Object[]{ getMessage() }, "Alternate Patient ID");
097                                  this.add(PN.class, true, 1, 48, new Object[]{ getMessage() }, "Patient Name");
098                                  this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "Mother's Maiden Name");
099                                  this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Date of Birth");
100                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(1) }, "Sex");
101                                  this.add(PN.class, false, 0, 48, new Object[]{ getMessage() }, "Patient Alias");
102                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(5) }, "Race");
103                                  this.add(AD.class, false, 3, 106, new Object[]{ getMessage() }, "Patient Address");
104                                              this.add(ID.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "County code");
105                                  this.add(TN.class, false, 3, 40, new Object[]{ getMessage() }, "Phone Number - Home");
106                                  this.add(TN.class, false, 3, 40, new Object[]{ getMessage() }, "Phone Number - Business");
107                                  this.add(ST.class, false, 1, 25, new Object[]{ getMessage() }, "Language - Patient");
108                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(2) }, "Marital Status");
109                                              this.add(ID.class, false, 1, 3, new Object[]{ getMessage(), new Integer(6) }, "Religion");
110                                  this.add(CK.class, false, 1, 20, new Object[]{ getMessage() }, "Patient Account Number");
111                                  this.add(ST.class, false, 1, 16, new Object[]{ getMessage() }, "Social security number - patient");
112                                  this.add(CM_LICENSE_NO.class, false, 1, 25, new Object[]{ getMessage() }, "Driver's license number - patient");
113                                  this.add(CK.class, false, 1, 20, new Object[]{ getMessage() }, "Mother's Identifier");
114                                              this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(189) }, "Ethnic Group");
115                                  this.add(ST.class, false, 1, 25, new Object[]{ getMessage() }, "Birth Place");
116                                              this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(0) }, "Multiple Birth Indicator");
117                                  this.add(NM.class, false, 1, 2, new Object[]{ getMessage() }, "Birth Order");
118                                              this.add(ID.class, false, 0, 3, new Object[]{ getMessage(), new Integer(171) }, "Citizenship");
119                                  this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Veterans Military Status");
120       } catch(HL7Exception e) {
121          log.error("Unexpected error creating PID - this is probably a bug in the source code generator.", e);
122       }
123    }
124
125
126
127    /**
128     * Returns
129     * PID-1: "Set ID - Patient ID" - creates it if necessary
130     */
131    public SI getSetIDPatientID() { 
132                SI retVal = this.getTypedField(1, 0);
133                return retVal;
134    }
135    
136    /**
137     * Returns
138     * PID-1: "Set ID - Patient ID" - creates it if necessary
139     */
140    public SI getPid1_SetIDPatientID() { 
141                SI retVal = this.getTypedField(1, 0);
142                return retVal;
143    }
144
145
146
147    /**
148     * Returns
149     * PID-2: "Patient ID (External ID)" - creates it if necessary
150     */
151    public CK getPatientIDExternalID() { 
152                CK retVal = this.getTypedField(2, 0);
153                return retVal;
154    }
155    
156    /**
157     * Returns
158     * PID-2: "Patient ID (External ID)" - creates it if necessary
159     */
160    public CK getPid2_PatientIDExternalID() { 
161                CK retVal = this.getTypedField(2, 0);
162                return retVal;
163    }
164
165
166    /**
167     * Returns all repetitions of Patient ID (Internal ID) (PID-3).
168     */
169    public CM_PAT_ID[] getPatientIDInternalID() {
170        CM_PAT_ID[] retVal = this.getTypedField(3, new CM_PAT_ID[0]);
171        return retVal;
172    }
173
174
175    /**
176     * Returns all repetitions of Patient ID (Internal ID) (PID-3).
177     */
178    public CM_PAT_ID[] getPid3_PatientIDInternalID() {
179        CM_PAT_ID[] retVal = this.getTypedField(3, new CM_PAT_ID[0]);
180        return retVal;
181    }
182
183
184    /**
185     * Returns a count of the current number of repetitions of Patient ID (Internal ID) (PID-3).
186     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
187     * it will return zero.
188     */
189    public int getPatientIDInternalIDReps() {
190        return this.getReps(3);
191    }
192
193
194    /**
195     * Returns a specific repetition of
196     * PID-3: "Patient ID (Internal ID)" - creates it if necessary
197     *
198     * @param rep The repetition index (0-indexed)
199     */
200    public CM_PAT_ID getPatientIDInternalID(int rep) { 
201                CM_PAT_ID retVal = this.getTypedField(3, rep);
202                return retVal;
203    }
204
205    /**
206     * Returns a specific repetition of
207     * PID-3: "Patient ID (Internal ID)" - creates it if necessary
208     *
209     * @param rep The repetition index (0-indexed)
210     */
211    public CM_PAT_ID getPid3_PatientIDInternalID(int rep) { 
212                CM_PAT_ID retVal = this.getTypedField(3, rep);
213                return retVal;
214    }
215
216    /**
217     * Returns a count of the current number of repetitions of Patient ID (Internal ID) (PID-3).
218     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
219     * it will return zero.
220     */
221    public int getPid3_PatientIDInternalIDReps() {
222        return this.getReps(3);
223    }
224
225
226    /**
227     * Inserts a repetition of
228     * PID-3: "Patient ID (Internal ID)" at a specific index
229     *
230     * @param rep The repetition index (0-indexed)
231     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
232     */
233    public CM_PAT_ID insertPatientIDInternalID(int rep) throws HL7Exception { 
234        return (CM_PAT_ID) super.insertRepetition(3, rep);
235    }
236
237
238    /**
239     * Inserts a repetition of
240     * PID-3: "Patient ID (Internal ID)" at a specific index
241     *
242     * @param rep The repetition index (0-indexed)
243     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
244     */
245    public CM_PAT_ID insertPid3_PatientIDInternalID(int rep) throws HL7Exception { 
246        return (CM_PAT_ID) super.insertRepetition(3, rep);
247    }
248
249
250    /**
251     * Removes a repetition of
252     * PID-3: "Patient ID (Internal ID)" at a specific index
253     *
254     * @param rep The repetition index (0-indexed)
255     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
256     */
257    public CM_PAT_ID removePatientIDInternalID(int rep) throws HL7Exception { 
258        return (CM_PAT_ID) super.removeRepetition(3, rep);
259    }
260
261
262    /**
263     * Removes a repetition of
264     * PID-3: "Patient ID (Internal ID)" at a specific index
265     *
266     * @param rep The repetition index (0-indexed)
267     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
268     */
269    public CM_PAT_ID removePid3_PatientIDInternalID(int rep) throws HL7Exception { 
270        return (CM_PAT_ID) super.removeRepetition(3, rep);
271    }
272
273
274
275
276    /**
277     * Returns
278     * PID-4: "Alternate Patient ID" - creates it if necessary
279     */
280    public ST getAlternatePatientID() { 
281                ST retVal = this.getTypedField(4, 0);
282                return retVal;
283    }
284    
285    /**
286     * Returns
287     * PID-4: "Alternate Patient ID" - creates it if necessary
288     */
289    public ST getPid4_AlternatePatientID() { 
290                ST retVal = this.getTypedField(4, 0);
291                return retVal;
292    }
293
294
295
296    /**
297     * Returns
298     * PID-5: "Patient Name" - creates it if necessary
299     */
300    public PN getPatientName() { 
301                PN retVal = this.getTypedField(5, 0);
302                return retVal;
303    }
304    
305    /**
306     * Returns
307     * PID-5: "Patient Name" - creates it if necessary
308     */
309    public PN getPid5_PatientName() { 
310                PN retVal = this.getTypedField(5, 0);
311                return retVal;
312    }
313
314
315
316    /**
317     * Returns
318     * PID-6: "Mother's Maiden Name" - creates it if necessary
319     */
320    public ST getMotherSMaidenName() { 
321                ST retVal = this.getTypedField(6, 0);
322                return retVal;
323    }
324    
325    /**
326     * Returns
327     * PID-6: "Mother's Maiden Name" - creates it if necessary
328     */
329    public ST getPid6_MotherSMaidenName() { 
330                ST retVal = this.getTypedField(6, 0);
331                return retVal;
332    }
333
334
335
336    /**
337     * Returns
338     * PID-7: "Date of Birth" - creates it if necessary
339     */
340    public TS getDateOfBirth() { 
341                TS retVal = this.getTypedField(7, 0);
342                return retVal;
343    }
344    
345    /**
346     * Returns
347     * PID-7: "Date of Birth" - creates it if necessary
348     */
349    public TS getPid7_DateOfBirth() { 
350                TS retVal = this.getTypedField(7, 0);
351                return retVal;
352    }
353
354
355
356    /**
357     * Returns
358     * PID-8: "Sex" - creates it if necessary
359     */
360    public ID getSex() { 
361                ID retVal = this.getTypedField(8, 0);
362                return retVal;
363    }
364    
365    /**
366     * Returns
367     * PID-8: "Sex" - creates it if necessary
368     */
369    public ID getPid8_Sex() { 
370                ID retVal = this.getTypedField(8, 0);
371                return retVal;
372    }
373
374
375    /**
376     * Returns all repetitions of Patient Alias (PID-9).
377     */
378    public PN[] getPatientAlias() {
379        PN[] retVal = this.getTypedField(9, new PN[0]);
380        return retVal;
381    }
382
383
384    /**
385     * Returns all repetitions of Patient Alias (PID-9).
386     */
387    public PN[] getPid9_PatientAlias() {
388        PN[] retVal = this.getTypedField(9, new PN[0]);
389        return retVal;
390    }
391
392
393    /**
394     * Returns a count of the current number of repetitions of Patient Alias (PID-9).
395     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
396     * it will return zero.
397     */
398    public int getPatientAliasReps() {
399        return this.getReps(9);
400    }
401
402
403    /**
404     * Returns a specific repetition of
405     * PID-9: "Patient Alias" - creates it if necessary
406     *
407     * @param rep The repetition index (0-indexed)
408     */
409    public PN getPatientAlias(int rep) { 
410                PN retVal = this.getTypedField(9, rep);
411                return retVal;
412    }
413
414    /**
415     * Returns a specific repetition of
416     * PID-9: "Patient Alias" - creates it if necessary
417     *
418     * @param rep The repetition index (0-indexed)
419     */
420    public PN getPid9_PatientAlias(int rep) { 
421                PN retVal = this.getTypedField(9, rep);
422                return retVal;
423    }
424
425    /**
426     * Returns a count of the current number of repetitions of Patient Alias (PID-9).
427     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
428     * it will return zero.
429     */
430    public int getPid9_PatientAliasReps() {
431        return this.getReps(9);
432    }
433
434
435    /**
436     * Inserts a repetition of
437     * PID-9: "Patient Alias" at a specific index
438     *
439     * @param rep The repetition index (0-indexed)
440     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
441     */
442    public PN insertPatientAlias(int rep) throws HL7Exception { 
443        return (PN) super.insertRepetition(9, rep);
444    }
445
446
447    /**
448     * Inserts a repetition of
449     * PID-9: "Patient Alias" at a specific index
450     *
451     * @param rep The repetition index (0-indexed)
452     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
453     */
454    public PN insertPid9_PatientAlias(int rep) throws HL7Exception { 
455        return (PN) super.insertRepetition(9, rep);
456    }
457
458
459    /**
460     * Removes a repetition of
461     * PID-9: "Patient Alias" at a specific index
462     *
463     * @param rep The repetition index (0-indexed)
464     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
465     */
466    public PN removePatientAlias(int rep) throws HL7Exception { 
467        return (PN) super.removeRepetition(9, rep);
468    }
469
470
471    /**
472     * Removes a repetition of
473     * PID-9: "Patient Alias" at a specific index
474     *
475     * @param rep The repetition index (0-indexed)
476     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
477     */
478    public PN removePid9_PatientAlias(int rep) throws HL7Exception { 
479        return (PN) super.removeRepetition(9, rep);
480    }
481
482
483
484
485    /**
486     * Returns
487     * PID-10: "Race" - creates it if necessary
488     */
489    public ID getRace() { 
490                ID retVal = this.getTypedField(10, 0);
491                return retVal;
492    }
493    
494    /**
495     * Returns
496     * PID-10: "Race" - creates it if necessary
497     */
498    public ID getPid10_Race() { 
499                ID retVal = this.getTypedField(10, 0);
500                return retVal;
501    }
502
503
504    /**
505     * Returns all repetitions of Patient Address (PID-11).
506     */
507    public AD[] getPatientAddress() {
508        AD[] retVal = this.getTypedField(11, new AD[0]);
509        return retVal;
510    }
511
512
513    /**
514     * Returns all repetitions of Patient Address (PID-11).
515     */
516    public AD[] getPid11_PatientAddress() {
517        AD[] retVal = this.getTypedField(11, new AD[0]);
518        return retVal;
519    }
520
521
522    /**
523     * Returns a count of the current number of repetitions of Patient Address (PID-11).
524     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
525     * it will return zero.
526     */
527    public int getPatientAddressReps() {
528        return this.getReps(11);
529    }
530
531
532    /**
533     * Returns a specific repetition of
534     * PID-11: "Patient Address" - creates it if necessary
535     *
536     * @param rep The repetition index (0-indexed)
537     */
538    public AD getPatientAddress(int rep) { 
539                AD retVal = this.getTypedField(11, rep);
540                return retVal;
541    }
542
543    /**
544     * Returns a specific repetition of
545     * PID-11: "Patient Address" - creates it if necessary
546     *
547     * @param rep The repetition index (0-indexed)
548     */
549    public AD getPid11_PatientAddress(int rep) { 
550                AD retVal = this.getTypedField(11, rep);
551                return retVal;
552    }
553
554    /**
555     * Returns a count of the current number of repetitions of Patient Address (PID-11).
556     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
557     * it will return zero.
558     */
559    public int getPid11_PatientAddressReps() {
560        return this.getReps(11);
561    }
562
563
564    /**
565     * Inserts a repetition of
566     * PID-11: "Patient Address" at a specific index
567     *
568     * @param rep The repetition index (0-indexed)
569     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
570     */
571    public AD insertPatientAddress(int rep) throws HL7Exception { 
572        return (AD) super.insertRepetition(11, rep);
573    }
574
575
576    /**
577     * Inserts a repetition of
578     * PID-11: "Patient Address" at a specific index
579     *
580     * @param rep The repetition index (0-indexed)
581     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
582     */
583    public AD insertPid11_PatientAddress(int rep) throws HL7Exception { 
584        return (AD) super.insertRepetition(11, rep);
585    }
586
587
588    /**
589     * Removes a repetition of
590     * PID-11: "Patient Address" at a specific index
591     *
592     * @param rep The repetition index (0-indexed)
593     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
594     */
595    public AD removePatientAddress(int rep) throws HL7Exception { 
596        return (AD) super.removeRepetition(11, rep);
597    }
598
599
600    /**
601     * Removes a repetition of
602     * PID-11: "Patient Address" at a specific index
603     *
604     * @param rep The repetition index (0-indexed)
605     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
606     */
607    public AD removePid11_PatientAddress(int rep) throws HL7Exception { 
608        return (AD) super.removeRepetition(11, rep);
609    }
610
611
612
613
614    /**
615     * Returns
616     * PID-12: "County code" - creates it if necessary
617     */
618    public ID getCountyCode() { 
619                ID retVal = this.getTypedField(12, 0);
620                return retVal;
621    }
622    
623    /**
624     * Returns
625     * PID-12: "County code" - creates it if necessary
626     */
627    public ID getPid12_CountyCode() { 
628                ID retVal = this.getTypedField(12, 0);
629                return retVal;
630    }
631
632
633    /**
634     * Returns all repetitions of Phone Number - Home (PID-13).
635     */
636    public TN[] getPhoneNumberHome() {
637        TN[] retVal = this.getTypedField(13, new TN[0]);
638        return retVal;
639    }
640
641
642    /**
643     * Returns all repetitions of Phone Number - Home (PID-13).
644     */
645    public TN[] getPid13_PhoneNumberHome() {
646        TN[] retVal = this.getTypedField(13, new TN[0]);
647        return retVal;
648    }
649
650
651    /**
652     * Returns a count of the current number of repetitions of Phone Number - Home (PID-13).
653     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
654     * it will return zero.
655     */
656    public int getPhoneNumberHomeReps() {
657        return this.getReps(13);
658    }
659
660
661    /**
662     * Returns a specific repetition of
663     * PID-13: "Phone Number - Home" - creates it if necessary
664     *
665     * @param rep The repetition index (0-indexed)
666     */
667    public TN getPhoneNumberHome(int rep) { 
668                TN retVal = this.getTypedField(13, rep);
669                return retVal;
670    }
671
672    /**
673     * Returns a specific repetition of
674     * PID-13: "Phone Number - Home" - creates it if necessary
675     *
676     * @param rep The repetition index (0-indexed)
677     */
678    public TN getPid13_PhoneNumberHome(int rep) { 
679                TN retVal = this.getTypedField(13, rep);
680                return retVal;
681    }
682
683    /**
684     * Returns a count of the current number of repetitions of Phone Number - Home (PID-13).
685     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
686     * it will return zero.
687     */
688    public int getPid13_PhoneNumberHomeReps() {
689        return this.getReps(13);
690    }
691
692
693    /**
694     * Inserts a repetition of
695     * PID-13: "Phone Number - Home" at a specific index
696     *
697     * @param rep The repetition index (0-indexed)
698     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
699     */
700    public TN insertPhoneNumberHome(int rep) throws HL7Exception { 
701        return (TN) super.insertRepetition(13, rep);
702    }
703
704
705    /**
706     * Inserts a repetition of
707     * PID-13: "Phone Number - Home" at a specific index
708     *
709     * @param rep The repetition index (0-indexed)
710     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
711     */
712    public TN insertPid13_PhoneNumberHome(int rep) throws HL7Exception { 
713        return (TN) super.insertRepetition(13, rep);
714    }
715
716
717    /**
718     * Removes a repetition of
719     * PID-13: "Phone Number - Home" at a specific index
720     *
721     * @param rep The repetition index (0-indexed)
722     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
723     */
724    public TN removePhoneNumberHome(int rep) throws HL7Exception { 
725        return (TN) super.removeRepetition(13, rep);
726    }
727
728
729    /**
730     * Removes a repetition of
731     * PID-13: "Phone Number - Home" at a specific index
732     *
733     * @param rep The repetition index (0-indexed)
734     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
735     */
736    public TN removePid13_PhoneNumberHome(int rep) throws HL7Exception { 
737        return (TN) super.removeRepetition(13, rep);
738    }
739
740
741
742    /**
743     * Returns all repetitions of Phone Number - Business (PID-14).
744     */
745    public TN[] getPhoneNumberBusiness() {
746        TN[] retVal = this.getTypedField(14, new TN[0]);
747        return retVal;
748    }
749
750
751    /**
752     * Returns all repetitions of Phone Number - Business (PID-14).
753     */
754    public TN[] getPid14_PhoneNumberBusiness() {
755        TN[] retVal = this.getTypedField(14, new TN[0]);
756        return retVal;
757    }
758
759
760    /**
761     * Returns a count of the current number of repetitions of Phone Number - Business (PID-14).
762     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
763     * it will return zero.
764     */
765    public int getPhoneNumberBusinessReps() {
766        return this.getReps(14);
767    }
768
769
770    /**
771     * Returns a specific repetition of
772     * PID-14: "Phone Number - Business" - creates it if necessary
773     *
774     * @param rep The repetition index (0-indexed)
775     */
776    public TN getPhoneNumberBusiness(int rep) { 
777                TN retVal = this.getTypedField(14, rep);
778                return retVal;
779    }
780
781    /**
782     * Returns a specific repetition of
783     * PID-14: "Phone Number - Business" - creates it if necessary
784     *
785     * @param rep The repetition index (0-indexed)
786     */
787    public TN getPid14_PhoneNumberBusiness(int rep) { 
788                TN retVal = this.getTypedField(14, rep);
789                return retVal;
790    }
791
792    /**
793     * Returns a count of the current number of repetitions of Phone Number - Business (PID-14).
794     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
795     * it will return zero.
796     */
797    public int getPid14_PhoneNumberBusinessReps() {
798        return this.getReps(14);
799    }
800
801
802    /**
803     * Inserts a repetition of
804     * PID-14: "Phone Number - Business" at a specific index
805     *
806     * @param rep The repetition index (0-indexed)
807     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
808     */
809    public TN insertPhoneNumberBusiness(int rep) throws HL7Exception { 
810        return (TN) super.insertRepetition(14, rep);
811    }
812
813
814    /**
815     * Inserts a repetition of
816     * PID-14: "Phone Number - Business" at a specific index
817     *
818     * @param rep The repetition index (0-indexed)
819     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
820     */
821    public TN insertPid14_PhoneNumberBusiness(int rep) throws HL7Exception { 
822        return (TN) super.insertRepetition(14, rep);
823    }
824
825
826    /**
827     * Removes a repetition of
828     * PID-14: "Phone Number - Business" at a specific index
829     *
830     * @param rep The repetition index (0-indexed)
831     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
832     */
833    public TN removePhoneNumberBusiness(int rep) throws HL7Exception { 
834        return (TN) super.removeRepetition(14, rep);
835    }
836
837
838    /**
839     * Removes a repetition of
840     * PID-14: "Phone Number - Business" at a specific index
841     *
842     * @param rep The repetition index (0-indexed)
843     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
844     */
845    public TN removePid14_PhoneNumberBusiness(int rep) throws HL7Exception { 
846        return (TN) super.removeRepetition(14, rep);
847    }
848
849
850
851
852    /**
853     * Returns
854     * PID-15: "Language - Patient" - creates it if necessary
855     */
856    public ST getLanguagePatient() { 
857                ST retVal = this.getTypedField(15, 0);
858                return retVal;
859    }
860    
861    /**
862     * Returns
863     * PID-15: "Language - Patient" - creates it if necessary
864     */
865    public ST getPid15_LanguagePatient() { 
866                ST retVal = this.getTypedField(15, 0);
867                return retVal;
868    }
869
870
871
872    /**
873     * Returns
874     * PID-16: "Marital Status" - creates it if necessary
875     */
876    public ID getMaritalStatus() { 
877                ID retVal = this.getTypedField(16, 0);
878                return retVal;
879    }
880    
881    /**
882     * Returns
883     * PID-16: "Marital Status" - creates it if necessary
884     */
885    public ID getPid16_MaritalStatus() { 
886                ID retVal = this.getTypedField(16, 0);
887                return retVal;
888    }
889
890
891
892    /**
893     * Returns
894     * PID-17: "Religion" - creates it if necessary
895     */
896    public ID getReligion() { 
897                ID retVal = this.getTypedField(17, 0);
898                return retVal;
899    }
900    
901    /**
902     * Returns
903     * PID-17: "Religion" - creates it if necessary
904     */
905    public ID getPid17_Religion() { 
906                ID retVal = this.getTypedField(17, 0);
907                return retVal;
908    }
909
910
911
912    /**
913     * Returns
914     * PID-18: "Patient Account Number" - creates it if necessary
915     */
916    public CK getPatientAccountNumber() { 
917                CK retVal = this.getTypedField(18, 0);
918                return retVal;
919    }
920    
921    /**
922     * Returns
923     * PID-18: "Patient Account Number" - creates it if necessary
924     */
925    public CK getPid18_PatientAccountNumber() { 
926                CK retVal = this.getTypedField(18, 0);
927                return retVal;
928    }
929
930
931
932    /**
933     * Returns
934     * PID-19: "Social security number - patient" - creates it if necessary
935     */
936    public ST getSocialSecurityNumberPatient() { 
937                ST retVal = this.getTypedField(19, 0);
938                return retVal;
939    }
940    
941    /**
942     * Returns
943     * PID-19: "Social security number - patient" - creates it if necessary
944     */
945    public ST getPid19_SocialSecurityNumberPatient() { 
946                ST retVal = this.getTypedField(19, 0);
947                return retVal;
948    }
949
950
951
952    /**
953     * Returns
954     * PID-20: "Driver's license number - patient" - creates it if necessary
955     */
956    public CM_LICENSE_NO getDriverSLicenseNumberPatient() { 
957                CM_LICENSE_NO retVal = this.getTypedField(20, 0);
958                return retVal;
959    }
960    
961    /**
962     * Returns
963     * PID-20: "Driver's license number - patient" - creates it if necessary
964     */
965    public CM_LICENSE_NO getPid20_DriverSLicenseNumberPatient() { 
966                CM_LICENSE_NO retVal = this.getTypedField(20, 0);
967                return retVal;
968    }
969
970
971
972    /**
973     * Returns
974     * PID-21: "Mother's Identifier" - creates it if necessary
975     */
976    public CK getMotherSIdentifier() { 
977                CK retVal = this.getTypedField(21, 0);
978                return retVal;
979    }
980    
981    /**
982     * Returns
983     * PID-21: "Mother's Identifier" - creates it if necessary
984     */
985    public CK getPid21_MotherSIdentifier() { 
986                CK retVal = this.getTypedField(21, 0);
987                return retVal;
988    }
989
990
991
992    /**
993     * Returns
994     * PID-22: "Ethnic Group" - creates it if necessary
995     */
996    public ID getEthnicGroup() { 
997                ID retVal = this.getTypedField(22, 0);
998                return retVal;
999    }
1000    
1001    /**
1002     * Returns
1003     * PID-22: "Ethnic Group" - creates it if necessary
1004     */
1005    public ID getPid22_EthnicGroup() { 
1006                ID retVal = this.getTypedField(22, 0);
1007                return retVal;
1008    }
1009
1010
1011
1012    /**
1013     * Returns
1014     * PID-23: "Birth Place" - creates it if necessary
1015     */
1016    public ST getBirthPlace() { 
1017                ST retVal = this.getTypedField(23, 0);
1018                return retVal;
1019    }
1020    
1021    /**
1022     * Returns
1023     * PID-23: "Birth Place" - creates it if necessary
1024     */
1025    public ST getPid23_BirthPlace() { 
1026                ST retVal = this.getTypedField(23, 0);
1027                return retVal;
1028    }
1029
1030
1031
1032    /**
1033     * Returns
1034     * PID-24: "Multiple Birth Indicator" - creates it if necessary
1035     */
1036    public ID getMultipleBirthIndicator() { 
1037                ID retVal = this.getTypedField(24, 0);
1038                return retVal;
1039    }
1040    
1041    /**
1042     * Returns
1043     * PID-24: "Multiple Birth Indicator" - creates it if necessary
1044     */
1045    public ID getPid24_MultipleBirthIndicator() { 
1046                ID retVal = this.getTypedField(24, 0);
1047                return retVal;
1048    }
1049
1050
1051
1052    /**
1053     * Returns
1054     * PID-25: "Birth Order" - creates it if necessary
1055     */
1056    public NM getBirthOrder() { 
1057                NM retVal = this.getTypedField(25, 0);
1058                return retVal;
1059    }
1060    
1061    /**
1062     * Returns
1063     * PID-25: "Birth Order" - creates it if necessary
1064     */
1065    public NM getPid25_BirthOrder() { 
1066                NM retVal = this.getTypedField(25, 0);
1067                return retVal;
1068    }
1069
1070
1071    /**
1072     * Returns all repetitions of Citizenship (PID-26).
1073     */
1074    public ID[] getCitizenship() {
1075        ID[] retVal = this.getTypedField(26, new ID[0]);
1076        return retVal;
1077    }
1078
1079
1080    /**
1081     * Returns all repetitions of Citizenship (PID-26).
1082     */
1083    public ID[] getPid26_Citizenship() {
1084        ID[] retVal = this.getTypedField(26, new ID[0]);
1085        return retVal;
1086    }
1087
1088
1089    /**
1090     * Returns a count of the current number of repetitions of Citizenship (PID-26).
1091     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1092     * it will return zero.
1093     */
1094    public int getCitizenshipReps() {
1095        return this.getReps(26);
1096    }
1097
1098
1099    /**
1100     * Returns a specific repetition of
1101     * PID-26: "Citizenship" - creates it if necessary
1102     *
1103     * @param rep The repetition index (0-indexed)
1104     */
1105    public ID getCitizenship(int rep) { 
1106                ID retVal = this.getTypedField(26, rep);
1107                return retVal;
1108    }
1109
1110    /**
1111     * Returns a specific repetition of
1112     * PID-26: "Citizenship" - creates it if necessary
1113     *
1114     * @param rep The repetition index (0-indexed)
1115     */
1116    public ID getPid26_Citizenship(int rep) { 
1117                ID retVal = this.getTypedField(26, rep);
1118                return retVal;
1119    }
1120
1121    /**
1122     * Returns a count of the current number of repetitions of Citizenship (PID-26).
1123     * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
1124     * it will return zero.
1125     */
1126    public int getPid26_CitizenshipReps() {
1127        return this.getReps(26);
1128    }
1129
1130
1131    /**
1132     * Inserts a repetition of
1133     * PID-26: "Citizenship" at a specific index
1134     *
1135     * @param rep The repetition index (0-indexed)
1136     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1137     */
1138    public ID insertCitizenship(int rep) throws HL7Exception { 
1139        return (ID) super.insertRepetition(26, rep);
1140    }
1141
1142
1143    /**
1144     * Inserts a repetition of
1145     * PID-26: "Citizenship" at a specific index
1146     *
1147     * @param rep The repetition index (0-indexed)
1148     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1149     */
1150    public ID insertPid26_Citizenship(int rep) throws HL7Exception { 
1151        return (ID) super.insertRepetition(26, rep);
1152    }
1153
1154
1155    /**
1156     * Removes a repetition of
1157     * PID-26: "Citizenship" at a specific index
1158     *
1159     * @param rep The repetition index (0-indexed)
1160     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1161     */
1162    public ID removeCitizenship(int rep) throws HL7Exception { 
1163        return (ID) super.removeRepetition(26, rep);
1164    }
1165
1166
1167    /**
1168     * Removes a repetition of
1169     * PID-26: "Citizenship" at a specific index
1170     *
1171     * @param rep The repetition index (0-indexed)
1172     * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
1173     */
1174    public ID removePid26_Citizenship(int rep) throws HL7Exception { 
1175        return (ID) super.removeRepetition(26, rep);
1176    }
1177
1178
1179
1180
1181    /**
1182     * Returns
1183     * PID-27: "Veterans Military Status" - creates it if necessary
1184     */
1185    public ST getVeteransMilitaryStatus() { 
1186                ST retVal = this.getTypedField(27, 0);
1187                return retVal;
1188    }
1189    
1190    /**
1191     * Returns
1192     * PID-27: "Veterans Military Status" - creates it if necessary
1193     */
1194    public ST getPid27_VeteransMilitaryStatus() { 
1195                ST retVal = this.getTypedField(27, 0);
1196                return retVal;
1197    }
1198
1199
1200
1201
1202
1203    /** {@inheritDoc} */   
1204    protected Type createNewTypeWithoutReflection(int field) {
1205       switch (field) {
1206          case 0: return new SI(getMessage());
1207          case 1: return new CK(getMessage());
1208          case 2: return new CM_PAT_ID(getMessage());
1209          case 3: return new ST(getMessage());
1210          case 4: return new PN(getMessage());
1211          case 5: return new ST(getMessage());
1212          case 6: return new TS(getMessage());
1213          case 7: return new ID(getMessage(), new Integer( 1 ));
1214          case 8: return new PN(getMessage());
1215          case 9: return new ID(getMessage(), new Integer( 5 ));
1216          case 10: return new AD(getMessage());
1217          case 11: return new ID(getMessage(), new Integer( 0 ));
1218          case 12: return new TN(getMessage());
1219          case 13: return new TN(getMessage());
1220          case 14: return new ST(getMessage());
1221          case 15: return new ID(getMessage(), new Integer( 2 ));
1222          case 16: return new ID(getMessage(), new Integer( 6 ));
1223          case 17: return new CK(getMessage());
1224          case 18: return new ST(getMessage());
1225          case 19: return new CM_LICENSE_NO(getMessage());
1226          case 20: return new CK(getMessage());
1227          case 21: return new ID(getMessage(), new Integer( 189 ));
1228          case 22: return new ST(getMessage());
1229          case 23: return new ID(getMessage(), new Integer( 0 ));
1230          case 24: return new NM(getMessage());
1231          case 25: return new ID(getMessage(), new Integer( 171 ));
1232          case 26: return new ST(getMessage());
1233          default: return null;
1234       }
1235   }
1236
1237
1238}
1239