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 @SuppressWarnings("unused")
68 public class NK1 extends AbstractSegment {
69
70
71
72
73 public NK1(Group parent, ModelClassFactory factory) {
74 super(parent, factory);
75 init(factory);
76 }
77
78 private void init(ModelClassFactory factory) {
79 try {
80 this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - Next of Kin");
81 this.add(PN.class, false, 1, 48, new Object[]{ getMessage() }, "NK Name");
82 this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Relationship");
83 this.add(AD.class, false, 1, 106, new Object[]{ getMessage() }, "Address");
84 this.add(TN.class, false, 3, 40, new Object[]{ getMessage() }, "Phone Number");
85 this.add(TN.class, false, 1, 40, new Object[]{ getMessage() }, "Business Phone Number");
86 this.add(CE.class, false, 1, 60, new Object[]{ getMessage() }, "Contact Role");
87 this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Start Date");
88 this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "End Date");
89 this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Next of Kin");
90 this.add(CM_JOB_CODE.class, false, 1, 60, new Object[]{ getMessage() }, "Next of kin job code / class");
91 this.add(ST.class, false, 1, 20, new Object[]{ getMessage() }, "Next of Kin Employee Number");
92 this.add(ST.class, false, 1, 60, new Object[]{ getMessage() }, "Organization Name");
93 } catch(HL7Exception e) {
94 log.error("Unexpected error creating NK1 - this is probably a bug in the source code generator.", e);
95 }
96 }
97
98
99
100
101
102
103
104 public SI getSetIDNextOfKin() {
105 SI retVal = this.getTypedField(1, 0);
106 return retVal;
107 }
108
109
110
111
112
113 public SI getNk11_SetIDNextOfKin() {
114 SI retVal = this.getTypedField(1, 0);
115 return retVal;
116 }
117
118
119
120
121
122
123
124 public PN getNKName() {
125 PN retVal = this.getTypedField(2, 0);
126 return retVal;
127 }
128
129
130
131
132
133 public PN getNk12_NKName() {
134 PN retVal = this.getTypedField(2, 0);
135 return retVal;
136 }
137
138
139
140
141
142
143
144 public CE getRelationship() {
145 CE retVal = this.getTypedField(3, 0);
146 return retVal;
147 }
148
149
150
151
152
153 public CE getNk13_Relationship() {
154 CE retVal = this.getTypedField(3, 0);
155 return retVal;
156 }
157
158
159
160
161
162
163
164 public AD getAddress() {
165 AD retVal = this.getTypedField(4, 0);
166 return retVal;
167 }
168
169
170
171
172
173 public AD getNk14_Address() {
174 AD retVal = this.getTypedField(4, 0);
175 return retVal;
176 }
177
178
179
180
181
182 public TN[] getPhoneNumber() {
183 TN[] retVal = this.getTypedField(5, new TN[0]);
184 return retVal;
185 }
186
187
188
189
190
191 public TN[] getNk15_PhoneNumber() {
192 TN[] retVal = this.getTypedField(5, new TN[0]);
193 return retVal;
194 }
195
196
197
198
199
200
201
202 public int getPhoneNumberReps() {
203 return this.getReps(5);
204 }
205
206
207
208
209
210
211
212
213 public TN getPhoneNumber(int rep) {
214 TN retVal = this.getTypedField(5, rep);
215 return retVal;
216 }
217
218
219
220
221
222
223
224 public TN getNk15_PhoneNumber(int rep) {
225 TN retVal = this.getTypedField(5, rep);
226 return retVal;
227 }
228
229
230
231
232
233
234 public int getNk15_PhoneNumberReps() {
235 return this.getReps(5);
236 }
237
238
239
240
241
242
243
244
245
246 public TN insertPhoneNumber(int rep) throws HL7Exception {
247 return (TN) super.insertRepetition(5, rep);
248 }
249
250
251
252
253
254
255
256
257
258 public TN insertNk15_PhoneNumber(int rep) throws HL7Exception {
259 return (TN) super.insertRepetition(5, rep);
260 }
261
262
263
264
265
266
267
268
269
270 public TN removePhoneNumber(int rep) throws HL7Exception {
271 return (TN) super.removeRepetition(5, rep);
272 }
273
274
275
276
277
278
279
280
281
282 public TN removeNk15_PhoneNumber(int rep) throws HL7Exception {
283 return (TN) super.removeRepetition(5, rep);
284 }
285
286
287
288
289
290
291
292
293 public TN getBusinessPhoneNumber() {
294 TN retVal = this.getTypedField(6, 0);
295 return retVal;
296 }
297
298
299
300
301
302 public TN getNk16_BusinessPhoneNumber() {
303 TN retVal = this.getTypedField(6, 0);
304 return retVal;
305 }
306
307
308
309
310
311
312
313 public CE getContactRole() {
314 CE retVal = this.getTypedField(7, 0);
315 return retVal;
316 }
317
318
319
320
321
322 public CE getNk17_ContactRole() {
323 CE retVal = this.getTypedField(7, 0);
324 return retVal;
325 }
326
327
328
329
330
331
332
333 public DT getStartDate() {
334 DT retVal = this.getTypedField(8, 0);
335 return retVal;
336 }
337
338
339
340
341
342 public DT getNk18_StartDate() {
343 DT retVal = this.getTypedField(8, 0);
344 return retVal;
345 }
346
347
348
349
350
351
352
353 public DT getEndDate() {
354 DT retVal = this.getTypedField(9, 0);
355 return retVal;
356 }
357
358
359
360
361
362 public DT getNk19_EndDate() {
363 DT retVal = this.getTypedField(9, 0);
364 return retVal;
365 }
366
367
368
369
370
371
372
373 public ST getNextOfKin() {
374 ST retVal = this.getTypedField(10, 0);
375 return retVal;
376 }
377
378
379
380
381
382 public ST getNk110_NextOfKin() {
383 ST retVal = this.getTypedField(10, 0);
384 return retVal;
385 }
386
387
388
389
390
391
392
393 public CM_JOB_CODE getNextOfKinJobCodeClass() {
394 CM_JOB_CODE retVal = this.getTypedField(11, 0);
395 return retVal;
396 }
397
398
399
400
401
402 public CM_JOB_CODE getNk111_NextOfKinJobCodeClass() {
403 CM_JOB_CODE retVal = this.getTypedField(11, 0);
404 return retVal;
405 }
406
407
408
409
410
411
412
413 public ST getNextOfKinEmployeeNumber() {
414 ST retVal = this.getTypedField(12, 0);
415 return retVal;
416 }
417
418
419
420
421
422 public ST getNk112_NextOfKinEmployeeNumber() {
423 ST retVal = this.getTypedField(12, 0);
424 return retVal;
425 }
426
427
428
429
430
431
432
433 public ST getOrganizationName() {
434 ST retVal = this.getTypedField(13, 0);
435 return retVal;
436 }
437
438
439
440
441
442 public ST getNk113_OrganizationName() {
443 ST retVal = this.getTypedField(13, 0);
444 return retVal;
445 }
446
447
448
449
450
451
452 protected Type createNewTypeWithoutReflection(int field) {
453 switch (field) {
454 case 0: return new SI(getMessage());
455 case 1: return new PN(getMessage());
456 case 2: return new CE(getMessage());
457 case 3: return new AD(getMessage());
458 case 4: return new TN(getMessage());
459 case 5: return new TN(getMessage());
460 case 6: return new CE(getMessage());
461 case 7: return new DT(getMessage());
462 case 8: return new DT(getMessage());
463 case 9: return new ST(getMessage());
464 case 10: return new CM_JOB_CODE(getMessage());
465 case 11: return new ST(getMessage());
466 case 12: return new ST(getMessage());
467 default: return null;
468 }
469 }
470
471
472 }
473