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