|
1 |
| -package org.highmed.dsf.bpe.service; |
2 |
| - |
3 |
| -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; |
4 |
| -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; |
| 1 | +package dev.dsf.bpe.service; |
5 | 2 |
|
6 | 3 | import java.util.EnumSet;
|
7 | 4 | import java.util.List;
|
8 | 5 | import java.util.Objects;
|
9 |
| -import java.util.stream.Collectors; |
10 |
| - |
11 |
| -import javax.ws.rs.WebApplicationException; |
12 | 6 |
|
13 | 7 | import org.camunda.bpm.engine.delegate.DelegateExecution;
|
14 |
| -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; |
15 |
| -import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; |
16 |
| -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; |
17 |
| -import org.highmed.dsf.fhir.task.TaskHelper; |
18 |
| -import org.highmed.fhir.client.FhirWebserviceClient; |
19 | 8 | import org.hl7.fhir.r4.model.Bundle;
|
20 | 9 | import org.hl7.fhir.r4.model.Bundle.BundleType;
|
21 | 10 | import org.hl7.fhir.r4.model.IdType;
|
|
25 | 14 | import org.slf4j.LoggerFactory;
|
26 | 15 |
|
27 | 16 | import ca.uhn.fhir.context.FhirContext;
|
| 17 | +import dev.dsf.bpe.ConstantsUpdateAllowList; |
| 18 | +import dev.dsf.bpe.delegate.AbstractServiceDelegate; |
| 19 | +import dev.dsf.fhir.authorization.read.ReadAccessHelper; |
| 20 | +import dev.dsf.fhir.client.FhirWebserviceClient; |
| 21 | +import dev.dsf.fhir.client.FhirWebserviceClientProvider; |
| 22 | +import dev.dsf.fhir.task.TaskHelper; |
| 23 | +import jakarta.ws.rs.WebApplicationException; |
28 | 24 |
|
29 | 25 | public class DownloadAllowList extends AbstractServiceDelegate
|
30 | 26 | {
|
@@ -93,24 +89,28 @@ protected void doExecute(DelegateExecution execution) throws Exception
|
93 | 89 |
|
94 | 90 | private IdType getBundleId(Task task)
|
95 | 91 | {
|
96 |
| - List<Reference> bundleReferences = getTaskHelper().getInputParameterReferenceValues(task, |
97 |
| - CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST, CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST) |
98 |
| - .collect(Collectors.toList()); |
| 92 | + List<Reference> bundleReferences = getTaskHelper() |
| 93 | + .getInputParameterReferenceValues(task, ConstantsUpdateAllowList.CODESYSTEM_DSF_UPDATE_ALLOW_LIST, |
| 94 | + ConstantsUpdateAllowList.CODESYSTEM_DSF_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST) |
| 95 | + .toList(); |
99 | 96 |
|
100 | 97 | if (bundleReferences.size() != 1)
|
101 | 98 | {
|
102 | 99 | logger.error("Task input parameter {} contains unexpected number of Bundle IDs, expected 1, got {}",
|
103 |
| - CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST, bundleReferences.size()); |
104 |
| - throw new RuntimeException("Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST |
105 |
| - + " contains unexpected number of Bundle IDs, expected 1, got " + bundleReferences.size()); |
| 100 | + ConstantsUpdateAllowList.CODESYSTEM_DSF_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST, |
| 101 | + bundleReferences.size()); |
| 102 | + throw new RuntimeException( |
| 103 | + "Task input parameter " + ConstantsUpdateAllowList.CODESYSTEM_DSF_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST |
| 104 | + + " contains unexpected number of Bundle IDs, expected 1, got " + bundleReferences.size()); |
106 | 105 | }
|
107 | 106 | else if (!bundleReferences.get(0).hasReference()
|
108 | 107 | || !bundleReferences.get(0).getReference().contains("/Bundle/"))
|
109 | 108 | {
|
110 | 109 | logger.error("Task input parameter {} has no Bundle reference",
|
111 |
| - CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); |
112 |
| - throw new RuntimeException("Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST |
113 |
| - + " has no Bundle reference"); |
| 110 | + ConstantsUpdateAllowList.CODESYSTEM_DSF_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); |
| 111 | + throw new RuntimeException( |
| 112 | + "Task input parameter " + ConstantsUpdateAllowList.CODESYSTEM_DSF_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST |
| 113 | + + " has no Bundle reference"); |
114 | 114 | }
|
115 | 115 |
|
116 | 116 | return new IdType(bundleReferences.get(0).getReference());
|
|
0 commit comments