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