1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package ca.uhn.hl7v2.model.v21.segment;
35
36
37 import ca.uhn.hl7v2.model.v21.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74 @SuppressWarnings("unused")
75 public class PID extends AbstractSegment {
76
77
78
79
80 public PID(Group parent, ModelClassFactory factory) {
81 super(parent, factory);
82 init(factory);
83 }
84
85 private void init(ModelClassFactory factory) {
86 try {
87 this.add(SI.class, false, 1, 4, new Object[]{ getMessage() }, "SET ID - PATIENT ID");
88 this.add(CK.class, false, 1, 16, new Object[]{ getMessage() }, "PATIENT ID EXTERNAL (EXTERNAL ID)");
89 this.add(CK.class, true, 1, 16, new Object[]{ getMessage() }, "PATIENT ID INTERNAL (INTERNAL ID)");
90 this.add(ST.class, false, 1, 12, new Object[]{ getMessage() }, "ALTERNATE PATIENT ID");
91 this.add(PN.class, true, 1, 48, new Object[]{ getMessage() }, "PATIENT NAME");
92 this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "MOTHER'S MAIDEN NAME");
93 this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "DATE OF BIRTH");
94 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(1) }, "SEX");
95 this.add(PN.class, false, 0, 48, new Object[]{ getMessage() }, "PATIENT ALIAS");
96 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(5) }, "ETHNIC GROUP");
97 this.add(AD.class, false, 1, 106, new Object[]{ getMessage() }, "PATIENT ADDRESS");
98 this.add(ID.class, false, 1, 4, new Object[]{ getMessage(), new Integer(0) }, "COUNTY CODE");
99 this.add(TN.class, false, 3, 40, new Object[]{ getMessage() }, "PHONE NUMBER - HOME");
100 this.add(TN.class, false, 3, 40, new Object[]{ getMessage() }, "PHONE NUMBER - BUSINESS");
101 this.add(ST.class, false, 1, 25, new Object[]{ getMessage() }, "LANGUAGE - PATIENT");
102 this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(2) }, "MARITAL STATUS");
103 this.add(ID.class, false, 1, 3, new Object[]{ getMessage(), new Integer(6) }, "RELIGION");
104 this.add(CK.class, false, 1, 20, new Object[]{ getMessage() }, "PATIENT ACCOUNT NUMBER");
105 this.add(ST.class, false, 1, 16, new Object[]{ getMessage() }, "SSN NUMBER - PATIENT");
106 this.add(CM.class, false, 1, 25, new Object[]{ getMessage() }, "DRIVER'S LIC NUM - PATIENT");
107 } catch(HL7Exception e) {
108 log.error("Unexpected error creating PID - this is probably a bug in the source code generator.", e);
109 }
110 }
111
112
113
114
115
116
117
118 public SI getSETIDPATIENTID() {
119 SI retVal = this.getTypedField(1, 0);
120 return retVal;
121 }
122
123
124
125
126
127 public SI getPid1_SETIDPATIENTID() {
128 SI retVal = this.getTypedField(1, 0);
129 return retVal;
130 }
131
132
133
134
135
136
137
138 public CK getPATIENTIDEXTERNALEXTERNALID() {
139 CK retVal = this.getTypedField(2, 0);
140 return retVal;
141 }
142
143
144
145
146
147 public CK getPid2_PATIENTIDEXTERNALEXTERNALID() {
148 CK retVal = this.getTypedField(2, 0);
149 return retVal;
150 }
151
152
153
154
155
156
157
158 public CK getPATIENTIDINTERNALINTERNALID() {
159 CK retVal = this.getTypedField(3, 0);
160 return retVal;
161 }
162
163
164
165
166
167 public CK getPid3_PATIENTIDINTERNALINTERNALID() {
168 CK retVal = this.getTypedField(3, 0);
169 return retVal;
170 }
171
172
173
174
175
176
177
178 public ST getALTERNATEPATIENTID() {
179 ST retVal = this.getTypedField(4, 0);
180 return retVal;
181 }
182
183
184
185
186
187 public ST getPid4_ALTERNATEPATIENTID() {
188 ST retVal = this.getTypedField(4, 0);
189 return retVal;
190 }
191
192
193
194
195
196
197
198 public PN getPATIENTNAME() {
199 PN retVal = this.getTypedField(5, 0);
200 return retVal;
201 }
202
203
204
205
206
207 public PN getPid5_PATIENTNAME() {
208 PN retVal = this.getTypedField(5, 0);
209 return retVal;
210 }
211
212
213
214
215
216
217
218 public ST getMOTHERSMAIDENNAME() {
219 ST retVal = this.getTypedField(6, 0);
220 return retVal;
221 }
222
223
224
225
226
227 public ST getPid6_MOTHERSMAIDENNAME() {
228 ST retVal = this.getTypedField(6, 0);
229 return retVal;
230 }
231
232
233
234
235
236
237
238 public DT getDATEOFBIRTH() {
239 DT retVal = this.getTypedField(7, 0);
240 return retVal;
241 }
242
243
244
245
246
247 public DT getPid7_DATEOFBIRTH() {
248 DT retVal = this.getTypedField(7, 0);
249 return retVal;
250 }
251
252
253
254
255
256
257
258 public ID getSEX() {
259 ID retVal = this.getTypedField(8, 0);
260 return retVal;
261 }
262
263
264
265
266
267 public ID getPid8_SEX() {
268 ID retVal = this.getTypedField(8, 0);
269 return retVal;
270 }
271
272
273
274
275
276 public PN[] getPATIENTALIAS() {
277 PN[] retVal = this.getTypedField(9, new PN[0]);
278 return retVal;
279 }
280
281
282
283
284
285 public PN[] getPid9_PATIENTALIAS() {
286 PN[] retVal = this.getTypedField(9, new PN[0]);
287 return retVal;
288 }
289
290
291
292
293
294
295
296 public int getPATIENTALIASReps() {
297 return this.getReps(9);
298 }
299
300
301
302
303
304
305
306
307 public PN getPATIENTALIAS(int rep) {
308 PN retVal = this.getTypedField(9, rep);
309 return retVal;
310 }
311
312
313
314
315
316
317
318 public PN getPid9_PATIENTALIAS(int rep) {
319 PN retVal = this.getTypedField(9, rep);
320 return retVal;
321 }
322
323
324
325
326
327
328 public int getPid9_PATIENTALIASReps() {
329 return this.getReps(9);
330 }
331
332
333
334
335
336
337
338
339
340 public PN insertPATIENTALIAS(int rep) throws HL7Exception {
341 return (PN) super.insertRepetition(9, rep);
342 }
343
344
345
346
347
348
349
350
351
352 public PN insertPid9_PATIENTALIAS(int rep) throws HL7Exception {
353 return (PN) super.insertRepetition(9, rep);
354 }
355
356
357
358
359
360
361
362
363
364 public PN removePATIENTALIAS(int rep) throws HL7Exception {
365 return (PN) super.removeRepetition(9, rep);
366 }
367
368
369
370
371
372
373
374
375
376 public PN removePid9_PATIENTALIAS(int rep) throws HL7Exception {
377 return (PN) super.removeRepetition(9, rep);
378 }
379
380
381
382
383
384
385
386
387 public ID getETHNICGROUP() {
388 ID retVal = this.getTypedField(10, 0);
389 return retVal;
390 }
391
392
393
394
395
396 public ID getPid10_ETHNICGROUP() {
397 ID retVal = this.getTypedField(10, 0);
398 return retVal;
399 }
400
401
402
403
404
405
406
407 public AD getPATIENTADDRESS() {
408 AD retVal = this.getTypedField(11, 0);
409 return retVal;
410 }
411
412
413
414
415
416 public AD getPid11_PATIENTADDRESS() {
417 AD retVal = this.getTypedField(11, 0);
418 return retVal;
419 }
420
421
422
423
424
425
426
427 public ID getCOUNTYCODE() {
428 ID retVal = this.getTypedField(12, 0);
429 return retVal;
430 }
431
432
433
434
435
436 public ID getPid12_COUNTYCODE() {
437 ID retVal = this.getTypedField(12, 0);
438 return retVal;
439 }
440
441
442
443
444
445 public TN[] getPHONENUMBERHOME() {
446 TN[] retVal = this.getTypedField(13, new TN[0]);
447 return retVal;
448 }
449
450
451
452
453
454 public TN[] getPid13_PHONENUMBERHOME() {
455 TN[] retVal = this.getTypedField(13, new TN[0]);
456 return retVal;
457 }
458
459
460
461
462
463
464
465 public int getPHONENUMBERHOMEReps() {
466 return this.getReps(13);
467 }
468
469
470
471
472
473
474
475
476 public TN getPHONENUMBERHOME(int rep) {
477 TN retVal = this.getTypedField(13, rep);
478 return retVal;
479 }
480
481
482
483
484
485
486
487 public TN getPid13_PHONENUMBERHOME(int rep) {
488 TN retVal = this.getTypedField(13, rep);
489 return retVal;
490 }
491
492
493
494
495
496
497 public int getPid13_PHONENUMBERHOMEReps() {
498 return this.getReps(13);
499 }
500
501
502
503
504
505
506
507
508
509 public TN insertPHONENUMBERHOME(int rep) throws HL7Exception {
510 return (TN) super.insertRepetition(13, rep);
511 }
512
513
514
515
516
517
518
519
520
521 public TN insertPid13_PHONENUMBERHOME(int rep) throws HL7Exception {
522 return (TN) super.insertRepetition(13, rep);
523 }
524
525
526
527
528
529
530
531
532
533 public TN removePHONENUMBERHOME(int rep) throws HL7Exception {
534 return (TN) super.removeRepetition(13, rep);
535 }
536
537
538
539
540
541
542
543
544
545 public TN removePid13_PHONENUMBERHOME(int rep) throws HL7Exception {
546 return (TN) super.removeRepetition(13, rep);
547 }
548
549
550
551
552
553
554 public TN[] getPHONENUMBERBUSINESS() {
555 TN[] retVal = this.getTypedField(14, new TN[0]);
556 return retVal;
557 }
558
559
560
561
562
563 public TN[] getPid14_PHONENUMBERBUSINESS() {
564 TN[] retVal = this.getTypedField(14, new TN[0]);
565 return retVal;
566 }
567
568
569
570
571
572
573
574 public int getPHONENUMBERBUSINESSReps() {
575 return this.getReps(14);
576 }
577
578
579
580
581
582
583
584
585 public TN getPHONENUMBERBUSINESS(int rep) {
586 TN retVal = this.getTypedField(14, rep);
587 return retVal;
588 }
589
590
591
592
593
594
595
596 public TN getPid14_PHONENUMBERBUSINESS(int rep) {
597 TN retVal = this.getTypedField(14, rep);
598 return retVal;
599 }
600
601
602
603
604
605
606 public int getPid14_PHONENUMBERBUSINESSReps() {
607 return this.getReps(14);
608 }
609
610
611
612
613
614
615
616
617
618 public TN insertPHONENUMBERBUSINESS(int rep) throws HL7Exception {
619 return (TN) super.insertRepetition(14, rep);
620 }
621
622
623
624
625
626
627
628
629
630 public TN insertPid14_PHONENUMBERBUSINESS(int rep) throws HL7Exception {
631 return (TN) super.insertRepetition(14, rep);
632 }
633
634
635
636
637
638
639
640
641
642 public TN removePHONENUMBERBUSINESS(int rep) throws HL7Exception {
643 return (TN) super.removeRepetition(14, rep);
644 }
645
646
647
648
649
650
651
652
653
654 public TN removePid14_PHONENUMBERBUSINESS(int rep) throws HL7Exception {
655 return (TN) super.removeRepetition(14, rep);
656 }
657
658
659
660
661
662
663
664
665 public ST getLANGUAGEPATIENT() {
666 ST retVal = this.getTypedField(15, 0);
667 return retVal;
668 }
669
670
671
672
673
674 public ST getPid15_LANGUAGEPATIENT() {
675 ST retVal = this.getTypedField(15, 0);
676 return retVal;
677 }
678
679
680
681
682
683
684
685 public ID getMARITALSTATUS() {
686 ID retVal = this.getTypedField(16, 0);
687 return retVal;
688 }
689
690
691
692
693
694 public ID getPid16_MARITALSTATUS() {
695 ID retVal = this.getTypedField(16, 0);
696 return retVal;
697 }
698
699
700
701
702
703
704
705 public ID getRELIGION() {
706 ID retVal = this.getTypedField(17, 0);
707 return retVal;
708 }
709
710
711
712
713
714 public ID getPid17_RELIGION() {
715 ID retVal = this.getTypedField(17, 0);
716 return retVal;
717 }
718
719
720
721
722
723
724
725 public CK getPATIENTACCOUNTNUMBER() {
726 CK retVal = this.getTypedField(18, 0);
727 return retVal;
728 }
729
730
731
732
733
734 public CK getPid18_PATIENTACCOUNTNUMBER() {
735 CK retVal = this.getTypedField(18, 0);
736 return retVal;
737 }
738
739
740
741
742
743
744
745 public ST getSSNNUMBERPATIENT() {
746 ST retVal = this.getTypedField(19, 0);
747 return retVal;
748 }
749
750
751
752
753
754 public ST getPid19_SSNNUMBERPATIENT() {
755 ST retVal = this.getTypedField(19, 0);
756 return retVal;
757 }
758
759
760
761
762
763
764
765 public CM getDRIVERSLICNUMPATIENT() {
766 CM retVal = this.getTypedField(20, 0);
767 return retVal;
768 }
769
770
771
772
773
774 public CM getPid20_DRIVERSLICNUMPATIENT() {
775 CM retVal = this.getTypedField(20, 0);
776 return retVal;
777 }
778
779
780
781
782
783
784 protected Type createNewTypeWithoutReflection(int field) {
785 switch (field) {
786 case 0: return new SI(getMessage());
787 case 1: return new CK(getMessage());
788 case 2: return new CK(getMessage());
789 case 3: return new ST(getMessage());
790 case 4: return new PN(getMessage());
791 case 5: return new ST(getMessage());
792 case 6: return new DT(getMessage());
793 case 7: return new ID(getMessage(), new Integer( 1 ));
794 case 8: return new PN(getMessage());
795 case 9: return new ID(getMessage(), new Integer( 5 ));
796 case 10: return new AD(getMessage());
797 case 11: return new ID(getMessage(), new Integer( 0 ));
798 case 12: return new TN(getMessage());
799 case 13: return new TN(getMessage());
800 case 14: return new ST(getMessage());
801 case 15: return new ID(getMessage(), new Integer( 2 ));
802 case 16: return new ID(getMessage(), new Integer( 6 ));
803 case 17: return new CK(getMessage());
804 case 18: return new ST(getMessage());
805 case 19: return new CM(getMessage());
806 default: return null;
807 }
808 }
809
810
811 }
812