1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.platform.camel.ihe.mllp.core;
17
18 import java.util.Map;
19
20 import ca.uhn.hl7v2.DefaultHapiContext;
21 import ca.uhn.hl7v2.ErrorCode;
22 import ca.uhn.hl7v2.Version;
23 import org.apache.camel.component.mina2.Mina2Endpoint;
24 import org.openehealth.ipf.commons.ihe.hl7v2.Hl7v2InteractionId;
25 import org.openehealth.ipf.commons.ihe.hl7v2.Hl7v2TransactionConfiguration;
26 import org.openehealth.ipf.commons.ihe.hl7v2.NakFactory;
27 import org.openehealth.ipf.commons.ihe.hl7v2.audit.MllpAuditDataset;
28 import org.openehealth.ipf.modules.hl7.parser.DefaultEscaping;
29
30
31
32
33
34 public class MllpDispatchComponent extends MllpComponent<MllpDispatchEndpointConfiguration, MllpAuditDataset> {
35
36 public static final Hl7v2TransactionConfiguration<MllpAuditDataset> CONFIGURATION =
37 new Hl7v2TransactionConfiguration<>(
38 "mllp-dispatch",
39 "MLLP Dispatcher",
40 false,
41 null,
42 null,
43 new Version[] {Version.V25},
44 "MLLP Dispatcher",
45 "IPF",
46 ErrorCode.APPLICATION_INTERNAL_ERROR,
47 ErrorCode.APPLICATION_INTERNAL_ERROR,
48 new String[] {"\0"},
49 new String[] {"\0"},
50 new String[] {"\0"},
51 new String[] {"\0"},
52 new boolean[] {false},
53 new boolean[] {false},
54 new DefaultHapiContext());
55
56 private static final NakFactory<MllpAuditDataset> NAK_FACTORY = new NakFactory<>(CONFIGURATION);
57
58 static {
59 CONFIGURATION.getHapiContext().getParserConfiguration().setEscaping(DefaultEscaping.INSTANCE);
60 }
61
62 @Override
63 protected MllpDispatchEndpointConfiguration createConfig(String uri, Map<String, Object> parameters) throws Exception {
64 return new MllpDispatchEndpointConfiguration(this, uri, parameters);
65 }
66
67 @Override
68 protected MllpEndpoint<?, ?, ?> createEndpoint(Mina2Endpoint wrappedEndpoint, MllpDispatchEndpointConfiguration config) {
69 return new MllpDispatchEndpoint(this, wrappedEndpoint, config);
70 }
71
72 @Override
73 public Hl7v2InteractionId<MllpAuditDataset> getInteractionId() {
74 return null;
75 }
76
77 @Override
78 public Hl7v2TransactionConfiguration<MllpAuditDataset> getHl7v2TransactionConfiguration() {
79 return CONFIGURATION;
80 }
81
82 @Override
83 public NakFactory<MllpAuditDataset> getNakFactory() {
84 return NAK_FACTORY;
85 }
86 }