From e474d7409f5f7460b436b01cd6225bce1c42e0c0 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Wed, 10 Aug 2022 18:14:02 +0200 Subject: [PATCH 01/12] update to dsf 0.7.0, improve questionnaire --- dsf-bpe-process-hello-world/pom.xml | 2 +- .../highmed/dsf/bpe/ConstantsHelloWorld.java | 5 ++- .../HelloWorldProcessPluginDefinition.java | 12 ++++--- .../bpe/spring/config/HelloWorldConfig.java | 15 ++++++++ .../highmed/dsf/bpe/user/task/UserTask.java | 16 +++++++++ .../src/main/resources/bpe/helloWorld.bpmn | 31 +++++++++++++--- .../highmed-questionnaire-hello-world.xml | 36 +++++++++++++++++++ ...HelloWorldProcessPluginDefinitionTest.java | 29 +++++++++++++++ pom.xml | 12 ++++--- 9 files changed, 142 insertions(+), 16 deletions(-) create mode 100644 dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java create mode 100644 dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml create mode 100644 dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinitionTest.java diff --git a/dsf-bpe-process-hello-world/pom.xml b/dsf-bpe-process-hello-world/pom.xml index e98543a..7539838 100755 --- a/dsf-bpe-process-hello-world/pom.xml +++ b/dsf-bpe-process-hello-world/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-example-processes-pom - 0.6.0-SNAPSHOT + 0.7.0-SNAPSHOT diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/ConstantsHelloWorld.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/ConstantsHelloWorld.java index 39a4bbd..ff4972d 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/ConstantsHelloWorld.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/ConstantsHelloWorld.java @@ -5,10 +5,13 @@ public interface ConstantsHelloWorld { + String PROCESS_NAME_HELLO_WORLD = "helloWorld"; + String PROCESS_NAME_FULL_HELLO_WORLD = "highmedorg_" + PROCESS_NAME_HELLO_WORLD; + String PROFILE_HIGHMED_TASK_HELLO_WORLD = "http://highmed.org/fhir/StructureDefinition/task-hello-world"; String PROFILE_HIGHMED_TASK_HELLO_WORLD_AND_LATEST_VERSION = "http://highmed.org/fhir/StructureDefinition/task-hello-world" + "|" + VERSION; - String PROFILE_HIGHMED_TASK_HELLO_WORLD_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "helloWorld/"; + String PROFILE_HIGHMED_TASK_HELLO_WORLD_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + PROCESS_NAME_HELLO_WORLD + "/"; String PROFILE_HIGHMED_TASK_HELLO_WORLD_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_HELLO_WORLD_PROCESS_URI + VERSION; String PROFILE_HIGHMED_TASK_HELLO_WORLD_MESSAGE_NAME = "helloWorldMessage"; diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java index d5c4979..35ad074 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java @@ -1,5 +1,7 @@ package org.highmed.dsf.bpe; +import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_WORLD; + import java.time.LocalDate; import java.util.Arrays; import java.util.List; @@ -9,6 +11,7 @@ import org.highmed.dsf.bpe.spring.config.HelloWorldConfig; import org.highmed.dsf.fhir.resources.AbstractResource; import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; +import org.highmed.dsf.fhir.resources.QuestionnaireResource; import org.highmed.dsf.fhir.resources.ResourceProvider; import org.highmed.dsf.fhir.resources.StructureDefinitionResource; import org.springframework.core.env.PropertyResolver; @@ -17,8 +20,8 @@ public class HelloWorldProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "0.6.0"; - public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 4, 14); + public static final String VERSION = "0.7.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 8, 1); @Override public String getName() @@ -55,10 +58,11 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader PropertyResolver resolver) { var aHelloWorld = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-helloWorld.xml"); + var qHelloWorld = QuestionnaireResource.file("fhir/Questionnaire/highmed-questionnaire-hello-world.xml"); var tHelloWorld = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-hello-world.xml"); - Map> resourcesByProcessKeyAndVersion = Map.of("highmedorg_helloWorld/" + VERSION, - Arrays.asList(aHelloWorld, tHelloWorld)); + Map> resourcesByProcessKeyAndVersion = Map.of( + PROCESS_NAME_FULL_HELLO_WORLD + "/" + VERSION, Arrays.asList(aHelloWorld, qHelloWorld, tHelloWorld)); return ResourceProvider.read(VERSION, RELEASE_DATE, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resolver, diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java index 2299858..787361f 100755 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java @@ -1,8 +1,11 @@ package org.highmed.dsf.bpe.spring.config; import org.highmed.dsf.bpe.service.HelloWorld; +import org.highmed.dsf.bpe.user.task.UserTask; 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.questionnaire.QuestionnaireResponseHelper; import org.highmed.dsf.fhir.task.TaskHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; @@ -17,6 +20,12 @@ public class HelloWorldConfig @Autowired private TaskHelper taskHelper; + @Autowired + private OrganizationProvider organizationProvider; + + @Autowired + private QuestionnaireResponseHelper questionnaireResponseHelper; + @Autowired private ReadAccessHelper readAccessHelper; @@ -25,4 +34,10 @@ public HelloWorld helloWorld() { return new HelloWorld(clientProvider, taskHelper, readAccessHelper); } + + @Bean + public UserTask userTask() + { + return new UserTask(clientProvider, organizationProvider, questionnaireResponseHelper, readAccessHelper); + } } diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java new file mode 100644 index 0000000..bf1087c --- /dev/null +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java @@ -0,0 +1,16 @@ +package org.highmed.dsf.bpe.user.task; + +import org.highmed.dsf.bpe.listener.AbstractUserTaskListener; +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.questionnaire.QuestionnaireResponseHelper; + +public class UserTask extends AbstractUserTaskListener +{ + public UserTask(FhirWebserviceClientProvider clientProvider, OrganizationProvider organizationProvider, + QuestionnaireResponseHelper questionnaireResponseHelper, ReadAccessHelper readAccessHelper) + { + super(clientProvider, organizationProvider, questionnaireResponseHelper, readAccessHelper); + } +} diff --git a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn index 8ef97b4..e532c21 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn +++ b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn @@ -1,11 +1,12 @@ - + + - SequenceFlow_0oyvmcd + Flow_00nx7hv - + SequenceFlow_0bbhq2r SequenceFlow_0oyvmcd @@ -14,20 +15,36 @@ SequenceFlow_0bbhq2r + + + + + + http://highmed.org/fhir/Questionnaire/hello-world + #{version} + + + SequenceFlow_0oyvmcd + Flow_00nx7hv + + + + + - + - + @@ -35,6 +52,10 @@ + + + + diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml new file mode 100644 index 0000000..f3940cc --- /dev/null +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinitionTest.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinitionTest.java new file mode 100644 index 0000000..3a6c56a --- /dev/null +++ b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinitionTest.java @@ -0,0 +1,29 @@ +package org.highmed.dsf.bpe; + +import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_WORLD; +import static org.highmed.dsf.bpe.HelloWorldProcessPluginDefinition.VERSION; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import org.highmed.dsf.fhir.resources.ResourceProvider; +import org.junit.Test; +import org.springframework.core.env.StandardEnvironment; + +import ca.uhn.fhir.context.FhirContext; + +public class HelloWorldProcessPluginDefinitionTest +{ + @Test + public void testResourceLoading() throws Exception + { + ProcessPluginDefinition definition = new HelloWorldProcessPluginDefinition(); + ResourceProvider provider = definition.getResourceProvider(FhirContext.forR4(), getClass().getClassLoader(), + new StandardEnvironment()); + assertNotNull(provider); + + var helloWorld = provider.getResources(PROCESS_NAME_FULL_HELLO_WORLD + "/" + VERSION, + s -> ResourceProvider.empty()); + assertNotNull(helloWorld); + assertEquals(3, helloWorld.count()); + } +} diff --git a/pom.xml b/pom.xml index 93c6ddf..4d29976 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.highmed.dsf dsf-bpe-example-processes-pom - 0.6.0-SNAPSHOT + 0.7.0-SNAPSHOT pom @@ -18,6 +18,8 @@ 11 11 + 0.7.0-SNAPSHOT + ${project.basedir} @@ -45,17 +47,17 @@ org.highmed.dsf dsf-bpe-process-base - 0.6.0-SNAPSHOT + ${dsf.version} org.highmed.dsf dsf-bpe-process-hello-world - 0.6.0-SNAPSHOT + ${dsf.version} org.highmed.dsf dsf-fhir-validation - 0.6.0-SNAPSHOT + ${dsf.version} @@ -74,7 +76,7 @@ org.highmed.dsf dsf-bpe-process-base - 0.6.0-SNAPSHOT + ${dsf.version} test test-jar From f02934781384341ab0f4cb87a7360d94960ef741 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Wed, 24 Aug 2022 18:18:12 +0200 Subject: [PATCH 02/12] improve questionnaire with more types --- .../highmed-questionnaire-hello-world.xml | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml index f3940cc..ff875e8 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml @@ -24,12 +24,47 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + From 9a999374297cd32402f8e92d96e5faced3b69694 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Wed, 31 Aug 2022 14:54:48 +0200 Subject: [PATCH 03/12] adds taskHelper to user task --- .../org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java | 3 ++- .../main/java/org/highmed/dsf/bpe/user/task/UserTask.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java index 787361f..2100bff 100755 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java @@ -38,6 +38,7 @@ public HelloWorld helloWorld() @Bean public UserTask userTask() { - return new UserTask(clientProvider, organizationProvider, questionnaireResponseHelper, readAccessHelper); + return new UserTask(clientProvider, organizationProvider, questionnaireResponseHelper, taskHelper, + readAccessHelper); } } diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java index bf1087c..bc3c4d1 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java @@ -5,12 +5,14 @@ import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.questionnaire.QuestionnaireResponseHelper; +import org.highmed.dsf.fhir.task.TaskHelper; public class UserTask extends AbstractUserTaskListener { public UserTask(FhirWebserviceClientProvider clientProvider, OrganizationProvider organizationProvider, - QuestionnaireResponseHelper questionnaireResponseHelper, ReadAccessHelper readAccessHelper) + QuestionnaireResponseHelper questionnaireResponseHelper, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) { - super(clientProvider, organizationProvider, questionnaireResponseHelper, readAccessHelper); + super(clientProvider, organizationProvider, questionnaireResponseHelper, taskHelper, readAccessHelper); } } From a21956f3e2211bb503d9f97b973a77f1d60e4149 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Wed, 31 Aug 2022 17:03:47 +0200 Subject: [PATCH 04/12] update to dsf version 0.8.0-SNAPSHOT --- dsf-bpe-process-hello-world/pom.xml | 2 +- .../highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java | 2 +- .../fhir/Questionnaire/highmed-questionnaire-hello-world.xml | 2 +- pom.xml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dsf-bpe-process-hello-world/pom.xml b/dsf-bpe-process-hello-world/pom.xml index 7539838..dc4baad 100755 --- a/dsf-bpe-process-hello-world/pom.xml +++ b/dsf-bpe-process-hello-world/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-example-processes-pom - 0.7.0-SNAPSHOT + 0.8.0-SNAPSHOT diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java index 35ad074..bb2cd5e 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java @@ -20,7 +20,7 @@ public class HelloWorldProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "0.7.0"; + public static final String VERSION = "0.8.0"; public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 8, 1); @Override diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml index ff875e8..58d184d 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml @@ -1,6 +1,6 @@ - + diff --git a/pom.xml b/pom.xml index 4d29976..54e9ca1 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.highmed.dsf dsf-bpe-example-processes-pom - 0.7.0-SNAPSHOT + 0.8.0-SNAPSHOT pom @@ -18,7 +18,7 @@ 11 11 - 0.7.0-SNAPSHOT + 0.8.0-SNAPSHOT ${project.basedir} From 9714388cc98f330197615d2da7257eba29871532 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 13 Sep 2022 11:49:33 +0200 Subject: [PATCH 05/12] use default user task listener, move url and version to form key --- .../bpe/spring/config/HelloWorldConfig.java | 8 -------- .../highmed/dsf/bpe/user/task/UserTask.java | 18 ------------------ .../src/main/resources/bpe/helloWorld.bpmn | 9 +-------- 3 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java index 2100bff..51b09a2 100755 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java @@ -1,7 +1,6 @@ package org.highmed.dsf.bpe.spring.config; import org.highmed.dsf.bpe.service.HelloWorld; -import org.highmed.dsf.bpe.user.task.UserTask; import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; @@ -34,11 +33,4 @@ public HelloWorld helloWorld() { return new HelloWorld(clientProvider, taskHelper, readAccessHelper); } - - @Bean - public UserTask userTask() - { - return new UserTask(clientProvider, organizationProvider, questionnaireResponseHelper, taskHelper, - readAccessHelper); - } } diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java deleted file mode 100644 index bc3c4d1..0000000 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/user/task/UserTask.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.highmed.dsf.bpe.user.task; - -import org.highmed.dsf.bpe.listener.AbstractUserTaskListener; -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.questionnaire.QuestionnaireResponseHelper; -import org.highmed.dsf.fhir.task.TaskHelper; - -public class UserTask extends AbstractUserTaskListener -{ - public UserTask(FhirWebserviceClientProvider clientProvider, OrganizationProvider organizationProvider, - QuestionnaireResponseHelper questionnaireResponseHelper, TaskHelper taskHelper, - ReadAccessHelper readAccessHelper) - { - super(clientProvider, organizationProvider, questionnaireResponseHelper, taskHelper, readAccessHelper); - } -} diff --git a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn index e532c21..dc69ad0 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn +++ b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn @@ -16,14 +16,7 @@ - - - - - http://highmed.org/fhir/Questionnaire/hello-world - #{version} - - + SequenceFlow_0oyvmcd Flow_00nx7hv From d463b8d891878647dc605c22468f2b3babab2176 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 13 Sep 2022 17:47:25 +0200 Subject: [PATCH 06/12] log user task after execution --- .../dsf/bpe/service/LogUserTaskResponse.java | 35 +++++++++++++++++++ .../bpe/spring/config/HelloWorldConfig.java | 7 ++++ .../src/main/resources/bpe/helloWorld.bpmn | 25 +++++++++---- 3 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java new file mode 100644 index 0000000..2fbe2da --- /dev/null +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java @@ -0,0 +1,35 @@ +package org.highmed.dsf.bpe.service; + +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_QUESTIONNAIRE_RESPONSE_COMPLETED; + +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.QuestionnaireResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ca.uhn.fhir.context.FhirContext; + +public class LogUserTaskResponse extends AbstractServiceDelegate +{ + private static final Logger logger = LoggerFactory.getLogger(LogUserTaskResponse.class); + + public LogUserTaskResponse(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, + ReadAccessHelper readAccessHelper) + { + super(clientProvider, taskHelper, readAccessHelper); + } + + @Override + protected void doExecute(DelegateExecution execution) + { + QuestionnaireResponse questionnaireResponse = (QuestionnaireResponse) execution + .getVariable(BPMN_EXECUTION_VARIABLE_QUESTIONNAIRE_RESPONSE_COMPLETED); + + logger.info("Completed QuestionnaireResponse: {}", + FhirContext.forR4().newXmlParser().encodeResourceToString(questionnaireResponse)); + } +} diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java index 51b09a2..86bc57c 100755 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java @@ -1,6 +1,7 @@ package org.highmed.dsf.bpe.spring.config; import org.highmed.dsf.bpe.service.HelloWorld; +import org.highmed.dsf.bpe.service.LogUserTaskResponse; import org.highmed.dsf.fhir.authorization.read.ReadAccessHelper; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; @@ -33,4 +34,10 @@ public HelloWorld helloWorld() { return new HelloWorld(clientProvider, taskHelper, readAccessHelper); } + + @Bean + public LogUserTaskResponse logUserTaskResponse() + { + return new LogUserTaskResponse(clientProvider, taskHelper, readAccessHelper); + } } diff --git a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn index dc69ad0..f523741 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn +++ b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn @@ -4,7 +4,7 @@ - Flow_00nx7hv + Flow_034bfq7 @@ -15,18 +15,23 @@ SequenceFlow_0bbhq2r - + SequenceFlow_0oyvmcd Flow_00nx7hv + + + Flow_00nx7hv + Flow_034bfq7 + - + @@ -36,9 +41,10 @@ - - - + + + + @@ -49,6 +55,13 @@ + + + + + + + From 70a0236bb17fd73efe468c8bd5a471447fe62184 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 13 Sep 2022 18:04:34 +0200 Subject: [PATCH 07/12] remove not needed extension element --- .../src/main/resources/bpe/helloWorld.bpmn | 1 - 1 file changed, 1 deletion(-) diff --git a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn index f523741..889f50e 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn +++ b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn @@ -1,7 +1,6 @@ - Flow_034bfq7 From b6ef2cd5290451a9000307db2e97266cc458e4e4 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Mon, 10 Oct 2022 19:04:44 +0200 Subject: [PATCH 08/12] add url type to questionnaire --- .../fhir/Questionnaire/highmed-questionnaire-hello-world.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml index 58d184d..b599f21 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml @@ -58,6 +58,11 @@ + + + + + From a49249c154e49e94c58ada74c7d0b9c03cdcf6a6 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Mon, 17 Oct 2022 14:17:06 +0200 Subject: [PATCH 09/12] update to dsf 0.9.0-SNAPSHOT, add display type --- .../org/highmed/dsf/bpe/service/HelloWorld.java | 4 ++-- .../highmed-questionnaire-hello-world.xml | 17 +++++++++++------ pom.xml | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/HelloWorld.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/HelloWorld.java index 81d7f4a..ae78e57 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/HelloWorld.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/HelloWorld.java @@ -20,9 +20,9 @@ public HelloWorld(FhirWebserviceClientProvider clientProvider, TaskHelper taskHe } @Override - public void doExecute(DelegateExecution execution) throws Exception + public void doExecute(DelegateExecution execution) { - Task task = getCurrentTaskFromExecutionVariables(); + Task task = getCurrentTaskFromExecutionVariables(execution); logger.info("Hello World from organization with identifier '{}'", task.getRequester().getIdentifier().getValue()); } diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml index b599f21..ac87bbe 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml @@ -1,9 +1,9 @@ - + - - + + @@ -13,15 +13,20 @@ + + + + + - - - + + + diff --git a/pom.xml b/pom.xml index 54e9ca1..8f08ca9 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 11 11 - 0.8.0-SNAPSHOT + 0.9.0-SNAPSHOT ${project.basedir} From 4c012f5b1c4fc20ce33f244e83b2ecd1056611c0 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Mon, 24 Oct 2022 17:06:13 +0200 Subject: [PATCH 10/12] move user-task to its own process, update to dsf 0.9.0 --- dsf-bpe-process-hello-world/pom.xml | 2 +- .../highmed/dsf/bpe/ConstantsHelloWorld.java | 15 ++++- .../HelloWorldProcessPluginDefinition.java | 18 ++++-- .../dsf/bpe/service/LogUserTaskResponse.java | 19 +++++- .../bpe/spring/config/HelloWorldConfig.java | 13 ++-- .../src/main/resources/bpe/helloUser.bpmn | 54 ++++++++++++++++ .../src/main/resources/bpe/helloWorld.bpmn | 36 ++--------- .../ActivityDefinition/highmed-helloUser.xml | 49 +++++++++++++++ .../ActivityDefinition/highmed-helloWorld.xml | 2 +- ...l => highmed-questionnaire-hello-user.xml} | 24 +++---- .../highmed-task-hello-user.xml | 63 +++++++++++++++++++ .../highmed-task-hello-world.xml | 2 +- ... => HelloProcessPluginDefinitionTest.java} | 21 ++++++- ...tractHelloUser3MedicTtpExampleStarter.java | 47 ++++++++++++++ ...elloUser3MedicTtpDockerExampleStarter.java | 15 +++++ .../HelloUser3MedicTtpExampleStarter.java | 15 +++++ .../ActivityDefinitionProfileTest.java | 15 +++++ .../dsf/fhir/profile/TaskProfileTest.java | 24 ++++++- pom.xml | 4 +- 19 files changed, 366 insertions(+), 72 deletions(-) create mode 100644 dsf-bpe-process-hello-world/src/main/resources/bpe/helloUser.bpmn create mode 100644 dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloUser.xml rename dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/{highmed-questionnaire-hello-world.xml => highmed-questionnaire-hello-user.xml} (84%) create mode 100644 dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-user.xml rename dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/{HelloWorldProcessPluginDefinitionTest.java => HelloProcessPluginDefinitionTest.java} (55%) create mode 100644 dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/AbstractHelloUser3MedicTtpExampleStarter.java create mode 100644 dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpDockerExampleStarter.java create mode 100644 dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpExampleStarter.java diff --git a/dsf-bpe-process-hello-world/pom.xml b/dsf-bpe-process-hello-world/pom.xml index dc4baad..9a00b9e 100755 --- a/dsf-bpe-process-hello-world/pom.xml +++ b/dsf-bpe-process-hello-world/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-example-processes-pom - 0.8.0-SNAPSHOT + 0.9.0-SNAPSHOT diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/ConstantsHelloWorld.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/ConstantsHelloWorld.java index ff4972d..d452e34 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/ConstantsHelloWorld.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/ConstantsHelloWorld.java @@ -8,11 +8,20 @@ public interface ConstantsHelloWorld String PROCESS_NAME_HELLO_WORLD = "helloWorld"; String PROCESS_NAME_FULL_HELLO_WORLD = "highmedorg_" + PROCESS_NAME_HELLO_WORLD; + String PROCESS_NAME_HELLO_USER = "helloUser"; + String PROCESS_NAME_FULL_HELLO_USER = "highmedorg_" + PROCESS_NAME_HELLO_USER; + String PROFILE_HIGHMED_TASK_HELLO_WORLD = "http://highmed.org/fhir/StructureDefinition/task-hello-world"; - String PROFILE_HIGHMED_TASK_HELLO_WORLD_AND_LATEST_VERSION = "http://highmed.org/fhir/StructureDefinition/task-hello-world" - + "|" + VERSION; + String PROFILE_HIGHMED_TASK_HELLO_WORLD_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_HELLO_WORLD + "|" + VERSION; String PROFILE_HIGHMED_TASK_HELLO_WORLD_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + PROCESS_NAME_HELLO_WORLD + "/"; String PROFILE_HIGHMED_TASK_HELLO_WORLD_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_HELLO_WORLD_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_HELLO_WORLD_MESSAGE_NAME = "helloWorldMessage"; + String PROFILE_HIGHMED_TASK_HELLO_WORLD_MESSAGE_NAME = "helloWorld"; + + String PROFILE_HIGHMED_TASK_HELLO_USER = "http://highmed.org/fhir/StructureDefinition/task-hello-user"; + String PROFILE_HIGHMED_TASK_HELLO_USER_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_HELLO_USER + "|" + VERSION; + String PROFILE_HIGHMED_TASK_HELLO_USER_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + PROCESS_NAME_HELLO_USER + "/"; + String PROFILE_HIGHMED_TASK_HELLO_USER_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_HELLO_USER_PROCESS_URI + + VERSION; + String PROFILE_HIGHMED_TASK_HELLO_USER_MESSAGE_NAME = "helloUser"; } diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java index bb2cd5e..2bb80a5 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe; +import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_USER; import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_WORLD; import java.time.LocalDate; @@ -20,13 +21,13 @@ public class HelloWorldProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "0.8.0"; - public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 8, 1); + public static final String VERSION = "0.9.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2022, 10, 24); @Override public String getName() { - return "dsf-bpe-process-hello-world"; + return "dsf-bpe-process-hello-world-and-user"; } @Override @@ -44,7 +45,7 @@ public LocalDate getReleaseDate() @Override public Stream getBpmnFiles() { - return Stream.of("bpe/helloWorld.bpmn"); + return Stream.of("bpe/helloWorld.bpmn", "bpe/helloUser.bpmn"); } @Override @@ -57,12 +58,17 @@ public Stream> getSpringConfigClasses() public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader, PropertyResolver resolver) { + var aHelloUser = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-helloUser.xml"); var aHelloWorld = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-helloWorld.xml"); - var qHelloWorld = QuestionnaireResource.file("fhir/Questionnaire/highmed-questionnaire-hello-world.xml"); + + var qHelloWorld = QuestionnaireResource.file("fhir/Questionnaire/highmed-questionnaire-hello-user.xml"); + + var tHelloUser = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-hello-user.xml"); var tHelloWorld = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-hello-world.xml"); Map> resourcesByProcessKeyAndVersion = Map.of( - PROCESS_NAME_FULL_HELLO_WORLD + "/" + VERSION, Arrays.asList(aHelloWorld, qHelloWorld, tHelloWorld)); + PROCESS_NAME_FULL_HELLO_USER + "/" + VERSION, Arrays.asList(aHelloUser, qHelloWorld, tHelloUser), + PROCESS_NAME_FULL_HELLO_WORLD + "/" + VERSION, Arrays.asList(aHelloWorld, tHelloWorld)); return ResourceProvider.read(VERSION, RELEASE_DATE, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resolver, diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java index 2fbe2da..6d88207 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java @@ -2,6 +2,8 @@ import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_QUESTIONNAIRE_RESPONSE_COMPLETED; +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; @@ -10,17 +12,28 @@ import org.hl7.fhir.r4.model.QuestionnaireResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; import ca.uhn.fhir.context.FhirContext; -public class LogUserTaskResponse extends AbstractServiceDelegate +public class LogUserTaskResponse extends AbstractServiceDelegate implements InitializingBean { private static final Logger logger = LoggerFactory.getLogger(LogUserTaskResponse.class); + private final FhirContext fhirContext; + public LogUserTaskResponse(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - ReadAccessHelper readAccessHelper) + ReadAccessHelper readAccessHelper, FhirContext fhirContext) { super(clientProvider, taskHelper, readAccessHelper); + this.fhirContext = fhirContext; + } + + @Override + public void afterPropertiesSet() throws Exception + { + super.afterPropertiesSet(); + Objects.requireNonNull(fhirContext, "fhirContext"); } @Override @@ -30,6 +43,6 @@ protected void doExecute(DelegateExecution execution) .getVariable(BPMN_EXECUTION_VARIABLE_QUESTIONNAIRE_RESPONSE_COMPLETED); logger.info("Completed QuestionnaireResponse: {}", - FhirContext.forR4().newXmlParser().encodeResourceToString(questionnaireResponse)); + fhirContext.newXmlParser().encodeResourceToString(questionnaireResponse)); } } diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java index 86bc57c..62dddc9 100755 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java @@ -4,13 +4,13 @@ import org.highmed.dsf.bpe.service.LogUserTaskResponse; 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.questionnaire.QuestionnaireResponseHelper; import org.highmed.dsf.fhir.task.TaskHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import ca.uhn.fhir.context.FhirContext; + @Configuration public class HelloWorldConfig { @@ -21,13 +21,10 @@ public class HelloWorldConfig private TaskHelper taskHelper; @Autowired - private OrganizationProvider organizationProvider; - - @Autowired - private QuestionnaireResponseHelper questionnaireResponseHelper; + private ReadAccessHelper readAccessHelper; @Autowired - private ReadAccessHelper readAccessHelper; + private FhirContext fhirContext; @Bean public HelloWorld helloWorld() @@ -38,6 +35,6 @@ public HelloWorld helloWorld() @Bean public LogUserTaskResponse logUserTaskResponse() { - return new LogUserTaskResponse(clientProvider, taskHelper, readAccessHelper); + return new LogUserTaskResponse(clientProvider, taskHelper, readAccessHelper, fhirContext); } } diff --git a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloUser.bpmn b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloUser.bpmn new file mode 100644 index 0000000..2a480ec --- /dev/null +++ b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloUser.bpmn @@ -0,0 +1,54 @@ + + + + + + Flow_034bfq7 + + + SequenceFlow_0bbhq2r + + + + + SequenceFlow_0bbhq2r + Flow_00nx7hv + + + + Flow_00nx7hv + Flow_034bfq7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn index 889f50e..68bb0f1 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn +++ b/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn @@ -3,9 +3,9 @@ - Flow_034bfq7 + SequenceFlow_0oyvmcd - + SequenceFlow_0bbhq2r SequenceFlow_0oyvmcd @@ -14,52 +14,26 @@ SequenceFlow_0bbhq2r - - - SequenceFlow_0oyvmcd - Flow_00nx7hv - - - - Flow_00nx7hv - Flow_034bfq7 - - + - - - - - + - - - - - - - - - - - - - + diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloUser.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloUser.xml new file mode 100644 index 0000000..acb32fa --- /dev/null +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloUser.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <subtitle value="Example Template Process as template for implementation of novel processes with user-tasks" /> + <!-- status managed by bpe --> + <status value="unknown" /> + <experimental value="false" /> + <!-- date managed by bpe --> + <date value="#{date}" /> + <publisher value="HiGHmed" /> + <contact> + <name value="HiGHmed" /> + <telecom> + <system value="email" /> + <value value="pmo@highmed.org" /> + </telecom> + </contact> + <description value="Example process as template for implementation of novel processes with user-tasks" /> + <kind value="Task" /> +</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloWorld.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloWorld.xml index 3f0f9cb..c260fea 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloWorld.xml +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloWorld.xml @@ -7,7 +7,7 @@ </meta> <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> - <valueString value="helloWorldMessage" /> + <valueString value="helloWorld" /> </extension> <extension url="task-profile"> <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-hello-world|#{version}" /> diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-user.xml similarity index 84% rename from dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml rename to dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-user.xml index ac87bbe..d3cd664 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-world.xml +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-user.xml @@ -6,7 +6,7 @@ <code value="ALL"/> </tag> </meta> - <url value="http://highmed.org/fhir/Questionnaire/hello-world"/> + <url value="http://highmed.org/fhir/Questionnaire/hello-user"/> <!-- version managed by bpe --> <version value="#{version}"/> <!-- date managed by bpe --> @@ -24,57 +24,57 @@ <text value="The business-key of the process execution"/> </item> <item> - <linkId value="display-test"/> + <linkId value="display-example"/> <type value="display"/> <text value="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."/> </item> <item> - <linkId value="string-test"/> + <linkId value="string-example"/> <type value="string"/> <text value="Add a string to test the string type"/> </item> <item> - <linkId value="text-test"/> + <linkId value="text-example"/> <type value="text"/> <text value="Add a text to test the text type"/> </item> <item> - <linkId value="integer-test"/> + <linkId value="integer-example"/> <type value="integer"/> <text value="Add an integer number to test the integer type"/> </item> <item> - <linkId value="decimal-test"/> + <linkId value="decimal-example"/> <type value="decimal"/> <text value="Add a decimal number to test the decimal type"/> </item> <item> - <linkId value="date-test"/> + <linkId value="date-example"/> <type value="date"/> <text value="Add a date to test the date type"/> </item> <item> - <linkId value="time-test"/> + <linkId value="time-example"/> <type value="time"/> <text value="Add a time to test the time type"/> </item> <item> - <linkId value="date-time-test"/> + <linkId value="date-time-example"/> <type value="dateTime"/> <text value="Add a date-time to test the dateTime type"/> </item> <item> - <linkId value="url-test"/> + <linkId value="url-example"/> <type value="url"/> <text value="Add the location of the pdf contract"/> </item> <item> - <linkId value="reference-test"/> + <linkId value="reference-example"/> <type value="reference"/> <text value="Add the location (url) of the data-set that should be approved"/> </item> <item> - <linkId value="boolean-test"/> + <linkId value="boolean-example"/> <type value="boolean"/> <text value="Do you approve the release of the data-set?"/> </item> diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-user.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-user.xml new file mode 100644 index 0000000..01a3b58 --- /dev/null +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-user.xml @@ -0,0 +1,63 @@ +<StructureDefinition xmlns="http://hl7.org/fhir"> + <meta> + <tag> + <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> + </tag> + </meta> + <url value="http://highmed.org/fhir/StructureDefinition/task-hello-user" /> + <!-- version managed by bpe --> + <version value="#{version}" /> + <name value="helloUserProcess" /> + <!-- status managed by bpe --> + <status value="unknown" /> + <experimental value="false" /> + <!-- date managed by bpe --> + <date value="#{date}" /> + <fhirVersion value="4.0.1" /> + <kind value="resource" /> + <abstract value="false" /> + <type value="Task" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> + <derivation value="constraint" /> + <differential> + <element id="Task.instantiatesUri"> + <path value="Task.instantiatesUri" /> + <fixedUri value="http://highmed.org/bpe/Process/helloUser/#{version}" /> + </element> + <element id="Task.input"> + <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> + <valueString value="Parameter" /> + </extension> + <path value="Task.input" /> + <max value="1" /> + </element> + <element id="Task.input:message-name"> + <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> + <valueString value="Parameter" /> + </extension> + <path value="Task.input" /> + <sliceName value="message-name" /> + </element> + <element id="Task.input:message-name.value[x]"> + <path value="Task.input.value[x]" /> + <fixedString value="helloUser" /> + </element> + <element id="Task.input:business-key"> + <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> + <valueString value="Parameter" /> + </extension> + <path value="Task.input" /> + <sliceName value="business-key" /> + <max value="0" /> + </element> + <element id="Task.input:correlation-key"> + <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> + <valueString value="Parameter" /> + </extension> + <path value="Task.input" /> + <sliceName value="correlation-key" /> + <max value="0" /> + </element> + </differential> +</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-world.xml b/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-world.xml index fda138e..194fa38 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-world.xml +++ b/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-world.xml @@ -41,7 +41,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="helloWorldMessage" /> + <fixedString value="helloWorld" /> </element> <element id="Task.input:business-key"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinitionTest.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloProcessPluginDefinitionTest.java similarity index 55% rename from dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinitionTest.java rename to dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloProcessPluginDefinitionTest.java index 3a6c56a..f29e2ac 100644 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinitionTest.java +++ b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloProcessPluginDefinitionTest.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe; +import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_USER; import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_WORLD; import static org.highmed.dsf.bpe.HelloWorldProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; @@ -11,10 +12,24 @@ import ca.uhn.fhir.context.FhirContext; -public class HelloWorldProcessPluginDefinitionTest +public class HelloProcessPluginDefinitionTest { @Test - public void testResourceLoading() throws Exception + public void testHelloUserResourceLoading() + { + ProcessPluginDefinition definition = new HelloWorldProcessPluginDefinition(); + ResourceProvider provider = definition.getResourceProvider(FhirContext.forR4(), getClass().getClassLoader(), + new StandardEnvironment()); + assertNotNull(provider); + + var helloUser = provider.getResources(PROCESS_NAME_FULL_HELLO_USER + "/" + VERSION, + s -> ResourceProvider.empty()); + assertNotNull(helloUser); + assertEquals(3, helloUser.count()); + } + + @Test + public void testHelloWorldResourceLoading() { ProcessPluginDefinition definition = new HelloWorldProcessPluginDefinition(); ResourceProvider provider = definition.getResourceProvider(FhirContext.forR4(), getClass().getClassLoader(), @@ -24,6 +39,6 @@ public void testResourceLoading() throws Exception var helloWorld = provider.getResources(PROCESS_NAME_FULL_HELLO_WORLD + "/" + VERSION, s -> ResourceProvider.empty()); assertNotNull(helloWorld); - assertEquals(3, helloWorld.count()); + assertEquals(2, helloWorld.count()); } } diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/AbstractHelloUser3MedicTtpExampleStarter.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/AbstractHelloUser3MedicTtpExampleStarter.java new file mode 100644 index 0000000..523d5fa --- /dev/null +++ b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/AbstractHelloUser3MedicTtpExampleStarter.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.ConstantsHelloWorld.PROFILE_HIGHMED_TASK_HELLO_USER_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROFILE_HIGHMED_TASK_HELLO_USER_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROFILE_HIGHMED_TASK_HELLO_USER_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 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 AbstractHelloUser3MedicTtpExampleStarter +{ + 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_HELLO_USER_AND_LATEST_VERSION); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_HELLO_USER_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_HELLO_USER_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + + return task; + } +} diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpDockerExampleStarter.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpDockerExampleStarter.java new file mode 100644 index 0000000..4acecd6 --- /dev/null +++ b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpDockerExampleStarter.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 HelloUser3MedicTtpDockerExampleStarter extends AbstractHelloUser3MedicTtpExampleStarter +{ + // 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 HelloUser3MedicTtpDockerExampleStarter().main(args, MEDIC_1_DOCKER_FHIR_BASE_URL); + } +} diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpExampleStarter.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpExampleStarter.java new file mode 100644 index 0000000..dcf325b --- /dev/null +++ b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpExampleStarter.java @@ -0,0 +1,15 @@ +package org.highmed.dsf.bpe.start; + +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; + +public class HelloUser3MedicTtpExampleStarter extends AbstractHelloUser3MedicTtpExampleStarter +{ + // 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 HelloUser3MedicTtpExampleStarter().main(args, MEDIC_1_FHIR_BASE_URL); + } +} diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java index 0c21530..a48bd0e 100644 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java +++ b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -46,6 +46,21 @@ public class ActivityDefinitionProfileTest private final ProcessAuthorizationHelper processAuthorizationHelper = new ProcessAuthorizationHelperImpl(); + @Test + public void testHelloUserValid() throws Exception + { + ActivityDefinition ad = validationRule + .readActivityDefinition(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-helloUser.xml")); + + 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 testHelloWorldValid() throws Exception { diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 3780646..19321c7 100644 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -3,6 +3,9 @@ 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.ConstantsHelloWorld.PROFILE_HIGHMED_TASK_HELLO_USER; +import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROFILE_HIGHMED_TASK_HELLO_USER_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROFILE_HIGHMED_TASK_HELLO_USER_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROFILE_HIGHMED_TASK_HELLO_WORLD; import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROFILE_HIGHMED_TASK_HELLO_WORLD_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsHelloWorld.PROFILE_HIGHMED_TASK_HELLO_WORLD_PROCESS_URI_AND_LATEST_VERSION; @@ -35,7 +38,7 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, - Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-hello-world.xml"), + Arrays.asList("highmed-task-base-0.5.0.xml", "highmed-task-hello-user.xml", "highmed-task-hello-world.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")); @@ -54,6 +57,25 @@ public void testTaskHelloWorldValid() || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } + private Task createValidTaskHelloUser() + { + Task task = new Task(); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_HELLO_USER); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_HELLO_USER_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("MeDIC 1"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); + + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_HELLO_USER_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + + return task; + } + private Task createValidTaskHelloWorld() { Task task = new Task(); diff --git a/pom.xml b/pom.xml index 8f08ca9..35f6bae 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-example-processes-pom</artifactId> - <version>0.8.0-SNAPSHOT</version> + <version>0.9.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> @@ -18,7 +18,7 @@ <compileSource>11</compileSource> <compileTarget>11</compileTarget> - <dsf.version>0.9.0-SNAPSHOT</dsf.version> + <dsf.version>0.9.0</dsf.version> <main.basedir>${project.basedir}</main.basedir> </properties> From 8015aff5781f61271fc036c52553dfaf500da65e Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Mon, 24 Oct 2022 17:45:53 +0200 Subject: [PATCH 11/12] add missing test, change .keep to readme files, log questionnaire-response pretty --- .../main/java/org/highmed/dsf/bpe/message/.keep | 0 .../java/org/highmed/dsf/bpe/message/README.md | 1 + .../dsf/bpe/service/LogUserTaskResponse.java | 2 +- .../main/java/org/highmed/dsf/bpe/variable/.keep | 0 .../java/org/highmed/dsf/bpe/variable/README.md | 1 + .../dsf/fhir/profile/TaskProfileTest.java | 16 ++++++++++++++-- 6 files changed, 17 insertions(+), 3 deletions(-) delete mode 100644 dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/message/.keep create mode 100644 dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/message/README.md delete mode 100644 dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/variable/.keep create mode 100644 dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/variable/README.md diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/message/.keep b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/message/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/message/README.md b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/message/README.md new file mode 100644 index 0000000..bc0cbf2 --- /dev/null +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/message/README.md @@ -0,0 +1 @@ +`message` package typically used for implementing task message send events \ No newline at end of file diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java index 6d88207..b8be7a1 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java @@ -43,6 +43,6 @@ protected void doExecute(DelegateExecution execution) .getVariable(BPMN_EXECUTION_VARIABLE_QUESTIONNAIRE_RESPONSE_COMPLETED); logger.info("Completed QuestionnaireResponse: {}", - fhirContext.newXmlParser().encodeResourceToString(questionnaireResponse)); + fhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(questionnaireResponse)); } } diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/variable/.keep b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/variable/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/variable/README.md b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/variable/README.md new file mode 100644 index 0000000..ab241aa --- /dev/null +++ b/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/variable/README.md @@ -0,0 +1 @@ +`variable` package typically used for implementing custom BPMN variable serializers \ No newline at end of file diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 19321c7..317ffa2 100644 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -46,9 +46,9 @@ public class TaskProfileTest validationRule.getValidationSupport()); @Test - public void testTaskHelloWorldValid() + public void testTaskHelloUserValid() { - Task task = createValidTaskHelloWorld(); + Task task = createValidTaskHelloUser(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -76,6 +76,18 @@ private Task createValidTaskHelloUser() return task; } + @Test + public void testTaskHelloWorldValid() + { + Task task = createValidTaskHelloWorld(); + + ValidationResult result = resourceValidator.validate(task); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + } + private Task createValidTaskHelloWorld() { Task task = new Task(); From ff2146ca12068c33bd452946933059002aeca961 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Mon, 24 Oct 2022 18:00:19 +0200 Subject: [PATCH 12/12] prepare release 0.9.0 --- dsf-bpe-process-hello-world/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dsf-bpe-process-hello-world/pom.xml b/dsf-bpe-process-hello-world/pom.xml index 9a00b9e..05235b7 100755 --- a/dsf-bpe-process-hello-world/pom.xml +++ b/dsf-bpe-process-hello-world/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-example-processes-pom</artifactId> - <version>0.9.0-SNAPSHOT</version> + <version>0.9.0</version> </parent> <properties> diff --git a/pom.xml b/pom.xml index 35f6bae..e87881e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-example-processes-pom</artifactId> - <version>0.9.0-SNAPSHOT</version> + <version>0.9.0</version> <packaging>pom</packaging> <modules>