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.v25.segment;
35
36
37 import ca.uhn.hl7v2.model.v25.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 @SuppressWarnings("unused")
76 public class MSH extends AbstractSegment {
77
78
79
80
81 public MSH(Group parent, ModelClassFactory factory) {
82 super(parent, factory);
83 init(factory);
84 }
85
86 private void init(ModelClassFactory factory) {
87 try {
88 this.add(ST.class, true, 1, 1, new Object[]{ getMessage() }, "Field Separator");
89 this.add(ST.class, true, 1, 4, new Object[]{ getMessage() }, "Encoding Characters");
90 this.add(HD.class, false, 1, 227, new Object[]{ getMessage() }, "Sending Application");
91 this.add(HD.class, false, 1, 227, new Object[]{ getMessage() }, "Sending Facility");
92 this.add(HD.class, false, 1, 227, new Object[]{ getMessage() }, "Receiving Application");
93 this.add(HD.class, false, 1, 227, new Object[]{ getMessage() }, "Receiving Facility");
94 this.add(TS.class, true, 1, 26, new Object[]{ getMessage() }, "Date/Time Of Message");
95 this.add(ST.class, false, 1, 40, new Object[]{ getMessage() }, "Security");
96 this.add(MSG.class, true, 1, 15, new Object[]{ getMessage() }, "Message Type");
97 this.add(ST.class, true, 1, 20, new Object[]{ getMessage() }, "Message Control ID");
98 this.add(PT.class, true, 1, 3, new Object[]{ getMessage() }, "Processing ID");
99 this.add(VID.class, true, 1, 60, new Object[]{ getMessage() }, "Version ID");
100 this.add(NM.class, false, 1, 15, new Object[]{ getMessage() }, "Sequence Number");
101 this.add(ST.class, false, 1, 180, new Object[]{ getMessage() }, "Continuation Pointer");
102 this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(155) }, "Accept Acknowledgment Type");
103 this.add(ID.class, false, 1, 2, new Object[]{ getMessage(), new Integer(155) }, "Application Acknowledgment Type");
104 this.add(ID.class, false, 1, 3, new Object[]{ getMessage(), new Integer(399) }, "Country Code");
105 this.add(ID.class, false, 0, 16, new Object[]{ getMessage(), new Integer(211) }, "Character Set");
106 this.add(CE.class, false, 1, 250, new Object[]{ getMessage() }, "Principal Language Of Message");
107 this.add(ID.class, false, 1, 20, new Object[]{ getMessage(), new Integer(356) }, "Alternate Character Set Handling Scheme");
108 this.add(EI.class, false, 0, 427, new Object[]{ getMessage() }, "Message Profile Identifier");
109 } catch(HL7Exception e) {
110 log.error("Unexpected error creating MSH - this is probably a bug in the source code generator.", e);
111 }
112 }
113
114
115
116
117
118
119
120 public ST getFieldSeparator() {
121 ST retVal = this.getTypedField(1, 0);
122 return retVal;
123 }
124
125
126
127
128
129 public ST getMsh1_FieldSeparator() {
130 ST retVal = this.getTypedField(1, 0);
131 return retVal;
132 }
133
134
135
136
137
138
139
140 public ST getEncodingCharacters() {
141 ST retVal = this.getTypedField(2, 0);
142 return retVal;
143 }
144
145
146
147
148
149 public ST getMsh2_EncodingCharacters() {
150 ST retVal = this.getTypedField(2, 0);
151 return retVal;
152 }
153
154
155
156
157
158
159
160 public HD getSendingApplication() {
161 HD retVal = this.getTypedField(3, 0);
162 return retVal;
163 }
164
165
166
167
168
169 public HD getMsh3_SendingApplication() {
170 HD retVal = this.getTypedField(3, 0);
171 return retVal;
172 }
173
174
175
176
177
178
179
180 public HD getSendingFacility() {
181 HD retVal = this.getTypedField(4, 0);
182 return retVal;
183 }
184
185
186
187
188
189 public HD getMsh4_SendingFacility() {
190 HD retVal = this.getTypedField(4, 0);
191 return retVal;
192 }
193
194
195
196
197
198
199
200 public HD getReceivingApplication() {
201 HD retVal = this.getTypedField(5, 0);
202 return retVal;
203 }
204
205
206
207
208
209 public HD getMsh5_ReceivingApplication() {
210 HD retVal = this.getTypedField(5, 0);
211 return retVal;
212 }
213
214
215
216
217
218
219
220 public HD getReceivingFacility() {
221 HD retVal = this.getTypedField(6, 0);
222 return retVal;
223 }
224
225
226
227
228
229 public HD getMsh6_ReceivingFacility() {
230 HD retVal = this.getTypedField(6, 0);
231 return retVal;
232 }
233
234
235
236
237
238
239
240 public TS getDateTimeOfMessage() {
241 TS retVal = this.getTypedField(7, 0);
242 return retVal;
243 }
244
245
246
247
248
249 public TS getMsh7_DateTimeOfMessage() {
250 TS retVal = this.getTypedField(7, 0);
251 return retVal;
252 }
253
254
255
256
257
258
259
260 public ST getSecurity() {
261 ST retVal = this.getTypedField(8, 0);
262 return retVal;
263 }
264
265
266
267
268
269 public ST getMsh8_Security() {
270 ST retVal = this.getTypedField(8, 0);
271 return retVal;
272 }
273
274
275
276
277
278
279
280 public MSG getMessageType() {
281 MSG retVal = this.getTypedField(9, 0);
282 return retVal;
283 }
284
285
286
287
288
289 public MSG getMsh9_MessageType() {
290 MSG retVal = this.getTypedField(9, 0);
291 return retVal;
292 }
293
294
295
296
297
298
299
300 public ST getMessageControlID() {
301 ST retVal = this.getTypedField(10, 0);
302 return retVal;
303 }
304
305
306
307
308
309 public ST getMsh10_MessageControlID() {
310 ST retVal = this.getTypedField(10, 0);
311 return retVal;
312 }
313
314
315
316
317
318
319
320 public PT getProcessingID() {
321 PT retVal = this.getTypedField(11, 0);
322 return retVal;
323 }
324
325
326
327
328
329 public PT getMsh11_ProcessingID() {
330 PT retVal = this.getTypedField(11, 0);
331 return retVal;
332 }
333
334
335
336
337
338
339
340 public VID getVersionID() {
341 VID retVal = this.getTypedField(12, 0);
342 return retVal;
343 }
344
345
346
347
348
349 public VID getMsh12_VersionID() {
350 VID retVal = this.getTypedField(12, 0);
351 return retVal;
352 }
353
354
355
356
357
358
359
360 public NM getSequenceNumber() {
361 NM retVal = this.getTypedField(13, 0);
362 return retVal;
363 }
364
365
366
367
368
369 public NM getMsh13_SequenceNumber() {
370 NM retVal = this.getTypedField(13, 0);
371 return retVal;
372 }
373
374
375
376
377
378
379
380 public ST getContinuationPointer() {
381 ST retVal = this.getTypedField(14, 0);
382 return retVal;
383 }
384
385
386
387
388
389 public ST getMsh14_ContinuationPointer() {
390 ST retVal = this.getTypedField(14, 0);
391 return retVal;
392 }
393
394
395
396
397
398
399
400 public ID getAcceptAcknowledgmentType() {
401 ID retVal = this.getTypedField(15, 0);
402 return retVal;
403 }
404
405
406
407
408
409 public ID getMsh15_AcceptAcknowledgmentType() {
410 ID retVal = this.getTypedField(15, 0);
411 return retVal;
412 }
413
414
415
416
417
418
419
420 public ID getApplicationAcknowledgmentType() {
421 ID retVal = this.getTypedField(16, 0);
422 return retVal;
423 }
424
425
426
427
428
429 public ID getMsh16_ApplicationAcknowledgmentType() {
430 ID retVal = this.getTypedField(16, 0);
431 return retVal;
432 }
433
434
435
436
437
438
439
440 public ID getCountryCode() {
441 ID retVal = this.getTypedField(17, 0);
442 return retVal;
443 }
444
445
446
447
448
449 public ID getMsh17_CountryCode() {
450 ID retVal = this.getTypedField(17, 0);
451 return retVal;
452 }
453
454
455
456
457
458 public ID[] getCharacterSet() {
459 ID[] retVal = this.getTypedField(18, new ID[0]);
460 return retVal;
461 }
462
463
464
465
466
467 public ID[] getMsh18_CharacterSet() {
468 ID[] retVal = this.getTypedField(18, new ID[0]);
469 return retVal;
470 }
471
472
473
474
475
476
477
478 public int getCharacterSetReps() {
479 return this.getReps(18);
480 }
481
482
483
484
485
486
487
488
489 public ID getCharacterSet(int rep) {
490 ID retVal = this.getTypedField(18, rep);
491 return retVal;
492 }
493
494
495
496
497
498
499
500 public ID getMsh18_CharacterSet(int rep) {
501 ID retVal = this.getTypedField(18, rep);
502 return retVal;
503 }
504
505
506
507
508
509
510 public int getMsh18_CharacterSetReps() {
511 return this.getReps(18);
512 }
513
514
515
516
517
518
519
520
521
522 public ID insertCharacterSet(int rep) throws HL7Exception {
523 return (ID) super.insertRepetition(18, rep);
524 }
525
526
527
528
529
530
531
532
533
534 public ID insertMsh18_CharacterSet(int rep) throws HL7Exception {
535 return (ID) super.insertRepetition(18, rep);
536 }
537
538
539
540
541
542
543
544
545
546 public ID removeCharacterSet(int rep) throws HL7Exception {
547 return (ID) super.removeRepetition(18, rep);
548 }
549
550
551
552
553
554
555
556
557
558 public ID removeMsh18_CharacterSet(int rep) throws HL7Exception {
559 return (ID) super.removeRepetition(18, rep);
560 }
561
562
563
564
565
566
567
568
569 public CE getPrincipalLanguageOfMessage() {
570 CE retVal = this.getTypedField(19, 0);
571 return retVal;
572 }
573
574
575
576
577
578 public CE getMsh19_PrincipalLanguageOfMessage() {
579 CE retVal = this.getTypedField(19, 0);
580 return retVal;
581 }
582
583
584
585
586
587
588
589 public ID getAlternateCharacterSetHandlingScheme() {
590 ID retVal = this.getTypedField(20, 0);
591 return retVal;
592 }
593
594
595
596
597
598 public ID getMsh20_AlternateCharacterSetHandlingScheme() {
599 ID retVal = this.getTypedField(20, 0);
600 return retVal;
601 }
602
603
604
605
606
607 public EI[] getMessageProfileIdentifier() {
608 EI[] retVal = this.getTypedField(21, new EI[0]);
609 return retVal;
610 }
611
612
613
614
615
616 public EI[] getMsh21_MessageProfileIdentifier() {
617 EI[] retVal = this.getTypedField(21, new EI[0]);
618 return retVal;
619 }
620
621
622
623
624
625
626
627 public int getMessageProfileIdentifierReps() {
628 return this.getReps(21);
629 }
630
631
632
633
634
635
636
637
638 public EI getMessageProfileIdentifier(int rep) {
639 EI retVal = this.getTypedField(21, rep);
640 return retVal;
641 }
642
643
644
645
646
647
648
649 public EI getMsh21_MessageProfileIdentifier(int rep) {
650 EI retVal = this.getTypedField(21, rep);
651 return retVal;
652 }
653
654
655
656
657
658
659 public int getMsh21_MessageProfileIdentifierReps() {
660 return this.getReps(21);
661 }
662
663
664
665
666
667
668
669
670
671 public EI insertMessageProfileIdentifier(int rep) throws HL7Exception {
672 return (EI) super.insertRepetition(21, rep);
673 }
674
675
676
677
678
679
680
681
682
683 public EI insertMsh21_MessageProfileIdentifier(int rep) throws HL7Exception {
684 return (EI) super.insertRepetition(21, rep);
685 }
686
687
688
689
690
691
692
693
694
695 public EI removeMessageProfileIdentifier(int rep) throws HL7Exception {
696 return (EI) super.removeRepetition(21, rep);
697 }
698
699
700
701
702
703
704
705
706
707 public EI removeMsh21_MessageProfileIdentifier(int rep) throws HL7Exception {
708 return (EI) super.removeRepetition(21, rep);
709 }
710
711
712
713
714
715
716
717 protected Type createNewTypeWithoutReflection(int field) {
718 switch (field) {
719 case 0: return new ST(getMessage());
720 case 1: return new ST(getMessage());
721 case 2: return new HD(getMessage());
722 case 3: return new HD(getMessage());
723 case 4: return new HD(getMessage());
724 case 5: return new HD(getMessage());
725 case 6: return new TS(getMessage());
726 case 7: return new ST(getMessage());
727 case 8: return new MSG(getMessage());
728 case 9: return new ST(getMessage());
729 case 10: return new PT(getMessage());
730 case 11: return new VID(getMessage());
731 case 12: return new NM(getMessage());
732 case 13: return new ST(getMessage());
733 case 14: return new ID(getMessage(), new Integer( 155 ));
734 case 15: return new ID(getMessage(), new Integer( 155 ));
735 case 16: return new ID(getMessage(), new Integer( 399 ));
736 case 17: return new ID(getMessage(), new Integer( 211 ));
737 case 18: return new CE(getMessage());
738 case 19: return new ID(getMessage(), new Integer( 356 ));
739 case 20: return new EI(getMessage());
740 default: return null;
741 }
742 }
743
744
745 }
746