diff --git a/dsf-bpe/dsf-bpe-process-update-whitelist/pom.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml
similarity index 91%
rename from dsf-bpe/dsf-bpe-process-update-whitelist/pom.xml
rename to dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml
index ab022bf0b..6f8ba7de8 100755
--- a/dsf-bpe/dsf-bpe-process-update-whitelist/pom.xml
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml
@@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- dsf-bpe-process-update-whitelist
+ dsf-bpe-process-update-allow-list
org.highmed.dsf
diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowListPlugin.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowListPlugin.java
new file mode 100755
index 000000000..ecab0a3fc
--- /dev/null
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowListPlugin.java
@@ -0,0 +1,20 @@
+package org.highmed.dsf.bpe.plugin;
+
+import org.camunda.bpm.engine.ProcessEngine;
+import org.camunda.bpm.model.bpmn.BpmnModelInstance;
+
+public class UpdateAllowListPlugin extends AbstractProcessEnginePlugin
+{
+ private static final String UPDATE_ALLOW_LIST_FILE = "updateAllowList.bpmn";
+ private static final String DOWNLOAD_ALLOW_LIST_FILE = "downloadAllowList.bpmn";
+
+ @Override
+ public void postProcessEngineBuild(ProcessEngine processEngine)
+ {
+ BpmnModelInstance updateAllowListProcess = readAndValidateModel("/" + UPDATE_ALLOW_LIST_FILE);
+ deploy(processEngine, UPDATE_ALLOW_LIST_FILE, updateAllowListProcess);
+
+ BpmnModelInstance downloadAllowListProcess = readAndValidateModel("/" + DOWNLOAD_ALLOW_LIST_FILE);
+ deploy(processEngine, DOWNLOAD_ALLOW_LIST_FILE, downloadAllowListProcess);
+ }
+}
diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java
new file mode 100644
index 000000000..57ff32b24
--- /dev/null
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java
@@ -0,0 +1,118 @@
+package org.highmed.dsf.bpe.service;
+
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+import javax.ws.rs.WebApplicationException;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.highmed.dsf.bpe.ConstantsBase;
+import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate;
+import org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList;
+import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider;
+import org.highmed.dsf.fhir.task.TaskHelper;
+import org.highmed.fhir.client.FhirWebserviceClient;
+import org.hl7.fhir.r4.model.Bundle;
+import org.hl7.fhir.r4.model.Bundle.BundleType;
+import org.hl7.fhir.r4.model.IdType;
+import org.hl7.fhir.r4.model.Reference;
+import org.hl7.fhir.r4.model.Task;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import ca.uhn.fhir.context.FhirContext;
+
+public class DownloadAllowList extends AbstractServiceDelegate
+{
+ private static final Logger logger = LoggerFactory.getLogger(DownloadAllowList.class);
+
+ private final FhirContext context;
+
+ public DownloadAllowList(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, FhirContext context)
+ {
+ super(clientProvider, taskHelper);
+ this.context = context;
+ }
+
+ @Override
+ public void afterPropertiesSet() throws Exception
+ {
+ super.afterPropertiesSet();
+ Objects.requireNonNull(context, "fhirContext");
+ }
+
+ @Override
+ protected void doExecute(DelegateExecution execution) throws Exception
+ {
+ Task task = (Task) execution.getVariable(ConstantsBase.VARIABLE_TASK);
+ IdType bundleId = getBundleId(task);
+ FhirWebserviceClient requesterClient = getFhirWebserviceClientProvider()
+ .getRemoteWebserviceClient(bundleId.getBaseUrl());
+
+ Bundle bundle;
+ try
+ {
+ if (bundleId.hasVersionIdPart())
+ bundle = requesterClient.read(Bundle.class, bundleId.getIdPart(), bundleId.getVersionIdPart());
+ else
+ bundle = requesterClient.read(Bundle.class, bundleId.getIdPart());
+ }
+ catch (WebApplicationException e)
+ {
+ logger.error("Error while reading Bundle with id {} from organization {}: {}", bundleId.getValue(),
+ task.getRequester().getReference(), e.getMessage());
+ throw new RuntimeException("Error while reading Bundle with id " + bundleId.getValue()
+ + " from organization " + task.getRequester().getReference() + ", " + e.getMessage(), e);
+ }
+
+ if (!EnumSet.of(BundleType.TRANSACTION, BundleType.BATCH).contains(bundle.getType()))
+ {
+ logger.error("Bundle type TRANSACTION or BATCH expected, but got {}", bundle.getType());
+ throw new RuntimeException("Bundle type TRANSACTION or BATCH expected, but got " + bundle.getType());
+ }
+
+ try
+ {
+ logger.debug("Posting bundle to local endpoint: {}", context.newXmlParser().encodeResourceToString(bundle));
+ getFhirWebserviceClientProvider().getLocalWebserviceClient().withMinimalReturn().postBundle(bundle);
+ }
+ catch (Exception e)
+ {
+ logger.error("Error while executing Bundle with id {} from organization {} locally: {}",
+ bundleId.getValue(), task.getRequester().getReference(), e.getMessage());
+ throw new RuntimeException("Error while executing Bundle with id " + bundleId.getValue()
+ + " from organization " + task.getRequester().getReference() + " locally, " + e.getMessage(), e);
+ }
+ }
+
+ private IdType getBundleId(Task task)
+ {
+ List bundleReferences = getTaskHelper()
+ .getInputParameterReferenceValues(task, ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST,
+ ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST)
+ .collect(Collectors.toList());
+
+ if (bundleReferences.size() != 1)
+ {
+ logger.error("Task input parameter {} contains unexpected number of Bundle IDs, expected 1, got {}",
+ ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST,
+ bundleReferences.size());
+ throw new RuntimeException("Task input parameter "
+ + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST
+ + " contains unexpected number of Bundle IDs, expected 1, got " + bundleReferences.size());
+ }
+ else if (!bundleReferences.get(0).hasReference()
+ || !bundleReferences.get(0).getReference().contains("/Bundle/"))
+ {
+ logger.error("Task input parameter {} has no Bundle reference",
+ ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST);
+ throw new RuntimeException("Task input parameter "
+ + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST
+ + " has no Bundle reference");
+ }
+
+ return new IdType(bundleReferences.get(0).getReference());
+ }
+}
diff --git a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/service/UpdateWhitelist.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java
similarity index 78%
rename from dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/service/UpdateWhitelist.java
rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java
index fe3f1fb19..4d18b14bf 100644
--- a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/service/UpdateWhitelist.java
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java
@@ -12,7 +12,7 @@
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.highmed.dsf.bpe.ConstantsBase;
import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate;
-import org.highmed.dsf.bpe.variables.ConstantsUpdateWhitelist;
+import org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList;
import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider;
import org.highmed.dsf.fhir.organization.OrganizationProvider;
import org.highmed.dsf.fhir.task.TaskHelper;
@@ -34,13 +34,13 @@
import ca.uhn.fhir.context.FhirContext;
-public class UpdateWhitelist extends AbstractServiceDelegate implements InitializingBean
+public class UpdateAllowList extends AbstractServiceDelegate implements InitializingBean
{
- private static final Logger logger = LoggerFactory.getLogger(UpdateWhitelist.class);
+ private static final Logger logger = LoggerFactory.getLogger(UpdateAllowList.class);
private final OrganizationProvider organizationProvider;
- public UpdateWhitelist(OrganizationProvider organizationProvider, FhirWebserviceClientProvider clientProvider,
+ public UpdateAllowList(OrganizationProvider organizationProvider, FhirWebserviceClientProvider clientProvider,
TaskHelper taskHelper)
{
super(clientProvider, taskHelper);
@@ -69,29 +69,31 @@ public void doExecute(DelegateExecution execution) throws Exception
Bundle transaction = new Bundle().setType(BundleType.TRANSACTION);
transaction.getMeta().addTag().setSystem("http://highmed.org/fhir/CodeSystem/authorization-role")
.setCode("REMOTE");
- transaction.getIdentifier().setSystem(ConstantsUpdateWhitelist.CODESYSTEM_HIGHMED_UPDATE_WHITELIST)
- .setValue(ConstantsUpdateWhitelist.CODESYSTEM_HIGHMED_UPDATE_WHITELIST_VALUE_WHITE_LIST);
+ transaction.getIdentifier().setSystem(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST)
+ .setValue(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST);
searchSet.getEntry().stream()
.filter(e -> e.hasSearch() && SearchEntryMode.MATCH.equals(e.getSearch().getMode()) && e.hasResource()
- && e.getResource() instanceof Organization).map(e -> (Organization) e.getResource())
- .forEach(addWhiteListEntry(transaction, searchSet));
+ && e.getResource() instanceof Organization)
+ .map(e -> (Organization) e.getResource()).forEach(addAllowListEntry(transaction, searchSet));
- logger.debug("Uploading new white-list transaction bundle: {}",
+ logger.debug("Uploading new allow list transaction bundle: {}",
FhirContext.forR4().newJsonParser().encodeResourceToString(transaction));
- IdType result = client.withMinimalReturn().updateConditionaly(transaction, Map.of("identifier", Collections
- .singletonList(ConstantsUpdateWhitelist.CODESYSTEM_HIGHMED_UPDATE_WHITELIST + "|"
- + ConstantsUpdateWhitelist.CODESYSTEM_HIGHMED_UPDATE_WHITELIST_VALUE_WHITE_LIST)));
+ IdType result = client.withMinimalReturn().updateConditionaly(transaction,
+ Map.of("identifier",
+ Collections.singletonList(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST + "|"
+ + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST)));
Task task = (Task) execution.getVariable(ConstantsBase.VARIABLE_LEADING_TASK);
task.addOutput().setValue(new Reference(new IdType("Bundle", result.getIdPart(), result.getVersionIdPart())))
- .getType().addCoding().setSystem(ConstantsUpdateWhitelist.CODESYSTEM_HIGHMED_UPDATE_WHITELIST)
- .setCode(ConstantsUpdateWhitelist.CODESYSTEM_HIGHMED_UPDATE_WHITELIST_VALUE_WHITE_LIST);
+ .getType().addCoding().setSystem(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST)
+ .setCode(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST);
}
- private Consumer super Organization> addWhiteListEntry(Bundle transaction, Bundle searchSet)
+ private Consumer super Organization> addAllowListEntry(Bundle transaction, Bundle searchSet)
{
- return organization -> {
+ return organization ->
+ {
Identifier identifier = getDefaultIdentifier(organization).get();
BundleEntryComponent organizationEntry = transaction.addEntry();
@@ -105,15 +107,16 @@ private Consumer super Organization> addWhiteListEntry(Bundle transaction, Bun
organizationEntry.setResource(organization);
organization.setEndpoint(organization.getEndpoint().stream()
- .map(addWhiteListEntryReturnReference(transaction, organizationId, searchSet))
+ .map(addAllowListEntryReturnReference(transaction, organizationId, searchSet))
.filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList()));
};
}
- private Function> addWhiteListEntryReturnReference(Bundle transaction,
+ private Function> addAllowListEntryReturnReference(Bundle transaction,
String organizationId, Bundle searchSet)
{
- return endpointRef -> getEndpoint(endpointRef, searchSet).map(endpoint -> {
+ return endpointRef -> getEndpoint(endpointRef, searchSet).map(endpoint ->
+ {
Identifier identifier = getDefaultIdentifier(endpoint).get();
BundleEntryComponent endpointEntry = transaction.addEntry();
@@ -146,7 +149,8 @@ private Optional getDefaultIdentifier(Endpoint ept)
private Optional getEndpoint(Reference endpoint, Bundle searchSet)
{
return searchSet.getEntry().stream()
- .filter(e -> e.hasResource() && e.getResource() instanceof Endpoint && e.getFullUrl()
- .endsWith(endpoint.getReference())).map(e -> (Endpoint) e.getResource()).findFirst();
+ .filter(e -> e.hasResource() && e.getResource() instanceof Endpoint
+ && e.getFullUrl().endsWith(endpoint.getReference()))
+ .map(e -> (Endpoint) e.getResource()).findFirst();
}
}
diff --git a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateWhitelistConfig.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java
similarity index 52%
rename from dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateWhitelistConfig.java
rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java
index e0efe0d4b..f0f4505f3 100755
--- a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateWhitelistConfig.java
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java
@@ -1,8 +1,9 @@
package org.highmed.dsf.bpe.spring.config;
import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin;
-import org.highmed.dsf.bpe.plugin.UpdateWhitelistPlugin;
-import org.highmed.dsf.bpe.service.UpdateWhitelist;
+import org.highmed.dsf.bpe.plugin.UpdateAllowListPlugin;
+import org.highmed.dsf.bpe.service.DownloadAllowList;
+import org.highmed.dsf.bpe.service.UpdateAllowList;
import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider;
import org.highmed.dsf.fhir.organization.OrganizationProvider;
import org.highmed.dsf.fhir.task.TaskHelper;
@@ -10,8 +11,10 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import ca.uhn.fhir.context.FhirContext;
+
@Configuration
-public class UpdateWhitelistConfig
+public class UpdateAllowListConfig
{
@Autowired
private FhirWebserviceClientProvider clientProvider;
@@ -22,15 +25,24 @@ public class UpdateWhitelistConfig
@Autowired
private TaskHelper taskHelper;
+ @Autowired
+ private FhirContext fhirContext;
+
+ @Bean
+ public ProcessEnginePlugin updateAllowListPlugin()
+ {
+ return new UpdateAllowListPlugin();
+ }
+
@Bean
- public ProcessEnginePlugin updateWhiteListPlugin()
+ public UpdateAllowList updateAllowList()
{
- return new UpdateWhitelistPlugin();
+ return new UpdateAllowList(organizationProvider, clientProvider, taskHelper);
}
@Bean
- public UpdateWhitelist updateWhiteList()
+ public DownloadAllowList downloadAllowList()
{
- return new UpdateWhitelist(organizationProvider, clientProvider, taskHelper);
+ return new DownloadAllowList(clientProvider, taskHelper, fhirContext);
}
}
diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java
new file mode 100644
index 000000000..dc6816a43
--- /dev/null
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java
@@ -0,0 +1,7 @@
+package org.highmed.dsf.bpe.variables;
+
+public interface ConstantsUpdateAllowList
+{
+ String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST = "http://highmed.org/fhir/CodeSystem/update-allow-list";
+ String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST = "highmed_allow_list";
+}
diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/downloadAllowList.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/downloadAllowList.bpmn
new file mode 100644
index 000000000..1ddce4d90
--- /dev/null
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/downloadAllowList.bpmn
@@ -0,0 +1,40 @@
+
+
+
+
+
+ SequenceFlow_0oyvmcd
+
+
+
+ SequenceFlow_0bbhq2r
+ SequenceFlow_0oyvmcd
+
+
+ SequenceFlow_0bbhq2r
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/resources/updateWhitelist.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/updateAllowList.bpmn
similarity index 81%
rename from dsf-bpe/dsf-bpe-process-update-whitelist/src/main/resources/updateWhitelist.bpmn
rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/updateAllowList.bpmn
index 13a84df30..ed675abd9 100755
--- a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/resources/updateWhitelist.bpmn
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/updateAllowList.bpmn
@@ -1,12 +1,12 @@
-
-
+
+
SequenceFlow_0oyvmcd
-
-
+
+
SequenceFlow_0bbhq2r
SequenceFlow_0oyvmcd
@@ -15,9 +15,9 @@
-
+
-
+
@@ -29,7 +29,7 @@
-
+
diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java
new file mode 100644
index 000000000..0e4919ce9
--- /dev/null
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java
@@ -0,0 +1,79 @@
+package org.highmed.dsf.bpe.start;
+
+import java.io.IOException;
+import java.nio.file.Paths;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Map;
+
+import org.highmed.dsf.fhir.service.ReferenceCleaner;
+import org.highmed.dsf.fhir.service.ReferenceCleanerImpl;
+import org.highmed.dsf.fhir.service.ReferenceExtractorImpl;
+import org.highmed.fhir.client.FhirWebserviceClient;
+import org.highmed.fhir.client.FhirWebserviceClientJersey;
+import org.hl7.fhir.r4.model.Bundle;
+import org.hl7.fhir.r4.model.IdType;
+import org.hl7.fhir.r4.model.Reference;
+import org.hl7.fhir.r4.model.StringType;
+import org.hl7.fhir.r4.model.Task;
+import org.hl7.fhir.r4.model.Task.TaskIntent;
+import org.hl7.fhir.r4.model.Task.TaskStatus;
+
+import ca.uhn.fhir.context.FhirContext;
+import de.rwh.utils.crypto.CertificateHelper;
+import de.rwh.utils.crypto.io.CertificateReader;
+
+public class DownloadAllowListFromTtpViaMedic1ExampleStarter
+{
+ public static void main(String[] args)
+ throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException
+ {
+ char[] keyStorePassword = "password".toCharArray();
+ KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(
+ "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"),
+ keyStorePassword);
+ KeyStore trustStore = CertificateHelper.extractTrust(keyStore);
+
+ FhirContext context = FhirContext.forR4();
+ ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl());
+
+ FhirWebserviceClient ttpClient = new FhirWebserviceClientJersey("https://ttp/fhir/", trustStore, keyStore,
+ keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner);
+
+ Bundle searchResult = ttpClient.searchWithStrictHandling(Bundle.class, Map.of("identifier",
+ Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list")));
+ if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle)
+ throw new IllegalStateException("Expected a single allow list Bundle");
+ Bundle allowList = (Bundle) searchResult.getEntryFirstRep().getResource();
+
+ System.out.println(context.newXmlParser().encodeResourceToString(allowList));
+
+ FhirWebserviceClient client = new FhirWebserviceClientJersey("https://medic1/fhir/", trustStore, keyStore,
+ keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner);
+
+ Task task = new Task();
+ task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list");
+ task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.3.0");
+ task.setStatus(TaskStatus.REQUESTED);
+ task.setIntent(TaskIntent.ORDER);
+ task.setAuthoredOn(new Date());
+ task.getRequester().setType("Organization").getIdentifier()
+ .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1");
+ task.getRestriction().addRecipient().setType("Organization").getIdentifier()
+ .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1");
+
+ task.addInput().setValue(new StringType("downloadAllowListMessage")).getType().addCoding()
+ .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name");
+ task.addInput()
+ .setValue(new Reference(new IdType("https://ttp/fhir", "Bundle", allowList.getIdElement().getIdPart(),
+ allowList.getIdElement().getVersionIdPart())))
+ .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list")
+ .setCode("highmed_allow_list");
+
+ client.withMinimalReturn().create(task);
+ }
+}
diff --git a/dsf-bpe/dsf-bpe-process-update-whitelist/src/test/java/org/highmed/dsf/bpe/start/UpdateWhitelist3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java
similarity index 93%
rename from dsf-bpe/dsf-bpe-process-update-whitelist/src/test/java/org/highmed/dsf/bpe/start/UpdateWhitelist3MedicTtpExampleStarter.java
rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java
index a7578cd9c..e47fed907 100644
--- a/dsf-bpe/dsf-bpe-process-update-whitelist/src/test/java/org/highmed/dsf/bpe/start/UpdateWhitelist3MedicTtpExampleStarter.java
+++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java
@@ -23,7 +23,7 @@
import de.rwh.utils.crypto.CertificateHelper;
import de.rwh.utils.crypto.io.CertificateReader;
-public class UpdateWhitelist3MedicTtpExampleStarter
+public class UpdateAllowList3MedicTtpExampleStarter
{
public static void main(String[] args)
throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException
@@ -40,8 +40,8 @@ public static void main(String[] args)
keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner);
Task task = new Task();
- task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-whitelist");
- task.setInstantiatesUri("http://highmed.org/bpe/Process/updateWhitelist/0.2.0");
+ task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list");
+ task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0");
task.setStatus(TaskStatus.REQUESTED);
task.setIntent(TaskIntent.ORDER);
task.setAuthoredOn(new Date());
@@ -50,7 +50,7 @@ public static void main(String[] args)
task.getRestriction().addRecipient().setType("Organization").getIdentifier()
.setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP");
- task.addInput().setValue(new StringType("updateWhitelistMessage")).getType().addCoding()
+ task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding()
.setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name");
client.withMinimalReturn().create(task);
diff --git a/dsf-bpe/dsf-bpe-process-update-whitelist/src/test/resources/log4j2.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/resources/log4j2.xml
similarity index 100%
rename from dsf-bpe/dsf-bpe-process-update-whitelist/src/test/resources/log4j2.xml
rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/test/resources/log4j2.xml
diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java
index 57c4bb701..039145dd9 100644
--- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java
+++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java
@@ -44,12 +44,12 @@ public static void main(String[] args)
keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner);
Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier",
- Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-whitelist|highmed_whitelist")));
+ Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list")));
if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle)
- throw new IllegalStateException("Expected a single White-List Bundle");
- Bundle whiteList = (Bundle) searchResult.getEntryFirstRep().getResource();
+ throw new IllegalStateException("Expected a single allow list Bundle");
+ Bundle allowList = (Bundle) searchResult.getEntryFirstRep().getResource();
- System.out.println(context.newXmlParser().encodeResourceToString(whiteList));
+ System.out.println(context.newXmlParser().encodeResourceToString(allowList));
Task task = new Task();
task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources");
@@ -66,8 +66,8 @@ public static void main(String[] args)
.setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name");
task.addInput()
- .setValue(new Reference(new IdType("Bundle", whiteList.getIdElement().getIdPart(),
- whiteList.getIdElement().getVersionIdPart())))
+ .setValue(new Reference(new IdType("Bundle", allowList.getIdElement().getIdPart(),
+ allowList.getIdElement().getVersionIdPart())))
.getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-resources")
.setCode("bundle-reference");
diff --git a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateWhitelistPlugin.java b/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateWhitelistPlugin.java
deleted file mode 100755
index 46e2ecdce..000000000
--- a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateWhitelistPlugin.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.highmed.dsf.bpe.plugin;
-
-import org.camunda.bpm.engine.ProcessEngine;
-import org.camunda.bpm.model.bpmn.BpmnModelInstance;
-
-public class UpdateWhitelistPlugin extends AbstractProcessEnginePlugin
-{
- private static final String UPDATE_WHITELIST_FILE = "updateWhitelist.bpmn";
-
- @Override
- public void postProcessEngineBuild(ProcessEngine processEngine)
- {
- BpmnModelInstance updateWhiteListeProcess = readAndValidateModel("/" + UPDATE_WHITELIST_FILE);
- deploy(processEngine, UPDATE_WHITELIST_FILE, updateWhiteListeProcess);
- }
-}
diff --git a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateWhitelist.java b/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateWhitelist.java
deleted file mode 100644
index a5f41562d..000000000
--- a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateWhitelist.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.highmed.dsf.bpe.variables;
-
-public interface ConstantsUpdateWhitelist
-{
- String CODESYSTEM_HIGHMED_UPDATE_WHITELIST = "http://highmed.org/fhir/CodeSystem/update-whitelist";
- String CODESYSTEM_HIGHMED_UPDATE_WHITELIST_VALUE_WHITE_LIST = "highmed_whitelist";
-}
diff --git a/dsf-bpe/dsf-bpe-server/pom.xml b/dsf-bpe/dsf-bpe-server/pom.xml
index 6f1cf359c..5be6db37d 100755
--- a/dsf-bpe/dsf-bpe-server/pom.xml
+++ b/dsf-bpe/dsf-bpe-server/pom.xml
@@ -35,7 +35,7 @@
org.highmed.dsf
- dsf-bpe-process-update-whitelist
+ dsf-bpe-process-update-allow-list
org.highmed.dsf
diff --git a/dsf-bpe/dsf-bpe-webservice-client/src/test/java/org/highmed/dsf/bpe/client/TestBpeJerseyClient.java b/dsf-bpe/dsf-bpe-webservice-client/src/test/java/org/highmed/dsf/bpe/client/TestBpeJerseyClient.java
index cef0220e3..4ff47b76b 100755
--- a/dsf-bpe/dsf-bpe-webservice-client/src/test/java/org/highmed/dsf/bpe/client/TestBpeJerseyClient.java
+++ b/dsf-bpe/dsf-bpe-webservice-client/src/test/java/org/highmed/dsf/bpe/client/TestBpeJerseyClient.java
@@ -33,7 +33,7 @@ public static void main(String[] args)
// client.startProcessWithVersion("ping", "1.0.0");
-// client.startProcessWithVersion("updateWhiteList", "1.0.0");
+// client.startProcessWithVersion("updateAllowList", "1.0.0");
client.startProcessWithVersion("requestUpdateResources", "1.0.0", Map.of("target-identifier",
Collections.singletonList("http://highmed.org/fhir/NamingSystem/organization-identifier|"), "bundle-id",
diff --git a/dsf-bpe/pom.xml b/dsf-bpe/pom.xml
index 58a2c9a84..a74cfbaf4 100755
--- a/dsf-bpe/pom.xml
+++ b/dsf-bpe/pom.xml
@@ -17,7 +17,7 @@
dsf-bpe-process-ping
dsf-bpe-process-plugin-example
dsf-bpe-process-update-resources
- dsf-bpe-process-update-whitelist
+ dsf-bpe-process-update-allow-list
dsf-bpe-server
dsf-bpe-server-jetty
dsf-bpe-webservice-client
@@ -108,7 +108,7 @@
org.highmed.dsf
- dsf-bpe-process-update-whitelist
+ dsf-bpe-process-update-allow-list
${project.version}
diff --git a/dsf-fhir/dsf-fhir-rest-adapter/src/main/java/org/highmed/dsf/fhir/adapter/BundleJsonFhirAdapter.java b/dsf-fhir/dsf-fhir-rest-adapter/src/main/java/org/highmed/dsf/fhir/adapter/BundleJsonFhirAdapter.java
index 5e2e5c331..026d3cfb1 100755
--- a/dsf-fhir/dsf-fhir-rest-adapter/src/main/java/org/highmed/dsf/fhir/adapter/BundleJsonFhirAdapter.java
+++ b/dsf-fhir/dsf-fhir-rest-adapter/src/main/java/org/highmed/dsf/fhir/adapter/BundleJsonFhirAdapter.java
@@ -28,6 +28,10 @@ protected Bundle fixResource(Bundle resource)
resource.setIdElement(fixedId);
}
+ // TODO Bugfix HAPI is removing version information from bundle.id
+ resource.getEntry().stream().filter(e -> e.hasResource() && e.getResource() instanceof Bundle)
+ .map(e -> (Bundle) e.getResource()).forEach(this::fixResource);
+
return resource;
}
}
diff --git a/dsf-fhir/dsf-fhir-rest-adapter/src/main/java/org/highmed/dsf/fhir/adapter/BundleXmlFhirAdapter.java b/dsf-fhir/dsf-fhir-rest-adapter/src/main/java/org/highmed/dsf/fhir/adapter/BundleXmlFhirAdapter.java
index cd848c816..58024b183 100755
--- a/dsf-fhir/dsf-fhir-rest-adapter/src/main/java/org/highmed/dsf/fhir/adapter/BundleXmlFhirAdapter.java
+++ b/dsf-fhir/dsf-fhir-rest-adapter/src/main/java/org/highmed/dsf/fhir/adapter/BundleXmlFhirAdapter.java
@@ -28,6 +28,10 @@ protected Bundle fixResource(Bundle resource)
resource.setIdElement(fixedId);
}
+ // TODO Bugfix HAPI is removing version information from bundle.id
+ resource.getEntry().stream().filter(e -> e.hasResource() && e.getResource() instanceof Bundle)
+ .map(e -> (Bundle) e.getResource()).forEach(this::fixResource);
+
return resource;
}
}
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml
new file mode 100644
index 000000000..1df5126b8
--- /dev/null
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml.post
new file mode 100644
index 000000000..caba3c4b6
--- /dev/null
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml.post
@@ -0,0 +1 @@
+url=http://highmed.org/bpe/Process/downloadAllowList&version=0.3.0
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateWhitelist-0.2.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml
similarity index 78%
rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateWhitelist-0.2.0.xml
rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml
index baf767625..bfa945f61 100644
--- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateWhitelist-0.2.0.xml
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml
@@ -7,7 +7,7 @@
-
+
@@ -34,17 +34,17 @@
-
+
-
-
-
-
-
+
+
+
+
+
-
+
@@ -53,6 +53,6 @@
-
+
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml.post
new file mode 100644
index 000000000..95e360e6c
--- /dev/null
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml.post
@@ -0,0 +1 @@
+url=http://highmed.org/bpe/Process/updateAllowList&version=0.3.0
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateWhitelist-0.2.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateWhitelist-0.2.0.xml.post
deleted file mode 100644
index 5b3b88f93..000000000
--- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateWhitelist-0.2.0.xml.post
+++ /dev/null
@@ -1 +0,0 @@
-url=http://highmed.org/bpe/Process/updateWhitelist&version=0.2.0
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-whitelist-0.2.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml
similarity index 56%
rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-whitelist-0.2.0.xml
rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml
index 4bf6a65bd..cc95f7c94 100644
--- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-whitelist-0.2.0.xml
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml
@@ -5,22 +5,22 @@
-
-
-
-
+
+
+
+
-
+
-
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml.post
new file mode 100644
index 000000000..c97e1d1b4
--- /dev/null
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml.post
@@ -0,0 +1 @@
+url=http://highmed.org/fhir/CodeSystem/update-allow-list&version=0.3.0
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-whitelist-0.2.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-whitelist-0.2.0.xml.post
deleted file mode 100644
index d13193464..000000000
--- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-whitelist-0.2.0.xml.post
+++ /dev/null
@@ -1 +0,0 @@
-url=http://highmed.org/fhir/CodeSystem/update-whitelist&version=0.2.0
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml
new file mode 100644
index 000000000..133658f79
--- /dev/null
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml.post
new file mode 100644
index 000000000..ec0d00b6c
--- /dev/null
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml.post
@@ -0,0 +1 @@
+url=http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list&version=0.3.0
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-whitelist-0.2.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml
similarity index 79%
rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-whitelist-0.2.0.xml
rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml
index 8881d43e7..627bdd679 100644
--- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-whitelist-0.2.0.xml
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml
@@ -5,11 +5,11 @@
-
-
-
+
+
+
-
+
@@ -19,7 +19,7 @@
-
+
@@ -37,7 +37,7 @@
-
+
@@ -55,47 +55,47 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-whitelist-0.2.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml.post
similarity index 69%
rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-whitelist-0.2.0.xml.post
rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml.post
index 13b1bb447..95e29475f 100644
--- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-whitelist-0.2.0.xml.post
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml.post
@@ -1 +1 @@
-url=http://highmed.org/fhir/StructureDefinition/highmed-task-update-whitelist&version=0.2.0
\ No newline at end of file
+url=http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list&version=0.3.0
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-whitelist-0.2.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml
similarity index 50%
rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-whitelist-0.2.0.xml
rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml
index a389370b1..315a7cd5d 100644
--- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-whitelist-0.2.0.xml
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml
@@ -5,20 +5,20 @@
-
-
-
-
+
+
+
+
-
+
+ value="ValueSet with standard values for the process update allow list"/>
-
+
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml.post
new file mode 100644
index 000000000..50356b429
--- /dev/null
+++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml.post
@@ -0,0 +1 @@
+url=http://highmed.org/fhir/ValueSet/update-allow-list&version=0.3.0
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-whitelist-0.2.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-whitelist-0.2.0.xml.post
deleted file mode 100644
index 10e003b0d..000000000
--- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-whitelist-0.2.0.xml.post
+++ /dev/null
@@ -1 +0,0 @@
-url=http://highmed.org/fhir/ValueSet/update-whitelist&version=0.2.0
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/README.md b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/README.md
new file mode 100644
index 000000000..5364f12e3
--- /dev/null
+++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/README.md
@@ -0,0 +1,5 @@
+For executing DAO tests from your IDE without Maven, execute
+
+`docker run -it --rm -e POSTGRES_PASSWORD=password -e TZ=Europe/Berlin -e POSTGRES_DB=db -p 127.0.0.1:54321:5432 postgres:13 postgres -c log_statement=all`
+
+to start a PostgreSQL 13 docker container. Press Ctrl-C to stop and cleanup the docker container after testing.
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java
index 1a13ba53a..9a5cbeb37 100644
--- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java
+++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java
@@ -20,13 +20,13 @@ public class BundleIntegrationTest extends AbstractIntegrationTest
@Test
public void testCreateBundle() throws Exception
{
- Bundle whiteList = readBundle(Paths.get("src/test/resources/integration/white-list.json"),
+ Bundle allowList = readBundle(Paths.get("src/test/resources/integration/allow-list.json"),
fhirContext.newJsonParser());
- logger.debug(fhirContext.newJsonParser().encodeResourceToString(whiteList));
+ logger.debug(fhirContext.newJsonParser().encodeResourceToString(allowList));
- Bundle updatedBundle = getWebserviceClient().updateConditionaly(whiteList, Map.of("identifier",
- Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-whitelist|highmed_whitelist")));
+ Bundle updatedBundle = getWebserviceClient().updateConditionaly(allowList, Map.of("identifier",
+ Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list")));
assertNotNull(updatedBundle);
}
@@ -34,13 +34,13 @@ public void testCreateBundle() throws Exception
@Test
public void testCreateBundleReturnMinimal() throws Exception
{
- Bundle whiteList = readBundle(Paths.get("src/test/resources/integration/white-list.json"),
+ Bundle allowList = readBundle(Paths.get("src/test/resources/integration/allow-list.json"),
fhirContext.newJsonParser());
- logger.debug(fhirContext.newJsonParser().encodeResourceToString(whiteList));
+ logger.debug(fhirContext.newJsonParser().encodeResourceToString(allowList));
- IdType id = getWebserviceClient().withMinimalReturn().updateConditionaly(whiteList, Map.of("identifier",
- Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-whitelist|highmed_whitelist")));
+ IdType id = getWebserviceClient().withMinimalReturn().updateConditionaly(allowList, Map.of("identifier",
+ Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list")));
assertNotNull(id);
}
@@ -48,14 +48,14 @@ public void testCreateBundleReturnMinimal() throws Exception
@Test
public void testCreateBundleReturnOperationOutcome() throws Exception
{
- Bundle whiteList = readBundle(Paths.get("src/test/resources/integration/white-list.json"),
+ Bundle allowList = readBundle(Paths.get("src/test/resources/integration/allow-list.json"),
fhirContext.newJsonParser());
- logger.debug(fhirContext.newJsonParser().encodeResourceToString(whiteList));
+ logger.debug(fhirContext.newJsonParser().encodeResourceToString(allowList));
- OperationOutcome outcome = getWebserviceClient().withOperationOutcomeReturn().updateConditionaly(whiteList,
+ OperationOutcome outcome = getWebserviceClient().withOperationOutcomeReturn().updateConditionaly(allowList,
Map.of("identifier", Collections
- .singletonList("http://highmed.org/fhir/CodeSystem/update-whitelist|highmed_whitelist")));
+ .singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list")));
assertNotNull(outcome);
}
diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/README.md b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/README.md
new file mode 100644
index 000000000..2db71a846
--- /dev/null
+++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/README.md
@@ -0,0 +1,5 @@
+For executing integration tests from your IDE without Maven, execute
+
+`docker run -it --rm -e POSTGRES_PASSWORD=password -e TZ=Europe/Berlin -e POSTGRES_DB=db -p 127.0.0.1:54321:5432 postgres:13 postgres -c log_statement=all`
+
+to start a PostgreSQL 13 docker container. Press Ctrl-C to stop and cleanup the docker container after testing.
\ No newline at end of file
diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java
index 0e7a7bcfe..dc03b373f 100755
--- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java
+++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java
@@ -48,7 +48,7 @@ public class TaskProfileTest
public static final ValidationSupportRule validationRule = new ValidationSupportRule(
Arrays.asList("highmed-task-base-0.2.0.xml", "highmed-task-start-ping-process-0.2.0.xml",
"highmed-task-ping-0.2.0.xml", "highmed-task-pong-0.2.0.xml",
- "highmed-task-update-whitelist-0.2.0.xml", "highmed-task-request-update-resources-0.2.0.xml",
+ "highmed-task-update-allow-list-0.3.0.xml", "highmed-task-request-update-resources-0.2.0.xml",
"highmed-task-execute-update-resources-0.2.0.xml", "highmed-group-0.2.0.xml",
"highmed-extension-group-id-0.2.0.xml", "highmed-research-study-feasibility-0.2.0.xml",
"highmed-task-request-simple-feasibility-0.2.0.xml",
@@ -56,10 +56,10 @@ public class TaskProfileTest
"highmed-task-single-medic-result-simple-feasibility-0.2.0.xml",
"highmed-task-compute-simple-feasibility-0.2.0.xml",
"highmed-task-multi-medic-result-simple-feasibility-0.2.0.xml",
- "highmed-task-local-services-integration-0.3.0.xml"),
- Arrays.asList("authorization-role-0.2.0.xml", "bpmn-message-0.2.0.xml", "update-whitelist-0.2.0.xml",
+ "highmed-task-local-services-integration-0.3.0.xml", "highmed-task-download-allow-list-0.3.0.xml"),
+ Arrays.asList("authorization-role-0.2.0.xml", "bpmn-message-0.2.0.xml", "update-allow-list-0.3.0.xml",
"update-resources-0.2.0.xml", "feasibility-0.2.0.xml"),
- Arrays.asList("authorization-role-0.2.0.xml", "bpmn-message-0.2.0.xml", "update-whitelist-0.2.0.xml",
+ Arrays.asList("authorization-role-0.2.0.xml", "bpmn-message-0.2.0.xml", "update-allow-list-0.3.0.xml",
"update-resources-0.2.0.xml", "feasibility-0.2.0.xml"));
private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(),
@@ -227,9 +227,9 @@ private Task createValidTaskPong()
}
@Test
- public void testTaskUpdateWhitelistValid() throws Exception
+ public void testTaskUpdateAllowListValid() throws Exception
{
- Task task = createValidTaskUpdateWhitelist();
+ Task task = createValidTaskUpdateAllowList();
ValidationResult result = resourceValidator.validate(task);
ValidationSupportRule.logValidationMessages(logger, result);
@@ -239,12 +239,12 @@ public void testTaskUpdateWhitelistValid() throws Exception
}
@Test
- public void testTaskUpdateWhitelistValidWithOutput() throws Exception
+ public void testTaskUpdateAllowlistValidWithOutput() throws Exception
{
- Task task = createValidTaskUpdateWhitelist();
+ Task task = createValidTaskUpdateAllowList();
task.addOutput().setValue(new Reference(new IdType("Bundle", UUID.randomUUID().toString(), "1"))).getType()
- .addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-whitelist")
- .setCode("highmed_whitelist");
+ .addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list")
+ .setCode("highmed_allow_list");
ValidationResult result = resourceValidator.validate(task);
ValidationSupportRule.logValidationMessages(logger, result);
@@ -253,11 +253,11 @@ public void testTaskUpdateWhitelistValidWithOutput() throws Exception
|| ResultSeverityEnum.FATAL.equals(m.getSeverity())).count());
}
- private Task createValidTaskUpdateWhitelist()
+ private Task createValidTaskUpdateAllowList()
{
Task task = new Task();
- task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-whitelist");
- task.setInstantiatesUri("http://highmed.org/bpe/Process/updateWhitelist/0.2.0");
+ task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list");
+ task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0");
task.setStatus(TaskStatus.REQUESTED);
task.setIntent(TaskIntent.ORDER);
task.setAuthoredOn(new Date());
@@ -266,16 +266,16 @@ private Task createValidTaskUpdateWhitelist()
task.getRestriction().addRecipient().setType("Organization").getIdentifier()
.setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP");
- task.addInput().setValue(new StringType("updateWhitelistMessage")).getType().addCoding()
+ task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding()
.setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name");
return task;
}
@Test
- public void testTaskRequestUpdateResourcesWhitelistValid() throws Exception
+ public void testTaskRequestUpdateResourcesAllowListValid() throws Exception
{
- Task task = createValidTaskRequestUpdateWhitelistResources();
+ Task task = createValidTaskRequestUpdateAllowListResources();
ValidationResult result = resourceValidator.validate(task);
ValidationSupportRule.logValidationMessages(logger, result);
@@ -284,11 +284,11 @@ public void testTaskRequestUpdateResourcesWhitelistValid() throws Exception
|| ResultSeverityEnum.FATAL.equals(m.getSeverity())).count());
}
- private Task createValidTaskRequestUpdateWhitelistResources()
+ private Task createValidTaskRequestUpdateAllowListResources()
{
Task task = new Task();
- task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-whitelist");
- task.setInstantiatesUri("http://highmed.org/bpe/Process/updateWhitelist/0.2.0");
+ task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list");
+ task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0");
task.setStatus(TaskStatus.REQUESTED);
task.setIntent(TaskIntent.ORDER);
task.setAuthoredOn(new Date());
@@ -297,7 +297,7 @@ private Task createValidTaskRequestUpdateWhitelistResources()
task.getRestriction().addRecipient().setType("Organization").getIdentifier()
.setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP");
- task.addInput().setValue(new StringType("updateWhitelistMessage")).getType().addCoding()
+ task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding()
.setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name");
return task;
@@ -749,4 +749,40 @@ private Task createValidTaskLocalServiceIntegration()
return task;
}
+
+ @Test
+ public void testTaskDownloadAllowListValid() throws Exception
+ {
+ Task task = createValidTaskDownloadAllowList();
+
+ ValidationResult result = resourceValidator.validate(task);
+ ValidationSupportRule.logValidationMessages(logger, result);
+
+ assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity())
+ || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count());
+ }
+
+ private Task createValidTaskDownloadAllowList()
+ {
+ Task task = new Task();
+ task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list");
+ task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.3.0");
+ task.setStatus(TaskStatus.REQUESTED);
+ task.setIntent(TaskIntent.ORDER);
+ task.setAuthoredOn(new Date());
+ task.getRequester().setType("Organization").getIdentifier()
+ .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1");
+ task.getRestriction().addRecipient().setType("Organization").getIdentifier()
+ .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1");
+
+ task.addInput().setValue(new StringType("downloadAllowListMessage")).getType().addCoding()
+ .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name");
+ task.addInput()
+ .setValue(
+ new Reference(new IdType("https://foo.bar/fhir", "Bundle", UUID.randomUUID().toString(), "1")))
+ .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list")
+ .setCode("highmed_allow_list");
+
+ return task;
+ }
}
diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/service/ValueSetExpanderTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/service/ValueSetExpanderTest.java
index 2ba6debfa..d4c8c1a9e 100755
--- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/service/ValueSetExpanderTest.java
+++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/service/ValueSetExpanderTest.java
@@ -61,7 +61,7 @@ private List readCodeSystems()
return Stream
.of("authorization-role-0.2.0.xml", "bpmn-message-0.2.0.xml", "feasibility-0.2.0.xml",
"organization-type-0.2.0.xml", "query-type-0.2.0.xml", "update-resources-0.2.0.xml",
- "update-whitelist-0.2.0.xml")
+ "update-allow-list-0.3.0.xml")
.map(f -> Paths.get(CODE_SYSTEM_FOLDER, f)).map(this::readCodeSystem).collect(Collectors.toList());
}
diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/white-list.json b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/allow-list.json
similarity index 99%
rename from dsf-fhir/dsf-fhir-server/src/test/resources/integration/white-list.json
rename to dsf-fhir/dsf-fhir-server/src/test/resources/integration/allow-list.json
index f9b538f14..e4e73341a 100644
--- a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/white-list.json
+++ b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/allow-list.json
@@ -8,8 +8,8 @@
]
},
"identifier": {
- "system": "http://highmed.org/fhir/CodeSystem/update-whitelist",
- "value": "highmed_whitelist"
+ "system": "http://highmed.org/fhir/CodeSystem/update-allowlist",
+ "value": "highmed_allowlist"
},
"type": "transaction",
"entry": [{