1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.openehealth.ipf.platform.camel.ihe.fhir.pcc44;
18
19 import org.apache.camel.CamelContext;
20 import org.openehealth.ipf.commons.ihe.core.TransactionOptionUtils;
21 import org.openehealth.ipf.commons.ihe.fhir.FhirTransactionOptions;
22 import org.openehealth.ipf.commons.ihe.fhir.audit.FhirQueryAuditDataset;
23 import org.openehealth.ipf.commons.ihe.fhir.pcc44.Pcc44Options;
24 import org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirComponent;
25 import org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirEndpointConfiguration;
26
27 import java.util.List;
28 import java.util.Map;
29
30 import static org.openehealth.ipf.commons.ihe.fhir.qedm.QEDM.Interactions.PCC_44;
31
32
33
34
35
36
37
38
39 public class Pcc44Component extends FhirComponent<FhirQueryAuditDataset> {
40
41
42 public Pcc44Component() {
43 super(PCC_44);
44 }
45
46 public Pcc44Component(CamelContext context) {
47 super(context, PCC_44);
48 }
49
50 @Override
51 protected Pcc44Endpoint doCreateEndpoint(String uri, FhirEndpointConfiguration<FhirQueryAuditDataset> config) {
52 return new Pcc44Endpoint(uri, this, config);
53 }
54
55 @Override
56 protected FhirEndpointConfiguration<FhirQueryAuditDataset> createConfig(String remaining, Map<String, Object> parameters) throws Exception {
57 String options = getAndRemoveParameter(parameters, "options", String.class, Pcc44Options.ALL.name());
58 List<? extends FhirTransactionOptions> iti44Options = TransactionOptionUtils.split(options, Pcc44Options.class);
59 if (iti44Options.isEmpty()) {
60 throw new IllegalArgumentException("Options parameter for qedm-pcc44 is invalid");
61 }
62 getInteractionId().init(iti44Options);
63 return super.createConfig(remaining, parameters);
64 }
65
66 }