From 14bb96a5376f51eb80059a8c05e59ba68c47a6d7 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 26 Jan 2021 19:22:49 +0100 Subject: [PATCH 01/21] starting new development cycle, version to 0.5.0-SNAPSHOT --- dsf-bpe-process-feasibility/pom.xml | 2 +- .../dsf/bpe/FeasibilityProcessPluginDefinition.java | 2 +- .../highmed/dsf/fhir/profile/TaskProfileTest.java | 8 ++++---- dsf-bpe-process-local-services/pom.xml | 2 +- .../bpe/LocalServicesProcessPluginDefinition.java | 6 +++--- .../highmed/dsf/fhir/profile/TaskProfileTest.java | 12 ++++++------ dsf-bpe-process-ping/pom.xml | 2 +- .../highmed/dsf/bpe/PingProcessPluginDefinition.java | 2 +- .../highmed/dsf/fhir/profiles/TaskProfileTest.java | 6 +++--- dsf-bpe-process-update-allow-list/pom.xml | 2 +- .../bpe/UpdateAllowListProcessPluginDefinition.java | 2 +- .../highmed/dsf/fhir/profile/TaskProfileTest.java | 6 +++--- dsf-bpe-process-update-resources/pom.xml | 2 +- .../bpe/UpdateResourcesProcessPluginDefinition.java | 2 +- .../highmed/dsf/fhir/profile/TaskProfileTest.java | 8 ++++---- pom.xml | 8 ++++---- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe-process-feasibility/pom.xml index a7ef97dd..4710c66a 100644 --- a/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe-process-feasibility/pom.xml @@ -8,7 +8,7 @@ dsf-bpe-highmed-processes-pom org.highmed.dsf - 0.4.0 + 0.5.0-SNAPSHOT diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index da228a4d..7713c894 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -18,7 +18,7 @@ public class FeasibilityProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "0.4.0"; + public static final String VERSION = "0.5.0"; @Override public String getName() diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index eb808a9e..67935edc 100644 --- a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -68,14 +68,14 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group-0.4.0.xml", - "highmed-extension-group-id-0.4.0.xml", "highmed-research-study-0.4.0.xml", + Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-group-0.5.0.xml", + "highmed-extension-group-id-0.5.0.xml", "highmed-research-study-0.5.0.xml", "highmed-task-request-feasibility.xml", "highmed-task-execute-feasibility.xml", "highmed-task-single-medic-result-feasibility.xml", "highmed-task-compute-feasibility.xml", "highmed-task-multi-medic-result-feasibility.xml", "highmed-task-error-feasibility.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-feasibility.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-feasibility.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), diff --git a/dsf-bpe-process-local-services/pom.xml b/dsf-bpe-process-local-services/pom.xml index 7ffc3082..7f0053f6 100644 --- a/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe-process-local-services/pom.xml @@ -9,7 +9,7 @@ dsf-bpe-highmed-processes-pom org.highmed.dsf - 0.4.0 + 0.5.0-SNAPSHOT diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index 7b173372..206962b5 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -18,10 +18,10 @@ public class LocalServicesProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "0.4.0"; + public static final String VERSION = "0.5.0"; - private static final String DEPENDENCY_FEASIBILITY_VERSION = "0.4.0"; - private static final String DEPENDENCY_FEASIBILITY_NAME_AND_VERSION = "dsf-bpe-process-feasibility-0.4.0"; + private static final String DEPENDENCY_FEASIBILITY_VERSION = "0.5.0"; + private static final String DEPENDENCY_FEASIBILITY_NAME_AND_VERSION = "dsf-bpe-process-feasibility-0.5.0"; @Override public String getName() diff --git a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 364a3b7c..6be24426 100644 --- a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -41,13 +41,13 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group-0.4.0.xml", - "highmed-extension-group-id-0.4.0.xml", "highmed-extension-query-0.4.0.xml", + Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-group-0.5.0.xml", + "highmed-extension-group-id-0.5.0.xml", "highmed-extension-query-0.5.0.xml", "highmed-task-local-services-integration.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-feasibility.xml", "highmed-query-type-0.4.0.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-feasibility.xml", "highmed-query-type-0.4.0.xml")); + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + "highmed-feasibility.xml", "highmed-query-type-0.5.0.xml"), + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + "highmed-feasibility.xml", "highmed-query-type-0.5.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); diff --git a/dsf-bpe-process-ping/pom.xml b/dsf-bpe-process-ping/pom.xml index 321468f4..69b15b75 100644 --- a/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe-process-ping/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-highmed-processes-pom - 0.4.0 + 0.5.0-SNAPSHOT diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java index a0ebf719..fd3d32d4 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java @@ -15,7 +15,7 @@ public class PingProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "0.4.0"; + public static final String VERSION = "0.5.0"; @Override public String getName() diff --git a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java index 04b3a75b..d704ab05 100644 --- a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java @@ -42,10 +42,10 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-start-ping-process.xml", "highmed-task-ping.xml", + Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-start-ping-process.xml", "highmed-task-ping.xml", "highmed-task-pong.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml")); + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml"), + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); diff --git a/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe-process-update-allow-list/pom.xml index 89558ed9..d41b388a 100644 --- a/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe-process-update-allow-list/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-highmed-processes-pom - 0.4.0 + 0.5.0-SNAPSHOT diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java index 3790c823..1273f458 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java @@ -17,7 +17,7 @@ public class UpdateAllowListProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "0.4.0"; + public static final String VERSION = "0.5.0"; @Override public String getName() diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index a2e17f81..085f10fa 100644 --- a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -42,11 +42,11 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-update-allow-list.xml", + Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-update-allow-list.xml", "highmed-task-download-allow-list.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-update-allow-list.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-update-allow-list.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), diff --git a/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe-process-update-resources/pom.xml index cf549fb7..dcc1fc4b 100644 --- a/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe-process-update-resources/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-highmed-processes-pom - 0.4.0 + 0.5.0-SNAPSHOT diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java index 6807af08..47fb6b44 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java @@ -17,7 +17,7 @@ public class UpdateResourcesProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "0.4.0"; + public static final String VERSION = "0.5.0"; @Override public String getName() diff --git a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index addcc80f..c9b8ca88 100644 --- a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -53,11 +53,11 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-request-update-resources.xml", + Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-request-update-resources.xml", "highmed-task-execute-update-resources.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-update-resources.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-update-resources.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), @@ -68,7 +68,7 @@ public void testGenerateSnapshotNotWorkingWithoutBaseSnapshot() throws Exception { var reader = new StructureDefinitionReader(validationRule.getFhirContext()); - StructureDefinition base = reader.readXml("/fhir/StructureDefinition/highmed-task-base-0.4.0.xml"); + StructureDefinition base = reader.readXml("/fhir/StructureDefinition/highmed-task-base-0.5.0.xml"); StructureDefinition differential = reader .readXml("/fhir/StructureDefinition/highmed-task-execute-update-resources.xml"); diff --git a/pom.xml b/pom.xml index c0731c73..177e898a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.highmed.dsf dsf-bpe-highmed-processes-pom - 0.4.0 + 0.5.0-SNAPSHOT pom @@ -62,12 +62,12 @@ org.highmed.dsf dsf-bpe-process-base - 0.4.0 + 0.5.0-SNAPSHOT org.highmed.dsf dsf-fhir-validation - 0.4.0 + 0.5.0-SNAPSHOT @@ -125,7 +125,7 @@ org.highmed.dsf dsf-bpe-process-base - 0.4.0 + 0.5.0-SNAPSHOT test test-jar From b23cc08edd030d8d20c0de7b440f66c6823a9120 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 9 Feb 2021 00:34:21 +0100 Subject: [PATCH 02/21] formatter and impsort maven plugin configs --- dsf-bpe-process-feasibility/pom.xml | 4 + dsf-bpe-process-local-services/pom.xml | 4 + dsf-bpe-process-ping/pom.xml | 4 + dsf-bpe-process-update-allow-list/pom.xml | 4 + dsf-bpe-process-update-resources/pom.xml | 5 +- pom.xml | 94 +++++ .../resources/eclipse-formatter-config.xml | 382 ++++++++++++++++++ 7 files changed, 496 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/eclipse-formatter-config.xml diff --git a/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe-process-feasibility/pom.xml index 4710c66a..75fa8677 100644 --- a/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe-process-feasibility/pom.xml @@ -10,6 +10,10 @@ org.highmed.dsf 0.5.0-SNAPSHOT + + + ${project.basedir}/.. + diff --git a/dsf-bpe-process-local-services/pom.xml b/dsf-bpe-process-local-services/pom.xml index 7f0053f6..26ea7b72 100644 --- a/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe-process-local-services/pom.xml @@ -11,6 +11,10 @@ org.highmed.dsf 0.5.0-SNAPSHOT + + + ${project.basedir}/.. + diff --git a/dsf-bpe-process-ping/pom.xml b/dsf-bpe-process-ping/pom.xml index 69b15b75..bff79a19 100644 --- a/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe-process-ping/pom.xml @@ -9,6 +9,10 @@ dsf-bpe-highmed-processes-pom 0.5.0-SNAPSHOT + + + ${project.basedir}/.. + diff --git a/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe-process-update-allow-list/pom.xml index d41b388a..755088b6 100644 --- a/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe-process-update-allow-list/pom.xml @@ -9,6 +9,10 @@ dsf-bpe-highmed-processes-pom 0.5.0-SNAPSHOT + + + ${project.basedir}/.. + diff --git a/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe-process-update-resources/pom.xml index dcc1fc4b..8461bd9a 100644 --- a/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe-process-update-resources/pom.xml @@ -9,6 +9,10 @@ dsf-bpe-highmed-processes-pom 0.5.0-SNAPSHOT + + + ${project.basedir}/.. + @@ -17,7 +21,6 @@ provided - de.hs-heilbronn.mi log4j2-utils diff --git a/pom.xml b/pom.xml index 177e898a..7d725203 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,8 @@ UTF-8 11 11 + + ${project.basedir} highmed-processes @@ -183,6 +185,16 @@ maven-clean-plugin 3.1.0 + + net.revelc.code.formatter + formatter-maven-plugin + 2.13.0 + + + net.revelc.code + impsort-maven-plugin + 1.5.0 + @@ -204,6 +216,22 @@ true + + net.revelc.code.formatter + formatter-maven-plugin + + ${main.basedir}/src/main/resources/eclipse-formatter-config.xml + + + + net.revelc.code + impsort-maven-plugin + + 11 + java.,javax.,org.,com. + java,* + + @@ -231,4 +259,70 @@ + + + + format-and-sort + + + + + net.revelc.code.formatter + formatter-maven-plugin + + + + format + + + + + + net.revelc.code + impsort-maven-plugin + + + + sort + + + + + + + + + validate-and-check + + true + + + + + + net.revelc.code.formatter + formatter-maven-plugin + + + + validate + + + + + + net.revelc.code + impsort-maven-plugin + + + + check + + + + + + + + diff --git a/src/main/resources/eclipse-formatter-config.xml b/src/main/resources/eclipse-formatter-config.xml new file mode 100644 index 00000000..fa149094 --- /dev/null +++ b/src/main/resources/eclipse-formatter-config.xml @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9ca16d41037037a3c955133de236dd0dec80a71c Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 9 Feb 2021 00:37:03 +0100 Subject: [PATCH 03/21] fail-at-end option (-fae) added to GitHub Actions maven build --- .github/workflows/maven-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 8d513d6a..d1cdb9f9 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -19,4 +19,4 @@ jobs: - name: Build with Maven env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: mvn -B verify --file pom.xml + run: mvn -B verify -fae --file pom.xml From 5847cf4e47d06eb22e237df83dde68779cc05ca3 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 9 Feb 2021 00:47:44 +0100 Subject: [PATCH 04/21] code formatted and java imports sorted by maven plugins --- .../highmed/dsf/bpe/ConstantsFeasibility.java | 12 ++--- .../FeasibilityProcessPluginDefinition.java | 13 +++--- .../dsf/bpe/message/SendMedicRequest.java | 10 ++--- .../dsf/bpe/message/SendMultiMedicErrors.java | 12 ++--- .../bpe/message/SendMultiMedicResults.java | 27 +++++------ .../bpe/message/SendSingleMedicResults.java | 8 ++-- .../dsf/bpe/message/SendTtpRequest.java | 5 +-- .../service/CalculateMultiMedicResults.java | 7 +-- .../bpe/service/CheckMultiMedicResults.java | 34 +++++++------- .../highmed/dsf/bpe/service/CheckQueries.java | 10 ++--- .../bpe/service/CheckSingleMedicResults.java | 5 +-- .../CheckTtpComputedMultiMedicResults.java | 20 +++++---- .../service/DownloadFeasibilityResources.java | 45 ++++++++++--------- .../DownloadResearchStudyResource.java | 37 +++++++-------- .../dsf/bpe/service/ExecuteQueries.java | 2 +- .../service/HandleErrorMultiMedicResults.java | 9 ++-- .../bpe/service/SelectResponseTargetTtp.java | 7 +-- .../dsf/bpe/service/StoreCorrelationKeys.java | 20 +++++---- .../highmed/dsf/bpe/service/StoreResults.java | 23 ++++++---- .../FeasibilityQueryResultValues.java | 3 +- .../FinalFeasibilityQueryResults.java | 3 +- ...lityFromMedicsViaMedic1ExampleStarter.java | 45 ++++++++++--------- .../dsf/bpe/ConstantsLocalServices.java | 4 +- .../LocalServicesProcessPluginDefinition.java | 15 +++---- .../dsf/bpe/service/ExtractInputValues.java | 25 +++++------ .../highmed/dsf/bpe/service/StoreResult.java | 24 +++++----- .../spring/config/LocalServicesConfig.java | 12 ++--- .../LocalServicesMedic1ExampleStarter.java | 4 +- .../dsf/bpe/PingProcessPluginDefinition.java | 10 ++--- .../dsf/bpe/service/SelectPingTargets.java | 4 +- .../Ping3MedicFromTtpExampleStarter.java | 4 +- .../dsf/bpe/ConstantsUpdateAllowList.java | 8 ++-- ...pdateAllowListProcessPluginDefinition.java | 10 ++--- .../dsf/bpe/service/DownloadAllowList.java | 20 ++++----- .../dsf/bpe/service/UpdateAllowList.java | 19 ++++---- ...lowListFromTtpViaMedic1ExampleStarter.java | 12 ++--- ...pdateAllowList3MedicTtpExampleStarter.java | 4 +- .../dsf/bpe/ConstantsUpdateResources.java | 16 +++---- ...pdateResourcesProcessPluginDefinition.java | 11 +++-- .../highmed/dsf/bpe/message/SendRequest.java | 5 ++- .../highmed/dsf/bpe/service/CheckRequest.java | 13 +++--- .../bpe/service/SelectResourceAndTargets.java | 6 +-- .../dsf/bpe/service/UpdateResources.java | 25 +++++------ ...UpdateResource3MedicTtpExampleStarter.java | 12 ++--- 44 files changed, 311 insertions(+), 309 deletions(-) diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java index 1a1b047e..1b45f522 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java @@ -36,22 +36,22 @@ public interface ConstantsFeasibility String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-request-feasibility"; String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "requestFeasibility/"; - String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI + + VERSION; String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME = "requestFeasibilityMessage"; String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "localServicesIntegration/"; String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-execute-feasibility"; String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "executeFeasibility/"; - String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI + + VERSION; String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_MESSAGE_NAME = "executeFeasibilityMessage"; String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-compute-feasibility"; String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "computeFeasibility/"; - String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI + + VERSION; String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME = "computeFeasibilityMessage"; String PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility"; diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index 7713c894..48999d88 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -64,13 +64,12 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader var vF = ValueSetResource.file("fhir/ValueSet/highmed-feasibility.xml"); - Map> resourcesByProcessKeyAndVersion = Map.of( - "computeFeasibility/" + VERSION, Arrays.asList(aCom, cF, sTCom, sTResS, vF), - "executeFeasibility/" + VERSION, Arrays.asList(aExe, cF, sTExe, vF), - "requestFeasibility/" + VERSION, Arrays.asList(aReq, cF, sTReq, sTResM, sTErr, vF)); + Map> resourcesByProcessKeyAndVersion = Map.of("computeFeasibility/" + VERSION, + Arrays.asList(aCom, cF, sTCom, sTResS, vF), "executeFeasibility/" + VERSION, + Arrays.asList(aExe, cF, sTExe, vF), "requestFeasibility/" + VERSION, + Arrays.asList(aReq, cF, sTReq, sTResM, sTErr, vF)); - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java index efd4d718..e32f436c 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java @@ -45,14 +45,12 @@ protected Stream getAdditionalInputParameters(DelegateExecut new Reference().setReference(researchStudyId.toVersionless().getValueAsString())); boolean needsConsentCheck = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); - ParameterComponent inputNeedsConsentCheck = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK, - needsConsentCheck); + ParameterComponent inputNeedsConsentCheck = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK, needsConsentCheck); boolean needsRecordLinkage = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); - ParameterComponent inputNeedsRecordLinkage = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, - needsRecordLinkage); + ParameterComponent inputNeedsRecordLinkage = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); if (needsRecordLinkage) { diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java index 999e44dc..4735ae64 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java @@ -30,13 +30,13 @@ protected Stream getAdditionalInputParameters(DelegateExecut { Task task = getLeadingTaskFromExecutionVariables(); - String taskUrl = new Reference(new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl() + "/Task" , task.getIdElement().getIdPart())) - .getReference(); + String taskUrl = new Reference(new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl() + "/Task", + task.getIdElement().getIdPart())).getReference(); - Task.ParameterComponent input = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - "An error occurred while calculating the multi medic feasibility result for " - + "all defined cohorts, see task with url='" + taskUrl + "'"); + Task.ParameterComponent input = getTaskHelper().createInput(CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, + "An error occurred while calculating the multi medic feasibility result for " + + "all defined cohorts, see task with url='" + taskUrl + "'"); return Stream.of(input); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java index 8597de85..6b3e8e68 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java @@ -48,16 +48,12 @@ protected Stream getAdditionalInputParameters(DelegateExecut private Stream toInputs(FinalFeasibilityQueryResult result) { - ParameterComponent input1 = getTaskHelper() - .createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT, - result.getCohortSize()); + ParameterComponent input1 = getTaskHelper().createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT, result.getCohortSize()); input1.addExtension(createCohortIdExtension(result.getCohortId())); - ParameterComponent input2 = getTaskHelper() - .createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT, - result.getParticipatingMedics()); + ParameterComponent input2 = getTaskHelper().createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT, result.getParticipatingMedics()); input2.addExtension(createCohortIdExtension(result.getCohortId())); return Stream.of(input1, input2); @@ -79,10 +75,10 @@ private Stream getErrorInput(DelegateExecution execution) String taskUrl = new Reference(new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl() + "/Task", task.getIdElement().getIdPart())).getReference(); - Task.ParameterComponent input = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - "Errors occurred for missing cohorts while calculating their multi medic feasibility " - + "result, see task with url='" + taskUrl + "'"); + Task.ParameterComponent input = getTaskHelper().createInput(CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, + "Errors occurred for missing cohorts while calculating their multi medic feasibility " + + "result, see task with url='" + taskUrl + "'"); return Stream.of(input); } @@ -91,8 +87,9 @@ private Stream getErrorInput(DelegateExecution execution) private boolean hasErrorOutput(List outputs) { - return outputs.stream().anyMatch(output -> output.getType().getCoding().stream().anyMatch( - coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_BPMN) && coding.getCode() - .equals(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR))); + return outputs.stream() + .anyMatch(output -> output.getType().getCoding().stream() + .anyMatch(coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_BPMN) + && coding.getCode().equals(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR))); } } \ No newline at end of file diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java index e28c582d..5cd7a69e 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java @@ -62,11 +62,11 @@ else if (result.isIdResultSetUrlResult()) } else { - logger.warn("Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result - .getCohortId()); + logger.warn("Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + + result.getCohortId()); throw new RuntimeException( - "Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result - .getCohortId()); + "Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + + result.getCohortId()); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java index 385d5bfb..68851316 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java @@ -37,9 +37,8 @@ protected Stream getAdditionalInputParameters(DelegateE target.getCorrelationKey())); boolean needsRecordLinkage = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); - Task.ParameterComponent inputNeedsRecordLinkage = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, - needsRecordLinkage); + Task.ParameterComponent inputNeedsRecordLinkage = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); return Stream.concat(inputTargets, Stream.of(inputNeedsRecordLinkage)); } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java index 4508c07e..421a0398 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java @@ -41,9 +41,10 @@ private List calculateResults(List> byCohortId = results.stream() .collect(Collectors.groupingBy(FeasibilityQueryResult::getCohortId)); - return byCohortId.entrySet().stream().map(e -> new FinalFeasibilityQueryResult(e.getKey(), - toInt(e.getValue().stream().filter(r -> r.getCohortSize() > 0).count()), - toInt(e.getValue().stream().mapToLong(FeasibilityQueryResult::getCohortSize).sum()))) + return byCohortId.entrySet().stream() + .map(e -> new FinalFeasibilityQueryResult(e.getKey(), + toInt(e.getValue().stream().filter(r -> r.getCohortSize() > 0).count()), + toInt(e.getValue().stream().mapToLong(FeasibilityQueryResult::getCohortSize).sum()))) .collect(Collectors.toList()); } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java index 96a62cc1..b2c527f0 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java @@ -51,21 +51,22 @@ protected void doExecute(DelegateExecution execution) throws Exception private void addFinalFeasibilityQueryErrorsToLeadingTask(Task toRead, Task toWrite) { - toRead.getInput().stream().filter(in -> in.hasType() && in.getType().hasCoding() && CODESYSTEM_HIGHMED_BPMN - .equals(in.getType().getCodingFirstRep().getSystem()) && CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR - .equals(in.getType().getCodingFirstRep().getCode())).forEach(in -> toWrite.getOutput() - .add(getTaskHelper().createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - in.getValue().primitiveValue()))); + toRead.getInput().stream() + .filter(in -> in.hasType() && in.getType().hasCoding() + && CODESYSTEM_HIGHMED_BPMN.equals(in.getType().getCodingFirstRep().getSystem()) + && CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR.equals(in.getType().getCodingFirstRep().getCode())) + .forEach(in -> toWrite.getOutput().add(getTaskHelper().createOutput(CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, in.getValue().primitiveValue()))); } private FinalFeasibilityQueryResults readFinalFeasibilityQueryResultsFromCurrentTask(Task task) { List results = task.getInput().stream() - .filter(in -> in.hasType() && in.getType().hasCoding() && CODESYSTEM_HIGHMED_FEASIBILITY - .equals(in.getType().getCodingFirstRep().getSystem()) + .filter(in -> in.hasType() && in.getType().hasCoding() + && CODESYSTEM_HIGHMED_FEASIBILITY.equals(in.getType().getCodingFirstRep().getSystem()) && CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT - .equals(in.getType().getCodingFirstRep().getCode())).map(in -> toResult(task, in)) - .collect(Collectors.toList()); + .equals(in.getType().getCodingFirstRep().getCode())) + .map(in -> toResult(task, in)).collect(Collectors.toList()); return new FinalFeasibilityQueryResults(results); } @@ -79,14 +80,13 @@ private FinalFeasibilityQueryResult toResult(Task task, ParameterComponent in) private int getParticipatingMedicsCountByCohortId(Task task, String cohortId) { - return task.getInput().stream() - .filter(in -> in.hasType() && in.getType().hasCoding() && CODESYSTEM_HIGHMED_FEASIBILITY - .equals(in.getType().getCodingFirstRep().getSystem()) - && CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT - .equals(in.getType().getCodingFirstRep().getCode()) && cohortId - .equals(((Reference) in.getExtensionByUrl(EXTENSION_HIGHMED_GROUP_ID).getValue()) - .getReference())).mapToInt(in -> ((UnsignedIntType) in.getValue()).getValue()) - .findFirst().getAsInt(); + return task.getInput().stream().filter(in -> in.hasType() && in.getType().hasCoding() + && CODESYSTEM_HIGHMED_FEASIBILITY.equals(in.getType().getCodingFirstRep().getSystem()) + && CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT + .equals(in.getType().getCodingFirstRep().getCode()) + && cohortId.equals( + ((Reference) in.getExtensionByUrl(EXTENSION_HIGHMED_GROUP_ID).getValue()).getReference())) + .mapToInt(in -> ((UnsignedIntType) in.getValue()).getValue()).findFirst().getAsInt(); } protected FinalFeasibilityQueryResults checkResults(FinalFeasibilityQueryResults results) diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java index 73965e0e..b19238a4 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java @@ -48,16 +48,16 @@ protected void doExecute(DelegateExecution execution) throws Exception Map queries = new HashMap<>(); Task leadingTask = getLeadingTaskFromExecutionVariables(); - cohorts.forEach(group -> { + cohorts.forEach(group -> + { String aqlQuery = groupHelper.extractAqlQuery(group).toLowerCase(); String groupId = group.getId(); if (!aqlQuery.startsWith(ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX)) { - String errorMessage = - "Initial single medic feasibility query check failed, wrong format for query of group with id '" - + groupId + "', expected query to start with '" - + ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX + "' but got '" + aqlQuery + "'"; + String errorMessage = "Initial single medic feasibility query check failed, wrong format for query of group with id '" + + groupId + "', expected query to start with '" + ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX + + "' but got '" + aqlQuery + "'"; logger.info(errorMessage); leadingTask.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java index 6dd391ae..831b9b55 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java @@ -71,8 +71,7 @@ private void addError(Task task, String cohortId, String error) String errorMessage = "Feasibility query result check failed for group with id '" + cohortId + "': " + error; logger.info(errorMessage); - task.getOutput().add(getTaskHelper() - .createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - errorMessage)); + task.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java index 77bbd244..709bad6b 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java @@ -61,15 +61,16 @@ private List filterResultsByParticipatingMedics(Tas String correlationKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); - return results.getResults().stream().filter(result -> { + return results.getResults().stream().filter(result -> + { if (result.getParticipatingMedics() < MIN_PARTICIPATING_MEDICS) { logger.warn("Removed result with cohort id='{}' from feasibility request with task-id='{}', " - + "business-key='{}' and correlation-key='{}' because of not enough participating MeDICs", + + "business-key='{}' and correlation-key='{}' because of not enough participating MeDICs", result.getCohortId(), taskId, businessKey, correlationKey); - leadingTask.getOutput().add(getTaskHelper() - .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, + leadingTask.getOutput() + .add(getTaskHelper().createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, "Removed result with cohort id='" + result.getCohortId() + "' from feasibility request because of not enough participating MeDICs")); @@ -90,12 +91,13 @@ private boolean checkIfAtLeastOneResultExists(Task leadingTask, List c.hasResource() && c.getRes private List getCohortDefinitions(Bundle bundle, String baseUrl) { - return bundle.getEntry().stream().skip(1).map(e -> { + return bundle.getEntry().stream().skip(1).map(e -> + { Group group = (Group) e.getResource(); IdType oldId = group.getIdElement(); group.setIdElement( @@ -167,29 +168,29 @@ private String getTtpIdentifier(ResearchStudy researchStudy, FhirWebserviceClien private boolean getNeedsConsentCheck(Task task) { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( - () -> new IllegalArgumentException( - "NeedsConsentCheck boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper() + .getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK) + .orElseThrow(() -> new IllegalArgumentException("NeedsConsentCheck boolean is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation")); } private boolean getNeedsRecordLinkageCheck(Task task) { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper() + .getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE) + .orElseThrow( + () -> new IllegalArgumentException("NeedsRecordLinkage boolean is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation")); } private BloomFilterConfig getBloomFilterConfig(Task task) { return BloomFilterConfig.fromBytes(getTaskHelper() .getFirstInputParameterByteValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG).orElseThrow( - () -> new IllegalArgumentException( - "BloomFilterConfig byte[] is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation"))); + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG) + .orElseThrow(() -> new IllegalArgumentException("BloomFilterConfig byte[] is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation"))); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java index 90b18e53..31841399 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java @@ -75,10 +75,10 @@ private IdType getResearchStudyId(Task task) { Reference researchStudyReference = getTaskHelper() .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE).findFirst().orElseThrow( - () -> new IllegalArgumentException( - "ResearchStudy reference is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("ResearchStudy reference is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation")); return new IdType(researchStudyReference.getReference()); } @@ -113,15 +113,15 @@ private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirW if (!identifiers.isEmpty()) { - identifiers.forEach(identifier -> { + identifiers.forEach(identifier -> + { logger.warn( "Adding missing organization with identifier='{}' to feasibility research study with id='{}'", identifier, researchStudy.getId()); researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(identifier))); + new Reference().setType(ResourceType.Organization.name()).setIdentifier(new Identifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue(identifier))); }); @@ -146,19 +146,20 @@ private ResearchStudy update(ResearchStudy researchStudy, FhirWebserviceClient c private boolean getNeedsConsentCheck(Task task) { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( - () -> new IllegalArgumentException( - "NeedsConsentCheck boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper() + .getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK) + .orElseThrow(() -> new IllegalArgumentException("NeedsConsentCheck boolean is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation")); } private boolean getNeedsRecordLinkageCheck(Task task) { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper() + .getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE) + .orElseThrow( + () -> new IllegalArgumentException("NeedsRecordLinkage boolean is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation")); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java index c4fb0365..a2ae34df 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java @@ -65,7 +65,7 @@ protected void doExecute(DelegateExecution execution) throws Exception private FeasibilityQueryResult executeQuery(String cohortId, String cohortQuery, boolean idQuery) { // TODO We might want to introduce a more complex result type to represent a count, - // errors and possible meta-data. + // errors and possible meta-data. ResultSet resultSet = openehrClient.query(cohortQuery, null); diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java index c00384c4..6b55accd 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java @@ -20,10 +20,11 @@ protected void doExecute(DelegateExecution execution) throws Exception Task currentTask = getCurrentTaskFromExecutionVariables(); Task leadingTask = getLeadingTaskFromExecutionVariables(); - currentTask.getInput().forEach(input -> { - boolean isErrorInput = input.getType().getCoding().stream().anyMatch( - code -> code.getSystem().equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN) && code.getCode() - .equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR)); + currentTask.getInput().forEach(input -> + { + boolean isErrorInput = input.getType().getCoding().stream() + .anyMatch(code -> code.getSystem().equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN) + && code.getCode().equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR)); if (isErrorInput) { diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java index 2677e6be..7c08e1b0 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java @@ -45,9 +45,10 @@ private String getCorrelationKey(DelegateExecution execution) { Task task = getCurrentTaskFromExecutionVariables(); - return getTaskHelper().getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElseThrow( - () -> new IllegalStateException( + return getTaskHelper() + .getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY) + .orElseThrow(() -> new IllegalStateException( "No correlation key found, this error should have been caught by resource validation")); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java index d4f3962f..aab08ec4 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java @@ -33,13 +33,14 @@ protected void doExecute(DelegateExecution execution) throws Exception { Task task = getCurrentTaskFromExecutionVariables(); - List targets = getTaskHelper().getInputParameterStringValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY) + List targets = getTaskHelper() + .getInputParameterStringValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY) .map(correlationKey -> Target.createBiDirectionalTarget("", correlationKey)) .collect(Collectors.toList()); - execution - .setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, + TargetsValues.create(new Targets(targets))); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); @@ -50,10 +51,11 @@ protected void doExecute(DelegateExecution execution) throws Exception private boolean getNeedsRecordLinkageCheck(Task task) { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper() + .getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE) + .orElseThrow( + () -> new IllegalArgumentException("NeedsRecordLinkage boolean is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation")); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java index 322a8f9e..c57b9c56 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java @@ -73,23 +73,28 @@ private List getResults(Task task, boolean needsRecordLi { return taskHelper.getInputParameterWithExtension(task, CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, EXTENSION_HIGHMED_GROUP_ID) - .map(input -> { + .map(input -> + { String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); String resultSetUrl = ((Reference) input.getValue()).getReference(); - return FeasibilityQueryResult - .idResult(requester.getIdentifier().getValue(), cohortId, resultSetUrl); + return FeasibilityQueryResult.idResult(requester.getIdentifier().getValue(), cohortId, + resultSetUrl); }).collect(Collectors.toList()); } else { - return taskHelper.getInputParameterWithExtension(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, EXTENSION_HIGHMED_GROUP_ID).map(input -> { - String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); - int cohortSize = ((UnsignedIntType) input.getValue()).getValue(); + return taskHelper + .getInputParameterWithExtension(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, EXTENSION_HIGHMED_GROUP_ID) + .map(input -> + { + String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); + int cohortSize = ((UnsignedIntType) input.getValue()).getValue(); - return FeasibilityQueryResult.countResult(requester.getIdentifier().getValue(), cohortId, cohortSize); - }).collect(Collectors.toList()); + return FeasibilityQueryResult.countResult(requester.getIdentifier().getValue(), cohortId, + cohortSize); + }).collect(Collectors.toList()); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultValues.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultValues.java index 5f5c2fe9..d2eea04a 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultValues.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultValues.java @@ -37,7 +37,8 @@ private FeasibilityQueryResultValueTypeImpl() @Override public TypedValue createValue(Object value, Map valueInfo) { - return new FeasibilityQueryResultValues.FeasibilityQueryResultValueImpl((FeasibilityQueryResult) value, VALUE_TYPE); + return new FeasibilityQueryResultValues.FeasibilityQueryResultValueImpl((FeasibilityQueryResult) value, + VALUE_TYPE); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java index a5905759..65f413db 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java @@ -13,7 +13,8 @@ public class FinalFeasibilityQueryResults private final List results = new ArrayList<>(); @JsonCreator - public FinalFeasibilityQueryResults(@JsonProperty("results") Collection results) + public FinalFeasibilityQueryResults( + @JsonProperty("results") Collection results) { if (results != null) this.results.addAll(results); diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java index f400ae3e..c50c2e56 100644 --- a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -3,17 +3,17 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsBase.CODE_TYPE_AQL_QUERY; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHEMD_RESEARCH_STUDY; +import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHMED_GROUP; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHEMD_RESEARCH_STUDY; -import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHMED_GROUP; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; @@ -48,9 +48,9 @@ public class RequestFeasibilityFromMedicsViaMedic1ExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate - // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate - // password + // password public static void main(String[] args) throws Exception { Bundle bundle = createStartResource(); @@ -108,21 +108,21 @@ private static ResearchStudy createResearchStudy(Group group1, Group group2) researchStudy.addEnrollment().setReference(group1.getIdElement().getIdPart()); researchStudy.addEnrollment().setReference(group2.getIdElement().getIdPart()); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC) + .setValue(new Reference().setType(ResourceType.Organization.name()) + .setIdentifier(new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1))); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC) + .setValue(new Reference().setType(ResourceType.Organization.name()) + .setIdentifier(new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2))); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC) + .setValue(new Reference().setType(ResourceType.Organization.name()) + .setIdentifier(new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3))); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP) + .setValue(new Reference().setType(ResourceType.Organization.name()) + .setIdentifier(new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP))); return researchStudy; @@ -147,9 +147,10 @@ private static Task createTask(ResearchStudy researchStudy) task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME)).getType() .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new Reference().setReference(researchStudy.getIdElement().getIdPart()) - .setType(ResourceType.ResearchStudy.name())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + task.addInput() + .setValue(new Reference().setReference(researchStudy.getIdElement().getIdPart()) + .setType(ResourceType.ResearchStudy.name())) + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java index 7dba0856..70562d56 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java @@ -6,7 +6,7 @@ public interface ConstantsLocalServices { String PROFILE_HIGHMED_TASK_LOCAL_SERVICES = "http://highmed.org/fhir/StructureDefinition/task-local-services-integration"; - String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI + + VERSION; String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME = "localServicesIntegrationMessage"; } diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index 206962b5..f7ad8ac3 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -60,18 +60,15 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader var sTL = StructureDefinitionResource .file("fhir/StructureDefinition/highmed-task-local-services-integration.xml"); - var vF = ValueSetResource - .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/ValueSet/feasibility", - DEPENDENCY_FEASIBILITY_VERSION); - var cF = CodeSystemResource - .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/CodeSystem/feasibility", - DEPENDENCY_FEASIBILITY_VERSION); + var vF = ValueSetResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, + "http://highmed.org/fhir/ValueSet/feasibility", DEPENDENCY_FEASIBILITY_VERSION); + var cF = CodeSystemResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, + "http://highmed.org/fhir/CodeSystem/feasibility", DEPENDENCY_FEASIBILITY_VERSION); Map> resourcesByProcessKeyAndVersion = Map .of("localServicesIntegration/" + VERSION, Arrays.asList(aL, sTL, vF, cF)); - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java index 6a020529..ab944ce2 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java @@ -64,7 +64,8 @@ private Stream getQueries(Task task) private List getCohortDefinitions(Stream queries) { - return queries.map(q -> { + return queries.map(q -> + { Group group = new Group(); group.setIdElement(new IdType(UUID.randomUUID().toString())); group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY) @@ -77,29 +78,27 @@ private boolean getNeedsConsentCheck(Task task) { return getTaskHelper() .getFirstInputParameterBooleanValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( - () -> new IllegalArgumentException( - "NeedsConsentCheck boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK) + .orElseThrow(() -> new IllegalArgumentException("NeedsConsentCheck boolean is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation")); } private boolean getNeedsRecordLinkageCheck(Task task) { return getTaskHelper() .getFirstInputParameterBooleanValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE) + .orElseThrow( + () -> new IllegalArgumentException("NeedsRecordLinkage boolean is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation")); } private BloomFilterConfig getBloomFilterConfig(Task task) { return BloomFilterConfig.fromBytes(getTaskHelper() .getFirstInputParameterByteValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG).orElseThrow( - () -> new IllegalArgumentException( - "BloomFilterConfig byte[] is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation"))); + ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG) + .orElseThrow(() -> new IllegalArgumentException("BloomFilterConfig byte[] is not set in task with id='" + + task.getId() + "', this error should " + "have been caught by resource validation"))); } } diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java index da4623b0..24f49b2d 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java @@ -44,29 +44,29 @@ private void addOutput(Task task, FeasibilityQueryResult result) { if (result.isCohortSizeResult()) { - Task.TaskOutputComponent output = getTaskHelper() - .createOutputUnsignedInt(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, - result.getCohortSize()); + Task.TaskOutputComponent output = getTaskHelper().createOutputUnsignedInt( + ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, + ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, + result.getCohortSize()); output.addExtension(createCohortIdExtension(result.getCohortId())); task.addOutput(output); } else if (result.isIdResultSetUrlResult()) { - Task.TaskOutputComponent output = getTaskHelper() - .createOutput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, - new Reference(result.getResultSetUrl())); + Task.TaskOutputComponent output = getTaskHelper().createOutput( + ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, + ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, + new Reference(result.getResultSetUrl())); output.addExtension(createCohortIdExtension(result.getCohortId())); task.addOutput(output); } else { - logger.warn("Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result - .getCohortId()); + logger.warn("Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + + result.getCohortId()); throw new RuntimeException( - "Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result - .getCohortId()); + "Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + + result.getCohortId()); } } diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java index c351806a..1cee133b 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java @@ -40,13 +40,13 @@ public class LocalServicesConfig @Autowired private OrganizationProvider organizationProvider; - + @Autowired private TaskHelper taskHelper; @Autowired private GroupHelper groupHelper; - + @Autowired private ObjectMapper objectMapper; @@ -104,25 +104,25 @@ public BouncyCastleProvider bouncyCastleProvider() { return new BouncyCastleProvider(); } - + @Bean public GenerateCountFromIds generateCountFromIds() { return new GenerateCountFromIds(fhirClientProvider, taskHelper); } - + @Bean public ExecuteQueries executeQueries() { return new ExecuteQueries(fhirClientProvider, openEhrClient(), taskHelper, organizationProvider); } - + @Bean public OpenEhrClient openEhrClient() { return openEhrClientFactory.createClient(environment::getProperty); } - + @Bean public CheckQueries checkQueries() { diff --git a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java index c7cee546..2015c40f 100644 --- a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java @@ -34,9 +34,9 @@ public class LocalServicesMedic1ExampleStarter private static boolean NEEDS_RECORD_LINKAGE = true; // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate - // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate - // password + // password public static void main(String[] args) throws Exception { Task task = createStartResource(); diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java index fd3d32d4..b058d755 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java @@ -51,12 +51,10 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader .file("fhir/StructureDefinition/highmed-task-start-ping-process.xml"); var tPong = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-ping.xml"); - Map> resourcesByProcessKeyAndVersion = Map - .of("ping/" + VERSION, Arrays.asList(aPing, tPong, tStartPing), "pong/" + VERSION, - Arrays.asList(aPong, tPing)); + Map> resourcesByProcessKeyAndVersion = Map.of("ping/" + VERSION, + Arrays.asList(aPing, tPong, tStartPing), "pong/" + VERSION, Arrays.asList(aPong, tPing)); - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java index bb91420f..79b5e30a 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java @@ -39,8 +39,8 @@ public void afterPropertiesSet() throws Exception @Override public void doExecute(DelegateExecution execution) throws Exception { - List targets = organizationProvider.getRemoteIdentifiers().stream().map(identifier -> Target - .createBiDirectionalTarget(identifier.getValue(), UUID.randomUUID().toString())) + List targets = organizationProvider.getRemoteIdentifiers().stream().map( + identifier -> Target.createBiDirectionalTarget(identifier.getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); diff --git a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index a782ab52..f08d97d5 100644 --- a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -20,9 +20,9 @@ public class Ping3MedicFromTtpExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate - // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate - // password + // password public static void main(String[] args) throws Exception { Task task = createStartResource(); diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java index 920befdd..56a226c4 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java @@ -10,13 +10,13 @@ public interface ConstantsUpdateAllowList String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST = "http://highmed.org/fhir/StructureDefinition/task-download-allow-list"; String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "downloadAllowList/"; - String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI + + VERSION; String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME = "downloadAllowListMessage"; String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST = "http://highmed.org/fhir/StructureDefinition/task-update-allow-list"; String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "updateAllowList/"; - String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI + + VERSION; String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME = "updateAllowListMessage"; } diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java index 1273f458..c2f1b9df 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java @@ -53,12 +53,10 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader var sUp = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-update-allow-list.xml"); var v = ValueSetResource.file("fhir/ValueSet/highmed-update-allow-list.xml"); - Map> resourcesByProcessKeyAndVersion = Map - .of("downloadAllowList/" + VERSION, Arrays.asList(aDown, c, sDown, v), "updateAllowList/" + VERSION, - Arrays.asList(aUp, c, sUp, v)); + Map> resourcesByProcessKeyAndVersion = Map.of("downloadAllowList/" + VERSION, + Arrays.asList(aDown, c, sDown, v), "updateAllowList/" + VERSION, Arrays.asList(aUp, c, sUp, v)); - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java index dda7f7a4..f59d3411 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java @@ -64,9 +64,8 @@ protected void doExecute(DelegateExecution execution) throws Exception { 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); + 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())) @@ -84,17 +83,16 @@ protected void doExecute(DelegateExecution execution) throws Exception { 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); + 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, CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST, - CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST).collect(Collectors.toList()); + List bundleReferences = getTaskHelper().getInputParameterReferenceValues(task, + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST, CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST) + .collect(Collectors.toList()); if (bundleReferences.size() != 1) { @@ -103,8 +101,8 @@ private IdType getBundleId(Task task) throw new RuntimeException("Task input parameter " + 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/")) + else if (!bundleReferences.get(0).hasReference() + || !bundleReferences.get(0).getReference().contains("/Bundle/")) { logger.error("Task input parameter {} has no Bundle reference", CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java index 68f38815..5c8d6a04 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java @@ -75,14 +75,14 @@ public void doExecute(DelegateExecution execution) throws Exception .setValue(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 allow list transaction bundle: {}", FhirContext.forR4().newJsonParser().encodeResourceToString(transaction)); - IdType result = client.withMinimalReturn().updateConditionaly(transaction, Map.of("identifier", Collections - .singletonList(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST + "|" + IdType result = client.withMinimalReturn().updateConditionaly(transaction, + Map.of("identifier", Collections.singletonList(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST + "|" + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST))); Task task = getLeadingTaskFromExecutionVariables(); @@ -93,7 +93,8 @@ public void doExecute(DelegateExecution execution) throws Exception private Consumer addAllowListEntry(Bundle transaction, Bundle searchSet) { - return organization -> { + return organization -> + { Identifier identifier = getDefaultIdentifier(organization).get(); BundleEntryComponent organizationEntry = transaction.addEntry(); @@ -115,7 +116,8 @@ private Consumer addAllowListEntry(Bundle transaction, Bun private Function> addAllowListEntryReturnReference(Bundle transaction, String organizationId, Bundle searchSet) { - return endpointRef -> getEndpoint(endpointRef, searchSet).map(endpoint -> { + return endpointRef -> getEndpoint(endpointRef, searchSet).map(endpoint -> + { Identifier identifier = getDefaultIdentifier(endpoint).get(); BundleEntryComponent endpointEntry = transaction.addEntry(); @@ -148,7 +150,8 @@ private Optional getDefaultIdentifier(Endpoint ept) private Optional getEndpoint(Reference endpoint, Bundle searchSet) { return searchSet.getEntry().stream() - .filter(e -> e.hasResource() && e.getResource() instanceof Endpoint && e.getFullUrl() - .endsWith(endpoint.getReference())).map(e -> (Endpoint) e.getResource()).findFirst(); + .filter(e -> e.hasResource() && e.getResource() instanceof Endpoint + && e.getFullUrl().endsWith(endpoint.getReference())) + .map(e -> (Endpoint) e.getResource()).findFirst(); } } diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index 5e729dba..1338e902 100644 --- a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -29,9 +29,9 @@ public class DownloadAllowListFromTtpViaMedic1ExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate - // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate - // password + // password public static void main(String[] args) throws Exception { ExampleStarter starter = ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL); @@ -58,10 +58,10 @@ private static Task createStartResource(ExampleStarter starter) throws Exception task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType() .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new Reference( - new IdType(TTP_FHIR_BASE_URL, ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), - allowList.getIdElement().getVersionIdPart()))).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) + task.addInput() + .setValue(new Reference(new IdType(TTP_FHIR_BASE_URL, ResourceType.Bundle.name(), + allowList.getIdElement().getIdPart(), allowList.getIdElement().getVersionIdPart()))) + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); return task; diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index 6d08e8ba..1144ff88 100644 --- a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -20,9 +20,9 @@ public class UpdateAllowList3MedicTtpExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate - // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate - // password + // password public static void main(String[] args) throws Exception { Task task = createStartResource(); diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java index d9ab66f3..d8468f53 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java @@ -10,16 +10,16 @@ public interface ConstantsUpdateResources String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER = "organization-identifier-search-parameter"; String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES = "http://highmed.org/fhir/StructureDefinition/task-request-update-resources"; - String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI = - PROCESS_HIGHMED_URI_BASE + "requestUpdateResources/"; - String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + + "requestUpdateResources/"; + String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI + + VERSION; String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME = "requestUpdateResourcesMessage"; String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES = "http://highmed.org/fhir/StructureDefinition/task-execute-update-resources"; - String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI = - PROCESS_HIGHMED_URI_BASE + "executeUpdateResources/"; - String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + + "executeUpdateResources/"; + String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI + + VERSION; String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME = "executeUpdateResourcesMessage"; } diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java index 47fb6b44..b0e87dd1 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java @@ -55,12 +55,11 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader .file("fhir/StructureDefinition/highmed-task-request-update-resources.xml"); var v = ValueSetResource.file("fhir/ValueSet/highmed-update-resources.xml"); - Map> resourcesByProcessKeyAndVersion = Map - .of("executeUpdateResources/" + VERSION, Arrays.asList(aExec, c, sExec, v), - "requestUpdateResources/" + VERSION, Arrays.asList(aReq, c, sReq, v)); + Map> resourcesByProcessKeyAndVersion = Map.of( + "executeUpdateResources/" + VERSION, Arrays.asList(aExec, c, sExec, v), + "requestUpdateResources/" + VERSION, Arrays.asList(aReq, c, sReq, v)); - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); + return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java index 9ff3a6a7..02c92293 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java @@ -39,8 +39,9 @@ private ParameterComponent toInputParameterBundleReference(String localBaseUrl, if (bundleId == null || bundleId.isEmpty()) throw new IllegalArgumentException("bundleId null or empty"); - return new ParameterComponent(new CodeableConcept(new Coding(CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, null)), + return new ParameterComponent( + new CodeableConcept(new Coding(CODESYSTEM_HIGHMED_UPDATE_RESOURCE, + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, null)), new Reference().setReference(localBaseUrl + (localBaseUrl.endsWith("/") ? "" : "/") + bundleId)); } } diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java index dd45cb07..e05098f6 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java @@ -51,11 +51,14 @@ protected void doExecute(DelegateExecution execution) throws Exception private boolean requesterIsNotOfTypeTtp(Identifier requester) { - Optional organization = organizationProvider - .getOrganization(requester.getSystem(), requester.getValue()); + Optional organization = organizationProvider.getOrganization(requester.getSystem(), + requester.getValue()); - return !organization.map(value -> value.getType().stream().anyMatch(type -> type.getCoding().stream().anyMatch( - coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE) && coding.getCode() - .equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP)))).orElse(false); + return !organization + .map(value -> value.getType().stream() + .anyMatch(type -> type.getCoding().stream() + .anyMatch(coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE) + && coding.getCode().equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP)))) + .orElse(false); } } diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java index a0f13f77..648abf44 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java @@ -54,9 +54,9 @@ public void afterPropertiesSet() throws Exception public void doExecute(DelegateExecution execution) throws Exception { Task task = getCurrentTaskFromExecutionVariables(); - List references = getTaskHelper() - .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE).collect(Collectors.toList()); + List references = getTaskHelper().getInputParameterReferenceValues(task, + CODESYSTEM_HIGHMED_UPDATE_RESOURCE, CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE) + .collect(Collectors.toList()); if (references.size() != 1) { diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java index 1f984efc..9c0b845d 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java @@ -65,9 +65,8 @@ public void doExecute(DelegateExecution execution) throws Exception { 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); + 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())) @@ -85,17 +84,16 @@ public void doExecute(DelegateExecution execution) throws Exception { 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); + 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, CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE).collect(Collectors.toList()); + List bundleReferences = getTaskHelper().getInputParameterReferenceValues(task, + CODESYSTEM_HIGHMED_UPDATE_RESOURCE, CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE) + .collect(Collectors.toList()); if (bundleReferences.size() != 1) { @@ -105,14 +103,13 @@ private IdType getBundleId(Task task) "Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE + " contains unexpected number of Bundle IDs, expected 1, got " + bundleReferences.size()); } - else if (!bundleReferences.get(0).hasReference() || !bundleReferences.get(0).getReference() - .contains("/Bundle/")) + else if (!bundleReferences.get(0).hasReference() + || !bundleReferences.get(0).getReference().contains("/Bundle/")) { logger.error("Task input parameter {} has no Bundle reference", CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); - throw new RuntimeException( - "Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE - + " has no Bundle reference"); + throw new RuntimeException("Task input parameter " + + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE + " has no Bundle reference"); } return new IdType(bundleReferences.get(0).getReference()); diff --git a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index 3cc79c9d..813fdfe7 100644 --- a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -29,9 +29,9 @@ public class UpdateResource3MedicTtpExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate - // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate - // password + // password public static void main(String[] args) throws Exception { ExampleStarter starter = ExampleStarter.forServer(args, TTP_FHIR_BASE_URL); @@ -59,10 +59,10 @@ private static Task createStartResource(ExampleStarter starter) throws Exception task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME)).getType() .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new Reference( - new IdType(ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), - allowList.getIdElement().getVersionIdPart()))).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) + task.addInput() + .setValue(new Reference(new IdType(ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), + allowList.getIdElement().getVersionIdPart()))) + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); task.addInput().setValue(new StringType("http://highmed.org/fhir/NamingSystem/organization-identifier|")) From de5b03338b5b85f951ccf6ccd60030a53abaf6ba Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 16 Feb 2021 17:42:09 +0100 Subject: [PATCH 05/21] changed process versions from 0.4.0 to 0.5.0 in bpmn files --- .../src/main/resources/bpe/computeFeasibility.bpmn | 6 +++--- .../src/main/resources/bpe/executeFeasibility.bpmn | 4 ++-- .../src/main/resources/bpe/requestFeasibility.bpmn | 6 +++--- .../src/main/resources/bpe/localServicesIntegration.bpmn | 4 ++-- dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn | 4 ++-- dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn | 4 ++-- .../src/main/resources/bpe/downloadAllowList.bpmn | 2 +- .../src/main/resources/bpe/updateAllowList.bpmn | 2 +- .../src/main/resources/bpe/executeUpdateResources.bpmn | 2 +- .../src/main/resources/bpe/requestUpdateResources.bpmn | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn index 753a9f97..18ccd7a4 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_1lfe4wr SequenceFlow_0xxpamp @@ -47,7 +47,7 @@ requestFeasibility http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility - 0.4.0 + 0.5.0 resultMultiMedicFeasibilityMessage @@ -99,7 +99,7 @@ requestFeasibility http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility - 0.4.0 + 0.5.0 errorMultiMedicFeasibilityMessage diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn index bbb01ebe..28ecd7dc 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0q803rh SequenceFlow_04ouilq @@ -25,7 +25,7 @@ resultSingleMedicFeasibilityMessage - 0.4.0 + 0.5.0 computeFeasibility http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn index 884b99ca..120b1ce3 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_11k77gx @@ -13,7 +13,7 @@ executeFeasibility - 0.4.0 + 0.5.0 executeFeasibilityMessage http://highmed.org/fhir/StructureDefinition/task-execute-feasibility @@ -34,7 +34,7 @@ computeFeasibility - 0.4.0 + 0.5.0 computeFeasibilityMessage http://highmed.org/fhir/StructureDefinition/task-compute-feasibility diff --git a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn index 6228d6d8..64d97c45 100644 --- a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn +++ b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0q803rh SequenceFlow_04ouilq @@ -95,7 +95,7 @@ resultSingleMedicFeasibilityMessage - 0.4.0 + 0.5.0 computeFeasibility http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility diff --git a/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn b/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn index 6bf868a0..2d32fb25 100644 --- a/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn +++ b/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn @@ -1,6 +1,6 @@ - + @@ -11,7 +11,7 @@ pong - 0.4.0 + 0.5.0 pingMessage http://highmed.org/fhir/StructureDefinition/task-ping diff --git a/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn b/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn index 4d207a6a..e3af4ee4 100644 --- a/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn +++ b/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_07w11cw @@ -10,7 +10,7 @@ pongMessage - 0.4.0 + 0.5.0 ping http://highmed.org/fhir/StructureDefinition/task-pong diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn index d3b32105..a325e15c 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn +++ b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0oyvmcd diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn index a4f87744..f3b5263b 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn +++ b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0oyvmcd diff --git a/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn b/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn index 38905763..163eaf4c 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn +++ b/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn @@ -1,6 +1,6 @@ - + SequenceFlow_0djh0eg diff --git a/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn b/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn index 13825c35..a8cc6c39 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn +++ b/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn @@ -1,6 +1,6 @@ - + @@ -11,7 +11,7 @@ executeUpdateResources - 0.4.0 + 0.5.0 executeUpdateResourcesMessage http://highmed.org/fhir/StructureDefinition/task-execute-update-resources From 07c74a5c7897ed65d27a07892d2ade24a05e070c Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Sat, 13 Mar 2021 22:15:21 +0100 Subject: [PATCH 06/21] adds property 'dsf.location' that can be used to override the default Building the HiGHmed processes project for example b via `mvn clean install -Pcopy-to-highmed-dsf-process -Ddsf.location=../../highmed-dsf-alt` allows for the highmed-dsf to be located in a folder called `highmed-dsf-alt` closes #15 --- dsf-bpe-process-feasibility/pom.xml | 21 +++++++++++---------- dsf-bpe-process-local-services/pom.xml | 21 +++++++++++---------- dsf-bpe-process-ping/pom.xml | 21 +++++++++++---------- dsf-bpe-process-update-allow-list/pom.xml | 21 +++++++++++---------- dsf-bpe-process-update-resources/pom.xml | 21 +++++++++++---------- 5 files changed, 55 insertions(+), 50 deletions(-) diff --git a/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe-process-feasibility/pom.xml index 75fa8677..d8db1740 100644 --- a/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe-process-feasibility/pom.xml @@ -13,6 +13,7 @@ ${project.basedir}/.. + ../../highmed-dsf @@ -68,7 +69,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process @@ -85,7 +86,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process @@ -102,7 +103,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process @@ -119,7 +120,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process @@ -136,7 +137,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process @@ -147,35 +148,35 @@ - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process ${project.artifactId}-${project.version}.jar diff --git a/dsf-bpe-process-local-services/pom.xml b/dsf-bpe-process-local-services/pom.xml index 26ea7b72..517bc74f 100644 --- a/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe-process-local-services/pom.xml @@ -14,6 +14,7 @@ ${project.basedir}/.. + ../../highmed-dsf @@ -69,7 +70,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process @@ -86,7 +87,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process @@ -103,7 +104,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process @@ -120,7 +121,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process @@ -137,7 +138,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process @@ -148,35 +149,35 @@ - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process ${project.artifactId}-${project.version}.jar diff --git a/dsf-bpe-process-ping/pom.xml b/dsf-bpe-process-ping/pom.xml index bff79a19..925ae232 100644 --- a/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe-process-ping/pom.xml @@ -12,6 +12,7 @@ ${project.basedir}/.. + ../../highmed-dsf @@ -62,7 +63,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process @@ -79,7 +80,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process @@ -96,7 +97,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process @@ -113,7 +114,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process @@ -130,7 +131,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process @@ -141,35 +142,35 @@ - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process ${project.artifactId}-${project.version}.jar diff --git a/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe-process-update-allow-list/pom.xml index 755088b6..1a4fdb32 100644 --- a/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe-process-update-allow-list/pom.xml @@ -12,6 +12,7 @@ ${project.basedir}/.. + ../../highmed-dsf @@ -62,7 +63,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process @@ -79,7 +80,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process @@ -96,7 +97,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process @@ -113,7 +114,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process @@ -130,7 +131,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process @@ -141,35 +142,35 @@ - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process ${project.artifactId}-${project.version}.jar diff --git a/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe-process-update-resources/pom.xml index 8461bd9a..987e7a00 100644 --- a/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe-process-update-resources/pom.xml @@ -12,6 +12,7 @@ ${project.basedir}/.. + ../../highmed-dsf @@ -62,7 +63,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process @@ -79,7 +80,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process @@ -96,7 +97,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process @@ -113,7 +114,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process @@ -130,7 +131,7 @@ ${project.version} - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process @@ -141,35 +142,35 @@ - ../../highmed-dsf/dsf-docker-test-setup/bpe/app/process + ${dsf.location}/dsf-docker-test-setup/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process ${project.artifactId}-${project.version}.jar false - ../../highmed-dsf/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process ${project.artifactId}-${project.version}.jar From 6d83f7323fdd4c74e55bbb01d02eaed77d805a8d Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 20 Apr 2021 11:42:47 +0200 Subject: [PATCH 07/21] remove toLowerCase() from AQL query extraction --- .../src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java | 2 +- .../src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java | 2 +- .../main/java/org/highmed/dsf/bpe/service/ModifyQueries.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java index 1b45f522..ebf11c54 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java @@ -20,7 +20,7 @@ public interface ConstantsFeasibility // (if I already know the cohort size in my MeDIC) int MIN_PARTICIPATING_MEDICS = 3; int MIN_COHORT_DEFINITIONS = 1; - String FEASIBILITY_QUERY_PREFIX = "select count"; + String FEASIBILITY_QUERY_PREFIX = "SELECT COUNT"; String CODESYSTEM_HIGHMED_FEASIBILITY = "http://highmed.org/fhir/CodeSystem/feasibility"; String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY = "medic-correlation-key"; diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java index b19238a4..428b73a4 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java @@ -50,7 +50,7 @@ protected void doExecute(DelegateExecution execution) throws Exception Task leadingTask = getLeadingTaskFromExecutionVariables(); cohorts.forEach(group -> { - String aqlQuery = groupHelper.extractAqlQuery(group).toLowerCase(); + String aqlQuery = groupHelper.extractAqlQuery(group); String groupId = group.getId(); if (!aqlQuery.startsWith(ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX)) diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java index 82fec146..83cc1bb9 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java @@ -64,6 +64,6 @@ private Map modifyQueries(Map queries) protected String replaceSelectCountWithSelectMpiId(String value) { // TODO Implement correct replacement for default id query - return value.replace("select count(e)", "select e" + ehrIdColumnPath + " as EHRID"); + return value.replace("SELECT COUNT(e)", "SELECT e" + ehrIdColumnPath + " as EHRID"); } } From 84476ecfe1aa359c5c211d92eed09f55df270c9d Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Sun, 6 Jun 2021 18:46:08 +0200 Subject: [PATCH 08/21] dependency upgrades this branch will work with https://github.com/highmed/highmed-dsf/tree/issues/179_read_access --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 7d725203..f395ad26 100644 --- a/pom.xml +++ b/pom.xml @@ -102,7 +102,7 @@ de.hs-heilbronn.mi log4j2-utils - 0.7.0 + 0.9.0 @@ -115,14 +115,14 @@ com.fasterxml.jackson.core jackson-annotations - 2.12.0 + 2.12.3 junit junit - 4.13.1 + 4.13.2 org.highmed.dsf @@ -188,12 +188,12 @@ net.revelc.code.formatter formatter-maven-plugin - 2.13.0 + 2.15.0 net.revelc.code impsort-maven-plugin - 1.5.0 + 1.6.2 From 5269395672bf8aa8d192b858f55fd38278e0dabf Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Sun, 6 Jun 2021 18:46:30 +0200 Subject: [PATCH 09/21] added copy to new 3medic/ttp docker test setup --- dsf-bpe-process-feasibility/pom.xml | 100 ++++++++++++++++++++++ dsf-bpe-process-local-services/pom.xml | 100 ++++++++++++++++++++++ dsf-bpe-process-ping/pom.xml | 100 ++++++++++++++++++++++ dsf-bpe-process-update-allow-list/pom.xml | 100 ++++++++++++++++++++++ dsf-bpe-process-update-resources/pom.xml | 100 ++++++++++++++++++++++ 5 files changed, 500 insertions(+) diff --git a/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe-process-feasibility/pom.xml index d8db1740..0287a9ad 100644 --- a/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe-process-feasibility/pom.xml @@ -140,6 +140,78 @@ ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic1 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic2 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic3 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/ttp + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + + @@ -182,6 +254,34 @@ false + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + diff --git a/dsf-bpe-process-local-services/pom.xml b/dsf-bpe-process-local-services/pom.xml index 517bc74f..939eace4 100644 --- a/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe-process-local-services/pom.xml @@ -141,6 +141,78 @@ ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic1 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic2 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic3 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/ttp + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + + @@ -183,6 +255,34 @@ false + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + diff --git a/dsf-bpe-process-ping/pom.xml b/dsf-bpe-process-ping/pom.xml index 925ae232..da9d67ea 100644 --- a/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe-process-ping/pom.xml @@ -134,6 +134,78 @@ ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic1 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic2 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic3 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/ttp + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + + @@ -176,6 +248,34 @@ false + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + diff --git a/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe-process-update-allow-list/pom.xml index 1a4fdb32..29764f70 100644 --- a/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe-process-update-allow-list/pom.xml @@ -134,6 +134,78 @@ ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic1 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic2 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic3 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/ttp + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + + @@ -176,6 +248,34 @@ false + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + diff --git a/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe-process-update-resources/pom.xml index 987e7a00..d3a1f244 100644 --- a/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe-process-update-resources/pom.xml @@ -134,6 +134,78 @@ ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic1 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic2 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/medic3 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + + + + copy-process-to-docker-test-setup-3medic-ttp-docker/ttp + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + + @@ -176,6 +248,34 @@ false + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic1/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic2/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/medic3/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3medic-ttp-docker/ttp/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + From b690c12a746d7935794a24fb333267100cbbed6f Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Wed, 9 Jun 2021 14:05:01 +0200 Subject: [PATCH 10/21] changes to align with dsf issues/179_read_access, new ActivityDef tests Modifications to align with the DSF branch: https://github.com/highmed/highmed-dsf/tree/issues/179_read_access Added ActivityDefinition profile tests. --- .../FeasibilityProcessPluginDefinition.java | 14 +- .../dsf/bpe/message/SendMedicRequest.java | 5 +- .../dsf/bpe/message/SendMultiMedicErrors.java | 5 +- .../bpe/message/SendMultiMedicResults.java | 5 +- .../bpe/message/SendSingleMedicResults.java | 5 +- .../dsf/bpe/message/SendTtpRequest.java | 5 +- .../service/CalculateMultiMedicResults.java | 6 +- .../service/CheckFeasibilityResources.java | 6 +- .../bpe/service/CheckMultiMedicResults.java | 6 +- .../highmed/dsf/bpe/service/CheckQueries.java | 32 ++- .../bpe/service/CheckSingleMedicResults.java | 20 +- .../CheckTtpComputedMultiMedicResults.java | 6 +- .../service/DownloadFeasibilityResources.java | 11 +- .../DownloadResearchStudyResource.java | 7 +- .../dsf/bpe/service/DownloadResultSets.java | 7 +- .../dsf/bpe/service/ExecuteQueries.java | 22 +- .../dsf/bpe/service/ExecuteRecordLink.java | 13 +- .../service/FilterQueryResultsByConsent.java | 13 +- .../dsf/bpe/service/GenerateBloomFilters.java | 21 +- .../dsf/bpe/service/GenerateCountFromIds.java | 13 +- .../service/HandleErrorMultiMedicResults.java | 18 +- .../dsf/bpe/service/ModifyQueries.java | 8 +- .../dsf/bpe/service/SelectRequestTargets.java | 55 +++-- .../service/SelectResponseTargetMedic.java | 32 ++- .../bpe/service/SelectResponseTargetTtp.java | 39 ++- .../dsf/bpe/service/StoreCorrelationKeys.java | 13 +- .../highmed/dsf/bpe/service/StoreResults.java | 6 +- .../bpe/spring/config/FeasibilityConfig.java | 70 ++++-- .../resources/bpe/computeFeasibility.bpmn | 16 +- .../resources/bpe/executeFeasibility.bpmn | 9 +- .../resources/bpe/requestFeasibility.bpmn | 12 +- .../highmed-computeFeasibility.xml | 136 +++++++---- .../highmed-executeFeasibility.xml | 96 +++++--- .../highmed-requestFeasibility.xml | 200 +++++++++------ .../fhir/CodeSystem/highmed-feasibility.xml | 84 +++---- .../highmed-task-compute-feasibility.xml | 6 +- .../highmed-task-error-feasibility.xml | 7 +- .../highmed-task-execute-feasibility.xml | 6 +- ...ed-task-multi-medic-result-feasibility.xml | 6 +- .../highmed-task-request-feasibility.xml | 6 +- ...d-task-single-medic-result-feasibility.xml | 6 +- .../fhir/ValueSet/highmed-feasibility.xml | 24 +- ...lityFromMedicsViaMedic1ExampleStarter.java | 167 +++++++++++++ ...omMedicsViaMedic1DockerExampleStarter.java | 16 ++ ...lityFromMedicsViaMedic1ExampleStarter.java | 150 +----------- .../ActivityDefinitionProfileTest.java | 116 +++++++++ .../dsf/fhir/profile/TaskProfileTest.java | 4 +- .../LocalServicesProcessPluginDefinition.java | 8 +- .../dsf/bpe/service/ExtractInputValues.java | 6 +- .../highmed/dsf/bpe/service/StoreResult.java | 6 +- .../spring/config/LocalServicesConfig.java | 25 +- .../bpe/localServicesIntegration.bpmn | 20 +- .../highmed-localServicesIntegration.xml | 96 ++++---- ...ighmed-task-local-services-integration.xml | 6 +- ...ractLocalServicesMedic1ExampleStarter.java | 91 +++++++ ...calServicesMedic1DockerExampleStarter.java | 15 ++ .../LocalServicesMedic1ExampleStarter.java | 85 +------ .../ActivityDefinitionProfileTest.java | 69 ++++++ .../dsf/fhir/profile/TaskProfileTest.java | 4 +- .../dsf/bpe/PingProcessPluginDefinition.java | 10 +- .../org/highmed/dsf/bpe/message/SendPing.java | 5 +- .../org/highmed/dsf/bpe/message/SendPong.java | 5 +- .../org/highmed/dsf/bpe/service/LogPing.java | 6 +- .../org/highmed/dsf/bpe/service/LogPong.java | 6 +- .../dsf/bpe/service/SelectPingTargets.java | 21 +- .../dsf/bpe/service/SelectPongTarget.java | 27 +- .../dsf/bpe/spring/config/PingConfig.java | 22 +- .../src/main/resources/bpe/ping.bpmn | 19 +- .../src/main/resources/bpe/pong.bpmn | 31 ++- .../fhir/ActivityDefinition/highmed-ping.xml | 104 +++----- .../fhir/ActivityDefinition/highmed-pong.xml | 56 ++--- .../StructureDefinition/highmed-task-ping.xml | 6 +- .../StructureDefinition/highmed-task-pong.xml | 6 +- .../highmed-task-start-ping-process.xml | 6 +- ...stractPing3MedicFromTtpExampleStarter.java | 47 ++++ ...Ping3MedicFromTtpDockerExampleStarter.java | 15 ++ .../Ping3MedicFromTtpExampleStarter.java | 41 +--- .../ActivityDefinitionProfileTest.java | 89 +++++++ .../dsf/fhir/profiles/TaskProfileTest.java | 4 +- .../dsf/bpe/ConstantsUpdateAllowList.java | 2 +- ...pdateAllowListProcessPluginDefinition.java | 11 +- .../dsf/bpe/service/DownloadAllowList.java | 9 +- .../dsf/bpe/service/UpdateAllowList.java | 231 ++++++++++++------ .../spring/config/UpdateAllowListConfig.java | 10 +- .../main/resources/bpe/downloadAllowList.bpmn | 6 +- .../main/resources/bpe/updateAllowList.bpmn | 14 +- .../highmed-downloadAllowList.xml | 56 ++--- .../highmed-updateAllowList.xml | 56 ++--- .../CodeSystem/highmed-update-allow-list.xml | 34 +-- .../highmed-task-download-allow-list.xml | 8 +- .../highmed-task-update-allow-list.xml | 8 +- .../ValueSet/highmed-update-allow-list.xml | 25 +- ...lowListFromTtpViaMedic1ExampleStarter.java | 75 ++++++ ...pdateAllowList3MedicTtpExampleStarter.java | 47 ++++ ...tFromTtpViaMedic1DockerExampleStarter.java | 18 ++ ...lowListFromTtpViaMedic1ExampleStarter.java | 68 +----- ...llowList3MedicTtpDockerExampleStarter.java | 15 ++ ...pdateAllowList3MedicTtpExampleStarter.java | 41 +--- .../ActivityDefinitionProfileTest.java | 89 +++++++ .../dsf/fhir/profile/TaskProfileTest.java | 4 +- .../dsf/bpe/ConstantsUpdateResources.java | 2 + ...pdateResourcesProcessPluginDefinition.java | 10 +- .../highmed/dsf/bpe/message/SendRequest.java | 5 +- .../highmed/dsf/bpe/service/CheckRequest.java | 52 +--- .../dsf/bpe/service/DownloadBundle.java | 96 ++++++++ .../bpe/service/SelectResourceAndTargets.java | 16 +- .../dsf/bpe/service/UpdateResources.java | 38 +-- .../spring/config/UpdateResourcesConfig.java | 28 ++- .../resources/bpe/executeUpdateResources.bpmn | 48 ++-- .../resources/bpe/requestUpdateResources.bpmn | 9 +- .../highmed-executeUpdateResources.xml | 56 ++--- .../highmed-requestUpdateResources.xml | 56 ++--- .../CodeSystem/highmed-update-resources.xml | 40 +-- .../highmed-task-execute-update-resources.xml | 6 +- .../highmed-task-request-update-resources.xml | 6 +- .../ValueSet/highmed-update-resources.xml | 25 +- ...UpdateResource3MedicTtpExampleStarter.java | 81 ++++++ ...Resource3MedicTtpDockerExampleStarter.java | 15 ++ ...UpdateResource3MedicTtpExampleStarter.java | 75 +----- .../ActivityDefinitionProfileTest.java | 89 +++++++ .../dsf/fhir/profile/TaskProfileTest.java | 4 +- 121 files changed, 2510 insertions(+), 1561 deletions(-) create mode 100644 dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter.java create mode 100644 dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1DockerExampleStarter.java create mode 100644 dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java create mode 100644 dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/AbstractLocalServicesMedic1ExampleStarter.java create mode 100644 dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1DockerExampleStarter.java create mode 100644 dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java create mode 100644 dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/AbstractPing3MedicFromTtpExampleStarter.java create mode 100644 dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpDockerExampleStarter.java create mode 100644 dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/ActivityDefinitionProfileTest.java create mode 100644 dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/AbstractDownloadAllowListFromTtpViaMedic1ExampleStarter.java create mode 100644 dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/AbstractUpdateAllowList3MedicTtpExampleStarter.java create mode 100644 dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1DockerExampleStarter.java create mode 100644 dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpDockerExampleStarter.java create mode 100644 dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java create mode 100644 dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/DownloadBundle.java create mode 100644 dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/AbstractUpdateResource3MedicTtpExampleStarter.java create mode 100644 dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpDockerExampleStarter.java create mode 100644 dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index 48999d88..8bd27bbe 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -13,6 +13,7 @@ import org.highmed.dsf.fhir.resources.ResourceProvider; import org.highmed.dsf.fhir.resources.StructureDefinitionResource; import org.highmed.dsf.fhir.resources.ValueSetResource; +import org.springframework.core.env.PropertyResolver; import ca.uhn.fhir.context.FhirContext; @@ -45,7 +46,8 @@ public Stream> getSpringConfigClasses() } @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader, + PropertyResolver resolver) { var aCom = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-computeFeasibility.xml"); var aExe = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-executeFeasibility.xml"); @@ -64,12 +66,12 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader var vF = ValueSetResource.file("fhir/ValueSet/highmed-feasibility.xml"); - Map> resourcesByProcessKeyAndVersion = Map.of("computeFeasibility/" + VERSION, - Arrays.asList(aCom, cF, sTCom, sTResS, vF), "executeFeasibility/" + VERSION, - Arrays.asList(aExe, cF, sTExe, vF), "requestFeasibility/" + VERSION, - Arrays.asList(aReq, cF, sTReq, sTResM, sTErr, vF)); + Map> resourcesByProcessKeyAndVersion = Map.of( + "highmedorg_computeFeasibility/" + VERSION, Arrays.asList(aCom, cF, sTCom, sTResS, vF), + "highmedorg_executeFeasibility/" + VERSION, Arrays.asList(aExe, cF, sTExe, vF), + "highmedorg_requestFeasibility/" + VERSION, Arrays.asList(aReq, cF, sTReq, sTResM, sTErr, vF)); return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + classLoader, resolver, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java index e32f436c..83c00837 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java @@ -14,6 +14,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.variables.BloomFilterConfig; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -28,9 +29,9 @@ public class SendMedicRequest extends AbstractTaskMessageSend { public SendMedicRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider, FhirContext fhirContext) { - super(clientProvider, taskHelper, organizationProvider, fhirContext); + super(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Override diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java index 4735ae64..dc996bf4 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java @@ -6,6 +6,7 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -20,9 +21,9 @@ public class SendMultiMedicErrors extends AbstractTaskMessageSend { public SendMultiMedicErrors(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider, FhirContext fhirContext) { - super(clientProvider, taskHelper, organizationProvider, fhirContext); + super(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Override diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java index 6b3e8e68..ecba92d7 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java @@ -14,6 +14,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -29,9 +30,9 @@ public class SendMultiMedicResults extends AbstractTaskMessageSend { public SendMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider, FhirContext fhirContext) { - super(clientProvider, taskHelper, organizationProvider, fhirContext); + super(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Override diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java index 5cd7a69e..ba5fb173 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java @@ -11,6 +11,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -29,9 +30,9 @@ public class SendSingleMedicResults extends AbstractTaskMessageSend private static final Logger logger = LoggerFactory.getLogger(SendSingleMedicResults.class); public SendSingleMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider, FhirContext fhirContext) { - super(clientProvider, taskHelper, organizationProvider, fhirContext); + super(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Override diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java index 68851316..1992ec01 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java @@ -9,6 +9,7 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -21,9 +22,9 @@ public class SendTtpRequest extends AbstractTaskMessageSend { public SendTtpRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider, FhirContext fhirContext) { - super(clientProvider, taskHelper, organizationProvider, fhirContext); + super(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Override diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java index 421a0398..f5ae3c9a 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java @@ -14,14 +14,16 @@ import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; public class CalculateMultiMedicResults extends AbstractServiceDelegate { - public CalculateMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public CalculateMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java index edbca48c..1fe346a9 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java @@ -11,6 +11,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.FhirResourcesList; @@ -20,9 +21,10 @@ public class CheckFeasibilityResources extends AbstractServiceDelegate { - public CheckFeasibilityResources(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public CheckFeasibilityResources(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java index b2c527f0..d8f9f83e 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java @@ -14,6 +14,7 @@ import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.hl7.fhir.r4.model.Extension; @@ -25,9 +26,10 @@ public class CheckMultiMedicResults extends AbstractServiceDelegate { - public CheckMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public CheckMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java index 428b73a4..e2ca8358 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java @@ -1,5 +1,11 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES; +import static org.highmed.dsf.bpe.ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX; + import java.util.HashMap; import java.util.List; import java.util.Map; @@ -7,9 +13,8 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.group.GroupHelper; import org.highmed.dsf.fhir.task.TaskHelper; @@ -26,9 +31,11 @@ public class CheckQueries extends AbstractServiceDelegate implements Initializin private final GroupHelper groupHelper; - public CheckQueries(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, GroupHelper groupHelper) + public CheckQueries(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper, GroupHelper groupHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); + this.groupHelper = groupHelper; } @@ -36,14 +43,15 @@ public CheckQueries(FhirWebserviceClientProvider clientProvider, TaskHelper task public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); + Objects.requireNonNull(groupHelper, "groupHelper"); } @Override protected void doExecute(DelegateExecution execution) throws Exception { - List cohorts = ((FhirResourcesList) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS)).getResourcesAndCast(); + List cohorts = ((FhirResourcesList) execution.getVariable(BPMN_EXECUTION_VARIABLE_COHORTS)) + .getResourcesAndCast(); Map queries = new HashMap<>(); @@ -53,15 +61,15 @@ protected void doExecute(DelegateExecution execution) throws Exception String aqlQuery = groupHelper.extractAqlQuery(group); String groupId = group.getId(); - if (!aqlQuery.startsWith(ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX)) + if (!aqlQuery.startsWith(FEASIBILITY_QUERY_PREFIX)) { String errorMessage = "Initial single medic feasibility query check failed, wrong format for query of group with id '" - + groupId + "', expected query to start with '" + ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX - + "' but got '" + aqlQuery + "'"; + + groupId + "', expected query to start with '" + FEASIBILITY_QUERY_PREFIX + "' but got '" + + aqlQuery + "'"; logger.info(errorMessage); - leadingTask.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); + leadingTask.getOutput().add(getTaskHelper().createOutput(CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); } else { @@ -69,6 +77,6 @@ protected void doExecute(DelegateExecution execution) throws Exception } }); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES, queries); + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERIES, queries); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java index 831b9b55..019f2ea8 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java @@ -1,16 +1,19 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; + import java.util.ArrayList; import java.util.List; import java.util.Optional; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.hl7.fhir.r4.model.Task; @@ -21,16 +24,17 @@ public class CheckSingleMedicResults extends AbstractServiceDelegate { private static final Logger logger = LoggerFactory.getLogger(CheckSingleMedicResults.class); - public CheckSingleMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public CheckSingleMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); Task currentTask = getCurrentTaskFromExecutionVariables(); List filteredResults = filterErroneousResultsAndAddErrorsToCurrentTaskOutputs(results, @@ -38,7 +42,7 @@ protected void doExecute(DelegateExecution execution) throws Exception // TODO: add percentage filter over results - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(filteredResults))); } @@ -71,7 +75,7 @@ private void addError(Task task, String cohortId, String error) String errorMessage = "Feasibility query result check failed for group with id '" + cohortId + "': " + error; logger.info(errorMessage); - task.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); + task.getOutput().add(getTaskHelper().createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, + errorMessage)); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java index 709bad6b..fc7f1501 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java @@ -17,6 +17,7 @@ import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.hl7.fhir.r4.model.Task; @@ -27,9 +28,10 @@ public class CheckTtpComputedMultiMedicResults extends AbstractServiceDelegate { private static final Logger logger = LoggerFactory.getLogger(CheckTtpComputedMultiMedicResults.class); - public CheckTtpComputedMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public CheckTtpComputedMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java index 2090dbda..cf5b8b76 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java @@ -23,6 +23,7 @@ import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -46,10 +47,11 @@ public class DownloadFeasibilityResources extends AbstractServiceDelegate implem private final OrganizationProvider organizationProvider; - public DownloadFeasibilityResources(OrganizationProvider organizationProvider, - FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public DownloadFeasibilityResources(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); + this.organizationProvider = organizationProvider; } @@ -57,6 +59,7 @@ public DownloadFeasibilityResources(OrganizationProvider organizationProvider, public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); + Objects.requireNonNull(organizationProvider, "organizationProvider"); } @@ -110,7 +113,7 @@ private FhirWebserviceClient getWebserviceClient(IdType researchStudyId) } else { - return getFhirWebserviceClientProvider().getRemoteWebserviceClient(researchStudyId.getBaseUrl()); + return getFhirWebserviceClientProvider().getWebserviceClient(researchStudyId.getBaseUrl()); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java index 31841399..f18ba427 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java @@ -17,6 +17,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -37,10 +38,10 @@ public class DownloadResearchStudyResource extends AbstractServiceDelegate imple private final OrganizationProvider organizationProvider; - public DownloadResearchStudyResource(OrganizationProvider organizationProvider, - FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public DownloadResearchStudyResource(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); this.organizationProvider = organizationProvider; } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java index 5df78880..6f49b179 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java @@ -16,6 +16,7 @@ import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.fhir.client.FhirWebserviceClient; @@ -33,9 +34,9 @@ public class DownloadResultSets extends AbstractServiceDelegate private final ObjectMapper openEhrObjectMapper; public DownloadResultSets(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - ObjectMapper openEhrObjectMapper) + ReadAccessHelper readAccessHelper, ObjectMapper openEhrObjectMapper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); this.openEhrObjectMapper = openEhrObjectMapper; } @@ -68,7 +69,7 @@ private List download(FeasibilityQueryResults results) private FeasibilityQueryResult download(FeasibilityQueryResult result) { IdType id = new IdType(result.getResultSetUrl()); - FhirWebserviceClient client = getFhirWebserviceClientProvider().getRemoteWebserviceClient(id.getBaseUrl()); + FhirWebserviceClient client = getFhirWebserviceClientProvider().getWebserviceClient(id.getBaseUrl()); InputStream binary = readBinaryResource(client, id.getIdPart()); ResultSet resultSet = deserializeResultSet(binary); diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java index a2ae34df..7c814ecd 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java @@ -1,16 +1,21 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; + import java.util.List; import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -24,9 +29,9 @@ public class ExecuteQueries extends AbstractServiceDelegate implements Initializ private final OrganizationProvider organizationProvider; public ExecuteQueries(FhirWebserviceClientProvider clientProvider, OpenEhrClient openehrClient, - TaskHelper taskHelper, OrganizationProvider organizationProvider) + TaskHelper taskHelper, ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); this.openehrClient = openehrClient; this.organizationProvider = organizationProvider; @@ -46,19 +51,16 @@ protected void doExecute(DelegateExecution execution) throws Exception { // @SuppressWarnings("unchecked") - Map queries = (Map) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES); + Map queries = (Map) execution.getVariable(BPMN_EXECUTION_VARIABLE_QUERIES); - Boolean needsConsentCheck = (Boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); - Boolean needsRecordLinkage = (Boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); + Boolean needsConsentCheck = (Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); + Boolean needsRecordLinkage = (Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); boolean idQuery = Boolean.TRUE.equals(needsConsentCheck) || Boolean.TRUE.equals(needsRecordLinkage); List results = queries.entrySet().stream() .map(entry -> executeQuery(entry.getKey(), entry.getValue(), idQuery)).collect(Collectors.toList()); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(results))); } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java index da6d2119..34159b7d 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java @@ -1,5 +1,8 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; + import java.util.List; import java.util.Map; import java.util.Objects; @@ -7,13 +10,13 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.pseudonymization.domain.PersonWithMdat; @@ -31,9 +34,9 @@ public class ExecuteRecordLink extends AbstractServiceDelegate private final ResultSetTranslatorFromMedicRbfOnly translator; public ExecuteRecordLink(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - ResultSetTranslatorFromMedicRbfOnly translator) + ReadAccessHelper readAccessHelper, ResultSetTranslatorFromMedicRbfOnly translator) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); this.translator = translator; } @@ -50,7 +53,7 @@ public void afterPropertiesSet() throws Exception protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); Map> byCohortId = results.getResults().stream() .collect(Collectors.groupingBy(FeasibilityQueryResult::getCohortId)); @@ -60,7 +63,7 @@ protected void doExecute(DelegateExecution execution) throws Exception List matchedResults = byCohortId.entrySet().stream() .map(e -> match(matcher, e.getKey(), e.getValue())).collect(Collectors.toList()); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, FinalFeasibilityQueryResultsValues.create(new FinalFeasibilityQueryResults(matchedResults))); } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java index ebdb9f02..7a16b970 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java @@ -1,34 +1,37 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; + import java.util.List; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.openehr.model.structure.ResultSet; public class FilterQueryResultsByConsent extends AbstractServiceDelegate { - public FilterQueryResultsByConsent(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public FilterQueryResultsByConsent(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); List filteredResults = filterResults(results.getResults()); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(filteredResults))); } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java index 6a10c6b1..677c0a23 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java @@ -1,11 +1,11 @@ package org.highmed.dsf.bpe.service; import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsBase.OPENEHR_MIMETYPE_JSON; import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI; +import static org.highmed.pseudonymization.translation.ResultSetTranslatorToTtpRbfOnlyImpl.FILTER_ON_IDAT_NOT_FOUND_EXCEPTION; import java.security.Key; import java.util.List; @@ -19,6 +19,7 @@ import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.mpi.client.MasterPatientIndexClient; @@ -32,7 +33,6 @@ import org.highmed.pseudonymization.translation.ResultSetTranslatorToTtpRbfOnlyImpl; import org.hl7.fhir.r4.model.Binary; import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.Task; import org.slf4j.Logger; @@ -58,10 +58,11 @@ public class GenerateBloomFilters extends AbstractServiceDelegate private final BouncyCastleProvider bouncyCastleProvider; public GenerateBloomFilters(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - String ehrIdColumnPath, MasterPatientIndexClient masterPatientIndexClient, ObjectMapper openEhrObjectMapper, + ReadAccessHelper readAccessHelper, String ehrIdColumnPath, + MasterPatientIndexClient masterPatientIndexClient, ObjectMapper openEhrObjectMapper, BouncyCastleProvider bouncyCastleProvider) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); this.ehrIdColumnPath = ehrIdColumnPath; this.masterPatientIndexClient = masterPatientIndexClient; @@ -116,7 +117,7 @@ protected ResultSetTranslatorToTtpRbfOnly createResultSetTranslator(BloomFilterC return new ResultSetTranslatorToTtpRbfOnlyImpl(ehrIdColumnPath, createRecordBloomFilterGenerator(bloomFilterConfig.getPermutationSeed(), bloomFilterConfig.getHmacSha2Key(), bloomFilterConfig.getHmacSha3Key()), - masterPatientIndexClient, ResultSetTranslatorToTtpRbfOnlyImpl.FILTER_ON_IDAT_NOT_FOUND_EXCEPTION); + masterPatientIndexClient, FILTER_ON_IDAT_NOT_FOUND_EXCEPTION); } protected RecordBloomFilterGenerator createRecordBloomFilterGenerator(long permutationSeed, Key hmacSha2Key, @@ -149,14 +150,12 @@ private ResultSet translate(ResultSetTranslatorToTtpRbfOnly resultSetTranslator, } } - protected String saveResultSetAsBinaryForTtp(ResultSet resultSet, String securityIdentifier) + protected String saveResultSetAsBinaryForTtp(ResultSet resultSet, String ttpIdentifier) { byte[] content = serializeResultSet(resultSet); - Reference securityContext = new Reference(); - securityContext.setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue(securityIdentifier); - Binary binary = new Binary().setContentType(OPENEHR_MIMETYPE_JSON).setSecurityContext(securityContext) - .setData(content); + Binary binary = new Binary().setContentType(OPENEHR_MIMETYPE_JSON).setData(content); + getReadAccessHelper().addLocal(binary); + getReadAccessHelper().addOrganization(binary, ttpIdentifier); IdType created = createBinaryResource(binary); return new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl(), ResourceType.Binary.name(), diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java index ef41cf4e..ccc83771 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java @@ -1,33 +1,36 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; + import java.util.List; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; public class GenerateCountFromIds extends AbstractServiceDelegate { - public GenerateCountFromIds(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public GenerateCountFromIds(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); List filteredResults = count(results.getResults()); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(filteredResults))); } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java index 6b55accd..79161ffd 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java @@ -1,17 +1,21 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; + import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.hl7.fhir.r4.model.Task; public class HandleErrorMultiMedicResults extends AbstractServiceDelegate { - public HandleErrorMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public HandleErrorMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override @@ -23,13 +27,13 @@ protected void doExecute(DelegateExecution execution) throws Exception currentTask.getInput().forEach(input -> { boolean isErrorInput = input.getType().getCoding().stream() - .anyMatch(code -> code.getSystem().equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN) - && code.getCode().equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR)); + .anyMatch(code -> code.getSystem().equals(CODESYSTEM_HIGHMED_BPMN) + && code.getCode().equals(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR)); if (isErrorInput) { - leadingTask.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, input.getValue().primitiveValue())); + leadingTask.getOutput().add(getTaskHelper().createOutput(CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, input.getValue().primitiveValue())); } }); diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java index 83cc1bb9..1df227ae 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java @@ -11,6 +11,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.springframework.beans.factory.InitializingBean; @@ -19,9 +20,11 @@ public class ModifyQueries extends AbstractServiceDelegate implements Initializi { private final String ehrIdColumnPath; - public ModifyQueries(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, String ehrIdColumnPath) + public ModifyQueries(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper, String ehrIdColumnPath) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); + this.ehrIdColumnPath = ehrIdColumnPath; } @@ -29,6 +32,7 @@ public ModifyQueries(FhirWebserviceClientProvider clientProvider, TaskHelper tas public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); + Objects.requireNonNull(ehrIdColumnPath, "ehrIdColumnPath"); } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java index 016da37b..08795a72 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java @@ -1,7 +1,13 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP; import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_HIGHMED_CONSORTIUM; import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; @@ -17,17 +23,19 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider; 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.BloomFilterConfig; import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; +import org.highmed.dsf.fhir.organization.EndpointProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.Target; import org.highmed.dsf.fhir.variables.TargetValues; import org.highmed.dsf.fhir.variables.Targets; import org.highmed.dsf.fhir.variables.TargetsValues; +import org.hl7.fhir.r4.model.Extension; +import org.hl7.fhir.r4.model.Identifier; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResearchStudy; @@ -35,16 +43,17 @@ public class SelectRequestTargets extends AbstractServiceDelegate { private static final Random random = new Random(); - private final OrganizationProvider organizationProvider; + private final EndpointProvider endpointProvider; private final KeyGenerator hmacSha2Generator; private final KeyGenerator hmacSha3Generator; public SelectRequestTargets(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, BouncyCastleProvider bouncyCastleProvider) + ReadAccessHelper readAccessHelper, EndpointProvider endpointProvider, + BouncyCastleProvider bouncyCastleProvider) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); - this.organizationProvider = organizationProvider; + this.endpointProvider = endpointProvider; try { @@ -63,7 +72,8 @@ public SelectRequestTargets(FhirWebserviceClientProvider clientProvider, TaskHel public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); - Objects.requireNonNull(organizationProvider, "organizationProvider"); + + Objects.requireNonNull(endpointProvider, "endpointProvider"); } @Override @@ -71,11 +81,8 @@ protected void doExecute(DelegateExecution execution) throws Exception { ResearchStudy researchStudy = (ResearchStudy) execution.getVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, - TargetsValues.create(getMedicTargets(researchStudy))); - - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, - TargetValues.create(getTtpTarget(researchStudy))); + execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(getMedicTargets(researchStudy))); + execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(getTtpTarget(researchStudy))); Boolean needsRecordLinkage = (Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); if (Boolean.TRUE.equals(needsRecordLinkage)) @@ -94,8 +101,12 @@ private BloomFilterConfig createBloomFilterConfig() private Targets getMedicTargets(ResearchStudy researchStudy) { List targets = researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).stream() - .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> Target.createBiDirectionalTarget(r.getIdentifier().getValue(), UUID.randomUUID().toString())) + .filter(Extension::hasValue).map(Extension::getValue).filter(v -> v instanceof Reference) + .map(v -> (Reference) v).filter(Reference::hasIdentifier).map(Reference::getIdentifier) + .filter(Identifier::hasValue).map(Identifier::getValue) + .map(medicIdentifier -> Target.createBiDirectionalTarget(medicIdentifier, + getAddress(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC, medicIdentifier), + UUID.randomUUID().toString())) .collect(Collectors.toList()); return new Targets(targets); @@ -104,7 +115,19 @@ private Targets getMedicTargets(ResearchStudy researchStudy) private Target getTtpTarget(ResearchStudy researchStudy) { return researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP).stream() - .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> Target.createUniDirectionalTarget(r.getIdentifier().getValue())).findFirst().get(); + .filter(Extension::hasValue).map(Extension::getValue).filter(v -> v instanceof Reference) + .map(v -> (Reference) v).filter(Reference::hasIdentifier).map(Reference::getIdentifier) + .filter(Identifier::hasValue).map(Identifier::getValue) + .map(ttpIdentifier -> Target.createUniDirectionalTarget(ttpIdentifier, + getAddress(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP, ttpIdentifier))) + .findFirst().get(); + } + + private String getAddress(String role, String identifier) + { + return endpointProvider + .getFirstConsortiumEndpointAdress(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_HIGHMED_CONSORTIUM, + CODESYSTEM_HIGHMED_ORGANIZATION_TYPE, role, identifier) + .get(); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java index 5e078184..c087f26c 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java @@ -1,28 +1,32 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_HIGHMED_CONSORTIUM; + import java.util.Objects; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; +import org.highmed.dsf.fhir.organization.EndpointProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.Target; import org.highmed.dsf.fhir.variables.TargetValues; -import org.hl7.fhir.r4.model.Task; import org.springframework.beans.factory.InitializingBean; public class SelectResponseTargetMedic extends AbstractServiceDelegate implements InitializingBean { - private final OrganizationProvider organizationProvider; + private final EndpointProvider endpointProvider; public SelectResponseTargetMedic(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) + ReadAccessHelper readAccessHelper, EndpointProvider endpointProvider) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); - this.organizationProvider = organizationProvider; + this.endpointProvider = endpointProvider; } @Override @@ -30,15 +34,19 @@ public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); - Objects.requireNonNull(organizationProvider, "organizationProvider"); + Objects.requireNonNull(endpointProvider, "endpointProvider"); } @Override protected void doExecute(DelegateExecution execution) throws Exception { - Task task = getLeadingTaskFromExecutionVariables(); - - Target medicTarget = Target.createUniDirectionalTarget(task.getRequester().getIdentifier().getValue()); - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(medicTarget)); + String medicIndentifier = getLeadingTaskFromExecutionVariables().getRequester().getIdentifier().getValue(); + + Target medicTarget = Target.createUniDirectionalTarget(medicIndentifier, + endpointProvider.getFirstConsortiumEndpointAdress( + NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_HIGHMED_CONSORTIUM, + CODESYSTEM_HIGHMED_ORGANIZATION_TYPE, CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC, + medicIndentifier).get()); + execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(medicTarget)); } } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java index 7c08e1b0..328701e1 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java @@ -1,12 +1,20 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_HIGHMED_CONSORTIUM; + import java.util.Objects; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; +import org.highmed.dsf.fhir.organization.EndpointProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.Target; import org.highmed.dsf.fhir.variables.TargetValues; @@ -15,30 +23,37 @@ public class SelectResponseTargetTtp extends AbstractServiceDelegate implements InitializingBean { - private final OrganizationProvider organizationProvider; + private final EndpointProvider endpointProvider; public SelectResponseTargetTtp(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) + ReadAccessHelper readAccessHelper, EndpointProvider endpointProvider) { - super(clientProvider, taskHelper); - this.organizationProvider = organizationProvider; + super(clientProvider, taskHelper, readAccessHelper); + + this.endpointProvider = endpointProvider; } @Override public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); - Objects.requireNonNull(organizationProvider, "organizationProvider"); + + Objects.requireNonNull(endpointProvider, "endpointProvider"); } @Override protected void doExecute(DelegateExecution execution) throws Exception { - String ttpIdentifier = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER); + String ttpIdentifier = (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER); String correlationKey = getCorrelationKey(execution); - Target ttpTarget = Target.createBiDirectionalTarget(ttpIdentifier, correlationKey); - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(ttpTarget)); + Target ttpTarget = Target.createBiDirectionalTarget(ttpIdentifier, + endpointProvider.getFirstConsortiumEndpointAdress( + NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_HIGHMED_CONSORTIUM, + CODESYSTEM_HIGHMED_ORGANIZATION_TYPE, CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP, + ttpIdentifier).get(), + correlationKey); + execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(ttpTarget)); } private String getCorrelationKey(DelegateExecution execution) @@ -46,8 +61,8 @@ private String getCorrelationKey(DelegateExecution execution) Task task = getCurrentTaskFromExecutionVariables(); return getTaskHelper() - .getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY) + .getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY) .orElseThrow(() -> new IllegalStateException( "No correlation key found, this error should have been caught by resource validation")); } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java index aab08ec4..ab70cc74 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS; import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; @@ -10,10 +11,10 @@ import java.util.stream.Collectors; 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.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.Target; @@ -23,9 +24,10 @@ public class StoreCorrelationKeys extends AbstractServiceDelegate { - public StoreCorrelationKeys(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public StoreCorrelationKeys(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override @@ -36,11 +38,10 @@ protected void doExecute(DelegateExecution execution) throws Exception List targets = getTaskHelper() .getInputParameterStringValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY) - .map(correlationKey -> Target.createBiDirectionalTarget("", correlationKey)) + .map(correlationKey -> Target.createBiDirectionalTarget("", "", correlationKey)) .collect(Collectors.toList()); - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, - TargetsValues.create(new Targets(targets))); + execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java index c57b9c56..9ebdab5d 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java @@ -17,6 +17,7 @@ import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -30,9 +31,9 @@ public class StoreResults extends AbstractServiceDelegate implements Initializin private final OrganizationProvider organizationProvider; public StoreResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); this.organizationProvider = organizationProvider; } @@ -97,5 +98,4 @@ private List getResults(Task task, boolean needsRecordLi }).collect(Collectors.toList()); } } - } diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java index 1abc6a6a..b674a878 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java @@ -27,8 +27,10 @@ import org.highmed.dsf.bpe.service.SelectResponseTargetTtp; import org.highmed.dsf.bpe.service.StoreCorrelationKeys; import org.highmed.dsf.bpe.service.StoreResults; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.group.GroupHelper; +import org.highmed.dsf.fhir.organization.EndpointProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.mpi.client.MasterPatientIndexClient; @@ -62,9 +64,15 @@ public class FeasibilityConfig @Autowired private OrganizationProvider organizationProvider; + @Autowired + private EndpointProvider endpointProvider; + @Autowired private TaskHelper taskHelper; + @Autowired + private ReadAccessHelper readAccessHelper; + @Autowired private GroupHelper groupHelper; @@ -87,37 +95,40 @@ public class FeasibilityConfig @Bean public DownloadResearchStudyResource downloadResearchStudyResource() { - return new DownloadResearchStudyResource(organizationProvider, fhirClientProvider, taskHelper); + return new DownloadResearchStudyResource(fhirClientProvider, taskHelper, readAccessHelper, + organizationProvider); } @Bean public SelectRequestTargets selectRequestTargets() { - return new SelectRequestTargets(fhirClientProvider, taskHelper, organizationProvider, bouncyCastleProvider()); + return new SelectRequestTargets(fhirClientProvider, taskHelper, readAccessHelper, endpointProvider, + bouncyCastleProvider()); } @Bean public SendTtpRequest sendTtpRequest() { - return new SendTtpRequest(fhirClientProvider, taskHelper, organizationProvider, fhirContext); + return new SendTtpRequest(fhirClientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Bean public SendMedicRequest sendMedicRequest() { - return new SendMedicRequest(fhirClientProvider, taskHelper, organizationProvider, fhirContext); + return new SendMedicRequest(fhirClientProvider, taskHelper, readAccessHelper, organizationProvider, + fhirContext); } @Bean public CheckMultiMedicResults checkMultiMedicResults() { - return new CheckMultiMedicResults(fhirClientProvider, taskHelper); + return new CheckMultiMedicResults(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public HandleErrorMultiMedicResults handleErrorMultiMedicResults() { - return new HandleErrorMultiMedicResults(fhirClientProvider, taskHelper); + return new HandleErrorMultiMedicResults(fhirClientProvider, taskHelper, readAccessHelper); } // @@ -127,43 +138,44 @@ public HandleErrorMultiMedicResults handleErrorMultiMedicResults() @Bean public DownloadFeasibilityResources downloadFeasibilityResources() { - return new DownloadFeasibilityResources(organizationProvider, fhirClientProvider, taskHelper); + return new DownloadFeasibilityResources(fhirClientProvider, taskHelper, readAccessHelper, organizationProvider); } @Bean public CheckFeasibilityResources checkFeasibilityResources() { - return new CheckFeasibilityResources(fhirClientProvider, taskHelper); + return new CheckFeasibilityResources(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public CheckQueries checkQueries() { - return new CheckQueries(fhirClientProvider, taskHelper, groupHelper); + return new CheckQueries(fhirClientProvider, taskHelper, readAccessHelper, groupHelper); } @Bean public ModifyQueries modifyQueries() { - return new ModifyQueries(fhirClientProvider, taskHelper, ehrIdColumnPath); + return new ModifyQueries(fhirClientProvider, taskHelper, readAccessHelper, ehrIdColumnPath); } @Bean public ExecuteQueries executeQueries() { - return new ExecuteQueries(fhirClientProvider, openEhrClient(), taskHelper, organizationProvider); + return new ExecuteQueries(fhirClientProvider, openEhrClient(), taskHelper, readAccessHelper, + organizationProvider); } @Bean public FilterQueryResultsByConsent filterQueryResultsByConsent() { - return new FilterQueryResultsByConsent(fhirClientProvider, taskHelper); + return new FilterQueryResultsByConsent(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public GenerateCountFromIds generateCountFromIds() { - return new GenerateCountFromIds(fhirClientProvider, taskHelper); + return new GenerateCountFromIds(fhirClientProvider, taskHelper, readAccessHelper); } @Bean @@ -181,8 +193,8 @@ public OpenEhrClient openEhrClient() @Bean public GenerateBloomFilters generateBloomFilters() { - return new GenerateBloomFilters(fhirClientProvider, taskHelper, ehrIdColumnPath, masterPatientIndexClient(), - objectMapper, bouncyCastleProvider()); + return new GenerateBloomFilters(fhirClientProvider, taskHelper, readAccessHelper, ehrIdColumnPath, + masterPatientIndexClient(), objectMapper, bouncyCastleProvider()); } @Bean @@ -194,19 +206,20 @@ public BouncyCastleProvider bouncyCastleProvider() @Bean public CheckSingleMedicResults checkSingleMedicResults() { - return new CheckSingleMedicResults(fhirClientProvider, taskHelper); + return new CheckSingleMedicResults(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public SelectResponseTargetTtp selectResponseTargetTtp() { - return new SelectResponseTargetTtp(fhirClientProvider, taskHelper, organizationProvider); + return new SelectResponseTargetTtp(fhirClientProvider, taskHelper, readAccessHelper, endpointProvider); } @Bean public SendSingleMedicResults sendSingleMedicResults() { - return new SendSingleMedicResults(fhirClientProvider, taskHelper, organizationProvider, fhirContext); + return new SendSingleMedicResults(fhirClientProvider, taskHelper, readAccessHelper, organizationProvider, + fhirContext); } // @@ -216,19 +229,19 @@ public SendSingleMedicResults sendSingleMedicResults() @Bean public StoreCorrelationKeys storeCorrelationKeys() { - return new StoreCorrelationKeys(fhirClientProvider, taskHelper); + return new StoreCorrelationKeys(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public StoreResults storeResults() { - return new StoreResults(fhirClientProvider, taskHelper, organizationProvider); + return new StoreResults(fhirClientProvider, taskHelper, readAccessHelper, organizationProvider); } @Bean public DownloadResultSets downloadResultSets() { - return new DownloadResultSets(fhirClientProvider, taskHelper, objectMapper); + return new DownloadResultSets(fhirClientProvider, taskHelper, readAccessHelper, objectMapper); } @Bean @@ -240,36 +253,39 @@ public ResultSetTranslatorFromMedicRbfOnly resultSetTranslatorFromMedicRbfOnly() @Bean public ExecuteRecordLink executeRecordLink() { - return new ExecuteRecordLink(fhirClientProvider, taskHelper, resultSetTranslatorFromMedicRbfOnly()); + return new ExecuteRecordLink(fhirClientProvider, taskHelper, readAccessHelper, + resultSetTranslatorFromMedicRbfOnly()); } @Bean public CalculateMultiMedicResults calculateMultiMedicResults() { - return new CalculateMultiMedicResults(fhirClientProvider, taskHelper); + return new CalculateMultiMedicResults(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public CheckTtpComputedMultiMedicResults checkTtpComputedMultiMedicResults() { - return new CheckTtpComputedMultiMedicResults(fhirClientProvider, taskHelper); + return new CheckTtpComputedMultiMedicResults(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public SelectResponseTargetMedic selectResponseTargetMedic() { - return new SelectResponseTargetMedic(fhirClientProvider, taskHelper, organizationProvider); + return new SelectResponseTargetMedic(fhirClientProvider, taskHelper, readAccessHelper, endpointProvider); } @Bean public SendMultiMedicResults sendMultiMedicResults() { - return new SendMultiMedicResults(fhirClientProvider, taskHelper, organizationProvider, fhirContext); + return new SendMultiMedicResults(fhirClientProvider, taskHelper, readAccessHelper, organizationProvider, + fhirContext); } @Bean public SendMultiMedicErrors sendMultiMedicErrors() { - return new SendMultiMedicErrors(fhirClientProvider, taskHelper, organizationProvider, fhirContext); + return new SendMultiMedicErrors(fhirClientProvider, taskHelper, readAccessHelper, organizationProvider, + fhirContext); } } diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn index 18ccd7a4..07f17b2e 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn @@ -1,6 +1,6 @@ - - + + SequenceFlow_1lfe4wr SequenceFlow_0xxpamp @@ -45,10 +45,9 @@ - requestFeasibility - http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility - 0.5.0 + http://highmed.org/bpe/Process/requestFeasibility/0.5.0 resultMultiMedicFeasibilityMessage + http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility Flow_1r6dq8y @@ -97,10 +96,9 @@ - requestFeasibility - http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility - 0.5.0 + http://highmed.org/bpe/Process/requestFeasibility/0.5.0 errorMultiMedicFeasibilityMessage + http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility Flow_1tmnvhl @@ -125,7 +123,7 @@ - + diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn index 28ecd7dc..6e1ba9f2 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn @@ -1,6 +1,6 @@ - - + + SequenceFlow_0q803rh SequenceFlow_04ouilq @@ -24,9 +24,8 @@ + http://highmed.org/bpe/Process/computeFeasibility/0.5.0 resultSingleMedicFeasibilityMessage - 0.5.0 - computeFeasibility http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility @@ -132,7 +131,7 @@ - + diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn index 120b1ce3..e9e704df 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn @@ -1,6 +1,6 @@ - - + + SequenceFlow_11k77gx @@ -12,8 +12,7 @@ - executeFeasibility - 0.5.0 + http://highmed.org/bpe/Process/executeFeasibility/0.5.0 executeFeasibilityMessage http://highmed.org/fhir/StructureDefinition/task-execute-feasibility @@ -33,8 +32,7 @@ - computeFeasibility - 0.5.0 + http://highmed.org/bpe/Process/computeFeasibility/0.5.0 computeFeasibilityMessage http://highmed.org/fhir/StructureDefinition/task-compute-feasibility @@ -97,7 +95,7 @@ - + diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml index 2350bef3..2b8becf9 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml @@ -1,84 +1,116 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + <subtitle value="Process to compute feasibility result" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml index 0cfb4c67..e98c22a7 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml @@ -1,58 +1,88 @@ <ActivityDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="executeFeasibilityMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> + <extension url="task-profile"> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> + <extension url="requester"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="MeDIC" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ROLE" /> + </valueCoding> </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> + <extension url="requester"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="MeDIC" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="REMOTE_ROLE" /> + </valueCoding> </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> + <extension url="recipient"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="MeDIC" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ROLE" /> + </valueCoding> </extension> </extension> <url value="http://highmed.org/bpe/Process/executeFeasibility" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="executeFeasibility" /> + <name value="ExecuteFeasibility" /> <title value="Execute a Feasibility" /> <subtitle value="Process to execute a feasibility query" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml index 3e038f8a..c033d843 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml @@ -1,116 +1,164 @@ <ActivityDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="requestFeasibilityMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> + <extension url="task-profile"> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility" /> </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> + <extension url="requester"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="MeDIC" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ROLE" /> + </valueCoding> </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-feasibility" /> + <extension url="recipient"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="MeDIC" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ROLE" /> + </valueCoding> </extension> </extension> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="resultMultiMedicFeasibilityMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility" /> </extension> + <extension url="requester"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="TTP" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="REMOTE_ROLE" /> + </valueCoding> + </extension> + <extension url="recipient"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="MeDIC" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ROLE" /> + </valueCoding> + </extension> </extension> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="errorMultiMedicFeasibilityMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility" /> </extension> + <extension url="requester"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="TTP" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="REMOTE_ROLE" /> + </valueCoding> + </extension> + <extension url="recipient"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="MeDIC" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ROLE" /> + </valueCoding> + </extension> </extension> <url value="http://highmed.org/bpe/Process/requestFeasibility" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="requestFeasibility" /> + <name value="RequestFeasibility" /> <title value="Request feasibility" /> <subtitle value="Feasibility Request Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml index dc13d98e..9be78431 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml @@ -1,68 +1,68 @@ <CodeSystem xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> + </tag> </meta> - <url value="http://highmed.org/fhir/CodeSystem/feasibility"/> + <url value="http://highmed.org/fhir/CodeSystem/feasibility" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="HiGHmed_Feasibility"/> - <title value="HiGHmed Feasibility"/> + <name value="HiGHmed_Feasibility" /> + <title value="HiGHmed Feasibility" /> <!-- status managed by bpe --> <status value="unknown" /> - <experimental value="false"/> - <date value="2021-01-26"/> - <publisher value="HiGHmed"/> - <description value="CodeSystem with standard values for feasibility processes"/> - <caseSensitive value="true"/> - <hierarchyMeaning value="grouped-by"/> - <versionNeeded value="false"/> - <content value="complete"/> - <concept> - <code value="research-study-reference"/> - <display value="Research Study Reference"/> - <definition value="HiGHmed Research Study Reference to define what data is requested from which MeDICs and for what purpose"/> + <experimental value="false" /> + <date value="2021-01-26" /> + <publisher value="HiGHmed" /> + <description value="CodeSystem with standard values for feasibility processes" /> + <caseSensitive value="true" /> + <hierarchyMeaning value="grouped-by" /> + <versionNeeded value="false" /> + <content value="complete" /> + <concept> + <code value="research-study-reference" /> + <display value="Research Study Reference" /> + <definition value="HiGHmed Research Study Reference to define what data is requested from which MeDICs and for what purpose" /> </concept> <concept> - <code value="needs-record-linkage"/> - <display value="Needs Record Linkage"/> - <definition value="Boolean indicating if a data analysis needs record linkage"/> + <code value="needs-record-linkage" /> + <display value="Needs Record Linkage" /> + <definition value="Boolean indicating if a data analysis needs record linkage" /> </concept> <concept> - <code value="needs-consent-check"/> - <display value="Needs Consent Check"/> - <definition value="Boolean indicating if a data analysis needs consent check"/> + <code value="needs-consent-check" /> + <display value="Needs Consent Check" /> + <definition value="Boolean indicating if a data analysis needs consent check" /> </concept> <concept> - <code value="bloom-filter-configuration"/> - <display value="Bloom Filter Cconfiguration"/> - <definition value="Base64 binary encoded bloom filter configuration"/> + <code value="bloom-filter-configuration" /> + <display value="Bloom Filter Cconfiguration" /> + <definition value="Base64 binary encoded bloom filter configuration" /> </concept> <concept> - <code value="medic-correlation-key"/> - <display value="MeDIC Correlation Key"/> - <definition value="MeDIC Correlation Key transfered to TTP for correlating incoming medic results"/> + <code value="medic-correlation-key" /> + <display value="MeDIC Correlation Key" /> + <definition value="MeDIC Correlation Key transfered to TTP for correlating incoming medic results" /> </concept> <concept> - <code value="single-medic-result"/> - <display value="Single MeDIC Result"/> - <definition value="Result of a single feasibility query execution"/> + <code value="single-medic-result" /> + <display value="Single MeDIC Result" /> + <definition value="Result of a single feasibility query execution" /> </concept> <concept> - <code value="single-medic-result-reference"/> - <display value="Single MeDIC Result Reference"/> - <definition value="Reference to an openEHR ResultSet as a result of a single feasibility query execution"/> + <code value="single-medic-result-reference" /> + <display value="Single MeDIC Result Reference" /> + <definition value="Reference to an openEHR ResultSet as a result of a single feasibility query execution" /> </concept> <concept> - <code value="participating-medics"/> - <display value="Participating MeDICs"/> - <definition value="Count of all MeDICs who participated in a feasibility query"/> + <code value="participating-medics" /> + <display value="Participating MeDICs" /> + <definition value="Count of all MeDICs who participated in a feasibility query" /> </concept> <concept> - <code value="multi-medic-result"/> - <display value="Multi MeDIC Result"/> - <definition value="Aggregated result of all single medic results"/> + <code value="multi-medic-result" /> + <display value="Multi MeDIC Result" /> + <definition value="Aggregated result of all single medic results" /> </concept> </CodeSystem> \ No newline at end of file diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml index 748ad5d0..63005a24 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml index 8a2d65a4..fb1002ff 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml @@ -1,9 +1,8 @@ -<?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" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility" /> @@ -13,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml index 613de1d9..2052b375 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml index 26ee63ab..cfbbabb4 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml index 40c7c523..4b17dac7 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml index e93132dc..46199c9d 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml index 1595f413..4d1d41b3 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml @@ -1,25 +1,25 @@ <ValueSet xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> + </tag> </meta> - <url value="http://highmed.org/fhir/ValueSet/feasibility"/> + <url value="http://highmed.org/fhir/ValueSet/feasibility" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="HiGHmed_Feasibility"/> - <title value="HiGHmed Feasibility"/> + <name value="HiGHmed_Feasibility" /> + <title value="HiGHmed Feasibility" /> <!-- status managed by bpe --> <status value="unknown" /> - <experimental value="false"/> - <date value="2021-01-26"/> - <publisher value="HiGHmed"/> - <description value="ValueSet with standard values for feasibility processes"/> - <immutable value="true"/> + <experimental value="false" /> + <date value="2021-06-09" /> + <publisher value="HiGHmed" /> + <description value="ValueSet with standard values for feasibility processes" /> + <immutable value="true" /> <compose> <include> - <system value="http://highmed.org/fhir/CodeSystem/feasibility"/> + <system value="http://highmed.org/fhir/CodeSystem/feasibility" /> </include> </compose> </ValueSet> \ No newline at end of file diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter.java new file mode 100644 index 00000000..3fff453f --- /dev/null +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -0,0 +1,167 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.CODE_TYPE_AQL_QUERY; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHEMD_RESEARCH_STUDY; +import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHMED_GROUP; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; + +import java.util.Arrays; +import java.util.Date; +import java.util.UUID; + +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelperImpl; +import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleType; +import org.hl7.fhir.r4.model.Bundle.HTTPVerb; +import org.hl7.fhir.r4.model.Expression; +import org.hl7.fhir.r4.model.Group; +import org.hl7.fhir.r4.model.Group.GroupType; +import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.Identifier; +import org.hl7.fhir.r4.model.Narrative; +import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.ResearchStudy; +import org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus; +import org.hl7.fhir.r4.model.ResourceType; +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; + +public abstract class AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter +{ + private final String[] medicIdentifier = new String[] { NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1, + NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2, + NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3 }; + private final String ttpIdentifier = NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; + + private final ReadAccessHelper readAccessHelper = new ReadAccessHelperImpl(); + + protected void main(String[] args, String baseUrl) throws Exception + { + Bundle bundle = createStartResource(); + ExampleStarter.forServer(args, baseUrl).startWith(bundle); + } + + private Bundle createStartResource() + { + Group group1 = createGroup("Group 1"); + Group group2 = createGroup("Group 2"); + ResearchStudy researchStudy = createResearchStudy(group1, group2); + Task task = createTask(researchStudy); + + Bundle bundle = new Bundle(); + bundle.setType(BundleType.TRANSACTION); + bundle.addEntry().setResource(group1).setFullUrl(group1.getIdElement().getIdPart()).getRequest() + .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); + bundle.addEntry().setResource(group2).setFullUrl(group2.getIdElement().getIdPart()).getRequest() + .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); + bundle.addEntry().setResource(researchStudy).setFullUrl(researchStudy.getIdElement().getIdPart()).getRequest() + .setMethod(HTTPVerb.POST).setUrl(ResourceType.ResearchStudy.name()); + bundle.addEntry().setResource(task).setFullUrl(task.getIdElement().getIdPart()).getRequest() + .setMethod(HTTPVerb.POST).setUrl(ResourceType.Task.name()); + + return bundle; + } + + private Group createGroup(String name) + { + Group group = new Group(); + group.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); + + group.getMeta().addProfile(PROFILE_HIGHMED_GROUP); + group.getText().getDiv().addText("This is the description"); + group.getText().setStatus(Narrative.NarrativeStatus.ADDITIONAL); + group.setType(GroupType.PERSON); + group.setActual(false); + group.setActive(true); + group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY).setValue( + new Expression().setLanguageElement(CODE_TYPE_AQL_QUERY).setExpression("SELECT COUNT(e) FROM EHR e")); + group.setName(name); + + readAccessHelper.addLocal(group); + Arrays.stream(medicIdentifier).forEach(i -> readAccessHelper.addOrganization(group, i)); + readAccessHelper.addOrganization(group, ttpIdentifier); + + return group; + } + + private ResearchStudy createResearchStudy(Group group1, Group group2) + { + ResearchStudy researchStudy = new ResearchStudy(); + researchStudy.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); + + researchStudy.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY); + researchStudy.addIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER) + .setValue(UUID.randomUUID().toString()); + researchStudy.setStatus(ResearchStudyStatus.ACTIVE); + researchStudy.addEnrollment().setReference(group1.getIdElement().getIdPart()); + researchStudy.addEnrollment().setReference(group2.getIdElement().getIdPart()); + + Arrays.stream(medicIdentifier) + .forEach(i -> researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC) + .setValue(new Reference().setType(ResourceType.Organization.name()).setIdentifier( + new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue(i)))); + + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP) + .setValue(new Reference().setType(ResourceType.Organization.name()).setIdentifier(new Identifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue(ttpIdentifier))); + + readAccessHelper.addLocal(researchStudy); + Arrays.stream(medicIdentifier).forEach(i -> readAccessHelper.addOrganization(researchStudy, i)); + readAccessHelper.addOrganization(researchStudy, ttpIdentifier); + + return researchStudy; + } + + private Task createTask(ResearchStudy researchStudy) + { + Task task = new Task(); + task.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); + + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput() + .setValue(new Reference().setReference(researchStudy.getIdElement().getIdPart()) + .setType(ResourceType.ResearchStudy.name())) + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); + task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); + task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); + + return task; + } +} diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1DockerExampleStarter.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1DockerExampleStarter.java new file mode 100644 index 00000000..5010341f --- /dev/null +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1DockerExampleStarter.java @@ -0,0 +1,16 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_DOCKER_FHIR_BASE_URL; + +public class RequestFeasibilityFromMedicsViaMedic1DockerExampleStarter + extends AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter +{ + // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate + // password + public static void main(String[] args) throws Exception + { + new RequestFeasibilityFromMedicsViaMedic1DockerExampleStarter().main(args, MEDIC_1_DOCKER_FHIR_BASE_URL); + } +} diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java index c50c2e56..4cb5ab05 100644 --- a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -1,51 +1,9 @@ package org.highmed.dsf.bpe.start; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.CODE_TYPE_AQL_QUERY; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHEMD_RESEARCH_STUDY; -import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHMED_GROUP; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; - -import java.util.Date; -import java.util.UUID; - -import org.hl7.fhir.r4.model.BooleanType; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Bundle.BundleType; -import org.hl7.fhir.r4.model.Bundle.HTTPVerb; -import org.hl7.fhir.r4.model.Expression; -import org.hl7.fhir.r4.model.Group; -import org.hl7.fhir.r4.model.Group.GroupType; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Narrative; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResearchStudy; -import org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus; -import org.hl7.fhir.r4.model.ResourceType; -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; public class RequestFeasibilityFromMedicsViaMedic1ExampleStarter + extends AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 @@ -53,110 +11,6 @@ public class RequestFeasibilityFromMedicsViaMedic1ExampleStarter // password public static void main(String[] args) throws Exception { - Bundle bundle = createStartResource(); - ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL).startWith(bundle); - } - - private static Bundle createStartResource() - { - Group group1 = createGroup("Group 1"); - Group group2 = createGroup("Group 2"); - ResearchStudy researchStudy = createResearchStudy(group1, group2); - Task task = createTask(researchStudy); - - Bundle bundle = new Bundle(); - bundle.setType(BundleType.TRANSACTION); - bundle.addEntry().setResource(group1).setFullUrl(group1.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); - bundle.addEntry().setResource(group2).setFullUrl(group2.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); - bundle.addEntry().setResource(researchStudy).setFullUrl(researchStudy.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.ResearchStudy.name()); - bundle.addEntry().setResource(task).setFullUrl(task.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.Task.name()); - - return bundle; - } - - private static Group createGroup(String name) - { - Group group = new Group(); - group.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - - group.getMeta().addProfile(PROFILE_HIGHMED_GROUP); - group.getText().getDiv().addText("This is the description"); - group.getText().setStatus(Narrative.NarrativeStatus.ADDITIONAL); - group.setType(GroupType.PERSON); - group.setActual(false); - group.setActive(true); - group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY).setValue( - new Expression().setLanguageElement(CODE_TYPE_AQL_QUERY).setExpression("SELECT COUNT(e) FROM EHR e")); - group.setName(name); - - return group; - } - - private static ResearchStudy createResearchStudy(Group group1, Group group2) - { - ResearchStudy researchStudy = new ResearchStudy(); - researchStudy.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - - researchStudy.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY); - researchStudy.addIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER) - .setValue(UUID.randomUUID().toString()); - researchStudy.setStatus(ResearchStudyStatus.ACTIVE); - researchStudy.addEnrollment().setReference(group1.getIdElement().getIdPart()); - researchStudy.addEnrollment().setReference(group2.getIdElement().getIdPart()); - - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC) - .setValue(new Reference().setType(ResourceType.Organization.name()) - .setIdentifier(new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1))); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC) - .setValue(new Reference().setType(ResourceType.Organization.name()) - .setIdentifier(new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2))); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC) - .setValue(new Reference().setType(ResourceType.Organization.name()) - .setIdentifier(new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3))); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP) - .setValue(new Reference().setType(ResourceType.Organization.name()) - .setIdentifier(new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP))); - - return researchStudy; - } - - private static Task createTask(ResearchStudy researchStudy) - { - Task task = new Task(); - task.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput() - .setValue(new Reference().setReference(researchStudy.getIdElement().getIdPart()) - .setType(ResourceType.ResearchStudy.name())) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); - task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); - - return task; + new RequestFeasibilityFromMedicsViaMedic1ExampleStarter().main(args, MEDIC_1_FHIR_BASE_URL); } } diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java new file mode 100644 index 00000000..e12cd5bc --- /dev/null +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -0,0 +1,116 @@ +package org.highmed.dsf.fhir.profile; + +import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.VERSION; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; + +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelper; +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelperImpl; +import org.highmed.dsf.fhir.validation.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidatorImpl; +import org.highmed.dsf.fhir.validation.ValidationSupportRule; +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.junit.ClassRule; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ca.uhn.fhir.validation.ResultSeverityEnum; +import ca.uhn.fhir.validation.ValidationResult; + +public class ActivityDefinitionProfileTest +{ + private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); + + @ClassRule + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", + "highmed-extension-process-authorization-consortium-role-0.5.0.xml", + "highmed-extension-process-authorization-organization-0.5.0.xml", + "highmed-coding-process-authorization-local-all-0.5.0.xml", + "highmed-coding-process-authorization-local-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-local-organization-0.5.0.xml", + "highmed-coding-process-authorization-remote-all-0.5.0.xml", + "highmed-coding-process-authorization-remote-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-remote-organization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-recipient-0.5.0.xml", + "highmed-process-authorization-requester-0.5.0.xml")); + + private final ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + private final ProcessAuthorizationHelper processAuthorizationHelper = new ProcessAuthorizationHelperImpl(); + + @Test + public void testComputeFeasibilityValid() throws Exception + { + try (InputStream in = Files + .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue(processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> + { + System.err.println("Org: " + orgIdentifier); + return true; + }, role -> + { + System.err.println("Role:" + role); + return true; + })); + } + } + + @Test + public void testExecuteFeasibilityValid() throws Exception + { + try (InputStream in = Files + .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue( + processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); + } + } + + @Test + public void testRequestFeasibilityValid() throws Exception + { + try (InputStream in = Files + .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue( + processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); + } + } +} \ No newline at end of file diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 67935edc..b3cea862 100644 --- a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -73,9 +73,9 @@ public class TaskProfileTest "highmed-task-request-feasibility.xml", "highmed-task-execute-feasibility.xml", "highmed-task-single-medic-result-feasibility.xml", "highmed-task-compute-feasibility.xml", "highmed-task-multi-medic-result-feasibility.xml", "highmed-task-error-feasibility.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-feasibility.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-feasibility.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index f7ad8ac3..c9e431f4 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -13,6 +13,7 @@ import org.highmed.dsf.fhir.resources.ResourceProvider; import org.highmed.dsf.fhir.resources.StructureDefinitionResource; import org.highmed.dsf.fhir.resources.ValueSetResource; +import org.springframework.core.env.PropertyResolver; import ca.uhn.fhir.context.FhirContext; @@ -54,7 +55,8 @@ public List<String> getDependencyNamesAndVersions() } @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader, + PropertyResolver resolver) { var aL = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-localServicesIntegration.xml"); var sTL = StructureDefinitionResource @@ -66,9 +68,9 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader "http://highmed.org/fhir/CodeSystem/feasibility", DEPENDENCY_FEASIBILITY_VERSION); Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map - .of("localServicesIntegration/" + VERSION, Arrays.asList(aL, sTL, vF, cF)); + .of("highmedorg_localServicesIntegration/" + VERSION, Arrays.asList(aL, sTL, vF, cF)); return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + classLoader, resolver, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java index ab944ce2..b194d615 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java @@ -17,6 +17,7 @@ import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.FhirResourcesListValues; @@ -28,9 +29,10 @@ public class ExtractInputValues extends AbstractServiceDelegate implements InitializingBean { - public ExtractInputValues(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public ExtractInputValues(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java index 24f49b2d..0d1b19dd 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java @@ -7,6 +7,7 @@ import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.hl7.fhir.r4.model.Extension; @@ -20,9 +21,10 @@ public class StoreResult extends AbstractServiceDelegate implements Initializing { private static final Logger logger = LoggerFactory.getLogger(StoreResult.class); - public StoreResult(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public StoreResult(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java index 1cee133b..12681ab6 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java @@ -10,6 +10,7 @@ import org.highmed.dsf.bpe.service.GenerateCountFromIds; import org.highmed.dsf.bpe.service.ModifyQueries; import org.highmed.dsf.bpe.service.StoreResult; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.group.GroupHelper; import org.highmed.dsf.fhir.organization.OrganizationProvider; @@ -44,6 +45,9 @@ public class LocalServicesConfig @Autowired private TaskHelper taskHelper; + @Autowired + private ReadAccessHelper readAccessHelper; + @Autowired private GroupHelper groupHelper; @@ -59,38 +63,38 @@ public class LocalServicesConfig @Bean public ExtractInputValues extractInputValues() { - return new ExtractInputValues(fhirClientProvider, taskHelper); + return new ExtractInputValues(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public StoreResult storeResult() { - return new StoreResult(fhirClientProvider, taskHelper); + return new StoreResult(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public CheckSingleMedicResults checkSingleMedicResults() { - return new CheckSingleMedicResults(fhirClientProvider, taskHelper); + return new CheckSingleMedicResults(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public ModifyQueries modifyQueries() { - return new ModifyQueries(fhirClientProvider, taskHelper, ehrIdColumnPath); + return new ModifyQueries(fhirClientProvider, taskHelper, readAccessHelper, ehrIdColumnPath); } @Bean public FilterQueryResultsByConsent filterQueryResultsByConsent() { - return new FilterQueryResultsByConsent(fhirClientProvider, taskHelper); + return new FilterQueryResultsByConsent(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public GenerateBloomFilters generateBloomFilters() { - return new GenerateBloomFilters(fhirClientProvider, taskHelper, ehrIdColumnPath, masterPatientIndexClient(), - objectMapper, bouncyCastleProvider()); + return new GenerateBloomFilters(fhirClientProvider, taskHelper, readAccessHelper, ehrIdColumnPath, + masterPatientIndexClient(), objectMapper, bouncyCastleProvider()); } @Bean @@ -108,13 +112,14 @@ public BouncyCastleProvider bouncyCastleProvider() @Bean public GenerateCountFromIds generateCountFromIds() { - return new GenerateCountFromIds(fhirClientProvider, taskHelper); + return new GenerateCountFromIds(fhirClientProvider, taskHelper, readAccessHelper); } @Bean public ExecuteQueries executeQueries() { - return new ExecuteQueries(fhirClientProvider, openEhrClient(), taskHelper, organizationProvider); + return new ExecuteQueries(fhirClientProvider, openEhrClient(), taskHelper, readAccessHelper, + organizationProvider); } @Bean @@ -126,6 +131,6 @@ public OpenEhrClient openEhrClient() @Bean public CheckQueries checkQueries() { - return new CheckQueries(fhirClientProvider, taskHelper, groupHelper); + return new CheckQueries(fhirClientProvider, taskHelper, readAccessHelper, groupHelper); } } diff --git a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn index 64d97c45..42da7ac9 100644 --- a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn +++ b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn @@ -1,6 +1,6 @@ <?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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0drkcb5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="localServicesIntegration" isExecutable="true" camunda:versionTag="0.5.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0drkcb5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> + <bpmn:process id="highmedorg_localServicesIntegration" isExecutable="true" camunda:versionTag="0.5.0"> <bpmn:serviceTask id="checkResults" name="check results" camunda:class="org.highmed.dsf.bpe.service.CheckSingleMedicResults"> <bpmn:incoming>SequenceFlow_0q803rh</bpmn:incoming> <bpmn:outgoing>SequenceFlow_04ouilq</bpmn:outgoing> @@ -122,7 +122,11 @@ <bpmn:message id="Message_1yz2a31" name="localServicesIntegrationMessage" /> <bpmn:message id="Message_1dr71re" name="resultSingleMedicFeasibilityMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="localServicesIntegration"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="highmedorg_localServicesIntegration"> + <bpmndi:BPMNEdge id="SequenceFlow_07wtgee_di" bpmnElement="SequenceFlow_07wtgee"> + <di:waypoint x="599" y="272" /> + <di:waypoint x="667" y="272" /> + </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="Flow_125i149_di" bpmnElement="Flow_125i149"> <di:waypoint x="400" y="272" /> <di:waypoint x="499" y="272" /> @@ -216,10 +220,6 @@ <dc:Bounds x="722" y="254" width="21" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_07wtgee_di" bpmnElement="SequenceFlow_07wtgee"> - <di:waypoint x="599" y="272" /> - <di:waypoint x="667" y="272" /> - </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_04ouilq_di" bpmnElement="SequenceFlow_04ouilq"> <di:waypoint x="1760" y="272" /> <di:waypoint x="1860" y="272" /> @@ -237,9 +237,6 @@ <dc:Bounds x="180" y="297" width="22" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_1pt9xhp_di" bpmnElement="checkQueries"> - <dc:Bounds x="499" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_1dln3in_di" bpmnElement="ExclusiveGateway_1dln3in" isMarkerVisible="true"> <dc:Bounds x="667" y="247" width="50" height="50" /> </bpmndi:BPMNShape> @@ -282,6 +279,9 @@ <bpmndi:BPMNShape id="Activity_1y9z4ut_di" bpmnElement="storeResult"> <dc:Bounds x="1860" y="232" width="100" height="80" /> </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1pt9xhp_di" bpmnElement="checkQueries"> + <dc:Bounds x="499" y="232" width="100" height="80" /> + </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> diff --git a/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml b/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml index 38321a2b..e02e4a28 100644 --- a/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml +++ b/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml @@ -1,62 +1,76 @@ <ActivityDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> - <valueString value="localServicesIntegrationMessage"/> + <valueString value="localServicesIntegrationMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="LOCAL"/> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type"/> - <code value="MeDIC"/> - </valueCoding> - </extension> + <extension url="task-profile"> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration" /> </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type"/> - <code value="MeDIC"/> - </valueCoding> - </extension> + <extension url="requester"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="MeDIC" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ROLE" /> + </valueCoding> </extension> - <extension url="task-profile"> - <valueCanonical - value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration"/> + <extension url="recipient"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-consortium-role"> + <extension url="consortium"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="highmed.org" /> + </valueIdentifier> + </extension> + <extension url="role"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> + <code value="MeDIC" /> + </valueCoding> + </extension> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ROLE" /> + </valueCoding> </extension> </extension> - <url value="http://highmed.org/bpe/Process/localServicesIntegration"/> + <url value="http://highmed.org/bpe/Process/localServicesIntegration" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="localServicesIntegration"/> - <title value="Local services integration"/> - <subtitle value="Service integration process"/> + <name value="LocalServicesIntegration" /> + <title value="Local services integration" /> + <subtitle value="Service integration process" /> <!-- status managed by bpe --> <status value="unknown" /> - <experimental value="false"/> - <date value="2021-01-26"/> - <publisher value="HiGHmed"/> + <experimental value="false" /> + <date value="2021-06-09" /> + <publisher value="HiGHmed" /> <contact> - <name value="HiGHmed"/> + <name value="HiGHmed" /> <telecom> - <system value="email"/> - <value value="pmo@highmed.org"/> + <system value="email" /> + <value value="pmo@highmed.org" /> </telecom> </contact> - <description - value="Process to test the integration of local external services like the MPI, the openEHR repository or the PEP."/> - <kind value="Task"/> + <description value="Process to test the integration of local external services like the MPI, the openEHR repository or the PEP." /> + <kind value="Task" /> </ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml b/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml index 809557d6..866ef05c 100644 --- a/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml +++ b/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml @@ -2,8 +2,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration" /> @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-09" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/AbstractLocalServicesMedic1ExampleStarter.java b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/AbstractLocalServicesMedic1ExampleStarter.java new file mode 100644 index 00000000..853f315e --- /dev/null +++ b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/AbstractLocalServicesMedic1ExampleStarter.java @@ -0,0 +1,91 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES; +import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; + +import java.util.Date; +import java.util.Random; + +import javax.crypto.KeyGenerator; + +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.highmed.dsf.bpe.variables.BloomFilterConfig; +import org.hl7.fhir.r4.model.Base64BinaryType; +import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.ResourceType; +import org.hl7.fhir.r4.model.StringType; +import org.hl7.fhir.r4.model.Task; + +public abstract class AbstractLocalServicesMedic1ExampleStarter +{ + private static boolean NEEDS_CONSENT_CHECK = true; + private static boolean NEEDS_RECORD_LINKAGE = true; + + protected void main(String[] args, String baseUrl) throws Exception + { + Task task = createStartResource(); + ExampleStarter.forServer(args, baseUrl).startWith(task); + } + + private Task createStartResource() + { + Task task = new Task(); + + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_LOCAL_SERVICES); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); + task.setStatus(Task.TaskStatus.REQUESTED); + task.setIntent(Task.TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + + task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE).setCode(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); + task.addInput().setValue(new BooleanType(NEEDS_CONSENT_CHECK)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); + task.addInput().setValue(new BooleanType(NEEDS_RECORD_LINKAGE)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); + + if (NEEDS_RECORD_LINKAGE) + { + try + { + BouncyCastleProvider bouncyCastleProvider = new BouncyCastleProvider(); + BloomFilterConfig bloomFilterConfig = new BloomFilterConfig(new Random().nextLong(), + KeyGenerator.getInstance("HmacSHA256", bouncyCastleProvider).generateKey(), + KeyGenerator.getInstance("HmacSHA3-256", bouncyCastleProvider).generateKey()); + + task.addInput().setValue(new Base64BinaryType(bloomFilterConfig.toBytes())).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); + } + catch (Exception exception) + { + throw new RuntimeException("Could not create BloomFilterConfig", exception); + } + } + + return task; + } +} diff --git a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1DockerExampleStarter.java b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1DockerExampleStarter.java new file mode 100644 index 00000000..bc56c526 --- /dev/null +++ b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1DockerExampleStarter.java @@ -0,0 +1,15 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_DOCKER_FHIR_BASE_URL; + +public class LocalServicesMedic1DockerExampleStarter extends AbstractLocalServicesMedic1ExampleStarter +{ + // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate + // password + public static void main(String[] args) throws Exception + { + new LocalServicesMedic1ExampleStarter().main(args, MEDIC_1_DOCKER_FHIR_BASE_URL); + } +} \ No newline at end of file diff --git a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java index 2015c40f..50625119 100644 --- a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java @@ -1,96 +1,15 @@ package org.highmed.dsf.bpe.start; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES; -import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; -import java.util.Date; -import java.util.Random; - -import javax.crypto.KeyGenerator; - -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.highmed.dsf.bpe.variables.BloomFilterConfig; -import org.hl7.fhir.r4.model.Base64BinaryType; -import org.hl7.fhir.r4.model.BooleanType; -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; - -public class LocalServicesMedic1ExampleStarter +public class LocalServicesMedic1ExampleStarter extends AbstractLocalServicesMedic1ExampleStarter { - private static boolean NEEDS_CONSENT_CHECK = true; - private static boolean NEEDS_RECORD_LINKAGE = true; - // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate // password public static void main(String[] args) throws Exception { - Task task = createStartResource(); - ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL).startWith(task); - } - - private static Task createStartResource() - { - Task task = new Task(); - - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_LOCAL_SERVICES); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(Task.TaskStatus.REQUESTED); - task.setIntent(Task.TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE).setCode(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); - task.addInput().setValue(new BooleanType(NEEDS_CONSENT_CHECK)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); - task.addInput().setValue(new BooleanType(NEEDS_RECORD_LINKAGE)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - - if (NEEDS_RECORD_LINKAGE) - { - try - { - BouncyCastleProvider bouncyCastleProvider = new BouncyCastleProvider(); - BloomFilterConfig bloomFilterConfig = new BloomFilterConfig(new Random().nextLong(), - KeyGenerator.getInstance("HmacSHA256", bouncyCastleProvider).generateKey(), - KeyGenerator.getInstance("HmacSHA3-256", bouncyCastleProvider).generateKey()); - - task.addInput().setValue(new Base64BinaryType(bloomFilterConfig.toBytes())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); - } - catch (Exception exception) - { - throw new RuntimeException("Could not create BloomFilterConfig", exception); - } - } - - return task; + new LocalServicesMedic1ExampleStarter().main(args, MEDIC_1_FHIR_BASE_URL); } } diff --git a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java new file mode 100644 index 00000000..c804f720 --- /dev/null +++ b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -0,0 +1,69 @@ +package org.highmed.dsf.fhir.profile; + +import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.VERSION; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; + +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelper; +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelperImpl; +import org.highmed.dsf.fhir.validation.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidatorImpl; +import org.highmed.dsf.fhir.validation.ValidationSupportRule; +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.junit.ClassRule; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ca.uhn.fhir.validation.ResultSeverityEnum; +import ca.uhn.fhir.validation.ValidationResult; + +public class ActivityDefinitionProfileTest +{ + private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); + + @ClassRule + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", + "highmed-extension-process-authorization-consortium-role-0.5.0.xml", + "highmed-extension-process-authorization-organization-0.5.0.xml", + "highmed-coding-process-authorization-local-all-0.5.0.xml", + "highmed-coding-process-authorization-local-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-local-organization-0.5.0.xml", + "highmed-coding-process-authorization-remote-all-0.5.0.xml", + "highmed-coding-process-authorization-remote-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-remote-organization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-recipient-0.5.0.xml", + "highmed-process-authorization-requester-0.5.0.xml")); + + private final ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + private final ProcessAuthorizationHelper processAuthorizationHelper = new ProcessAuthorizationHelperImpl(); + + @Test + public void testLocalServicesIntegrationValid() throws Exception + { + try (InputStream in = Files.newInputStream( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue( + processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); + } + } +} \ No newline at end of file diff --git a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 6be24426..fa64f641 100644 --- a/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -44,9 +44,9 @@ public class TaskProfileTest Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-group-0.5.0.xml", "highmed-extension-group-id-0.5.0.xml", "highmed-extension-query-0.5.0.xml", "highmed-task-local-services-integration.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-feasibility.xml", "highmed-query-type-0.5.0.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-feasibility.xml", "highmed-query-type-0.5.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java index b058d755..180a53a7 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java @@ -10,6 +10,7 @@ import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; import org.highmed.dsf.fhir.resources.ResourceProvider; import org.highmed.dsf.fhir.resources.StructureDefinitionResource; +import org.springframework.core.env.PropertyResolver; import ca.uhn.fhir.context.FhirContext; @@ -42,7 +43,8 @@ public Stream<Class<?>> getSpringConfigClasses() } @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader, + PropertyResolver resolver) { var aPing = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-ping.xml"); var aPong = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-pong.xml"); @@ -51,10 +53,10 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader .file("fhir/StructureDefinition/highmed-task-start-ping-process.xml"); var tPong = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-ping.xml"); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("ping/" + VERSION, - Arrays.asList(aPing, tPong, tStartPing), "pong/" + VERSION, Arrays.asList(aPong, tPing)); + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("highmedorg_ping/" + VERSION, + Arrays.asList(aPing, tPong, tStartPing), "highmedorg_pong/" + VERSION, Arrays.asList(aPong, tPing)); return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + classLoader, resolver, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPing.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPing.java index 13205a49..8a64cc1e 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPing.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPing.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe.message; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -10,8 +11,8 @@ public class SendPing extends AbstractTaskMessageSend { public SendPing(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider, FhirContext fhirContext) { - super(clientProvider, taskHelper, organizationProvider, fhirContext); + super(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } } diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPong.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPong.java index 1d98a3c5..3ba8659c 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPong.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPong.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe.message; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -10,8 +11,8 @@ public class SendPong extends AbstractTaskMessageSend { public SendPong(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider, FhirContext fhirContext) { - super(clientProvider, taskHelper, organizationProvider, fhirContext); + super(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } } diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPing.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPing.java index 41de1434..e436c9f6 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPing.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPing.java @@ -2,6 +2,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.hl7.fhir.r4.model.Task; @@ -12,9 +13,10 @@ public class LogPing extends AbstractServiceDelegate { private static final Logger logger = LoggerFactory.getLogger(LogPing.class); - public LogPing(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public LogPing(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPong.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPong.java index 97a79692..400ee43d 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPong.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPong.java @@ -2,6 +2,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.hl7.fhir.r4.model.Task; @@ -12,9 +13,10 @@ public class LogPong extends AbstractServiceDelegate { private static final Logger logger = LoggerFactory.getLogger(LogPong.class); - public LogPong(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + public LogPong(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); } @Override diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java index 79b5e30a..9066782e 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java @@ -9,8 +9,9 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; +import org.highmed.dsf.fhir.organization.EndpointProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.Target; import org.highmed.dsf.fhir.variables.Targets; @@ -19,13 +20,14 @@ public class SelectPingTargets extends AbstractServiceDelegate implements InitializingBean { - private final OrganizationProvider organizationProvider; + private final EndpointProvider endpointProvider; public SelectPingTargets(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) + ReadAccessHelper readAccessHelper, EndpointProvider endpointProvider) { - super(clientProvider, taskHelper); - this.organizationProvider = organizationProvider; + super(clientProvider, taskHelper, readAccessHelper); + + this.endpointProvider = endpointProvider; } @Override @@ -33,14 +35,17 @@ public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); - Objects.requireNonNull(organizationProvider, "organizationProvider"); + Objects.requireNonNull(endpointProvider, "endpointProvider"); } @Override public void doExecute(DelegateExecution execution) throws Exception { - List<Target> targets = organizationProvider.getRemoteIdentifiers().stream().map( - identifier -> Target.createBiDirectionalTarget(identifier.getValue(), UUID.randomUUID().toString())) + String localAddress = endpointProvider.getLocalEndpoint().getAddress(); + + List<Target> targets = endpointProvider.getDefaultEndpointAdressesByOrganizationIdentifier().entrySet().stream() + .filter(a -> !localAddress.equals(a.getValue())) + .map(e -> Target.createBiDirectionalTarget(e.getKey(), e.getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java index f0d0cb0a..b064d657 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java @@ -4,9 +4,13 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; +import java.util.Objects; + import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.organization.EndpointProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.Target; import org.highmed.dsf.fhir.variables.TargetValues; @@ -16,9 +20,22 @@ public class SelectPongTarget extends AbstractServiceDelegate implements InitializingBean { - public SelectPongTarget(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) + private final EndpointProvider endpointProvider; + + public SelectPongTarget(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper, EndpointProvider endpointProvider) + { + super(clientProvider, taskHelper, readAccessHelper); + + this.endpointProvider = endpointProvider; + } + + @Override + public void afterPropertiesSet() throws Exception { - super(clientProvider, taskHelper); + super.afterPropertiesSet(); + + Objects.requireNonNull(endpointProvider, "endpointProvider"); } @Override @@ -30,7 +47,9 @@ public void doExecute(DelegateExecution execution) throws Exception CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).get(); Identifier targetOrganizationIdentifier = task.getRequester().getIdentifier(); - execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGET, TargetValues - .create(Target.createBiDirectionalTarget(targetOrganizationIdentifier.getValue(), correlationKey))); + execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGET, + TargetValues.create(Target.createBiDirectionalTarget(targetOrganizationIdentifier.getValue(), + endpointProvider.getFirstDefaultEndpointAddress(targetOrganizationIdentifier.getValue()).get(), + correlationKey))); } } diff --git a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java index b1dd4a66..a67497cf 100644 --- a/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java +++ b/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java @@ -6,7 +6,9 @@ import org.highmed.dsf.bpe.service.LogPong; import org.highmed.dsf.bpe.service.SelectPingTargets; import org.highmed.dsf.bpe.service.SelectPongTarget; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.organization.EndpointProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.springframework.beans.factory.annotation.Autowired; @@ -21,11 +23,17 @@ public class PingConfig @Autowired private FhirWebserviceClientProvider clientProvider; + @Autowired + private TaskHelper taskHelper; + + @Autowired + private ReadAccessHelper readAccessHelper; + @Autowired private OrganizationProvider organizationProvider; @Autowired - private TaskHelper taskHelper; + private EndpointProvider endpointProvider; @Autowired private FhirContext fhirContext; @@ -33,36 +41,36 @@ public class PingConfig @Bean public SendPing sendPing() { - return new SendPing(clientProvider, taskHelper, organizationProvider, fhirContext); + return new SendPing(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Bean public SendPong sendPong() { - return new SendPong(clientProvider, taskHelper, organizationProvider, fhirContext); + return new SendPong(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Bean public LogPing logPing() { - return new LogPing(clientProvider, taskHelper); + return new LogPing(clientProvider, taskHelper, readAccessHelper); } @Bean public LogPong logPong() { - return new LogPong(clientProvider, taskHelper); + return new LogPong(clientProvider, taskHelper, readAccessHelper); } @Bean public SelectPingTargets selectPingTargets() { - return new SelectPingTargets(clientProvider, taskHelper, organizationProvider); + return new SelectPingTargets(clientProvider, taskHelper, readAccessHelper, endpointProvider); } @Bean public SelectPongTarget selectPongTarget() { - return new SelectPongTarget(clientProvider, taskHelper); + return new SelectPongTarget(clientProvider, taskHelper, readAccessHelper, endpointProvider); } } diff --git a/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn b/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn index 2d32fb25..3301f3b9 100644 --- a/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn +++ b/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn @@ -1,6 +1,6 @@ <?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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0azvmx1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="ping" isExecutable="true" camunda:versionTag="0.5.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0azvmx1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> + <bpmn:process id="highmedorg_ping" isExecutable="true" camunda:versionTag="0.5.0"> <bpmn:sequenceFlow id="SequenceFlow_0k1j79c" sourceRef="StartEvent_1" targetRef="selectTargets" /> <bpmn:sequenceFlow id="SequenceFlow_05ia6lz" sourceRef="selectTargets" targetRef="sendPing" /> <bpmn:serviceTask id="selectTargets" name="selectTargets" camunda:class="org.highmed.dsf.bpe.service.SelectPingTargets"> @@ -10,8 +10,7 @@ <bpmn:sendTask id="sendPing" name="sendPing" camunda:class="org.highmed.dsf.bpe.message.SendPing"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">pong</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.5.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/pong/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">pingMessage</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-ping</camunda:inputParameter> </camunda:inputOutput> @@ -68,7 +67,7 @@ <bpmn:message id="Message_10o3b8y" name="pongMessage" /> <bpmn:message id="Message_1pklz6t" name="startPingProcessMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ping"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="highmedorg_ping"> <bpmndi:BPMNEdge id="SequenceFlow_1vng5zz_di" bpmnElement="SequenceFlow_1vng5zz"> <di:waypoint x="530" y="120" /> <di:waypoint x="606" y="120" /> @@ -83,19 +82,19 @@ <di:waypoint x="1154" y="120" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_05ia6lz_di" bpmnElement="SequenceFlow_05ia6lz"> - <di:waypoint x="359" y="120" /> + <di:waypoint x="370" y="120" /> <di:waypoint x="430" y="120" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0k1j79c_di" bpmnElement="SequenceFlow_0k1j79c"> <di:waypoint x="209" y="120" /> - <di:waypoint x="259" y="120" /> + <di:waypoint x="270" y="120" /> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1cxtndb_di" bpmnElement="selectTargets"> - <dc:Bounds x="259" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="SendTask_01t32b2_di" bpmnElement="sendPing"> <dc:Bounds x="430" y="80" width="100" height="80" /> </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1cxtndb_di" bpmnElement="selectTargets"> + <dc:Bounds x="270" y="80" width="100" height="80" /> + </bpmndi:BPMNShape> <bpmndi:BPMNShape id="SubProcess_0szmntn_di" bpmnElement="SubProcess_0szmntn" isExpanded="true"> <dc:Bounds x="606" y="60" width="458" height="120" /> </bpmndi:BPMNShape> diff --git a/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn b/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn index e3af4ee4..a5a3f2aa 100644 --- a/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn +++ b/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn @@ -1,6 +1,6 @@ <?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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_15v05m6" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0"> - <bpmn:process id="pong" isExecutable="true" camunda:versionTag="0.5.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_15v05m6" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> + <bpmn:process id="highmedorg_pong" isExecutable="true" camunda:versionTag="0.5.0"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_07w11cw</bpmn:outgoing> <bpmn:messageEventDefinition messageRef="Message_0u91abp" /> @@ -9,9 +9,8 @@ <bpmn:endEvent id="EndEvent_1ivxrjg"> <bpmn:extensionElements> <camunda:inputOutput> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/ping/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">pongMessage</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.5.0</camunda:inputParameter> - <camunda:inputParameter name="processDefinitionKey">ping</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-pong</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> @@ -32,31 +31,31 @@ <bpmn:message id="Message_0u91abp" name="pingMessage" /> <bpmn:message id="Message_1h0kvyq" name="pong" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="pong"> - <bpmndi:BPMNShape id="StartEvent_1qh431z_di" bpmnElement="StartEvent_1"> - <dc:Bounds x="173" y="102" width="36" height="36" /> - </bpmndi:BPMNShape> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="highmedorg_pong"> + <bpmndi:BPMNEdge id="SequenceFlow_1ism9wt_di" bpmnElement="SequenceFlow_1ism9wt"> + <di:waypoint x="528" y="120" /> + <di:waypoint x="580" y="120" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_09i9zb8_di" bpmnElement="SequenceFlow_09i9zb8"> + <di:waypoint x="362" y="120" /> + <di:waypoint x="428" y="120" /> + </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_07w11cw_di" bpmnElement="SequenceFlow_07w11cw"> <di:waypoint x="209" y="120" /> <di:waypoint x="262" y="120" /> </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1qh431z_di" bpmnElement="StartEvent_1"> + <dc:Bounds x="173" y="102" width="36" height="36" /> + </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_108jj6g_di" bpmnElement="EndEvent_1ivxrjg"> <dc:Bounds x="580" y="102" width="36" height="36" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_09i9zb8_di" bpmnElement="SequenceFlow_09i9zb8"> - <di:waypoint x="362" y="120" /> - <di:waypoint x="428" y="120" /> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_1uea92o_di" bpmnElement="logPing"> <dc:Bounds x="262" y="80" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0ko681m_di" bpmnElement="selectTarget"> <dc:Bounds x="428" y="80" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1ism9wt_di" bpmnElement="SequenceFlow_1ism9wt"> - <di:waypoint x="528" y="120" /> - <di:waypoint x="580" y="120" /> - </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml index a86cb581..164b08a6 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml @@ -1,108 +1,60 @@ <ActivityDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="startPingProcessMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process" /> </extension> + <extension url="requester"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ALL" /> + </valueCoding> + </extension> + <extension url="recipient"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ALL" /> + </valueCoding> + </extension> </extension> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="pongMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-pong" /> </extension> + <extension url="requester"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="REMOTE_ALL" /> + </valueCoding> + </extension> + <extension url="recipient"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ALL" /> + </valueCoding> + </extension> </extension> <url value="http://highmed.org/bpe/Process/ping" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="ping" /> + <name value="Ping" /> <title value="PING process" /> <subtitle value="Communication Testing Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-08" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml index 8c2d3ef8..903ea016 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml @@ -1,64 +1,40 @@ <ActivityDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="pingMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-ping" /> </extension> + <extension url="requester"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="REMOTE_ALL" /> + </valueCoding> + </extension> + <extension url="recipient"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ALL" /> + </valueCoding> + </extension> </extension> <url value="http://highmed.org/bpe/Process/pong" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="pong" /> + <name value="Pong" /> <title value="PONG process" /> <subtitle value="Communication Testing Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-08" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml index 1acf758e..a5eca4f7 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-ping" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-08" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml index a7ec929c..0c7dc81a 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-pong" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-08" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml index 82d5f3c7..e81f8374 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-08" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/AbstractPing3MedicFromTtpExampleStarter.java b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/AbstractPing3MedicFromTtpExampleStarter.java new file mode 100644 index 00000000..ee760643 --- /dev/null +++ b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/AbstractPing3MedicFromTtpExampleStarter.java @@ -0,0 +1,47 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; + +import java.util.Date; + +import org.hl7.fhir.r4.model.ResourceType; +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; + +public abstract class AbstractPing3MedicFromTtpExampleStarter +{ + protected void main(String[] args, String baseUrl) throws Exception + { + Task task = createStartResource(); + ExampleStarter.forServer(args, baseUrl).startWith(task); + } + + private Task createStartResource() + { + Task task = new Task(); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_START_PING); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); + + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + + return task; + } +} diff --git a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpDockerExampleStarter.java b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpDockerExampleStarter.java new file mode 100644 index 00000000..815e80ef --- /dev/null +++ b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpDockerExampleStarter.java @@ -0,0 +1,15 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_DOCKER_FHIR_BASE_URL; + +public class Ping3MedicFromTtpDockerExampleStarter extends AbstractPing3MedicFromTtpExampleStarter +{ + // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate + // password + public static void main(String[] args) throws Exception + { + new Ping3MedicFromTtpDockerExampleStarter().main(args, TTP_DOCKER_FHIR_BASE_URL); + } +} diff --git a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index f08d97d5..6a3041a3 100644 --- a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -1,23 +1,8 @@ package org.highmed.dsf.bpe.start; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; -import java.util.Date; - -import org.hl7.fhir.r4.model.ResourceType; -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; - -public class Ping3MedicFromTtpExampleStarter +public class Ping3MedicFromTtpExampleStarter extends AbstractPing3MedicFromTtpExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 @@ -25,28 +10,6 @@ public class Ping3MedicFromTtpExampleStarter // password public static void main(String[] args) throws Exception { - Task task = createStartResource(); - ExampleStarter.forServer(args, TTP_FHIR_BASE_URL).startWith(task); - } - - private static Task createStartResource() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_START_PING); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - return task; + new Ping3MedicFromTtpExampleStarter().main(args, TTP_FHIR_BASE_URL); } } diff --git a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/ActivityDefinitionProfileTest.java b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/ActivityDefinitionProfileTest.java new file mode 100644 index 00000000..36e45fae --- /dev/null +++ b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/ActivityDefinitionProfileTest.java @@ -0,0 +1,89 @@ +package org.highmed.dsf.fhir.profiles; + +import static org.highmed.dsf.bpe.PingProcessPluginDefinition.VERSION; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; + +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelper; +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelperImpl; +import org.highmed.dsf.fhir.validation.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidatorImpl; +import org.highmed.dsf.fhir.validation.ValidationSupportRule; +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.junit.ClassRule; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ca.uhn.fhir.validation.ResultSeverityEnum; +import ca.uhn.fhir.validation.ValidationResult; + +public class ActivityDefinitionProfileTest +{ + private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); + + @ClassRule + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", + "highmed-extension-process-authorization-consortium-role-0.5.0.xml", + "highmed-extension-process-authorization-organization-0.5.0.xml", + "highmed-coding-process-authorization-local-all-0.5.0.xml", + "highmed-coding-process-authorization-local-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-local-organization-0.5.0.xml", + "highmed-coding-process-authorization-remote-all-0.5.0.xml", + "highmed-coding-process-authorization-remote-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-remote-organization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-recipient-0.5.0.xml", + "highmed-process-authorization-requester-0.5.0.xml")); + + private final ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + private final ProcessAuthorizationHelper processAuthorizationHelper = new ProcessAuthorizationHelperImpl(); + + @Test + public void testPingValid() throws Exception + { + try (InputStream in = Files + .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-ping.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue( + processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); + } + } + + @Test + public void testPongValid() throws Exception + { + try (InputStream in = Files + .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-pong.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue( + processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); + } + } +} \ No newline at end of file diff --git a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java index d704ab05..a89d86dd 100644 --- a/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ b/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java @@ -44,8 +44,8 @@ public class TaskProfileTest public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-start-ping-process.xml", "highmed-task-ping.xml", "highmed-task-pong.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml")); + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java index 56a226c4..2e0c3e33 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java @@ -6,7 +6,7 @@ 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"; + String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST = "allow_list"; String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST = "http://highmed.org/fhir/StructureDefinition/task-download-allow-list"; String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "downloadAllowList/"; diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java index c2f1b9df..0f330987 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java @@ -12,6 +12,7 @@ import org.highmed.dsf.fhir.resources.ResourceProvider; import org.highmed.dsf.fhir.resources.StructureDefinitionResource; import org.highmed.dsf.fhir.resources.ValueSetResource; +import org.springframework.core.env.PropertyResolver; import ca.uhn.fhir.context.FhirContext; @@ -44,7 +45,8 @@ public Stream<Class<?>> getSpringConfigClasses() } @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader, + PropertyResolver resolver) { var aDown = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-downloadAllowList.xml"); var aUp = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-updateAllowList.xml"); @@ -53,10 +55,11 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader var sUp = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-update-allow-list.xml"); var v = ValueSetResource.file("fhir/ValueSet/highmed-update-allow-list.xml"); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("downloadAllowList/" + VERSION, - Arrays.asList(aDown, c, sDown, v), "updateAllowList/" + VERSION, Arrays.asList(aUp, c, sUp, v)); + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of( + "highmedorg_downloadAllowList/" + VERSION, Arrays.asList(aDown, c, sDown, v), + "highmedorg_updateAllowList/" + VERSION, Arrays.asList(aUp, c, sUp, v)); return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + classLoader, resolver, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java index f59d3411..7945405e 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java @@ -12,6 +12,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.fhir.client.FhirWebserviceClient; @@ -31,9 +32,11 @@ public class DownloadAllowList extends AbstractServiceDelegate private final FhirContext context; - public DownloadAllowList(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, FhirContext context) + public DownloadAllowList(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper, FhirContext context) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); + this.context = context; } @@ -50,7 +53,7 @@ protected void doExecute(DelegateExecution execution) throws Exception Task task = getCurrentTaskFromExecutionVariables(); IdType bundleId = getBundleId(task); FhirWebserviceClient requesterClient = getFhirWebserviceClientProvider() - .getRemoteWebserviceClient(bundleId.getBaseUrl()); + .getWebserviceClient(bundleId.getBaseUrl()); Bundle bundle; try diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java index 5c8d6a04..cc72a034 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java @@ -1,34 +1,34 @@ package org.highmed.dsf.bpe.service; import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; import java.util.Collections; +import java.util.List; import java.util.Map; -import java.util.Objects; -import java.util.Optional; import java.util.UUID; -import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; 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.BundleEntryComponent; import org.hl7.fhir.r4.model.Bundle.BundleType; import org.hl7.fhir.r4.model.Bundle.HTTPVerb; -import org.hl7.fhir.r4.model.Bundle.SearchEntryMode; import org.hl7.fhir.r4.model.Endpoint; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Identifier; import org.hl7.fhir.r4.model.Organization; +import org.hl7.fhir.r4.model.OrganizationAffiliation; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.Task; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,22 +40,10 @@ public class UpdateAllowList extends AbstractServiceDelegate implements Initiali { private static final Logger logger = LoggerFactory.getLogger(UpdateAllowList.class); - private final OrganizationProvider organizationProvider; - - public UpdateAllowList(OrganizationProvider organizationProvider, FhirWebserviceClientProvider clientProvider, - TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception + public UpdateAllowList(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super.afterPropertiesSet(); - - Objects.requireNonNull(organizationProvider, "organizationProvider"); + super(clientProvider, taskHelper, readAccessHelper); } @Override @@ -65,18 +53,35 @@ public void doExecute(DelegateExecution execution) throws Exception Bundle searchSet = client.searchWithStrictHandling(Organization.class, Map.of("active", Collections.singletonList("true"), "identifier", - Collections.singletonList(organizationProvider.getDefaultIdentifierSystem() + "|"), "_include", - Collections.singletonList("Organization:endpoint"))); + Collections.singletonList(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER + "|"), "_include", + Collections.singletonList("Organization:endpoint"), "_revinclude", + Collections.singletonList("OrganizationAffiliation:participating-organization"))); + + Map<String, String> identifierByTypeAndId = searchSet.getEntry().stream() + .filter(BundleEntryComponent::hasResource).map(BundleEntryComponent::getResource) + .filter(r -> r instanceof Organization || r instanceof Endpoint).filter(Resource::hasIdElement) + .collect(Collectors.toMap(r -> r.getIdElement().toUnqualifiedVersionless().getValue(), + this::getIdentifierValue)); + Map<String, String> tempIdsByTypeAndId = searchSet.getEntry().stream().filter(BundleEntryComponent::hasResource) + .map(BundleEntryComponent::getResource) + .filter(r -> r instanceof Organization || r instanceof Endpoint || r instanceof OrganizationAffiliation) + .filter(Resource::hasIdElement) + .collect(Collectors.toMap(r -> r.getIdElement().toUnqualifiedVersionless().getValue(), + r -> "urn:uuid:" + UUID.randomUUID().toString())); Bundle transaction = new Bundle().setType(BundleType.TRANSACTION); - transaction.getMeta().addTag().setSystem("http://highmed.org/fhir/CodeSystem/authorization-role") - .setCode("REMOTE"); + + getReadAccessHelper().addAll(transaction); + transaction.getIdentifier().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) .setValue(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)); + + List<BundleEntryComponent> entries = searchSet.getEntry().stream().filter(BundleEntryComponent::hasResource) + .map(BundleEntryComponent::getResource) + .filter(r -> r instanceof Organization || r instanceof Endpoint || r instanceof OrganizationAffiliation) + .map(toAllowListBundleEntry(identifierByTypeAndId, tempIdsByTypeAndId)).collect(Collectors.toList()); + + transaction.setEntry(entries); logger.debug("Uploading new allow list transaction bundle: {}", FhirContext.forR4().newJsonParser().encodeResourceToString(transaction)); @@ -91,67 +96,143 @@ public void doExecute(DelegateExecution execution) throws Exception .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); } - private Consumer<? super Organization> addAllowListEntry(Bundle transaction, Bundle searchSet) + private String getIdentifierValue(Resource resource) { - return organization -> - { - Identifier identifier = getDefaultIdentifier(organization).get(); - - BundleEntryComponent organizationEntry = transaction.addEntry(); - String organizationId = "urn:uuid:" + UUID.randomUUID(); - organizationEntry.setFullUrl(organizationId); - organizationEntry.getRequest().setMethod(HTTPVerb.PUT) - .setUrl("Organization?identifier=" + identifier.getSystem() + "|" + identifier.getValue()); - - organization.setIdElement(new IdType(organizationId)); - organization.getMeta().setVersionIdElement(null).setLastUpdatedElement(null); - organizationEntry.setResource(organization); - - organization.setEndpoint(organization.getEndpoint().stream() - .map(addAllowListEntryReturnReference(transaction, organizationId, searchSet)) - .filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList())); - }; + if (resource instanceof Organization) + return ((Organization) resource).getIdentifier().stream().filter(Identifier::hasSystem) + .filter(i -> NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER.equals(i.getSystem())).findFirst() + .filter(Identifier::hasValue).map(Identifier::getValue) + .orElseThrow(() -> new RuntimeException("Organization is missing identifier value with system " + + NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER)); + else if (resource instanceof Endpoint) + return ((Endpoint) resource).getIdentifier().stream().filter(Identifier::hasSystem) + .filter(i -> NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER.equals(i.getSystem())).findFirst() + .filter(Identifier::hasValue).map(Identifier::getValue) + .orElseThrow(() -> new RuntimeException("Endpoint is missing identifier value with system " + + NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER)); + else + throw new IllegalStateException("Organization or Endpoint expected"); } - private Function<Reference, Optional<Reference>> addAllowListEntryReturnReference(Bundle transaction, - String organizationId, Bundle searchSet) + private Function<Resource, BundleEntryComponent> toAllowListBundleEntry(Map<String, String> identifierByTypeAndId, + Map<String, String> tempIdsByTypeAndId) { - return endpointRef -> getEndpoint(endpointRef, searchSet).map(endpoint -> + return resource -> { - Identifier identifier = getDefaultIdentifier(endpoint).get(); + if (resource instanceof Organization) + return toOrganizationEntry((Organization) resource, identifierByTypeAndId, tempIdsByTypeAndId); + else if (resource instanceof Endpoint) + return toEndpointEntry((Endpoint) resource, identifierByTypeAndId, tempIdsByTypeAndId); + else if (resource instanceof OrganizationAffiliation) + return toOrganizationAffiliationEntry((OrganizationAffiliation) resource, identifierByTypeAndId, + tempIdsByTypeAndId); + else + throw new IllegalStateException("Organization, Endpoint or OrganizationAffiliation expected"); + }; + } - BundleEntryComponent endpointEntry = transaction.addEntry(); - String endpointId = "urn:uuid:" + UUID.randomUUID(); - endpointEntry.setFullUrl(endpointId); - endpointEntry.getRequest().setMethod(HTTPVerb.PUT) - .setUrl("Endpoint?identifier=" + identifier.getSystem() + "|" + identifier.getValue()); + private BundleEntryComponent toOrganizationEntry(Organization organization, + Map<String, String> identifierByTypeAndId, Map<String, String> tempIdsByTypeAndId) + { + String typeAndId = organization.getIdElement().toUnqualifiedVersionless().getValue(); + String uuid = tempIdsByTypeAndId.get(typeAndId); + String organizationIdentifier = identifierByTypeAndId.get(typeAndId); - endpoint.setIdElement(new IdType(endpointId)); - endpoint.getMeta().setVersionIdElement(null).setLastUpdatedElement(null); - endpoint.setManagingOrganization(new Reference().setReference(organizationId).setType("Organization")); - endpointEntry.setResource(endpoint); + organization.setIdElement(new IdType(uuid)); + organization.getMeta().setVersionIdElement(null).setLastUpdatedElement(null); - return new Reference().setReference(endpointId).setType("Endpoint"); - }); + if (organization.hasEndpoint()) + { + List<Reference> endpoints = organization.getEndpoint().stream() + .map(e -> tempIdsByTypeAndId.get(e.getReference())) + .map(tempId -> new Reference().setType("Endpoint").setReference(tempId)) + .collect(Collectors.toList()); + organization.setEndpoint(endpoints); + } + + BundleEntryComponent entry = new BundleEntryComponent(); + entry.setFullUrl(uuid); + entry.setResource(organization); + entry.getRequest().setMethod(HTTPVerb.PUT).setUrl("Organization?identifier=" + + NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER + "|" + organizationIdentifier); + return entry; } - private Optional<Identifier> getDefaultIdentifier(Organization org) + private BundleEntryComponent toEndpointEntry(Endpoint endpoint, Map<String, String> identifierByTypeAndId, + Map<String, String> tempIdsByTypeAndId) { - return org.getIdentifier().stream() - .filter(i -> organizationProvider.getDefaultIdentifierSystem().equals(i.getSystem())).findFirst(); - } + String typeAndId = endpoint.getIdElement().toUnqualifiedVersionless().getValue(); + String uuid = tempIdsByTypeAndId.get(typeAndId); + String endpointIdentifier = identifierByTypeAndId.get(typeAndId); - private Optional<Identifier> getDefaultIdentifier(Endpoint ept) - { - return ept.getIdentifier().stream().filter(i -> NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER.equals(i.getSystem())) - .findFirst(); + endpoint.setIdElement(new IdType(uuid)); + endpoint.getMeta().setVersionIdElement(null).setLastUpdatedElement(null); + + if (endpoint.hasManagingOrganization()) + { + String organizationTempId = tempIdsByTypeAndId.get(endpoint.getManagingOrganization().getReference()); + endpoint.setManagingOrganization(new Reference().setType("Organization").setReference(organizationTempId)); + } + + BundleEntryComponent entry = new BundleEntryComponent(); + entry.setFullUrl(uuid); + entry.setResource(endpoint); + entry.getRequest().setMethod(HTTPVerb.PUT) + .setUrl("Endpoint?identifier=" + NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER + "|" + endpointIdentifier); + return entry; } - private Optional<Endpoint> getEndpoint(Reference endpoint, Bundle searchSet) + private BundleEntryComponent toOrganizationAffiliationEntry(OrganizationAffiliation affiliation, + Map<String, String> identifierByTypeAndId, Map<String, String> tempIdsByTypeAndId) { - return searchSet.getEntry().stream() - .filter(e -> e.hasResource() && e.getResource() instanceof Endpoint - && e.getFullUrl().endsWith(endpoint.getReference())) - .map(e -> (Endpoint) e.getResource()).findFirst(); + String uuid = tempIdsByTypeAndId.get(affiliation.getIdElement().toUnqualifiedVersionless().getValue()); + + affiliation.setIdElement(new IdType(uuid)); + affiliation.getMeta().setVersionIdElement(null).setLastUpdatedElement(null); + + String primaryOrganizatioIdentifier; + if (affiliation.hasOrganization()) + { + String ref = affiliation.getOrganization().getReference(); + primaryOrganizatioIdentifier = identifierByTypeAndId.get(ref); + String primaryOrganizationTempId = tempIdsByTypeAndId.get(ref); + + affiliation + .setOrganization(new Reference().setType("Organization").setReference(primaryOrganizationTempId)); + } + else + throw new IllegalStateException("OrganizationAffiliation with primary organization expected"); + + String participatingOrganizationIdentifier; + if (affiliation.hasParticipatingOrganization()) + { + String ref = affiliation.getParticipatingOrganization().getReference(); + participatingOrganizationIdentifier = identifierByTypeAndId.get(ref); + String participatingOrganizationTempId = tempIdsByTypeAndId.get(ref); + + affiliation.setParticipatingOrganization( + new Reference().setType("Organization").setReference(participatingOrganizationTempId)); + } + else + throw new IllegalStateException("OrganizationAffiliation with participating organization expected"); + + if (affiliation.hasEndpoint()) + { + List<Reference> endpoints = affiliation.getEndpoint().stream() + .map(e -> tempIdsByTypeAndId.get(e.getReference())) + .map(tempId -> new Reference().setType("Endpoint").setReference(tempId)) + .collect(Collectors.toList()); + affiliation.setEndpoint(endpoints); + } + + BundleEntryComponent entry = new BundleEntryComponent(); + entry.setFullUrl(uuid); + entry.setResource(affiliation); + entry.getRequest().setMethod(HTTPVerb.PUT) + .setUrl("OrganizationAffiliation?primary-organization:identifier=" + + NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER + "|" + primaryOrganizatioIdentifier + + "&participating-organization:identifier=" + NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER + "|" + + participatingOrganizationIdentifier); + return entry; } } diff --git a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java index 55702ba9..92a894ff 100644 --- a/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java +++ b/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java @@ -2,8 +2,8 @@ import org.highmed.dsf.bpe.service.DownloadAllowList; import org.highmed.dsf.bpe.service.UpdateAllowList; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; @@ -18,10 +18,10 @@ public class UpdateAllowListConfig private FhirWebserviceClientProvider clientProvider; @Autowired - private OrganizationProvider organizationProvider; + private TaskHelper taskHelper; @Autowired - private TaskHelper taskHelper; + private ReadAccessHelper readAccessHelper; @Autowired private FhirContext fhirContext; @@ -29,12 +29,12 @@ public class UpdateAllowListConfig @Bean public UpdateAllowList updateAllowList() { - return new UpdateAllowList(organizationProvider, clientProvider, taskHelper); + return new UpdateAllowList(clientProvider, taskHelper, readAccessHelper); } @Bean public DownloadAllowList downloadAllowList() { - return new DownloadAllowList(clientProvider, taskHelper, fhirContext); + return new DownloadAllowList(clientProvider, taskHelper, readAccessHelper, fhirContext); } } diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn index a325e15c..2ac200dd 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn +++ b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn @@ -1,6 +1,6 @@ <?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.5.0"> +<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.8.1"> + <bpmn:process id="highmedorg_downloadAllowList" isExecutable="true" camunda:versionTag="0.5.0"> <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="downloadAllowListTask" /> <bpmn:endEvent id="EndEvent_0xd0x8k"> <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> @@ -17,7 +17,7 @@ </bpmn:process> <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="highmedorg_downloadAllowList"> <bpmndi:BPMNEdge id="SequenceFlow_0oyvmcd_di" bpmnElement="SequenceFlow_0oyvmcd"> <di:waypoint x="365" y="121" /> <di:waypoint x="415" y="121" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn index f3b5263b..58003231 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn +++ b/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn @@ -1,6 +1,6 @@ <?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.5.0"> +<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.8.1"> + <bpmn:process id="highmedorg_updateAllowList" isExecutable="true" camunda:versionTag="0.5.0"> <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="updateAllowListTask" /> <bpmn:endEvent id="EndEvent_0xd0x8k"> <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> @@ -17,7 +17,11 @@ </bpmn:process> <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="highmedorg_updateAllowList"> + <bpmndi:BPMNEdge id="SequenceFlow_0oyvmcd_di" bpmnElement="SequenceFlow_0oyvmcd"> + <di:waypoint x="365" y="121" /> + <di:waypoint x="415" y="121" /> + </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0bbhq2r_di" bpmnElement="SequenceFlow_0bbhq2r"> <di:waypoint x="215" y="121" /> <di:waypoint x="265" y="121" /> @@ -25,10 +29,6 @@ <bpmndi:BPMNShape id="EndEvent_0xd0x8k_di" bpmnElement="EndEvent_0xd0x8k"> <dc:Bounds x="415" y="103" width="36" height="36" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0oyvmcd_di" bpmnElement="SequenceFlow_0oyvmcd"> - <di:waypoint x="365" y="121" /> - <di:waypoint x="415" y="121" /> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0um3ad2_di" bpmnElement="updateAllowListTask"> <dc:Bounds x="265" y="81" width="100" height="80" /> </bpmndi:BPMNShape> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml index 2195e242..2dcfd59d 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml @@ -1,64 +1,40 @@ <ActivityDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="downloadAllowListMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list" /> </extension> + <extension url="requester"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ALL" /> + </valueCoding> + </extension> + <extension url="recipient"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ALL" /> + </valueCoding> + </extension> </extension> <url value="http://highmed.org/bpe/Process/downloadAllowList" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="downloadAllowList" /> + <name value="DownloadAllowList" /> <title value="Download Allow List" /> <subtitle value="Download Allow List Bundle Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-07" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml index 1868ee5e..787476ea 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml @@ -1,52 +1,52 @@ <ActivityDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="updateAllowListMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list" /> </extension> + <extension url="requester"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + </valueIdentifier> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ORGANIZATION" /> + </valueCoding> + </extension> + <extension url="recipient"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + </valueIdentifier> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ORGANIZATION" /> + </valueCoding> + </extension> </extension> <url value="http://highmed.org/bpe/Process/updateAllowList" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="updateAllowList" /> + <name value="UpdateAllowList" /> <title value="Update Allow List" /> <subtitle value="Update Allow List Bundle Process" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-07" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml index b12be1e3..7fad8a3e 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml @@ -1,28 +1,28 @@ <CodeSystem xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> + </tag> </meta> - <url value="http://highmed.org/fhir/CodeSystem/update-allow-list"/> + <url value="http://highmed.org/fhir/CodeSystem/update-allow-list" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="HiGHmed_Update_Allow_List"/> - <title value="HiGHmed Update Allow List"/> + <name value="HiGHmed_Update_Allow_List" /> + <title value="HiGHmed Update Allow List" /> <!-- status managed by bpe --> <status value="unknown" /> - <experimental value="false"/> - <date value="2021-01-26"/> - <publisher value="HiGHmed"/> - <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"/> + <experimental value="false" /> + <date value="2021-06-07" /> + <publisher value="HiGHmed" /> + <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_allow_list"/> - <display value="HiGHmed Allow List"/> - <definition value="Allow list identifying organizations as part of HiGHmed"/> + <code value="allow_list" /> + <display value="HiGHmed Allow List" /> + <definition value="Allow list identifying organizations" /> </concept> </CodeSystem> \ No newline at end of file diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml index c92c0dc9..8111d9d7 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml @@ -2,8 +2,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list" /> @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-07" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -74,7 +74,7 @@ <element id="Task.input:bundle-reference.type.coding.code"> <path value="Task.input.type.coding.code" /> <min value="1" /> - <fixedCode value="highmed_allow_list" /> + <fixedCode value="allow_list" /> </element> <element id="Task.input:bundle-reference.value[x]"> <path value="Task.input.value[x]" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml index b3566dab..a71e8a5e 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-07" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -86,7 +86,7 @@ <element id="Task.output:allowList.type.coding.code"> <path value="Task.output.type.coding.code" /> <min value="1" /> - <fixedCode value="highmed_allow_list" /> + <fixedCode value="allow_list" /> </element> <element id="Task.output:allowList.value[x]"> <path value="Task.output.value[x]" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml index 4713deaa..46df3f2b 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml @@ -1,26 +1,25 @@ <ValueSet xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> + </tag> </meta> - <url value="http://highmed.org/fhir/ValueSet/update-allow-list"/> + <url value="http://highmed.org/fhir/ValueSet/update-allow-list" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="HiGHmed_Update_Allow_List"/> - <title value="HiGHmed Update Allow List"/> + <name value="HiGHmed_Update_Allow_List" /> + <title value="HiGHmed Update Allow List" /> <!-- status managed by bpe --> <status value="unknown" /> - <experimental value="false"/> - <date value="2021-01-26"/> - <publisher value="HiGHmed"/> - <description - value="ValueSet with standard values for the process update allow list"/> - <immutable value="true"/> + <experimental value="false" /> + <date value="2021-06-07" /> + <publisher value="HiGHmed" /> + <description value="ValueSet with standard values for the process update allow list" /> + <immutable value="true" /> <compose> <include> - <system value="http://highmed.org/fhir/CodeSystem/update-allow-list"/> + <system value="http://highmed.org/fhir/CodeSystem/update-allow-list" /> </include> </compose> </ValueSet> \ No newline at end of file diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/AbstractDownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/AbstractDownloadAllowListFromTtpViaMedic1ExampleStarter.java new file mode 100644 index 00000000..1410f258 --- /dev/null +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/AbstractDownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -0,0 +1,75 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; + +import java.util.Collections; +import java.util.Date; +import java.util.Map; + +import org.highmed.fhir.client.FhirWebserviceClient; +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.ResourceType; +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; + +public abstract class AbstractDownloadAllowListFromTtpViaMedic1ExampleStarter +{ + protected void main(String[] args, String baseUrl, String ttpUrl) throws Exception + { + ExampleStarter starter = ExampleStarter.forServer(args, baseUrl); + Task task = createStartResource(starter, ttpUrl); + starter.startWith(task); + } + + private Task createStartResource(ExampleStarter starter, String ttpUrl) throws Exception + { + Bundle allowList = getAllowList(starter, ttpUrl); + + Task task = new Task(); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput() + .setValue(new Reference(new IdType(ttpUrl, ResourceType.Bundle.name(), + allowList.getIdElement().getIdPart(), allowList.getIdElement().getVersionIdPart()))) + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) + .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); + + return task; + } + + private Bundle getAllowList(ExampleStarter starter, String ttpUrl) throws Exception + { + FhirWebserviceClient client = starter.createClient(ttpUrl); + Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", + Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|allow_list"))); + + if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) + throw new IllegalStateException("Expected a single allow list Bundle"); + + return (Bundle) searchResult.getEntryFirstRep().getResource(); + } +} diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/AbstractUpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/AbstractUpdateAllowList3MedicTtpExampleStarter.java new file mode 100644 index 00000000..89920cf7 --- /dev/null +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/AbstractUpdateAllowList3MedicTtpExampleStarter.java @@ -0,0 +1,47 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; + +import java.util.Date; + +import org.hl7.fhir.r4.model.ResourceType; +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; + +public abstract class AbstractUpdateAllowList3MedicTtpExampleStarter +{ + protected void main(String[] args, String baseUrl) throws Exception + { + Task task = createStartResource(); + ExampleStarter.forServer(args, baseUrl).startWith(task); + } + + private Task createStartResource() + { + Task task = new Task(); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); + + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + + return task; + } +} diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1DockerExampleStarter.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1DockerExampleStarter.java new file mode 100644 index 00000000..85677fc5 --- /dev/null +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1DockerExampleStarter.java @@ -0,0 +1,18 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_DOCKER_FHIR_BASE_URL; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_DOCKER_FHIR_BASE_URL; + +public class DownloadAllowListFromTtpViaMedic1DockerExampleStarter + extends AbstractDownloadAllowListFromTtpViaMedic1ExampleStarter +{ + // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate + // password + public static void main(String[] args) throws Exception + { + new DownloadAllowListFromTtpViaMedic1DockerExampleStarter().main(args, MEDIC_1_DOCKER_FHIR_BASE_URL, + TTP_DOCKER_FHIR_BASE_URL); + } +} diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index 1338e902..e7cd3d46 100644 --- a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -1,32 +1,10 @@ package org.highmed.dsf.bpe.start; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; -import java.util.Collections; -import java.util.Date; -import java.util.Map; - -import org.highmed.fhir.client.FhirWebserviceClient; -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.ResourceType; -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; - public class DownloadAllowListFromTtpViaMedic1ExampleStarter + extends AbstractDownloadAllowListFromTtpViaMedic1ExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 @@ -34,48 +12,6 @@ public class DownloadAllowListFromTtpViaMedic1ExampleStarter // password public static void main(String[] args) throws Exception { - ExampleStarter starter = ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL); - Task task = createStartResource(starter); - starter.startWith(task); - } - - private static Task createStartResource(ExampleStarter starter) throws Exception - { - Bundle allowList = getAllowList(starter); - - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput() - .setValue(new Reference(new IdType(TTP_FHIR_BASE_URL, ResourceType.Bundle.name(), - allowList.getIdElement().getIdPart(), allowList.getIdElement().getVersionIdPart()))) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) - .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); - - return task; - } - - private static Bundle getAllowList(ExampleStarter starter) throws Exception - { - FhirWebserviceClient client = starter.createClient(TTP_FHIR_BASE_URL); - Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", - Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); - - if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) - throw new IllegalStateException("Expected a single allow list Bundle"); - - return (Bundle) searchResult.getEntryFirstRep().getResource(); + new DownloadAllowListFromTtpViaMedic1ExampleStarter().main(args, MEDIC_1_FHIR_BASE_URL, TTP_FHIR_BASE_URL); } } diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpDockerExampleStarter.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpDockerExampleStarter.java new file mode 100644 index 00000000..35346e12 --- /dev/null +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpDockerExampleStarter.java @@ -0,0 +1,15 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_DOCKER_FHIR_BASE_URL; + +public class UpdateAllowList3MedicTtpDockerExampleStarter extends AbstractUpdateAllowList3MedicTtpExampleStarter +{ + // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate + // password + public static void main(String[] args) throws Exception + { + new UpdateAllowList3MedicTtpDockerExampleStarter().main(args, TTP_DOCKER_FHIR_BASE_URL); + } +} diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index 1144ff88..090fa361 100644 --- a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -1,23 +1,8 @@ package org.highmed.dsf.bpe.start; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; -import java.util.Date; - -import org.hl7.fhir.r4.model.ResourceType; -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; - -public class UpdateAllowList3MedicTtpExampleStarter +public class UpdateAllowList3MedicTtpExampleStarter extends AbstractUpdateAllowList3MedicTtpExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 @@ -25,28 +10,6 @@ public class UpdateAllowList3MedicTtpExampleStarter // password public static void main(String[] args) throws Exception { - Task task = createStartResource(); - ExampleStarter.forServer(args, TTP_FHIR_BASE_URL).startWith(task); - } - - private static Task createStartResource() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - return task; + new UpdateAllowList3MedicTtpExampleStarter().main(args, TTP_FHIR_BASE_URL); } } diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java new file mode 100644 index 00000000..1d1797f1 --- /dev/null +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -0,0 +1,89 @@ +package org.highmed.dsf.fhir.profile; + +import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.VERSION; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; + +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelper; +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelperImpl; +import org.highmed.dsf.fhir.validation.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidatorImpl; +import org.highmed.dsf.fhir.validation.ValidationSupportRule; +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.junit.ClassRule; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ca.uhn.fhir.validation.ResultSeverityEnum; +import ca.uhn.fhir.validation.ValidationResult; + +public class ActivityDefinitionProfileTest +{ + private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); + + @ClassRule + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", + "highmed-extension-process-authorization-consortium-role-0.5.0.xml", + "highmed-extension-process-authorization-organization-0.5.0.xml", + "highmed-coding-process-authorization-local-all-0.5.0.xml", + "highmed-coding-process-authorization-local-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-local-organization-0.5.0.xml", + "highmed-coding-process-authorization-remote-all-0.5.0.xml", + "highmed-coding-process-authorization-remote-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-remote-organization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-recipient-0.5.0.xml", + "highmed-process-authorization-requester-0.5.0.xml")); + + private final ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + private final ProcessAuthorizationHelper processAuthorizationHelper = new ProcessAuthorizationHelperImpl(); + + @Test + public void testDownloadAllowListValid() throws Exception + { + try (InputStream in = Files + .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue( + processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); + } + } + + @Test + public void testUpdateAllowListValid() throws Exception + { + try (InputStream in = Files + .newInputStream(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue( + processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); + } + } +} \ No newline at end of file diff --git a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 085f10fa..fef1465d 100644 --- a/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -44,9 +44,9 @@ public class TaskProfileTest public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-update-allow-list.xml", "highmed-task-download-allow-list.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-update-allow-list.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-update-allow-list.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java index d8468f53..a4a56881 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java @@ -5,6 +5,8 @@ public interface ConstantsUpdateResources { + String BPMN_EXECUTION_VARIABLE_BUNDLE = "bundle"; + String CODESYSTEM_HIGHMED_UPDATE_RESOURCE = "http://highmed.org/fhir/CodeSystem/update-resources"; String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE = "bundle-reference"; String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER = "organization-identifier-search-parameter"; diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java index b0e87dd1..8bde102e 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java @@ -12,6 +12,7 @@ import org.highmed.dsf.fhir.resources.ResourceProvider; import org.highmed.dsf.fhir.resources.StructureDefinitionResource; import org.highmed.dsf.fhir.resources.ValueSetResource; +import org.springframework.core.env.PropertyResolver; import ca.uhn.fhir.context.FhirContext; @@ -44,7 +45,8 @@ public Stream<Class<?>> getSpringConfigClasses() } @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader, + PropertyResolver resolver) { var aExec = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-executeUpdateResources.xml"); var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-requestUpdateResources.xml"); @@ -56,10 +58,10 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader var v = ValueSetResource.file("fhir/ValueSet/highmed-update-resources.xml"); Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of( - "executeUpdateResources/" + VERSION, Arrays.asList(aExec, c, sExec, v), - "requestUpdateResources/" + VERSION, Arrays.asList(aReq, c, sReq, v)); + "highmedorg_executeUpdateResources/" + VERSION, Arrays.asList(aExec, c, sExec, v), + "highmedorg_requestUpdateResources/" + VERSION, Arrays.asList(aReq, c, sReq, v)); return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + classLoader, resolver, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java index 02c92293..96f24b9f 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java @@ -7,6 +7,7 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -21,9 +22,9 @@ public class SendRequest extends AbstractTaskMessageSend { public SendRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider, FhirContext fhirContext) { - super(clientProvider, taskHelper, organizationProvider, fhirContext); + super(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Override diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java index e05098f6..4e0a8d2d 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java @@ -1,64 +1,24 @@ package org.highmed.dsf.bpe.service; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP; - -import java.util.Objects; -import java.util.Optional; - import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Organization; -import org.hl7.fhir.r4.model.Task; -import org.springframework.beans.factory.InitializingBean; -public class CheckRequest extends AbstractServiceDelegate implements InitializingBean +public class CheckRequest extends AbstractServiceDelegate { - private final OrganizationProvider organizationProvider; - public CheckRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) + ReadAccessHelper readAccessHelper) { - super(clientProvider, taskHelper); - - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(organizationProvider, "organizationProvider"); + super(clientProvider, taskHelper, readAccessHelper); } @Override protected void doExecute(DelegateExecution execution) throws Exception { - Task task = getCurrentTaskFromExecutionVariables(); - - if (requesterIsNotOfTypeTtp(task.getRequester().getIdentifier())) - { - throw new RuntimeException( - "Request check failed: process can only be started by requesting organization of type='" - + CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP + "'"); - } - } - - private boolean requesterIsNotOfTypeTtp(Identifier requester) - { - Optional<Organization> organization = organizationProvider.getOrganization(requester.getSystem(), - requester.getValue()); + // TODO check digital signature of bundle - return !organization - .map(value -> value.getType().stream() - .anyMatch(type -> type.getCoding().stream() - .anyMatch(coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE) - && coding.getCode().equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP)))) - .orElse(false); + // Bundle bundle = (Bundle) execution.getVariable(BPMN_EXECUTION_VARIABLE_BUNDLE); } } diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/DownloadBundle.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/DownloadBundle.java new file mode 100644 index 00000000..30e52801 --- /dev/null +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/DownloadBundle.java @@ -0,0 +1,96 @@ +package org.highmed.dsf.bpe.service; + +import static org.highmed.dsf.bpe.ConstantsUpdateResources.BPMN_EXECUTION_VARIABLE_BUNDLE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; + +import java.util.EnumSet; +import java.util.List; +import java.util.stream.Collectors; + +import javax.ws.rs.WebApplicationException; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; +import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.task.TaskHelper; +import org.highmed.dsf.fhir.variables.FhirResourceValues; +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; + +public class DownloadBundle extends AbstractServiceDelegate +{ + private static final Logger logger = LoggerFactory.getLogger(DownloadBundle.class); + + public DownloadBundle(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) + { + super(clientProvider, taskHelper, readAccessHelper); + } + + @Override + protected void doExecute(DelegateExecution execution) throws Exception + { + Task task = getCurrentTaskFromExecutionVariables(); + IdType bundleId = getBundleId(task); + FhirWebserviceClient requesterClient = getFhirWebserviceClientProvider() + .getWebserviceClient(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()); + } + + execution.setVariable(BPMN_EXECUTION_VARIABLE_BUNDLE, FhirResourceValues.create(bundle)); + } + + private IdType getBundleId(Task task) + { + List<Reference> bundleReferences = getTaskHelper().getInputParameterReferenceValues(task, + CODESYSTEM_HIGHMED_UPDATE_RESOURCE, CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE) + .collect(Collectors.toList()); + + if (bundleReferences.size() != 1) + { + logger.error("Task input parameter {} contains unexpected number of Bundle IDs, expected 1, got {}", + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, bundleReferences.size()); + throw new RuntimeException( + "Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE + + " 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", + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); + throw new RuntimeException("Task input parameter " + + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE + " has no Bundle reference"); + } + + return new IdType(bundleReferences.get(0).getReference()); + } +} diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java index 648abf44..17410614 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java @@ -13,12 +13,15 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.organization.EndpointProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.Target; import org.highmed.dsf.fhir.variables.Targets; import org.highmed.dsf.fhir.variables.TargetsValues; +import org.hl7.fhir.r4.model.Endpoint; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Task; import org.slf4j.Logger; @@ -33,13 +36,16 @@ public class SelectResourceAndTargets extends AbstractServiceDelegate implements private static final Pattern BUNDLE_ID_PATTERN = Pattern.compile(BUNDLE_ID_PATTERN_STRING); private final OrganizationProvider organizationProvider; + private final EndpointProvider endpointProvider; public SelectResourceAndTargets(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) + ReadAccessHelper readAccessHelper, OrganizationProvider organizationProvider, + EndpointProvider endpointProvider) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); this.organizationProvider = organizationProvider; + this.endpointProvider = endpointProvider; } @Override @@ -80,8 +86,10 @@ else if (!BUNDLE_ID_PATTERN.matcher(references.get(0).getReference()).matches()) List<Target> targets = targetIdentifierSearchParameters.stream() .flatMap(organizationProvider::searchRemoteOrganizationsIdentifiers) - .map(identifier -> Target.createUniDirectionalTarget(identifier.getValue())) - .collect(Collectors.toList()); + .map(identifier -> Target.createUniDirectionalTarget(identifier.getValue(), + endpointProvider.getFirstDefaultEndpoint(identifier.getValue()).filter(Endpoint::hasAddress) + .map(Endpoint::getAddress).orElse(null))) + .filter(t -> t.getTargetEndpointUrl() != null).collect(Collectors.toList()); execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); } } diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java index 9c0b845d..a23df160 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java @@ -1,22 +1,19 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.BPMN_EXECUTION_VARIABLE_BUNDLE; import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; -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.delegate.AbstractServiceDelegate; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; 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; @@ -32,9 +29,11 @@ public class UpdateResources extends AbstractServiceDelegate implements Initiali private final FhirContext context; - public UpdateResources(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, FhirContext context) + public UpdateResources(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper, FhirContext context) { - super(clientProvider, taskHelper); + super(clientProvider, taskHelper, readAccessHelper); + this.context = context; } @@ -42,6 +41,7 @@ public UpdateResources(FhirWebserviceClientProvider clientProvider, TaskHelper t public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); + Objects.requireNonNull(context, "fhirContext"); } @@ -50,30 +50,8 @@ public void doExecute(DelegateExecution execution) throws Exception { Task task = getCurrentTaskFromExecutionVariables(); 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()); - } + Bundle bundle = (Bundle) execution.getVariable(BPMN_EXECUTION_VARIABLE_BUNDLE); try { diff --git a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java index 8625f6f6..e5ff7d51 100644 --- a/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java +++ b/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java @@ -2,9 +2,12 @@ import org.highmed.dsf.bpe.message.SendRequest; import org.highmed.dsf.bpe.service.CheckRequest; +import org.highmed.dsf.bpe.service.DownloadBundle; import org.highmed.dsf.bpe.service.SelectResourceAndTargets; import org.highmed.dsf.bpe.service.UpdateResources; +import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.organization.EndpointProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.springframework.beans.factory.annotation.Autowired; @@ -19,11 +22,17 @@ public class UpdateResourcesConfig @Autowired private FhirWebserviceClientProvider clientProvider; + @Autowired + private TaskHelper taskHelper; + + @Autowired + private ReadAccessHelper readAccessHelper; + @Autowired private OrganizationProvider organizationProvider; @Autowired - private TaskHelper taskHelper; + private EndpointProvider endpointProvider; @Autowired private FhirContext fhirContext; @@ -31,24 +40,31 @@ public class UpdateResourcesConfig @Bean public SendRequest sendRequest() { - return new SendRequest(clientProvider, taskHelper, organizationProvider, fhirContext); + return new SendRequest(clientProvider, taskHelper, readAccessHelper, organizationProvider, fhirContext); } @Bean public SelectResourceAndTargets selectUpdateResourcesTargets() { - return new SelectResourceAndTargets(clientProvider, taskHelper, organizationProvider); + return new SelectResourceAndTargets(clientProvider, taskHelper, readAccessHelper, organizationProvider, + endpointProvider); } @Bean - public UpdateResources updateResources() + public DownloadBundle downloadBundle() { - return new UpdateResources(clientProvider, taskHelper, fhirContext); + return new DownloadBundle(clientProvider, taskHelper, readAccessHelper); } @Bean public CheckRequest checkRequest() { - return new CheckRequest(clientProvider, taskHelper, organizationProvider); + return new CheckRequest(clientProvider, taskHelper, readAccessHelper); + } + + @Bean + public UpdateResources updateResources() + { + return new UpdateResources(clientProvider, taskHelper, readAccessHelper, fhirContext); } } diff --git a/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn b/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn index 163eaf4c..b19a714c 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn +++ b/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn @@ -1,11 +1,11 @@ <?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_0k0v4i2" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0"> - <bpmn:process id="executeUpdateResources" isExecutable="true" camunda:versionTag="0.5.0"> +<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_0k0v4i2" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> + <bpmn:process id="highmedorg_executeUpdateResources" isExecutable="true" camunda:versionTag="0.5.0"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_0djh0eg</bpmn:outgoing> <bpmn:messageEventDefinition messageRef="Message_1r6vnvn" /> </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_0djh0eg" sourceRef="StartEvent_1" targetRef="checkRequest" /> + <bpmn:sequenceFlow id="SequenceFlow_0djh0eg" sourceRef="StartEvent_1" targetRef="downloadBundle" /> <bpmn:serviceTask id="updateResources" name="updateResources" camunda:class="org.highmed.dsf.bpe.service.UpdateResources"> <bpmn:incoming>SequenceFlow_141lpsf</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0eygcor</bpmn:outgoing> @@ -16,35 +16,47 @@ <bpmn:sequenceFlow id="SequenceFlow_0eygcor" sourceRef="updateResources" targetRef="EndEvent_1i1w8yx" /> <bpmn:sequenceFlow id="SequenceFlow_141lpsf" sourceRef="checkRequest" targetRef="updateResources" /> <bpmn:serviceTask id="checkRequest" name="checkRequest" camunda:class="org.highmed.dsf.bpe.service.CheckRequest"> - <bpmn:incoming>SequenceFlow_0djh0eg</bpmn:incoming> + <bpmn:incoming>Flow_1iamqwv</bpmn:incoming> <bpmn:outgoing>SequenceFlow_141lpsf</bpmn:outgoing> </bpmn:serviceTask> + <bpmn:sequenceFlow id="Flow_1iamqwv" sourceRef="downloadBundle" targetRef="checkRequest" /> + <bpmn:serviceTask id="downloadBundle" name="downloadBundle" camunda:class="org.highmed.dsf.bpe.service.DownloadBundle"> + <bpmn:incoming>SequenceFlow_0djh0eg</bpmn:incoming> + <bpmn:outgoing>Flow_1iamqwv</bpmn:outgoing> + </bpmn:serviceTask> </bpmn:process> <bpmn:message id="Message_1r6vnvn" name="executeUpdateResourcesMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="executeUpdateResources"> - <bpmndi:BPMNShape id="StartEvent_1orek60_di" bpmnElement="StartEvent_1"> - <dc:Bounds x="179" y="103" width="36" height="36" /> - </bpmndi:BPMNShape> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="highmedorg_executeUpdateResources"> + <bpmndi:BPMNEdge id="Flow_1iamqwv_di" bpmnElement="Flow_1iamqwv"> + <di:waypoint x="370" y="121" /> + <di:waypoint x="430" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_141lpsf_di" bpmnElement="SequenceFlow_141lpsf"> + <di:waypoint x="530" y="121" /> + <di:waypoint x="593" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0eygcor_di" bpmnElement="SequenceFlow_0eygcor"> + <di:waypoint x="693" y="121" /> + <di:waypoint x="752" y="121" /> + </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0djh0eg_di" bpmnElement="SequenceFlow_0djh0eg"> <di:waypoint x="215" y="121" /> <di:waypoint x="270" y="121" /> </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1orek60_di" bpmnElement="StartEvent_1"> + <dc:Bounds x="179" y="103" width="36" height="36" /> + </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_1t3955f_di" bpmnElement="updateResources"> - <dc:Bounds x="433" y="81" width="100" height="80" /> + <dc:Bounds x="593" y="81" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1i1w8yx_di" bpmnElement="EndEvent_1i1w8yx"> - <dc:Bounds x="622" y="103" width="36" height="36" /> + <dc:Bounds x="752" y="103" width="36" height="36" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0eygcor_di" bpmnElement="SequenceFlow_0eygcor"> - <di:waypoint x="533" y="121" /> - <di:waypoint x="622" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_141lpsf_di" bpmnElement="SequenceFlow_141lpsf"> - <di:waypoint x="370" y="121" /> - <di:waypoint x="433" y="121" /> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_1aaurev_di" bpmnElement="checkRequest"> + <dc:Bounds x="430" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_059xaj1_di" bpmnElement="downloadBundle"> <dc:Bounds x="270" y="81" width="100" height="80" /> </bpmndi:BPMNShape> </bpmndi:BPMNPlane> diff --git a/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn b/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn index a8cc6c39..b1870ae7 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn +++ b/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn @@ -1,6 +1,6 @@ <?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_0os0n0z" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="requestUpdateResources" isExecutable="true" camunda:versionTag="0.5.0"> +<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_0os0n0z" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.8.1"> + <bpmn:process id="highmedorg_requestUpdateResources" isExecutable="true" camunda:versionTag="0.5.0"> <bpmn:sequenceFlow id="SequenceFlow_1ryplwc" sourceRef="StartEvent_1" targetRef="selectResourceAndTargets" /> <bpmn:sequenceFlow id="SequenceFlow_1u4zxix" sourceRef="selectResourceAndTargets" targetRef="sendRequest" /> <bpmn:endEvent id="EndEvent_1f9cjs7"> @@ -10,8 +10,7 @@ <bpmn:sendTask id="sendRequest" name="sendRequest" camunda:class="org.highmed.dsf.bpe.message.SendRequest"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">executeUpdateResources</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.5.0</camunda:inputParameter> + <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/executeUpdateResources/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">executeUpdateResourcesMessage</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-update-resources</camunda:inputParameter> </camunda:inputOutput> @@ -31,7 +30,7 @@ </bpmn:process> <bpmn:message id="Message_1buqzgq" name="requestUpdateResourcesMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="requestUpdateResources"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="highmedorg_requestUpdateResources"> <bpmndi:BPMNEdge id="SequenceFlow_1xwki6k_di" bpmnElement="SequenceFlow_1xwki6k"> <di:waypoint x="515" y="121" /> <di:waypoint x="565" y="121" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml index 6fa2d639..b70420a6 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml @@ -1,58 +1,46 @@ <ActivityDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="executeUpdateResourcesMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources" /> </extension> + <extension url="requester"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + </valueIdentifier> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="REMOTE_ORGANIZATION" /> + </valueCoding> + </extension> + <extension url="recipient"> + <valueCoding> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ALL" /> + </valueCoding> + </extension> </extension> <url value="http://highmed.org/bpe/Process/executeUpdateResources" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="executeUpdateResources" /> + <name value="ExecuteUpdateResources" /> <title value="Execute Update of Resources" /> <subtitle value="Process to Download and Execute FHIR Bundle" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-07" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml index 9dadde3f..d2f7f5b7 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml @@ -1,52 +1,52 @@ <ActivityDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="requestUpdateResourcesMessage" /> </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources" /> </extension> + <extension url="requester"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + </valueIdentifier> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ORGANIZATION" /> + </valueCoding> + </extension> + <extension url="recipient"> + <valueCoding> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> + <valueIdentifier> + <system value="http://highmed.org/sid/organization-identifier" /> + <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + </valueIdentifier> + </extension> + <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> + <code value="LOCAL_ORGANIZATION" /> + </valueCoding> + </extension> </extension> <url value="http://highmed.org/bpe/Process/requestUpdateResources" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="requestUpdateResources" /> + <name value="RequestUpdateResources" /> <title value="Request Update of Resources" /> <subtitle value="Process to Request a Bundle Download" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-07" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml index 0909b4eb..9ea9e494 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml @@ -1,33 +1,33 @@ <CodeSystem xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> + </tag> </meta> - <url value="http://highmed.org/fhir/CodeSystem/update-resources"/> + <url value="http://highmed.org/fhir/CodeSystem/update-resources" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="HiGHmed_Update_Resources"/> - <title value="HiGHmed Update Resources"/> + <name value="HiGHmed_Update_Resources" /> + <title value="HiGHmed Update Resources" /> <!-- status managed by bpe --> <status value="unknown" /> - <experimental value="false"/> - <date value="2021-01-26"/> - <publisher value="HiGHmed"/> - <description value="CodeSystem with standard values for the process update resources"/> - <caseSensitive value="true"/> - <hierarchyMeaning value="grouped-by"/> - <versionNeeded value="false"/> - <content value="complete"/> + <experimental value="false" /> + <date value="2021-06-07" /> + <publisher value="HiGHmed" /> + <description value="CodeSystem with standard values for the process update resources" /> + <caseSensitive value="true" /> + <hierarchyMeaning value="grouped-by" /> + <versionNeeded value="false" /> + <content value="complete" /> <concept> - <code value="bundle-reference"/> - <display value="Bundle Reference"/> - <definition value="Bundle reference to be downloaded to update local resources"/> + <code value="bundle-reference" /> + <display value="Bundle Reference" /> + <definition value="Bundle reference to be downloaded to update local resources" /> </concept> <concept> - <code value="organization-identifier-search-parameter"/> - <display value="Organization Identifier Search Parameter"/> - <definition value="Organization system identifier as search parameter to define which organization are targets"/> + <code value="organization-identifier-search-parameter" /> + <display value="Organization Identifier Search Parameter" /> + <definition value="Organization system identifier as search parameter to define which organization are targets" /> </concept> </CodeSystem> \ No newline at end of file diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml index 0075d577..c8b10c94 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-07" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml index abd1fe4f..acfbb685 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml @@ -1,8 +1,8 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources" /> @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-06-07" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml index 36e81323..13ab8482 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml @@ -1,26 +1,25 @@ <ValueSet xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> + </tag> </meta> - <url value="http://highmed.org/fhir/ValueSet/update-resources"/> + <url value="http://highmed.org/fhir/ValueSet/update-resources" /> <!-- version managed by bpe --> <version value="${version}" /> - <name value="HiGHmed_Update_Resources"/> - <title value="HiGHmed Update Resources"/> + <name value="HiGHmed_Update_Resources" /> + <title value="HiGHmed Update Resources" /> <!-- status managed by bpe --> <status value="unknown" /> - <experimental value="false"/> - <date value="2021-01-26"/> - <publisher value="HiGHmed"/> - <description - value="ValueSet with standard values for the process update resources"/> - <immutable value="true"/> + <experimental value="false" /> + <date value="2021-06-07" /> + <publisher value="HiGHmed" /> + <description value="ValueSet with standard values for the process update resources" /> + <immutable value="true" /> <compose> <include> - <system value="http://highmed.org/fhir/CodeSystem/update-resources"/> + <system value="http://highmed.org/fhir/CodeSystem/update-resources" /> </include> </compose> </ValueSet> \ No newline at end of file diff --git a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/AbstractUpdateResource3MedicTtpExampleStarter.java b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/AbstractUpdateResource3MedicTtpExampleStarter.java new file mode 100644 index 00000000..9fa0731b --- /dev/null +++ b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/AbstractUpdateResource3MedicTtpExampleStarter.java @@ -0,0 +1,81 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; + +import java.util.Collections; +import java.util.Date; +import java.util.Map; + +import org.highmed.fhir.client.FhirWebserviceClient; +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.ResourceType; +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; + +public abstract class AbstractUpdateResource3MedicTtpExampleStarter +{ + protected void main(String[] args, String baseUrl) throws Exception + { + ExampleStarter starter = ExampleStarter.forServer(args, baseUrl); + Task task = createStartResource(starter, baseUrl); + starter.startWith(task); + } + + private Task createStartResource(ExampleStarter starter, String ttpUrl) throws Exception + { + Bundle allowList = getAllowList(starter, ttpUrl); + + Task task = new Task(); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); + + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + + task.addInput() + .setValue(new Reference(new IdType(ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), + allowList.getIdElement().getVersionIdPart()))) + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) + .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); + + task.addInput().setValue(new StringType(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER + "|")).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) + .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER); + + return task; + } + + private Bundle getAllowList(ExampleStarter starter, String ttpUrl) throws Exception + { + FhirWebserviceClient client = starter.createClient(ttpUrl); + Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", + Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|allow_list"))); + + if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) + throw new IllegalStateException("Expected a single allow list Bundle"); + + return (Bundle) searchResult.getEntryFirstRep().getResource(); + } +} diff --git a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpDockerExampleStarter.java b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpDockerExampleStarter.java new file mode 100644 index 00000000..da80cea3 --- /dev/null +++ b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpDockerExampleStarter.java @@ -0,0 +1,15 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_DOCKER_FHIR_BASE_URL; + +public class UpdateResource3MedicTtpDockerExampleStarter extends AbstractUpdateResource3MedicTtpExampleStarter +{ + // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate + // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate + // password + public static void main(String[] args) throws Exception + { + new UpdateResource3MedicTtpDockerExampleStarter().main(args, TTP_DOCKER_FHIR_BASE_URL); + } +} diff --git a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index 813fdfe7..afd39d7d 100644 --- a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -1,32 +1,8 @@ package org.highmed.dsf.bpe.start; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; -import java.util.Collections; -import java.util.Date; -import java.util.Map; - -import org.highmed.fhir.client.FhirWebserviceClient; -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.ResourceType; -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; - -public class UpdateResource3MedicTtpExampleStarter +public class UpdateResource3MedicTtpExampleStarter extends AbstractUpdateResource3MedicTtpExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 @@ -34,53 +10,6 @@ public class UpdateResource3MedicTtpExampleStarter // password public static void main(String[] args) throws Exception { - ExampleStarter starter = ExampleStarter.forServer(args, TTP_FHIR_BASE_URL); - Task task = createStartResource(starter); - starter.startWith(task); - } - - private static Task createStartResource(ExampleStarter starter) throws Exception - { - Bundle allowList = getAllowList(starter); - - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - task.addInput() - .setValue(new Reference(new IdType(ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), - allowList.getIdElement().getVersionIdPart()))) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) - .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); - - task.addInput().setValue(new StringType("http://highmed.org/fhir/NamingSystem/organization-identifier|")) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) - .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER); - - return task; - } - - private static Bundle getAllowList(ExampleStarter starter) throws Exception - { - FhirWebserviceClient client = starter.createClient(TTP_FHIR_BASE_URL); - Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", - Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); - - if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) - throw new IllegalStateException("Expected a single allow list Bundle"); - - return (Bundle) searchResult.getEntryFirstRep().getResource(); + new UpdateResource3MedicTtpExampleStarter().main(args, TTP_FHIR_BASE_URL); } } diff --git a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java new file mode 100644 index 00000000..8c763dfa --- /dev/null +++ b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -0,0 +1,89 @@ +package org.highmed.dsf.fhir.profile; + +import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.VERSION; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; + +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelper; +import org.highmed.dsf.fhir.authorization.process.ProcessAuthorizationHelperImpl; +import org.highmed.dsf.fhir.validation.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidatorImpl; +import org.highmed.dsf.fhir.validation.ValidationSupportRule; +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.junit.ClassRule; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ca.uhn.fhir.validation.ResultSeverityEnum; +import ca.uhn.fhir.validation.ValidationResult; + +public class ActivityDefinitionProfileTest +{ + private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); + + @ClassRule + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + Arrays.asList("highmed-activity-definition-0.5.0.xml", "highmed-extension-process-authorization-0.5.0.xml", + "highmed-extension-process-authorization-consortium-role-0.5.0.xml", + "highmed-extension-process-authorization-organization-0.5.0.xml", + "highmed-coding-process-authorization-local-all-0.5.0.xml", + "highmed-coding-process-authorization-local-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-local-organization-0.5.0.xml", + "highmed-coding-process-authorization-remote-all-0.5.0.xml", + "highmed-coding-process-authorization-remote-consortium-role-0.5.0.xml", + "highmed-coding-process-authorization-remote-organization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-0.5.0.xml"), + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-process-authorization-recipient-0.5.0.xml", + "highmed-process-authorization-requester-0.5.0.xml")); + + private final ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + private final ProcessAuthorizationHelper processAuthorizationHelper = new ProcessAuthorizationHelperImpl(); + + @Test + public void testExecuteUpdateResourcesValid() throws Exception + { + try (InputStream in = Files.newInputStream( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue( + processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); + } + } + + @Test + public void testRequestUpdateResourcesValid() throws Exception + { + try (InputStream in = Files.newInputStream( + Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml"))) + { + ActivityDefinition ad = validationRule.getFhirContext().newXmlParser() + .parseResource(ActivityDefinition.class, in); + + ValidationResult result = resourceValidator.validate(ad); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + + assertTrue( + processAuthorizationHelper.isValid(ad, taskProfile -> true, orgIdentifier -> true, role -> true)); + } + } +} \ No newline at end of file diff --git a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index c9b8ca88..b90a947f 100644 --- a/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -55,9 +55,9 @@ public class TaskProfileTest public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-request-update-resources.xml", "highmed-task-execute-update-resources.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-update-resources.xml"), - Arrays.asList("highmed-authorization-role-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", + Arrays.asList("highmed-read-access-tag-0.5.0.xml", "highmed-bpmn-message-0.5.0.xml", "highmed-update-resources.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), From fb67fa6ab9408374b2332518e52704d9d75295d6 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Sun, 20 Jun 2021 22:44:45 +0200 Subject: [PATCH 11/21] removes explicit addLocal calls Explicitly adding LOCAL read access is not needed anymore, adding read access for ORGANIZATION will automatically add read access for LOCAL if not present. --- .../java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java | 1 - ...ractRequestFeasibilityFromMedicsViaMedic1ExampleStarter.java | 2 -- 2 files changed, 3 deletions(-) diff --git a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java index 677c0a23..faa94230 100644 --- a/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java +++ b/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java @@ -154,7 +154,6 @@ protected String saveResultSetAsBinaryForTtp(ResultSet resultSet, String ttpIden { byte[] content = serializeResultSet(resultSet); Binary binary = new Binary().setContentType(OPENEHR_MIMETYPE_JSON).setData(content); - getReadAccessHelper().addLocal(binary); getReadAccessHelper().addOrganization(binary, ttpIdentifier); IdType created = createBinaryResource(binary); diff --git a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter.java index 3fff453f..1cc918ac 100644 --- a/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/AbstractRequestFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -98,7 +98,6 @@ private Group createGroup(String name) new Expression().setLanguageElement(CODE_TYPE_AQL_QUERY).setExpression("SELECT COUNT(e) FROM EHR e")); group.setName(name); - readAccessHelper.addLocal(group); Arrays.stream(medicIdentifier).forEach(i -> readAccessHelper.addOrganization(group, i)); readAccessHelper.addOrganization(group, ttpIdentifier); @@ -126,7 +125,6 @@ private ResearchStudy createResearchStudy(Group group1, Group group2) .setValue(new Reference().setType(ResourceType.Organization.name()).setIdentifier(new Identifier() .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue(ttpIdentifier))); - readAccessHelper.addLocal(researchStudy); Arrays.stream(medicIdentifier).forEach(i -> readAccessHelper.addOrganization(researchStudy, i)); readAccessHelper.addOrganization(researchStudy, ttpIdentifier); From 77a7962a825017dba6ca85f86c8042292ff67aab Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Thu, 5 Aug 2021 23:43:14 +0200 Subject: [PATCH 12/21] improved description, fixed typos --- .../src/main/resources/fhir/ActivityDefinition/highmed-ping.xml | 2 +- .../src/main/resources/fhir/ActivityDefinition/highmed-pong.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml index 164b08a6..d6d7bf61 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml @@ -63,6 +63,6 @@ <value value="pmo@highmed.org" /> </telecom> </contact> - <description value="Process to send PING messages to remote Organizations and to receive corresponding PONG message" /> + <description value="Process to send PING messages to remote Organizations and to receive corresponding PONG messages" /> <kind value="Task" /> </ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml index 903ea016..4f705257 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml @@ -43,6 +43,6 @@ <value value="pmo@highmed.org" /> </telecom> </contact> - <description value="Process startet by PING messages and to send corresponding PONG messages back remote Organizations" /> + <description value="Process startet by PING messages and to send corresponding PONG messages back to remote Organizations" /> <kind value="Task" /> </ActivityDefinition> \ No newline at end of file From b79e780784e674136d68f17c74fbc115e8daf541 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Thu, 5 Aug 2021 23:45:39 +0200 Subject: [PATCH 13/21] added creation of generated group resource in fhir server Not creating the generated group resources in the fhir server resulted in a validation error of the completed Task resource, since the reference to the groups as extension of the result outputs, did not validate. --- .../highmed/dsf/bpe/service/ExtractInputValues.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java index b194d615..e80f59cb 100644 --- a/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java +++ b/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java @@ -8,7 +8,6 @@ import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; import java.util.List; -import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -23,7 +22,7 @@ import org.highmed.dsf.fhir.variables.FhirResourcesListValues; import org.hl7.fhir.r4.model.Expression; import org.hl7.fhir.r4.model.Group; -import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.Group.GroupType; import org.hl7.fhir.r4.model.Task; import org.springframework.beans.factory.InitializingBean; @@ -69,10 +68,13 @@ private List<Group> getCohortDefinitions(Stream<String> queries) return queries.map(q -> { Group group = new Group(); - group.setIdElement(new IdType(UUID.randomUUID().toString())); + group.setType(GroupType.PERSON); + group.setActual(false); group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY) .setValue(new Expression().setLanguageElement(CODE_TYPE_AQL_QUERY).setExpression(q)); - return group; + getReadAccessHelper().addLocal(group); + + return getFhirWebserviceClientProvider().getLocalWebserviceClient().create(group); }).collect(Collectors.toList()); } From d22ae7117e8f6b6bf3c4c1489b193672a0e330a2 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 18 Aug 2021 02:08:15 +0200 Subject: [PATCH 14/21] modified copy processes profile for highmed/highmed-dsf#224 --- dsf-bpe-process-feasibility/pom.xml | 20 ++++++++++---------- dsf-bpe-process-local-services/pom.xml | 20 ++++++++++---------- dsf-bpe-process-ping/pom.xml | 20 ++++++++++---------- dsf-bpe-process-update-allow-list/pom.xml | 20 ++++++++++---------- dsf-bpe-process-update-resources/pom.xml | 20 ++++++++++---------- 5 files changed, 50 insertions(+), 50 deletions(-) diff --git a/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe-process-feasibility/pom.xml index 0287a9ad..1e9f0cee 100644 --- a/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe-process-feasibility/pom.xml @@ -69,7 +69,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -86,7 +86,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -103,7 +103,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -120,7 +120,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -137,7 +137,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -220,35 +220,35 @@ <configuration> <filesets> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> diff --git a/dsf-bpe-process-local-services/pom.xml b/dsf-bpe-process-local-services/pom.xml index 939eace4..2ac21bd4 100644 --- a/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe-process-local-services/pom.xml @@ -70,7 +70,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -87,7 +87,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -104,7 +104,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -121,7 +121,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -138,7 +138,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -221,35 +221,35 @@ <configuration> <filesets> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> diff --git a/dsf-bpe-process-ping/pom.xml b/dsf-bpe-process-ping/pom.xml index da9d67ea..b04cc233 100644 --- a/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe-process-ping/pom.xml @@ -63,7 +63,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -80,7 +80,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -97,7 +97,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -114,7 +114,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -131,7 +131,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -214,35 +214,35 @@ <configuration> <filesets> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> diff --git a/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe-process-update-allow-list/pom.xml index 29764f70..0200b57e 100644 --- a/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe-process-update-allow-list/pom.xml @@ -63,7 +63,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -80,7 +80,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -97,7 +97,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -114,7 +114,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -131,7 +131,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -214,35 +214,35 @@ <configuration> <filesets> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> diff --git a/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe-process-update-resources/pom.xml index d3a1f244..ea1991e9 100644 --- a/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe-process-update-resources/pom.xml @@ -63,7 +63,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -80,7 +80,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -97,7 +97,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -114,7 +114,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -131,7 +131,7 @@ <version>${project.version}</version> </artifactItem> </artifactItems> - <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + <outputDirectory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</outputDirectory> </configuration> </execution> <execution> @@ -214,35 +214,35 @@ <configuration> <filesets> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> - <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <directory>${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process</directory> <includes> <include>${project.artifactId}-${project.version}.jar</include> </includes> From 3e37a993a0eb931ed3b70d2ae53afe4faa69c0da Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 18 Aug 2021 02:09:30 +0200 Subject: [PATCH 15/21] modified allow list org property name to only use lower case and dots --- .../fhir/ActivityDefinition/highmed-updateAllowList.xml | 4 ++-- .../ActivityDefinition/highmed-executeUpdateResources.xml | 2 +- .../ActivityDefinition/highmed-requestUpdateResources.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml index 787476ea..1730c55d 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml @@ -17,7 +17,7 @@ <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> <valueIdentifier> <system value="http://highmed.org/sid/organization-identifier" /> - <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + <value value="${org.highmed.dsf.bpe.allow.list.organization:hs-heilbronn.de}" /> </valueIdentifier> </extension> <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> @@ -29,7 +29,7 @@ <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> <valueIdentifier> <system value="http://highmed.org/sid/organization-identifier" /> - <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + <value value="${org.highmed.dsf.bpe.allow.list.organization:hs-heilbronn.de}" /> </valueIdentifier> </extension> <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml index b70420a6..ef94a41f 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml @@ -17,7 +17,7 @@ <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> <valueIdentifier> <system value="http://highmed.org/sid/organization-identifier" /> - <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + <value value="${org.highmed.dsf.bpe.allow.list.organization:hs-heilbronn.de}" /> </valueIdentifier> </extension> <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml index d2f7f5b7..e7bec910 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml @@ -17,7 +17,7 @@ <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> <valueIdentifier> <system value="http://highmed.org/sid/organization-identifier" /> - <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + <value value="${org.highmed.dsf.bpe.allow.list.organization:hs-heilbronn.de}" /> </valueIdentifier> </extension> <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> @@ -29,7 +29,7 @@ <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization-organization"> <valueIdentifier> <system value="http://highmed.org/sid/organization-identifier" /> - <value value="${org.highmed.dsf.bpe.allowListOrganization:hs-heilbronn.de}" /> + <value value="${org.highmed.dsf.bpe.allow.list.organization:hs-heilbronn.de}" /> </valueIdentifier> </extension> <system value="http://highmed.org/fhir/CodeSystem/process-authorization" /> From 05affe1e67cf5bb89260b80f8c49c25595c94717 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Thu, 19 Aug 2021 10:59:24 +0200 Subject: [PATCH 16/21] upgrades maven dependencies to latest compatible versions, closes #24 --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f395ad26..b43f53ab 100644 --- a/pom.xml +++ b/pom.xml @@ -102,7 +102,7 @@ <dependency> <groupId>de.hs-heilbronn.mi</groupId> <artifactId>log4j2-utils</artifactId> - <version>0.9.0</version> + <version>0.10.0</version> </dependency> <!-- logging --> @@ -115,7 +115,7 @@ <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> - <version>2.12.3</version> + <version>2.12.4</version> </dependency> <!-- testing --> @@ -178,7 +178,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> - <version>3.1.2</version> + <version>3.2.0</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -188,7 +188,7 @@ <plugin> <groupId>net.revelc.code.formatter</groupId> <artifactId>formatter-maven-plugin</artifactId> - <version>2.15.0</version> + <version>2.16.0</version> </plugin> <plugin> <groupId>net.revelc.code</groupId> From 760d02593f1263f21915b3f5a99904ea84c59355 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 24 Aug 2021 03:27:36 +0200 Subject: [PATCH 17/21] fixed display value --- .../resources/fhir/CodeSystem/highmed-update-allow-list.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml index 7fad8a3e..be149a5e 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml @@ -22,7 +22,7 @@ <content value="complete" /> <concept> <code value="allow_list" /> - <display value="HiGHmed Allow List" /> + <display value="Allow List" /> <definition value="Allow list identifying organizations" /> </concept> </CodeSystem> \ No newline at end of file From ad0e2b1c1d57a26121c95c260cfaf4601e12239c Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 24 Aug 2021 03:31:21 +0200 Subject: [PATCH 18/21] fhir date to 2021-08-24 --- .../fhir/ActivityDefinition/highmed-computeFeasibility.xml | 2 +- .../fhir/ActivityDefinition/highmed-executeFeasibility.xml | 2 +- .../fhir/ActivityDefinition/highmed-requestFeasibility.xml | 2 +- .../src/main/resources/fhir/CodeSystem/highmed-feasibility.xml | 2 +- .../StructureDefinition/highmed-task-compute-feasibility.xml | 2 +- .../fhir/StructureDefinition/highmed-task-error-feasibility.xml | 2 +- .../StructureDefinition/highmed-task-execute-feasibility.xml | 2 +- .../highmed-task-multi-medic-result-feasibility.xml | 2 +- .../StructureDefinition/highmed-task-request-feasibility.xml | 2 +- .../highmed-task-single-medic-result-feasibility.xml | 2 +- .../src/main/resources/fhir/ValueSet/highmed-feasibility.xml | 2 +- .../ActivityDefinition/highmed-localServicesIntegration.xml | 2 +- .../highmed-task-local-services-integration.xml | 2 +- .../src/main/resources/fhir/ActivityDefinition/highmed-ping.xml | 2 +- .../src/main/resources/fhir/ActivityDefinition/highmed-pong.xml | 2 +- .../resources/fhir/StructureDefinition/highmed-task-ping.xml | 2 +- .../resources/fhir/StructureDefinition/highmed-task-pong.xml | 2 +- .../StructureDefinition/highmed-task-start-ping-process.xml | 2 +- .../fhir/ActivityDefinition/highmed-downloadAllowList.xml | 2 +- .../fhir/ActivityDefinition/highmed-updateAllowList.xml | 2 +- .../resources/fhir/CodeSystem/highmed-update-allow-list.xml | 2 +- .../StructureDefinition/highmed-task-download-allow-list.xml | 2 +- .../fhir/StructureDefinition/highmed-task-update-allow-list.xml | 2 +- .../main/resources/fhir/ValueSet/highmed-update-allow-list.xml | 2 +- .../fhir/ActivityDefinition/highmed-executeUpdateResources.xml | 2 +- .../fhir/ActivityDefinition/highmed-requestUpdateResources.xml | 2 +- .../main/resources/fhir/CodeSystem/highmed-update-resources.xml | 2 +- .../highmed-task-execute-update-resources.xml | 2 +- .../highmed-task-request-update-resources.xml | 2 +- .../main/resources/fhir/ValueSet/highmed-update-resources.xml | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml index 2b8becf9..479dd7d1 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml @@ -110,7 +110,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml index e98c22a7..97c4de7d 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml @@ -82,7 +82,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml index c033d843..c2ad36a1 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml @@ -158,7 +158,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml index 9be78431..12c62aa2 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-01-26" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <description value="CodeSystem with standard values for feasibility processes" /> <caseSensitive value="true" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml index 63005a24..d550ac41 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml index fb1002ff..a225592d 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml index 2052b375..f0c63dff 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml index cfbbabb4..fbdd3578 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml index 4b17dac7..185e164c 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml index 46199c9d..54aa89e8 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml index 4d1d41b3..6c7289ba 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <description value="ValueSet with standard values for feasibility processes" /> <immutable value="true" /> diff --git a/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml b/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml index e02e4a28..55e44e5f 100644 --- a/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml +++ b/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml @@ -62,7 +62,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml b/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml index 866ef05c..b56866de 100644 --- a/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml +++ b/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-09" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml index d6d7bf61..06bd3149 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml @@ -54,7 +54,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-08" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml index 4f705257..b4aa01e2 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml @@ -34,7 +34,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-08" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml index a5eca4f7..f388c627 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-08" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml index 0c7dc81a..d4084cf4 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-08" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml index e81f8374..aebc6cde 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-08" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml index 2dcfd59d..ab13418a 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml @@ -34,7 +34,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml index 1730c55d..077df007 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml @@ -46,7 +46,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml index be149a5e..fbce2f2b 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <description value="CodeSystem with standard values for the processes update and download allow list" /> <caseSensitive value="true" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml index 8111d9d7..afcb991c 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml index a71e8a5e..83f474ba 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml index 46df3f2b..44450c21 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <description value="ValueSet with standard values for the process update allow list" /> <immutable value="true" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml index ef94a41f..cb9ef22e 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml @@ -40,7 +40,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml index e7bec910..ed0d5b6c 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml @@ -46,7 +46,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml index 9ea9e494..6589ed88 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <description value="CodeSystem with standard values for the process update resources" /> <caseSensitive value="true" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml index c8b10c94..276e9aad 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml index acfbb685..50b69c78 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml @@ -12,7 +12,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml index 13ab8482..6ab0bb9d 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml @@ -13,7 +13,7 @@ <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> - <date value="2021-06-07" /> + <date value="2021-08-24" /> <publisher value="HiGHmed" /> <description value="ValueSet with standard values for the process update resources" /> <immutable value="true" /> From 03b15ac62d6e0f7410cf399dca461e6a10241e86 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 24 Aug 2021 15:39:22 +0200 Subject: [PATCH 19/21] added task profile versions to ActivityDefinitions and BPMN files Task profiles need to be version specific in order to allow for executing of processes with same name different version on the same DSF FHIR/BPE instances. --- .../src/main/resources/bpe/computeFeasibility.bpmn | 4 ++-- .../src/main/resources/bpe/executeFeasibility.bpmn | 2 +- .../src/main/resources/bpe/requestFeasibility.bpmn | 4 ++-- .../fhir/ActivityDefinition/highmed-computeFeasibility.xml | 4 ++-- .../fhir/ActivityDefinition/highmed-executeFeasibility.xml | 2 +- .../fhir/ActivityDefinition/highmed-requestFeasibility.xml | 6 +++--- .../src/main/resources/bpe/localServicesIntegration.bpmn | 2 +- .../ActivityDefinition/highmed-localServicesIntegration.xml | 2 +- dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn | 2 +- dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn | 2 +- .../main/resources/fhir/ActivityDefinition/highmed-ping.xml | 4 ++-- .../main/resources/fhir/ActivityDefinition/highmed-pong.xml | 2 +- .../fhir/ActivityDefinition/highmed-downloadAllowList.xml | 2 +- .../fhir/ActivityDefinition/highmed-updateAllowList.xml | 2 +- .../src/main/resources/bpe/requestUpdateResources.bpmn | 2 +- .../ActivityDefinition/highmed-executeUpdateResources.xml | 2 +- .../ActivityDefinition/highmed-requestUpdateResources.xml | 2 +- 17 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn index 07f17b2e..ee7d301d 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn @@ -47,7 +47,7 @@ <camunda:inputOutput> <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/requestFeasibility/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">resultMultiMedicFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility|0.5.0</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>Flow_1r6dq8y</bpmn:incoming> @@ -98,7 +98,7 @@ <camunda:inputOutput> <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/requestFeasibility/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">errorMultiMedicFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility|0.5.0</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>Flow_1tmnvhl</bpmn:incoming> diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn index 6e1ba9f2..230c52c7 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn @@ -26,7 +26,7 @@ <camunda:inputOutput> <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/computeFeasibility/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">resultSingleMedicFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility|0.5.0</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0ascyjc</bpmn:incoming> diff --git a/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn b/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn index e9e704df..597e131c 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn +++ b/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn @@ -14,7 +14,7 @@ <camunda:inputOutput> <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/executeFeasibility/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">executeFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-feasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-feasibility|0.5.0</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_035oihl</bpmn:incoming> @@ -34,7 +34,7 @@ <camunda:inputOutput> <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/computeFeasibility/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">computeFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-compute-feasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-compute-feasibility|0.5.0</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0b5s4ef</bpmn:incoming> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml index 479dd7d1..2149ad7e 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml @@ -10,7 +10,7 @@ <valueString value="computeFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility|${version}" /> </extension> <extension url="requester"> <valueCoding> @@ -58,7 +58,7 @@ <valueString value="resultSingleMedicFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility|${version}" /> </extension> <extension url="requester"> <valueCoding> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml index 97c4de7d..ceb27b2c 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml @@ -10,7 +10,7 @@ <valueString value="executeFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility|${version}" /> </extension> <extension url="requester"> <valueCoding> diff --git a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml index c2ad36a1..44c96360 100644 --- a/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml +++ b/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml @@ -10,7 +10,7 @@ <valueString value="requestFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility|${version}" /> </extension> <extension url="requester"> <valueCoding> @@ -58,7 +58,7 @@ <valueString value="resultMultiMedicFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility|${version}" /> </extension> <extension url="requester"> <valueCoding> @@ -106,7 +106,7 @@ <valueString value="errorMultiMedicFeasibilityMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility|${version}" /> </extension> <extension url="requester"> <valueCoding> diff --git a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn index 42da7ac9..a7449ba2 100644 --- a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn +++ b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn @@ -97,7 +97,7 @@ <camunda:inputParameter name="messageName">resultSingleMedicFeasibilityMessage</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.5.0</camunda:inputParameter> <camunda:inputParameter name="processDefinitionKey">computeFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility|0.5.0</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>Flow_0m4rhl9</bpmn:incoming> diff --git a/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml b/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml index 55e44e5f..510b6a7d 100644 --- a/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml +++ b/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml @@ -10,7 +10,7 @@ <valueString value="localServicesIntegrationMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration|${version}" /> </extension> <extension url="requester"> <valueCoding> diff --git a/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn b/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn index 3301f3b9..1b87ce4b 100644 --- a/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn +++ b/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn @@ -12,7 +12,7 @@ <camunda:inputOutput> <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/pong/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">pingMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-ping</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-ping|0.5.0</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_05ia6lz</bpmn:incoming> diff --git a/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn b/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn index a5a3f2aa..94580681 100644 --- a/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn +++ b/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn @@ -11,7 +11,7 @@ <camunda:inputOutput> <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/ping/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">pongMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-pong</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-pong|0.5.0</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_1ism9wt</bpmn:incoming> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml index 06bd3149..fb074ac7 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml @@ -10,7 +10,7 @@ <valueString value="startPingProcessMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process|${version}" /> </extension> <extension url="requester"> <valueCoding> @@ -30,7 +30,7 @@ <valueString value="pongMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-pong" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-pong|${version}" /> </extension> <extension url="requester"> <valueCoding> diff --git a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml index b4aa01e2..fb6d1ce4 100644 --- a/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml +++ b/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml @@ -10,7 +10,7 @@ <valueString value="pingMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-ping" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-ping|${version}" /> </extension> <extension url="requester"> <valueCoding> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml index ab13418a..639af2d6 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml @@ -10,7 +10,7 @@ <valueString value="downloadAllowListMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list|${version}" /> </extension> <extension url="requester"> <valueCoding> diff --git a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml index 077df007..d1c7cf33 100644 --- a/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml +++ b/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml @@ -10,7 +10,7 @@ <valueString value="updateAllowListMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list|${version}" /> </extension> <extension url="requester"> <valueCoding> diff --git a/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn b/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn index b1870ae7..595694e7 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn +++ b/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn @@ -12,7 +12,7 @@ <camunda:inputOutput> <camunda:inputParameter name="instantiatesUri">http://highmed.org/bpe/Process/executeUpdateResources/0.5.0</camunda:inputParameter> <camunda:inputParameter name="messageName">executeUpdateResourcesMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-update-resources</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-update-resources|0.5.0</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_1u4zxix</bpmn:incoming> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml index cb9ef22e..bdaa2b5f 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml @@ -10,7 +10,7 @@ <valueString value="executeUpdateResourcesMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources|${version}" /> </extension> <extension url="requester"> <valueCoding> diff --git a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml index ed0d5b6c..d71a67b2 100644 --- a/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml +++ b/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml @@ -10,7 +10,7 @@ <valueString value="requestUpdateResourcesMessage" /> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources|${version}" /> </extension> <extension url="requester"> <valueCoding> From ff0247cc52b05d60d444217c3223d4109adde849 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 25 Aug 2021 00:38:17 +0200 Subject: [PATCH 20/21] removed not needed input parameters in EndEvent Input-Parameters where not deleted when using a feasibility process as a template for this one. --- .../src/main/resources/bpe/localServicesIntegration.bpmn | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn index a7449ba2..bac4e414 100644 --- a/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn +++ b/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn @@ -92,14 +92,6 @@ <bpmn:outgoing>SequenceFlow_1rmqv20</bpmn:outgoing> </bpmn:serviceTask> <bpmn:endEvent id="EndEvent"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="messageName">resultSingleMedicFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.5.0</camunda:inputParameter> - <camunda:inputParameter name="processDefinitionKey">computeFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility|0.5.0</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> <bpmn:incoming>Flow_0m4rhl9</bpmn:incoming> </bpmn:endEvent> <bpmn:sequenceFlow id="Flow_0m4rhl9" sourceRef="storeResult" targetRef="EndEvent" /> From 0217f0753252a525beb932d89cdef4e19eafc639 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 24 Aug 2021 23:07:23 +0200 Subject: [PATCH 21/21] 0.5.0 release --- dsf-bpe-process-feasibility/pom.xml | 2 +- dsf-bpe-process-local-services/pom.xml | 2 +- dsf-bpe-process-ping/pom.xml | 2 +- dsf-bpe-process-update-allow-list/pom.xml | 2 +- dsf-bpe-process-update-resources/pom.xml | 2 +- pom.xml | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe-process-feasibility/pom.xml index 1e9f0cee..7c54622c 100644 --- a/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe-process-feasibility/pom.xml @@ -8,7 +8,7 @@ <parent> <artifactId>dsf-bpe-highmed-processes-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.5.0-SNAPSHOT</version> + <version>0.5.0</version> </parent> <properties> diff --git a/dsf-bpe-process-local-services/pom.xml b/dsf-bpe-process-local-services/pom.xml index 2ac21bd4..710ff991 100644 --- a/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe-process-local-services/pom.xml @@ -9,7 +9,7 @@ <parent> <artifactId>dsf-bpe-highmed-processes-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.5.0-SNAPSHOT</version> + <version>0.5.0</version> </parent> <properties> diff --git a/dsf-bpe-process-ping/pom.xml b/dsf-bpe-process-ping/pom.xml index b04cc233..50af9679 100644 --- a/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe-process-ping/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-highmed-processes-pom</artifactId> - <version>0.5.0-SNAPSHOT</version> + <version>0.5.0</version> </parent> <properties> diff --git a/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe-process-update-allow-list/pom.xml index 0200b57e..5c39fb5f 100644 --- a/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe-process-update-allow-list/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-highmed-processes-pom</artifactId> - <version>0.5.0-SNAPSHOT</version> + <version>0.5.0</version> </parent> <properties> diff --git a/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe-process-update-resources/pom.xml index ea1991e9..856c7a6f 100644 --- a/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe-process-update-resources/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-highmed-processes-pom</artifactId> - <version>0.5.0-SNAPSHOT</version> + <version>0.5.0</version> </parent> <properties> diff --git a/pom.xml b/pom.xml index b43f53ab..24452a06 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-highmed-processes-pom</artifactId> - <version>0.5.0-SNAPSHOT</version> + <version>0.5.0</version> <packaging>pom</packaging> <modules> @@ -64,12 +64,12 @@ <dependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-process-base</artifactId> - <version>0.5.0-SNAPSHOT</version> + <version>0.5.0</version> </dependency> <dependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-fhir-validation</artifactId> - <version>0.5.0-SNAPSHOT</version> + <version>0.5.0</version> </dependency> <dependency> @@ -127,7 +127,7 @@ <dependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-process-base</artifactId> - <version>0.5.0-SNAPSHOT</version> + <version>0.5.0</version> <scope>test</scope> <type>test-jar</type> </dependency>