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 @SuppressWarnings("unused")
72 public class MSH extends AbstractSegment {
73
74
75
76
77 public MSH(Group parent, ModelClassFactory factory) {
78 super(parent, factory);
79 init(factory);
80 }
81
82 private void init(ModelClassFactory factory) {
83 try {
84 this.add(ST.class, true, 1, 1, new Object[]{ getMessage() }, "Field separator");
85 this.add(ST.class, true, 1, 4, new Object[]{ getMessage() }, "Encoding characters");
86 this.add(ST.class, false, 1, 15, new Object[]{ getMessage() }, "Sending application");
87 this.add(ST.class, false, 1, 20, new Object[]{ getMessage() }, "Sending facility");
88 this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "Receiving application");
89 this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "Receiving facility");
90 this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Date / Time of message");
91 this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Security");
92 this.add(CM_MSG.class, true, 1, 7, new Object[]{ getMessage() }, "Message type");
93 this.add(ST.class, true, 1, 20, new Object[]{ getMessage() }, "Message Control ID");
94 this.add(ID.class, true, 1, 1, new Object[]{ getMessage(), new Integer(103) }, "Processing ID");
95 this.add(ID.class, true, 1, 8, new Object[]{ getMessage(), new Integer(104) }, "Version ID");
96 this.add(NM.class, false, 1, 15, new Object[]{ getMessage() }, "Sequence number");
97 this.add(ST.class, false, 1, 180, new Object[]{ getMessage() }, "Continuation pointer");
98 this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(155) }, "Accept acknowledgement type");
99 this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(155) }, "Application acknowledgement type");
100 this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(0) }, "Country code");
101 } catch(HL7Exception e) {
102 log.error("Unexpected error creating MSH - this is probably a bug in the source code generator.", e);
103 }
104 }
105
106
107
108
109
110
111
112 public ST getFieldSeparator() {
113 ST retVal = this.getTypedField(1, 0);
114 return retVal;
115 }
116
117
118
119
120
121 public ST getMsh1_FieldSeparator() {
122 ST retVal = this.getTypedField(1, 0);
123 return retVal;
124 }
125
126
127
128
129
130
131
132 public ST getEncodingCharacters() {
133 ST retVal = this.getTypedField(2, 0);
134 return retVal;
135 }
136
137
138
139
140
141 public ST getMsh2_EncodingCharacters() {
142 ST retVal = this.getTypedField(2, 0);
143 return retVal;
144 }
145
146
147
148
149
150
151
152 public ST getSendingApplication() {
153 ST retVal = this.getTypedField(3, 0);
154 return retVal;
155 }
156
157
158
159
160
161 public ST getMsh3_SendingApplication() {
162 ST retVal = this.getTypedField(3, 0);
163 return retVal;
164 }
165
166
167
168
169
170
171
172 public ST getSendingFacility() {
173 ST retVal = this.getTypedField(4, 0);
174 return retVal;
175 }
176
177
178
179
180
181 public ST getMsh4_SendingFacility() {
182 ST retVal = this.getTypedField(4, 0);
183 return retVal;
184 }
185
186
187
188
189
190
191
192 public ST getReceivingApplication() {
193 ST retVal = this.getTypedField(5, 0);
194 return retVal;
195 }
196
197
198
199
200
201 public ST getMsh5_ReceivingApplication() {
202 ST retVal = this.getTypedField(5, 0);
203 return retVal;
204 }
205
206
207
208
209
210
211
212 public ST getReceivingFacility() {
213 ST retVal = this.getTypedField(6, 0);
214 return retVal;
215 }
216
217
218
219
220
221 public ST getMsh6_ReceivingFacility() {
222 ST retVal = this.getTypedField(6, 0);
223 return retVal;
224 }
225
226
227
228
229
230
231
232 public TS getDateTimeOfMessage() {
233 TS retVal = this.getTypedField(7, 0);
234 return retVal;
235 }
236
237
238
239
240
241 public TS getMsh7_DateTimeOfMessage() {
242 TS retVal = this.getTypedField(7, 0);
243 return retVal;
244 }
245
246
247
248
249
250
251
252 public ST getSecurity() {
253 ST retVal = this.getTypedField(8, 0);
254 return retVal;
255 }
256
257
258
259
260
261 public ST getMsh8_Security() {
262 ST retVal = this.getTypedField(8, 0);
263 return retVal;
264 }
265
266
267
268
269
270
271
272 public CM_MSG getMessageType() {
273 CM_MSG retVal = this.getTypedField(9, 0);
274 return retVal;
275 }
276
277
278
279
280
281 public CM_MSG getMsh9_MessageType() {
282 CM_MSG retVal = this.getTypedField(9, 0);
283 return retVal;
284 }
285
286
287
288
289
290
291
292 public ST getMessageControlID() {
293 ST retVal = this.getTypedField(10, 0);
294 return retVal;
295 }
296
297
298
299
300
301 public ST getMsh10_MessageControlID() {
302 ST retVal = this.getTypedField(10, 0);
303 return retVal;
304 }
305
306
307
308
309
310
311
312 public ID getProcessingID() {
313 ID retVal = this.getTypedField(11, 0);
314 return retVal;
315 }
316
317
318
319
320
321 public ID getMsh11_ProcessingID() {
322 ID retVal = this.getTypedField(11, 0);
323 return retVal;
324 }
325
326
327
328
329
330
331
332 public ID getVersionID() {
333 ID retVal = this.getTypedField(12, 0);
334 return retVal;
335 }
336
337
338
339
340
341 public ID getMsh12_VersionID() {
342 ID retVal = this.getTypedField(12, 0);
343 return retVal;
344 }
345
346
347
348
349
350
351
352 public NM getSequenceNumber() {
353 NM retVal = this.getTypedField(13, 0);
354 return retVal;
355 }
356
357
358
359
360
361 public NM getMsh13_SequenceNumber() {
362 NM retVal = this.getTypedField(13, 0);
363 return retVal;
364 }
365
366
367
368
369
370
371
372 public ST getContinuationPointer() {
373 ST retVal = this.getTypedField(14, 0);
374 return retVal;
375 }
376
377
378
379
380
381 public ST getMsh14_ContinuationPointer() {
382 ST retVal = this.getTypedField(14, 0);
383 return retVal;
384 }
385
386
387
388
389
390
391
392 public ID getAcceptAcknowledgementType() {
393 ID retVal = this.getTypedField(15, 0);
394 return retVal;
395 }
396
397
398
399
400
401 public ID getMsh15_AcceptAcknowledgementType() {
402 ID retVal = this.getTypedField(15, 0);
403 return retVal;
404 }
405
406
407
408
409
410
411
412 public ID getApplicationAcknowledgementType() {
413 ID retVal = this.getTypedField(16, 0);
414 return retVal;
415 }
416
417
418
419
420
421 public ID getMsh16_ApplicationAcknowledgementType() {
422 ID retVal = this.getTypedField(16, 0);
423 return retVal;
424 }
425
426
427
428
429
430
431
432 public ID getCountryCode() {
433 ID retVal = this.getTypedField(17, 0);
434 return retVal;
435 }
436
437
438
439
440
441 public ID getMsh17_CountryCode() {
442 ID retVal = this.getTypedField(17, 0);
443 return retVal;
444 }
445
446
447
448
449
450
451 protected Type createNewTypeWithoutReflection(int field) {
452 switch (field) {
453 case 0: return new ST(getMessage());
454 case 1: return new ST(getMessage());
455 case 2: return new ST(getMessage());
456 case 3: return new ST(getMessage());
457 case 4: return new ST(getMessage());
458 case 5: return new ST(getMessage());
459 case 6: return new TS(getMessage());
460 case 7: return new ST(getMessage());
461 case 8: return new CM_MSG(getMessage());
462 case 9: return new ST(getMessage());
463 case 10: return new ID(getMessage(), new Integer( 103 ));
464 case 11: return new ID(getMessage(), new Integer( 104 ));
465 case 12: return new NM(getMessage());
466 case 13: return new ST(getMessage());
467 case 14: return new ID(getMessage(), new Integer( 155 ));
468 case 15: return new ID(getMessage(), new Integer( 155 ));
469 case 16: return new ID(getMessage(), new Integer( 0 ));
470 default: return null;
471 }
472 }
473
474
475 }
476