From d9dc90ab6daaad838d4fa3005e2de8ff79c13113 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Mon, 26 Oct 2020 02:29:35 +0100 Subject: [PATCH 1/3] new download allow list process, renamed whitelist into allowlist --- .../pom.xml | 2 +- .../dsf/bpe/plugin/UpdateAllowlistPlugin.java | 20 +++ .../dsf/bpe/service/DownloadAllowlist.java | 118 ++++++++++++++++++ .../dsf/bpe/service/UpdateAllowlist.java} | 30 ++--- .../spring/config/UpdateAllowlistConfig.java} | 26 ++-- .../variables/ConstantsUpdateAllowlist.java | 7 ++ .../src/main/resources/downloadAllowlist.bpmn | 40 ++++++ .../src/main/resources/updateAllowlist.bpmn} | 14 +-- ...lowlistFromTtpViaMedic1ExampleStarter.java | 80 ++++++++++++ ...dateAllowlist3MedicTtpExampleStarter.java} | 8 +- .../src/test/resources/log4j2.xml | 0 ...UpdateResource3MedicTtpExampleStarter.java | 12 +- .../dsf/bpe/plugin/UpdateWhitelistPlugin.java | 16 --- .../variables/ConstantsUpdateWhitelist.java | 7 -- dsf-bpe/dsf-bpe-server/pom.xml | 2 +- .../dsf/bpe/client/TestBpeJerseyClient.java | 2 +- dsf-bpe/pom.xml | 4 +- .../fhir/adapter/BundleJsonFhirAdapter.java | 4 + .../fhir/adapter/BundleXmlFhirAdapter.java | 4 + .../downloadAllowlist-0.3.0.xml | 70 +++++++++++ .../downloadAllowlist-0.3.0.xml.post | 1 + ...st-0.2.0.xml => updateAllowlist-0.3.0.xml} | 18 +-- .../updateAllowlist-0.3.0.xml.post | 1 + .../updateWhitelist-0.2.0.xml.post | 1 - ...t-0.2.0.xml => update-allowlist-0.3.0.xml} | 18 +-- .../update-allowlist-0.3.0.xml.post | 1 + .../update-whitelist-0.2.0.xml.post | 1 - .../highmed-task-download-allowlist-0.3.0.xml | 91 ++++++++++++++ ...med-task-download-allowlist-0.3.0.xml.post | 1 + ...> highmed-task-update-allowlist-0.3.0.xml} | 36 +++--- ...hmed-task-update-allowlist-0.3.0.xml.post} | 2 +- ...t-0.2.0.xml => update-allowlist-0.3.0.xml} | 14 +-- .../ValueSet/update-allowlist-0.3.0.xml.post | 1 + .../ValueSet/update-whitelist-0.2.0.xml.post | 1 - .../integration/BundleIntegrationTest.java | 24 ++-- .../dsf/fhir/profiles/TaskProfileTest.java | 77 +++++++++--- .../fhir/service/ValueSetExpanderTest.java | 2 +- .../{white-list.json => allow-list.json} | 4 +- 38 files changed, 611 insertions(+), 149 deletions(-) rename dsf-bpe/{dsf-bpe-process-update-whitelist => dsf-bpe-process-update-allowlist}/pom.xml (91%) create mode 100755 dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowlistPlugin.java create mode 100644 dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowlist.java rename dsf-bpe/{dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/service/UpdateWhitelist.java => dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowlist.java} (83%) rename dsf-bpe/{dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateWhitelistConfig.java => dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowlistConfig.java} (52%) create mode 100644 dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowlist.java create mode 100644 dsf-bpe/dsf-bpe-process-update-allowlist/src/main/resources/downloadAllowlist.bpmn rename dsf-bpe/{dsf-bpe-process-update-whitelist/src/main/resources/updateWhitelist.bpmn => dsf-bpe-process-update-allowlist/src/main/resources/updateAllowlist.bpmn} (81%) create mode 100644 dsf-bpe/dsf-bpe-process-update-allowlist/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowlistFromTtpViaMedic1ExampleStarter.java rename dsf-bpe/{dsf-bpe-process-update-whitelist/src/test/java/org/highmed/dsf/bpe/start/UpdateWhitelist3MedicTtpExampleStarter.java => dsf-bpe-process-update-allowlist/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowlist3MedicTtpExampleStarter.java} (93%) rename dsf-bpe/{dsf-bpe-process-update-whitelist => dsf-bpe-process-update-allowlist}/src/test/resources/log4j2.xml (100%) delete mode 100755 dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateWhitelistPlugin.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-whitelist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateWhitelist.java create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowlist-0.3.0.xml create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowlist-0.3.0.xml.post rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/{updateWhitelist-0.2.0.xml => updateAllowlist-0.3.0.xml} (79%) create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowlist-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateWhitelist-0.2.0.xml.post rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/{update-whitelist-0.2.0.xml => update-allowlist-0.3.0.xml} (55%) create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allowlist-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-whitelist-0.2.0.xml.post create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml.post rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/{highmed-task-update-whitelist-0.2.0.xml => highmed-task-update-allowlist-0.3.0.xml} (79%) rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/{highmed-task-update-whitelist-0.2.0.xml.post => highmed-task-update-allowlist-0.3.0.xml.post} (70%) rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/{update-whitelist-0.2.0.xml => update-allowlist-0.3.0.xml} (50%) create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allowlist-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-whitelist-0.2.0.xml.post rename dsf-fhir/dsf-fhir-server/src/test/resources/integration/{white-list.json => allow-list.json} (99%) diff --git a/dsf-bpe/dsf-bpe-process-update-whitelist/pom.xml b/dsf-bpe/dsf-bpe-process-update-allowlist/pom.xml similarity index 91% rename from dsf-bpe/dsf-bpe-process-update-whitelist/pom.xml rename to dsf-bpe/dsf-bpe-process-update-allowlist/pom.xml index ab022bf0b..eb5f1b718 100755 --- a/dsf-bpe/dsf-bpe-process-update-whitelist/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-allowlist/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-allowlist org.highmed.dsf diff --git a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowlistPlugin.java b/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowlistPlugin.java new file mode 100755 index 000000000..c8c9ce459 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-allowlist/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_ALLOWLIST_FILE = "updateAllowlist.bpmn"; + private static final String DOWNLOAD_ALLOWLIST_FILE = "downloadAllowlist.bpmn"; + + @Override + public void postProcessEngineBuild(ProcessEngine processEngine) + { + BpmnModelInstance updateAllowlistProcess = readAndValidateModel("/" + UPDATE_ALLOWLIST_FILE); + deploy(processEngine, UPDATE_ALLOWLIST_FILE, updateAllowlistProcess); + + BpmnModelInstance downloadAllowlistProcess = readAndValidateModel("/" + DOWNLOAD_ALLOWLIST_FILE); + deploy(processEngine, DOWNLOAD_ALLOWLIST_FILE, downloadAllowlistProcess); + } +} diff --git a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowlist.java b/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowlist.java new file mode 100644 index 000000000..21d0b104a --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-allowlist/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_ALLOWLIST, + ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST) + .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_ALLOWLIST_VALUE_ALLOWLIST, + bundleReferences.size()); + throw new RuntimeException("Task input parameter " + + ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST + + " 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_ALLOWLIST_VALUE_ALLOWLIST); + throw new RuntimeException("Task input parameter " + + ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST + + " 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-allowlist/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowlist.java similarity index 83% 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-allowlist/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowlist.java index fe3f1fb19..ebb46d0e0 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-allowlist/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,27 +69,27 @@ 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_ALLOWLIST) + .setValue(ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST); 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)); + .forEach(addAllowListEntry(transaction, searchSet)); - logger.debug("Uploading new white-list transaction bundle: {}", + logger.debug("Uploading new allowlist 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))); + .singletonList(ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST + "|" + + ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST))); 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_ALLOWLIST) + .setCode(ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST); } - private Consumer addWhiteListEntry(Bundle transaction, Bundle searchSet) + private Consumer addAllowListEntry(Bundle transaction, Bundle searchSet) { return organization -> { Identifier identifier = getDefaultIdentifier(organization).get(); @@ -105,12 +105,12 @@ private Consumer 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 -> { 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-allowlist/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-allowlist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowlistConfig.java index e0efe0d4b..ad18c2667 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-allowlist/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-allowlist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowlist.java b/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowlist.java new file mode 100644 index 000000000..a23e05195 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-allowlist/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_ALLOWLIST = "http://highmed.org/fhir/CodeSystem/update-allowlist"; + String CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST = "highmed_allowlist"; +} diff --git a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/resources/downloadAllowlist.bpmn b/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/resources/downloadAllowlist.bpmn new file mode 100644 index 000000000..eccef120f --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-allowlist/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-allowlist/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-allowlist/src/main/resources/updateAllowlist.bpmn index 13a84df30..c278f6908 100755 --- a/dsf-bpe/dsf-bpe-process-update-whitelist/src/main/resources/updateWhitelist.bpmn +++ b/dsf-bpe/dsf-bpe-process-update-allowlist/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-allowlist/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowlistFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allowlist/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowlistFromTtpViaMedic1ExampleStarter.java new file mode 100644 index 000000000..3e5f24245 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-allowlist/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowlistFromTtpViaMedic1ExampleStarter.java @@ -0,0 +1,80 @@ +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-allowlist|highmed_allowlist"))); + 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-allowlist"); + 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-allowlist") + .setCode("highmed_allowlist"); + + 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-allowlist/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-allowlist/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowlist3MedicTtpExampleStarter.java index a7578cd9c..c6741e852 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-allowlist/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-allowlist"); + 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-allowlist/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-allowlist/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..2f6369c0c 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-allowlist|highmed_allowlist"))); 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..c8be76191 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-allowlist 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..c0c9a4c4a 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-allowlist 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-allowlist ${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..d271c2700 --- /dev/null +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowlist-0.3.0.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <subtitle value="Download Allowlist Bundle Process" /> + <status value="draft" /> + <experimental value="true" /> + <date value="2020-10-26" /> + <publisher value="HiGHmed" /> + <contact> + <name value="HiGHmed" /> + <telecom> + <system value="email" /> + <value value="pmo@highmed.org" /> + </telecom> + </contact> + <description value="Process to download the allowlist FHIR bundle" /> + <kind value="Task" /> +</ActivityDefinition> \ 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..aab2450b4 --- /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 79% 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..2d84c8738 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 @@ </meta> <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> <extension url="message-name"> - <valueString value="updateWhitelistMessage" /> + <valueString value="updateAllowlistMessage" /> </extension> <extension url="authorization-roles"> <extension url="authorization-role"> @@ -34,17 +34,17 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-whitelist" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allowlist" /> </extension> </extension> - <url value="http://highmed.org/bpe/Process/updateWhitelist" /> - <version value="0.2.0" /> - <name value="UpdateWhitelist" /> - <title value="Update Whitelist" /> - <subtitle value="Update Whitelist Bundle Process" /> + <url value="http://highmed.org/bpe/Process/updateAllowlist" /> + <version value="0.3.0" /> + <name value="UpdateAllowlist" /> + <title value="Update Allowlist" /> + <subtitle value="Update Allowlist Bundle Process" /> <status value="draft" /> <experimental value="true" /> - <date value="2020-05-25" /> + <date value="2020-10-26" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> @@ -53,6 +53,6 @@ <value value="pmo@highmed.org" /> </telecom> </contact> - <description value="Process to update the whitelist FHIR bundle" /> + <description value="Process to update the allowlist FHIR bundle" /> <kind value="Task" /> </ActivityDefinition> \ 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..7d3d0671f --- /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-allowlist-0.3.0.xml similarity index 55% 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-allowlist-0.3.0.xml index 4bf6a65bd..8e5a8d6dc 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-allowlist-0.3.0.xml @@ -5,22 +5,22 @@ <code value="REMOTE"/> </tag> </meta> - <url value="http://highmed.org/fhir/CodeSystem/update-whitelist"/> - <version value="0.2.0"/> - <name value="HiGHmed_Update_Whitelist"/> - <title value="HiGHmed Update Whitelist"/> + <url value="http://highmed.org/fhir/CodeSystem/update-allowlist"/> + <version value="0.3.0"/> + <name value="HiGHmed_Update_Allowlist"/> + <title value="HiGHmed Update Allowlist"/> <status value="active"/> <experimental value="false"/> - <date value="2020-05-25"/> + <date value="2020-10-26"/> <publisher value="HiGHmed"/> - <description value="CodeSystem with standard values for the process update whitelist"/> + <description value="CodeSystem with standard values for the processes update and download allowlist"/> <caseSensitive value="true"/> <hierarchyMeaning value="grouped-by"/> <versionNeeded value="false"/> <content value="complete"/> <concept> - <code value="highmed_whitelist"/> - <display value="HiGHmed Whitelist"/> - <definition value="White list identifying organizations as part of HiGHmed"/> + <code value="highmed_allowlist"/> + <display value="HiGHmed Allowlist"/> + <definition value="Allowlist identifying organizations as part of HiGHmed"/> </concept> </CodeSystem> \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allowlist-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allowlist-0.3.0.xml.post new file mode 100644 index 000000000..bd4406073 --- /dev/null +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allowlist-0.3.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/CodeSystem/update-allowlist&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-allowlist-0.3.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml new file mode 100644 index 000000000..c9be76fc8 --- /dev/null +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="utf-8"?> +<StructureDefinition xmlns="http://hl7.org/fhir"> + <meta> + <tag> + <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> + <code value="REMOTE" /> + </tag> + </meta> + <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-download-allowlist" /> + <version value="0.3.0" /> + <name value="TaskDownloadAllowlist" /> + <status value="draft" /> + <date value="2020-10-26" /> + <fhirVersion value="4.0.1" /> + <kind value="resource" /> + <abstract value="false" /> + <type value="Task" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <derivation value="constraint" /> + <differential> + <element id="Task.instantiatesUri"> + <path value="Task.instantiatesUri" /> + <fixedUri value="http://highmed.org/bpe/Process/downloadAllowlist/0.3.0" /> + </element> + <element id="Task.input"> + <path value="Task.input" /> + <min value="2" /> + <max value="2" /> + </element> + <element id="Task.input:message-name"> + <path value="Task.input" /> + <sliceName value="message-name" /> + </element> + <element id="Task.input:message-name.value[x]"> + <path value="Task.input.value[x]" /> + <fixedString value="downloadAllowlistMessage" /> + </element> + <element id="Task.input:business-key"> + <path value="Task.input" /> + <sliceName value="business-key" /> + <max value="0" /> + </element> + <element id="Task.input:correlation-key"> + <path value="Task.input" /> + <sliceName value="correlation-key" /> + <max value="0" /> + </element> + <element id="Task.input:bundle-reference"> + <path value="Task.input" /> + <sliceName value="bundle-reference" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:bundle-reference.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://highmed.org/fhir/ValueSet/update-allowlist" /> + </binding> + </element> + <element id="Task.input:bundle-reference.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:bundle-reference.type.coding.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://highmed.org/fhir/CodeSystem/update-allowlist" /> + </element> + <element id="Task.input:bundle-reference.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="highmed_allowlist" /> + </element> + <element id="Task.input:bundle-reference.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="Reference" /> + </type> + </element> + <element id="Task.input:bundle-reference.value[x].reference"> + <path value="Task.input.value[x].reference" /> + <min value="1" /> + </element> + <element id="Task.input:bundle-reference.value[x].identifier"> + <path value="Task.input.value[x].identifier" /> + <max value="0" /> + </element> + </differential> +</StructureDefinition> \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml.post new file mode 100644 index 000000000..0ba360add --- /dev/null +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/StructureDefinition/highmed-task-download-allowlist&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-allowlist-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-allowlist-0.3.0.xml index 8881d43e7..9de88fd5a 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-allowlist-0.3.0.xml @@ -5,11 +5,11 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-whitelist" /> - <version value="0.2.0" /> - <name value="TaskUpdateWhitelist" /> + <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allowlist" /> + <version value="0.3.0" /> + <name value="TaskUpdateAllowlist" /> <status value="draft" /> - <date value="2020-05-25" /> + <date value="2020-10-26" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -19,7 +19,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/updateWhitelist/0.2.0" /> + <fixedUri value="http://highmed.org/bpe/Process/updateAllowlist/0.3.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -37,7 +37,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="updateWhitelistMessage" /> + <fixedString value="updateAllowlistMessage" /> </element> <element id="Task.input:business-key"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -55,47 +55,47 @@ <sliceName value="correlation-key" /> <max value="0" /> </element> - <element id="Task.output:whitelist"> + <element id="Task.output:allowlist"> <path value="Task.output" /> - <sliceName value="whitelist" /> + <sliceName value="allowlist" /> <max value="1" /> </element> - <element id="Task.output:whitelist.type"> + <element id="Task.output:allowlist.type"> <path value="Task.output.type" /> <binding> <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> <valueString value="TaskOutputParameterType" /> </extension> <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/update-whitelist" /> + <valueSet value="http://highmed.org/fhir/ValueSet/update-allowlist" /> </binding> </element> - <element id="Task.output:whitelist.type.coding"> + <element id="Task.output:allowlist.type.coding"> <path value="Task.output.type.coding" /> <min value="1" /> <max value="1" /> </element> - <element id="Task.output:whitelist.type.coding.system"> + <element id="Task.output:allowlist.type.coding.system"> <path value="Task.output.type.coding.system" /> <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/update-whitelist" /> + <fixedUri value="http://highmed.org/fhir/CodeSystem/update-allowlist" /> </element> - <element id="Task.output:whitelist.type.coding.code"> + <element id="Task.output:allowlist.type.coding.code"> <path value="Task.output.type.coding.code" /> <min value="1" /> - <fixedCode value="highmed_whitelist" /> + <fixedCode value="highmed_allowlist" /> </element> - <element id="Task.output:whitelist.value[x]"> + <element id="Task.output:allowlist.value[x]"> <path value="Task.output.value[x]" /> <type> <code value="Reference" /> </type> </element> - <element id="Task.output:whitelist.value[x].reference"> + <element id="Task.output:allowlist.value[x].reference"> <path value="Task.output.value[x].reference" /> <min value="1" /> </element> - <element id="Task.output:whitelist.value[x].identifier"> + <element id="Task.output:allowlist.value[x].identifier"> <path value="Task.output.value[x].identifier" /> <max value="0" /> </element> 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-allowlist-0.3.0.xml.post similarity index 70% 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-allowlist-0.3.0.xml.post index 13b1bb447..0575066c2 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-allowlist-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-allowlist&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-allowlist-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-allowlist-0.3.0.xml index a389370b1..b63a5be05 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-allowlist-0.3.0.xml @@ -5,20 +5,20 @@ <code value="REMOTE"/> </tag> </meta> - <url value="http://highmed.org/fhir/ValueSet/update-whitelist"/> - <version value="0.2.0"/> - <name value="HiGHmed_Update_Whitelist"/> - <title value="HiGHmed Update Whitelist"/> + <url value="http://highmed.org/fhir/ValueSet/update-allowlist"/> + <version value="0.3.0"/> + <name value="HiGHmed_Update_Allowlist"/> + <title value="HiGHmed Update Allowlist"/> <status value="active"/> <experimental value="false"/> - <date value="2020-05-25"/> + <date value="2020-10-26"/> <publisher value="HiGHmed"/> <description - value="ValueSet with standard values for the process update whitelist"/> + value="ValueSet with standard values for the process update allowlist"/> <immutable value="true"/> <compose> <include> - <system value="http://highmed.org/fhir/CodeSystem/update-whitelist"/> + <system value="http://highmed.org/fhir/CodeSystem/update-allowlist"/> </include> </compose> </ValueSet> \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allowlist-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allowlist-0.3.0.xml.post new file mode 100644 index 000000000..2a07d65cf --- /dev/null +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allowlist-0.3.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/ValueSet/update-allowlist&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/integration/BundleIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java index 1a13ba53a..49b49e0b7 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-allowlist|highmed_allowlist"))); 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-allowlist|highmed_allowlist"))); 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-allowlist|highmed_allowlist"))); assertNotNull(outcome); } 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..00227cc41 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 @@ -36,6 +36,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.validation.ResultSeverityEnum; import ca.uhn.fhir.validation.ValidationResult; @@ -48,7 +49,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-allowlist-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 +57,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-allowlist-0.3.0.xml"), + Arrays.asList("authorization-role-0.2.0.xml", "bpmn-message-0.2.0.xml", "update-allowlist-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-allowlist-0.3.0.xml", "update-resources-0.2.0.xml", "feasibility-0.2.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), @@ -227,9 +228,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 +240,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-allowlist") + .setCode("highmed_allowlist"); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -253,11 +254,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-allowlist"); + 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 +267,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 +285,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-allowlist"); + 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 +298,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 +750,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-allowlist"); + 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-allowlist") + .setCode("highmed_allowlist"); + System.out.println(FhirContext.forR4().newXmlParser().setPrettyPrint(true).encodeResourceToString(task)); + 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..53a4a4eec 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<CodeSystem> 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-allowlist-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": [{ From baa0fcb4b36874d634c8f2ff347695fe751114bc Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 26 Oct 2020 18:17:55 +0100 Subject: [PATCH 2/3] allow list now two words --- .../pom.xml | 2 +- .../dsf/bpe/plugin/UpdateAllowListPlugin.java | 20 +++++++ .../dsf/bpe/service/DownloadAllowList.java} | 20 +++---- .../dsf/bpe/service/UpdateAllowList.java} | 40 +++++++------ .../spring/config/UpdateAllowListConfig.java} | 20 +++---- .../variables/ConstantsUpdateAllowList.java | 7 +++ .../main/resources/downloadAllowList.bpmn} | 14 ++--- .../src/main/resources/updateAllowList.bpmn} | 14 ++--- ...owListFromTtpViaMedic1ExampleStarter.java} | 17 +++--- ...dateAllowList3MedicTtpExampleStarter.java} | 8 +-- .../src/test/resources/log4j2.xml | 0 .../dsf/bpe/plugin/UpdateAllowlistPlugin.java | 20 ------- .../variables/ConstantsUpdateAllowlist.java | 7 --- ...UpdateResource3MedicTtpExampleStarter.java | 4 +- dsf-bpe/dsf-bpe-server/pom.xml | 2 +- dsf-bpe/pom.xml | 4 +- ...-0.3.0.xml => downloadAllowList-0.3.0.xml} | 14 ++--- .../downloadAllowList-0.3.0.xml.post | 1 + .../downloadAllowlist-0.3.0.xml.post | 1 - ...st-0.3.0.xml => updateAllowList-0.3.0.xml} | 14 ++--- .../updateAllowList-0.3.0.xml.post | 1 + .../updateAllowlist-0.3.0.xml.post | 1 - ...-0.3.0.xml => update-allow-list-0.3.0.xml} | 14 ++--- .../update-allow-list-0.3.0.xml.post | 1 + .../update-allowlist-0.3.0.xml.post | 1 - ...ighmed-task-download-allow-list-0.3.0.xml} | 14 ++--- ...d-task-download-allow-list-0.3.0.xml.post} | 2 +- ... highmed-task-update-allow-list-0.3.0.xml} | 32 +++++------ ...med-task-update-allow-list-0.3.0.xml.post} | 2 +- ...-0.3.0.xml => update-allow-list-0.3.0.xml} | 10 ++-- .../ValueSet/update-allow-list-0.3.0.xml.post | 1 + .../ValueSet/update-allowlist-0.3.0.xml.post | 1 - .../java/org/highmed/dsf/fhir/dao/README.md | 5 ++ .../integration/BundleIntegrationTest.java | 6 +- .../highmed/dsf/fhir/integration/README.md | 5 ++ .../dsf/fhir/profiles/TaskProfileTest.java | 57 +++++++++---------- .../fhir/service/ValueSetExpanderTest.java | 2 +- 37 files changed, 199 insertions(+), 185 deletions(-) rename dsf-bpe/{dsf-bpe-process-update-allowlist => dsf-bpe-process-update-allow-list}/pom.xml (91%) create mode 100755 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowListPlugin.java rename dsf-bpe/{dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowlist.java => dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java} (85%) rename dsf-bpe/{dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowlist.java => dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java} (81%) rename dsf-bpe/{dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowlistConfig.java => dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java} (61%) create mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java rename dsf-bpe/{dsf-bpe-process-update-allowlist/src/main/resources/downloadAllowlist.bpmn => dsf-bpe-process-update-allow-list/src/main/resources/downloadAllowList.bpmn} (84%) rename dsf-bpe/{dsf-bpe-process-update-allowlist/src/main/resources/updateAllowlist.bpmn => dsf-bpe-process-update-allow-list/src/main/resources/updateAllowList.bpmn} (82%) rename dsf-bpe/{dsf-bpe-process-update-allowlist/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowlistFromTtpViaMedic1ExampleStarter.java => dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java} (87%) rename dsf-bpe/{dsf-bpe-process-update-allowlist/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowlist3MedicTtpExampleStarter.java => dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java} (93%) rename dsf-bpe/{dsf-bpe-process-update-allowlist => dsf-bpe-process-update-allow-list}/src/test/resources/log4j2.xml (100%) delete mode 100755 dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowlistPlugin.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowlist.java rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/{downloadAllowlist-0.3.0.xml => downloadAllowList-0.3.0.xml} (84%) create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowlist-0.3.0.xml.post rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/{updateAllowlist-0.3.0.xml => updateAllowList-0.3.0.xml} (81%) create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowlist-0.3.0.xml.post rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/{update-allowlist-0.3.0.xml => update-allow-list-0.3.0.xml} (60%) create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allowlist-0.3.0.xml.post rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/{highmed-task-download-allowlist-0.3.0.xml => highmed-task-download-allow-list-0.3.0.xml} (93%) rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/{highmed-task-download-allowlist-0.3.0.xml.post => highmed-task-download-allow-list-0.3.0.xml.post} (68%) rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/{highmed-task-update-allowlist-0.3.0.xml => highmed-task-update-allow-list-0.3.0.xml} (82%) rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/{highmed-task-update-allowlist-0.3.0.xml.post => highmed-task-update-allow-list-0.3.0.xml.post} (69%) rename dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/{update-allowlist-0.3.0.xml => update-allow-list-0.3.0.xml} (75%) create mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allowlist-0.3.0.xml.post create mode 100644 dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/README.md create mode 100644 dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/README.md diff --git a/dsf-bpe/dsf-bpe-process-update-allowlist/pom.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml similarity index 91% rename from dsf-bpe/dsf-bpe-process-update-allowlist/pom.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml index eb5f1b718..6f8ba7de8 100755 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/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"> <modelVersion>4.0.0</modelVersion> - <artifactId>dsf-bpe-process-update-allowlist</artifactId> + <artifactId>dsf-bpe-process-update-allow-list</artifactId> <parent> <groupId>org.highmed.dsf</groupId> 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-allowlist/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 similarity index 85% rename from dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowlist.java rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java index 21d0b104a..57ff32b24 100644 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/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 @@ -10,7 +10,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.ConstantsUpdateAllowlist; +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; @@ -24,13 +24,13 @@ import ca.uhn.fhir.context.FhirContext; -public class DownloadAllowlist extends AbstractServiceDelegate +public class DownloadAllowList extends AbstractServiceDelegate { - private static final Logger logger = LoggerFactory.getLogger(DownloadAllowlist.class); + private static final Logger logger = LoggerFactory.getLogger(DownloadAllowList.class); private final FhirContext context; - public DownloadAllowlist(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, FhirContext context) + public DownloadAllowList(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, FhirContext context) { super(clientProvider, taskHelper); this.context = context; @@ -90,26 +90,26 @@ protected void doExecute(DelegateExecution execution) throws Exception private IdType getBundleId(Task task) { List<Reference> bundleReferences = getTaskHelper() - .getInputParameterReferenceValues(task, ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST, - ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST) + .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_ALLOWLIST_VALUE_ALLOWLIST, + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST, bundleReferences.size()); throw new RuntimeException("Task input parameter " - + ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST + + 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_ALLOWLIST_VALUE_ALLOWLIST); + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); throw new RuntimeException("Task input parameter " - + ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST + + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST + " has no Bundle reference"); } diff --git a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowlist.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java similarity index 81% rename from dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowlist.java rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java index ebb46d0e0..4d18b14bf 100644 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowlist.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.ConstantsUpdateAllowlist; +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 UpdateAllowlist extends AbstractServiceDelegate implements InitializingBean +public class UpdateAllowList extends AbstractServiceDelegate implements InitializingBean { - private static final Logger logger = LoggerFactory.getLogger(UpdateAllowlist.class); + private static final Logger logger = LoggerFactory.getLogger(UpdateAllowList.class); private final OrganizationProvider organizationProvider; - public UpdateAllowlist(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(ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST) - .setValue(ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST); + 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(addAllowListEntry(transaction, searchSet)); + && e.getResource() instanceof Organization) + .map(e -> (Organization) e.getResource()).forEach(addAllowListEntry(transaction, searchSet)); - logger.debug("Uploading new allowlist 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(ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST + "|" - + ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST))); + 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(ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST) - .setCode(ConstantsUpdateAllowlist.CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST); + .getType().addCoding().setSystem(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) + .setCode(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); } private Consumer<? super Organization> addAllowListEntry(Bundle transaction, Bundle searchSet) { - return organization -> { + return organization -> + { Identifier identifier = getDefaultIdentifier(organization).get(); BundleEntryComponent organizationEntry = transaction.addEntry(); @@ -113,7 +115,8 @@ private Consumer<? super Organization> addAllowListEntry(Bundle transaction, Bun private Function<Reference, Optional<Reference>> 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<Identifier> getDefaultIdentifier(Endpoint ept) private Optional<Endpoint> 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-allowlist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowlistConfig.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java similarity index 61% rename from dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowlistConfig.java rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java index ad18c2667..f0f4505f3 100755 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowlistConfig.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java @@ -1,9 +1,9 @@ package org.highmed.dsf.bpe.spring.config; import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; -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.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; @@ -14,7 +14,7 @@ import ca.uhn.fhir.context.FhirContext; @Configuration -public class UpdateAllowlistConfig +public class UpdateAllowListConfig { @Autowired private FhirWebserviceClientProvider clientProvider; @@ -29,20 +29,20 @@ public class UpdateAllowlistConfig private FhirContext fhirContext; @Bean - public ProcessEnginePlugin updateAllowlistPlugin() + public ProcessEnginePlugin updateAllowListPlugin() { - return new UpdateAllowlistPlugin(); + return new UpdateAllowListPlugin(); } @Bean - public UpdateAllowlist updateAllowlist() + public UpdateAllowList updateAllowList() { - return new UpdateAllowlist(organizationProvider, clientProvider, taskHelper); + return new UpdateAllowList(organizationProvider, clientProvider, taskHelper); } @Bean - public DownloadAllowlist downloadAllowlist() + public DownloadAllowList downloadAllowList() { - return new DownloadAllowlist(clientProvider, taskHelper, fhirContext); + 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-allowlist/src/main/resources/downloadAllowlist.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/downloadAllowList.bpmn similarity index 84% rename from dsf-bpe/dsf-bpe-process-update-allowlist/src/main/resources/downloadAllowlist.bpmn rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/downloadAllowList.bpmn index eccef120f..1ddce4d90 100644 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/resources/downloadAllowlist.bpmn +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/downloadAllowList.bpmn @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1yb5vw3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.2.0"> - <bpmn:process id="downloadAllowlist" isExecutable="true" camunda:versionTag="0.3.0"> - <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="downloadAllowlistTask" /> + <bpmn:process id="downloadAllowList" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="downloadAllowListTask" /> <bpmn:endEvent id="EndEvent_0xd0x8k"> <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0oyvmcd" sourceRef="downloadAllowlistTask" targetRef="EndEvent_0xd0x8k" /> - <bpmn:serviceTask id="downloadAllowlistTask" name="downloadAllowlist" camunda:class="org.highmed.dsf.bpe.service.DownloadAllowlist"> + <bpmn:sequenceFlow id="SequenceFlow_0oyvmcd" sourceRef="downloadAllowListTask" targetRef="EndEvent_0xd0x8k" /> + <bpmn:serviceTask id="downloadAllowListTask" name="downloadAllowList" camunda:class="org.highmed.dsf.bpe.service.DownloadAllowList"> <bpmn:incoming>SequenceFlow_0bbhq2r</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0oyvmcd</bpmn:outgoing> </bpmn:serviceTask> @@ -15,9 +15,9 @@ <bpmn:messageEventDefinition messageRef="Message_1nn2wdw" /> </bpmn:startEvent> </bpmn:process> - <bpmn:message id="Message_1nn2wdw" name="downloadAllowlistMessage" /> + <bpmn:message id="Message_1nn2wdw" name="downloadAllowListMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="downloadAllowlist"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="downloadAllowList"> <bpmndi:BPMNEdge id="SequenceFlow_0oyvmcd_di" bpmnElement="SequenceFlow_0oyvmcd"> <di:waypoint x="365" y="121" /> <di:waypoint x="415" y="121" /> @@ -29,7 +29,7 @@ <bpmndi:BPMNShape id="EndEvent_0xd0x8k_di" bpmnElement="EndEvent_0xd0x8k"> <dc:Bounds x="415" y="103" width="36" height="36" /> </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0um3ad2_di" bpmnElement="downloadAllowlistTask"> + <bpmndi:BPMNShape id="ServiceTask_0um3ad2_di" bpmnElement="downloadAllowListTask"> <dc:Bounds x="265" y="81" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_0x5gijn_di" bpmnElement="StartEvent_1"> diff --git a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/resources/updateAllowlist.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/updateAllowList.bpmn similarity index 82% rename from dsf-bpe/dsf-bpe-process-update-allowlist/src/main/resources/updateAllowlist.bpmn rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/updateAllowList.bpmn index c278f6908..ed675abd9 100755 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/resources/updateAllowlist.bpmn +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/updateAllowList.bpmn @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1yb5vw3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0"> - <bpmn:process id="updateAllowlist" isExecutable="true" camunda:versionTag="0.3.0"> - <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="updateAllowlistTask" /> + <bpmn:process id="updateAllowList" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="updateAllowListTask" /> <bpmn:endEvent id="EndEvent_0xd0x8k"> <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0oyvmcd" sourceRef="updateAllowlistTask" targetRef="EndEvent_0xd0x8k" /> - <bpmn:serviceTask id="updateAllowlistTask" name="updateAllowlist" camunda:class="org.highmed.dsf.bpe.service.UpdateAllowlist"> + <bpmn:sequenceFlow id="SequenceFlow_0oyvmcd" sourceRef="updateAllowListTask" targetRef="EndEvent_0xd0x8k" /> + <bpmn:serviceTask id="updateAllowListTask" name="updateAllowList" camunda:class="org.highmed.dsf.bpe.service.UpdateAllowList"> <bpmn:incoming>SequenceFlow_0bbhq2r</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0oyvmcd</bpmn:outgoing> </bpmn:serviceTask> @@ -15,9 +15,9 @@ <bpmn:messageEventDefinition messageRef="Message_1nn2wdw" /> </bpmn:startEvent> </bpmn:process> - <bpmn:message id="Message_1nn2wdw" name="updateAllowlistMessage" /> + <bpmn:message id="Message_1nn2wdw" name="updateAllowListMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="updateAllowlist"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="updateAllowList"> <bpmndi:BPMNEdge id="SequenceFlow_0bbhq2r_di" bpmnElement="SequenceFlow_0bbhq2r"> <di:waypoint x="215" y="121" /> <di:waypoint x="265" y="121" /> @@ -29,7 +29,7 @@ <di:waypoint x="365" y="121" /> <di:waypoint x="415" y="121" /> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0um3ad2_di" bpmnElement="updateAllowlistTask"> + <bpmndi:BPMNShape id="ServiceTask_0um3ad2_di" bpmnElement="updateAllowListTask"> <dc:Bounds x="265" y="81" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="StartEvent_0x5gijn_di" bpmnElement="StartEvent_1"> diff --git a/dsf-bpe/dsf-bpe-process-update-allowlist/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 similarity index 87% rename from dsf-bpe/dsf-bpe-process-update-allowlist/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowlistFromTtpViaMedic1ExampleStarter.java rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index 3e5f24245..b780c11f5 100644 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/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 @@ -28,7 +28,7 @@ import de.rwh.utils.crypto.CertificateHelper; import de.rwh.utils.crypto.io.CertificateReader; -public class DownloadAllowlistFromTtpViaMedic1ExampleStarter +public class DownloadAllowListFromTtpViaMedic1ExampleStarter { public static void main(String[] args) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException @@ -46,9 +46,9 @@ public static void main(String[] args) 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-allowlist|highmed_allowlist"))); + 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"); + throw new IllegalStateException("Expected a single allow list Bundle"); Bundle allowList = (Bundle) searchResult.getEntryFirstRep().getResource(); System.out.println(context.newXmlParser().encodeResourceToString(allowList)); @@ -57,8 +57,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-download-allowlist"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowlist/0.3.0"); + 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()); @@ -67,14 +67,15 @@ public static void main(String[] args) 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() + 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-allowlist") - .setCode("highmed_allowlist"); + .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") + .setCode("highmed_allow_list"); + System.out.println(FhirContext.forR4().newXmlParser().setPrettyPrint(true).setStripVersionsFromReferences(false).encodeResourceToString(task)); client.withMinimalReturn().create(task); } } diff --git a/dsf-bpe/dsf-bpe-process-update-allowlist/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowlist3MedicTtpExampleStarter.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-allowlist/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowlist3MedicTtpExampleStarter.java rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index c6741e852..e47fed907 100644 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowlist3MedicTtpExampleStarter.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 UpdateAllowlist3MedicTtpExampleStarter +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-allowlist"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowlist/0.3.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("updateAllowlistMessage")).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-allowlist/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-allowlist/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-allowlist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowlistPlugin.java b/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowlistPlugin.java deleted file mode 100755 index c8c9ce459..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowlistPlugin.java +++ /dev/null @@ -1,20 +0,0 @@ -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_ALLOWLIST_FILE = "updateAllowlist.bpmn"; - private static final String DOWNLOAD_ALLOWLIST_FILE = "downloadAllowlist.bpmn"; - - @Override - public void postProcessEngineBuild(ProcessEngine processEngine) - { - BpmnModelInstance updateAllowlistProcess = readAndValidateModel("/" + UPDATE_ALLOWLIST_FILE); - deploy(processEngine, UPDATE_ALLOWLIST_FILE, updateAllowlistProcess); - - BpmnModelInstance downloadAllowlistProcess = readAndValidateModel("/" + DOWNLOAD_ALLOWLIST_FILE); - deploy(processEngine, DOWNLOAD_ALLOWLIST_FILE, downloadAllowlistProcess); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowlist.java b/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowlist.java deleted file mode 100644 index a23e05195..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allowlist/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowlist.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -public interface ConstantsUpdateAllowlist -{ - String CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST = "http://highmed.org/fhir/CodeSystem/update-allowlist"; - String CODESYSTEM_HIGHMED_UPDATE_ALLOWLIST_VALUE_ALLOWLIST = "highmed_allowlist"; -} 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 2f6369c0c..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,9 +44,9 @@ 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-allowlist|highmed_allowlist"))); + 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"); + throw new IllegalStateException("Expected a single allow list Bundle"); Bundle allowList = (Bundle) searchResult.getEntryFirstRep().getResource(); System.out.println(context.newXmlParser().encodeResourceToString(allowList)); diff --git a/dsf-bpe/dsf-bpe-server/pom.xml b/dsf-bpe/dsf-bpe-server/pom.xml index c8be76191..5be6db37d 100755 --- a/dsf-bpe/dsf-bpe-server/pom.xml +++ b/dsf-bpe/dsf-bpe-server/pom.xml @@ -35,7 +35,7 @@ </dependency> <dependency> <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-update-allowlist</artifactId> + <artifactId>dsf-bpe-process-update-allow-list</artifactId> </dependency> <dependency> <groupId>org.highmed.dsf</groupId> diff --git a/dsf-bpe/pom.xml b/dsf-bpe/pom.xml index c0c9a4c4a..a74cfbaf4 100755 --- a/dsf-bpe/pom.xml +++ b/dsf-bpe/pom.xml @@ -17,7 +17,7 @@ <module>dsf-bpe-process-ping</module> <module>dsf-bpe-process-plugin-example</module> <module>dsf-bpe-process-update-resources</module> - <module>dsf-bpe-process-update-allowlist</module> + <module>dsf-bpe-process-update-allow-list</module> <module>dsf-bpe-server</module> <module>dsf-bpe-server-jetty</module> <module>dsf-bpe-webservice-client</module> @@ -108,7 +108,7 @@ </dependency> <dependency> <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-update-allowlist</artifactId> + <artifactId>dsf-bpe-process-update-allow-list</artifactId> <version>${project.version}</version> </dependency> <dependency> 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 similarity index 84% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowlist-0.3.0.xml rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml index d271c2700..1df5126b8 100644 --- 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 @@ -7,7 +7,7 @@ </meta> <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> <extension url="message-name"> - <valueString value="downloadAllowlistMessage" /> + <valueString value="downloadAllowListMessage" /> </extension> <extension url="authorization-roles"> <extension url="authorization-role"> @@ -46,14 +46,14 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-download-allowlist" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list" /> </extension> </extension> - <url value="http://highmed.org/bpe/Process/downloadAllowlist" /> + <url value="http://highmed.org/bpe/Process/downloadAllowList" /> <version value="0.3.0" /> - <name value="DownloadAllowlist" /> - <title value="Download Allowlist" /> - <subtitle value="Download Allowlist Bundle Process" /> + <name value="DownloadAllowList" /> + <title value="Download Allow List" /> + <subtitle value="Download Allow List Bundle Process" /> <status value="draft" /> <experimental value="true" /> <date value="2020-10-26" /> @@ -65,6 +65,6 @@ <value value="pmo@highmed.org" /> </telecom> </contact> - <description value="Process to download the allowlist FHIR bundle" /> + <description value="Process to download the allow list FHIR bundle" /> <kind value="Task" /> </ActivityDefinition> \ 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/downloadAllowlist-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowlist-0.3.0.xml.post deleted file mode 100644 index aab2450b4..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowlist-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -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/updateAllowlist-0.3.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml similarity index 81% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowlist-0.3.0.xml rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml index 2d84c8738..bfa945f61 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowlist-0.3.0.xml +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml @@ -7,7 +7,7 @@ </meta> <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> <extension url="message-name"> - <valueString value="updateAllowlistMessage" /> + <valueString value="updateAllowListMessage" /> </extension> <extension url="authorization-roles"> <extension url="authorization-role"> @@ -34,14 +34,14 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allowlist" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list" /> </extension> </extension> - <url value="http://highmed.org/bpe/Process/updateAllowlist" /> + <url value="http://highmed.org/bpe/Process/updateAllowList" /> <version value="0.3.0" /> - <name value="UpdateAllowlist" /> - <title value="Update Allowlist" /> - <subtitle value="Update Allowlist Bundle Process" /> + <name value="UpdateAllowList" /> + <title value="Update Allow List" /> + <subtitle value="Update Allow List Bundle Process" /> <status value="draft" /> <experimental value="true" /> <date value="2020-10-26" /> @@ -53,6 +53,6 @@ <value value="pmo@highmed.org" /> </telecom> </contact> - <description value="Process to update the allowlist FHIR bundle" /> + <description value="Process to update the allow list FHIR bundle" /> <kind value="Task" /> </ActivityDefinition> \ 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/updateAllowlist-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowlist-0.3.0.xml.post deleted file mode 100644 index 7d3d0671f..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowlist-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -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/CodeSystem/update-allowlist-0.3.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml similarity index 60% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allowlist-0.3.0.xml rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml index 8e5a8d6dc..cc95f7c94 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allowlist-0.3.0.xml +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml @@ -5,22 +5,22 @@ <code value="REMOTE"/> </tag> </meta> - <url value="http://highmed.org/fhir/CodeSystem/update-allowlist"/> + <url value="http://highmed.org/fhir/CodeSystem/update-allow-list"/> <version value="0.3.0"/> - <name value="HiGHmed_Update_Allowlist"/> - <title value="HiGHmed Update Allowlist"/> + <name value="HiGHmed_Update_Allow_List"/> + <title value="HiGHmed Update Allow List"/> <status value="active"/> <experimental value="false"/> <date value="2020-10-26"/> <publisher value="HiGHmed"/> - <description value="CodeSystem with standard values for the processes update and download allowlist"/> + <description value="CodeSystem with standard values for the processes update and download allow list"/> <caseSensitive value="true"/> <hierarchyMeaning value="grouped-by"/> <versionNeeded value="false"/> <content value="complete"/> <concept> - <code value="highmed_allowlist"/> - <display value="HiGHmed Allowlist"/> - <definition value="Allowlist identifying organizations as part of HiGHmed"/> + <code value="highmed_allow_list"/> + <display value="HiGHmed Allow List"/> + <definition value="Allow list identifying organizations as part of HiGHmed"/> </concept> </CodeSystem> \ 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-allowlist-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allowlist-0.3.0.xml.post deleted file mode 100644 index bd4406073..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allowlist-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/CodeSystem/update-allowlist&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-download-allowlist-0.3.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml similarity index 93% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml index c9be76fc8..133658f79 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml @@ -6,9 +6,9 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-download-allowlist" /> + <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list" /> <version value="0.3.0" /> - <name value="TaskDownloadAllowlist" /> + <name value="TaskDownloadAllowList" /> <status value="draft" /> <date value="2020-10-26" /> <fhirVersion value="4.0.1" /> @@ -20,7 +20,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/downloadAllowlist/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/downloadAllowList/0.3.0" /> </element> <element id="Task.input"> <path value="Task.input" /> @@ -33,7 +33,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="downloadAllowlistMessage" /> + <fixedString value="downloadAllowListMessage" /> </element> <element id="Task.input:business-key"> <path value="Task.input" /> @@ -55,7 +55,7 @@ <path value="Task.input.type" /> <binding> <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/update-allowlist" /> + <valueSet value="http://highmed.org/fhir/ValueSet/update-allow-list" /> </binding> </element> <element id="Task.input:bundle-reference.type.coding"> @@ -66,12 +66,12 @@ <element id="Task.input:bundle-reference.type.coding.system"> <path value="Task.input.type.coding.system" /> <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/update-allowlist" /> + <fixedUri value="http://highmed.org/fhir/CodeSystem/update-allow-list" /> </element> <element id="Task.input:bundle-reference.type.coding.code"> <path value="Task.input.type.coding.code" /> <min value="1" /> - <fixedCode value="highmed_allowlist" /> + <fixedCode value="highmed_allow_list" /> </element> <element id="Task.input:bundle-reference.value[x]"> <path value="Task.input.value[x]" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-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 similarity index 68% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml.post index 0ba360add..ec0d00b6c 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allowlist-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 @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-download-allowlist&version=0.3.0 \ No newline at end of file +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-allowlist-0.3.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml similarity index 82% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allowlist-0.3.0.xml rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml index 9de88fd5a..627bdd679 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allowlist-0.3.0.xml +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml @@ -5,9 +5,9 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allowlist" /> + <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list" /> <version value="0.3.0" /> - <name value="TaskUpdateAllowlist" /> + <name value="TaskUpdateAllowList" /> <status value="draft" /> <date value="2020-10-26" /> <fhirVersion value="4.0.1" /> @@ -19,7 +19,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/updateAllowlist/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/updateAllowList/0.3.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -37,7 +37,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="updateAllowlistMessage" /> + <fixedString value="updateAllowListMessage" /> </element> <element id="Task.input:business-key"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -55,47 +55,47 @@ <sliceName value="correlation-key" /> <max value="0" /> </element> - <element id="Task.output:allowlist"> + <element id="Task.output:allowList"> <path value="Task.output" /> - <sliceName value="allowlist" /> + <sliceName value="allowList" /> <max value="1" /> </element> - <element id="Task.output:allowlist.type"> + <element id="Task.output:allowList.type"> <path value="Task.output.type" /> <binding> <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> <valueString value="TaskOutputParameterType" /> </extension> <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/update-allowlist" /> + <valueSet value="http://highmed.org/fhir/ValueSet/update-allow-list" /> </binding> </element> - <element id="Task.output:allowlist.type.coding"> + <element id="Task.output:allowList.type.coding"> <path value="Task.output.type.coding" /> <min value="1" /> <max value="1" /> </element> - <element id="Task.output:allowlist.type.coding.system"> + <element id="Task.output:allowList.type.coding.system"> <path value="Task.output.type.coding.system" /> <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/update-allowlist" /> + <fixedUri value="http://highmed.org/fhir/CodeSystem/update-allow-list" /> </element> - <element id="Task.output:allowlist.type.coding.code"> + <element id="Task.output:allowList.type.coding.code"> <path value="Task.output.type.coding.code" /> <min value="1" /> - <fixedCode value="highmed_allowlist" /> + <fixedCode value="highmed_allow_list" /> </element> - <element id="Task.output:allowlist.value[x]"> + <element id="Task.output:allowList.value[x]"> <path value="Task.output.value[x]" /> <type> <code value="Reference" /> </type> </element> - <element id="Task.output:allowlist.value[x].reference"> + <element id="Task.output:allowList.value[x].reference"> <path value="Task.output.value[x].reference" /> <min value="1" /> </element> - <element id="Task.output:allowlist.value[x].identifier"> + <element id="Task.output:allowList.value[x].identifier"> <path value="Task.output.value[x].identifier" /> <max value="0" /> </element> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allowlist-0.3.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-allowlist-0.3.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 0575066c2..95e29475f 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allowlist-0.3.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-allowlist&version=0.3.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-allowlist-0.3.0.xml b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml similarity index 75% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allowlist-0.3.0.xml rename to dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml index b63a5be05..315a7cd5d 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allowlist-0.3.0.xml +++ b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml @@ -5,20 +5,20 @@ <code value="REMOTE"/> </tag> </meta> - <url value="http://highmed.org/fhir/ValueSet/update-allowlist"/> + <url value="http://highmed.org/fhir/ValueSet/update-allow-list"/> <version value="0.3.0"/> - <name value="HiGHmed_Update_Allowlist"/> - <title value="HiGHmed Update Allowlist"/> + <name value="HiGHmed_Update_Allow_List"/> + <title value="HiGHmed Update Allow List"/> <status value="active"/> <experimental value="false"/> <date value="2020-10-26"/> <publisher value="HiGHmed"/> <description - value="ValueSet with standard values for the process update allowlist"/> + value="ValueSet with standard values for the process update allow list"/> <immutable value="true"/> <compose> <include> - <system value="http://highmed.org/fhir/CodeSystem/update-allowlist"/> + <system value="http://highmed.org/fhir/CodeSystem/update-allow-list"/> </include> </compose> </ValueSet> \ 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-allowlist-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allowlist-0.3.0.xml.post deleted file mode 100644 index 2a07d65cf..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allowlist-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/ValueSet/update-allowlist&version=0.3.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 49b49e0b7..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 @@ -26,7 +26,7 @@ public void testCreateBundle() throws Exception logger.debug(fhirContext.newJsonParser().encodeResourceToString(allowList)); Bundle updatedBundle = getWebserviceClient().updateConditionaly(allowList, Map.of("identifier", - Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allowlist|highmed_allowlist"))); + Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); assertNotNull(updatedBundle); } @@ -40,7 +40,7 @@ public void testCreateBundleReturnMinimal() throws Exception logger.debug(fhirContext.newJsonParser().encodeResourceToString(allowList)); IdType id = getWebserviceClient().withMinimalReturn().updateConditionaly(allowList, Map.of("identifier", - Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allowlist|highmed_allowlist"))); + Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); assertNotNull(id); } @@ -55,7 +55,7 @@ public void testCreateBundleReturnOperationOutcome() throws Exception OperationOutcome outcome = getWebserviceClient().withOperationOutcomeReturn().updateConditionaly(allowList, Map.of("identifier", Collections - .singletonList("http://highmed.org/fhir/CodeSystem/update-allowlist|highmed_allowlist"))); + .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 00227cc41..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 @@ -36,7 +36,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.validation.ResultSeverityEnum; import ca.uhn.fhir.validation.ValidationResult; @@ -49,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-allowlist-0.3.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", @@ -57,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", "highmed-task-download-allowlist-0.3.0.xml"), - Arrays.asList("authorization-role-0.2.0.xml", "bpmn-message-0.2.0.xml", "update-allowlist-0.3.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-allowlist-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")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), @@ -228,9 +227,9 @@ private Task createValidTaskPong() } @Test - public void testTaskUpdateAllowlistValid() throws Exception + public void testTaskUpdateAllowListValid() throws Exception { - Task task = createValidTaskUpdateAllowlist(); + Task task = createValidTaskUpdateAllowList(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -242,10 +241,10 @@ public void testTaskUpdateAllowlistValid() throws Exception @Test public void testTaskUpdateAllowlistValidWithOutput() throws Exception { - Task task = createValidTaskUpdateAllowlist(); + Task task = createValidTaskUpdateAllowList(); task.addOutput().setValue(new Reference(new IdType("Bundle", UUID.randomUUID().toString(), "1"))).getType() - .addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allowlist") - .setCode("highmed_allowlist"); + .addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") + .setCode("highmed_allow_list"); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -254,11 +253,11 @@ public void testTaskUpdateAllowlistValidWithOutput() throws Exception || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } - private Task createValidTaskUpdateAllowlist() + private Task createValidTaskUpdateAllowList() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allowlist"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowlist/0.3.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()); @@ -267,16 +266,16 @@ private Task createValidTaskUpdateAllowlist() task.getRestriction().addRecipient().setType("Organization").getIdentifier() .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.addInput().setValue(new StringType("updateAllowlistMessage")).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 testTaskRequestUpdateResourcesAllowlistValid() throws Exception + public void testTaskRequestUpdateResourcesAllowListValid() throws Exception { - Task task = createValidTaskRequestUpdateAllowlistResources(); + Task task = createValidTaskRequestUpdateAllowListResources(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -285,11 +284,11 @@ public void testTaskRequestUpdateResourcesAllowlistValid() throws Exception || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } - private Task createValidTaskRequestUpdateAllowlistResources() + private Task createValidTaskRequestUpdateAllowListResources() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allowlist"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowlist/0.3.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()); @@ -298,7 +297,7 @@ private Task createValidTaskRequestUpdateAllowlistResources() task.getRestriction().addRecipient().setType("Organization").getIdentifier() .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.addInput().setValue(new StringType("updateAllowlistMessage")).getType().addCoding() + task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); return task; @@ -752,9 +751,9 @@ private Task createValidTaskLocalServiceIntegration() } @Test - public void testTaskDownloadAllowlistValid() throws Exception + public void testTaskDownloadAllowListValid() throws Exception { - Task task = createValidTaskDownloadAllowlist(); + Task task = createValidTaskDownloadAllowList(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -763,11 +762,11 @@ public void testTaskDownloadAllowlistValid() throws Exception || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } - private Task createValidTaskDownloadAllowlist() + private Task createValidTaskDownloadAllowList() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-download-allowlist"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowlist/0.3.0"); + 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()); @@ -776,14 +775,14 @@ private Task createValidTaskDownloadAllowlist() 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() + 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-allowlist") - .setCode("highmed_allowlist"); - System.out.println(FhirContext.forR4().newXmlParser().setPrettyPrint(true).encodeResourceToString(task)); + .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 53a4a4eec..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<CodeSystem> 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-allowlist-0.3.0.xml") + "update-allow-list-0.3.0.xml") .map(f -> Paths.get(CODE_SYSTEM_FOLDER, f)).map(this::readCodeSystem).collect(Collectors.toList()); } From 148ac3bbc18bb050b515d4ca8c6cf8ee71af7911 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 26 Oct 2020 18:26:41 +0100 Subject: [PATCH 3/3] removed not needed syso --- .../start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java | 2 -- 1 file changed, 2 deletions(-) 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 index b780c11f5..0e4919ce9 100644 --- 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 @@ -24,7 +24,6 @@ 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; @@ -75,7 +74,6 @@ public static void main(String[] args) .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") .setCode("highmed_allow_list"); - System.out.println(FhirContext.forR4().newXmlParser().setPrettyPrint(true).setStripVersionsFromReferences(false).encodeResourceToString(task)); client.withMinimalReturn().create(task); } }