diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 8d513d6..5fb8224 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -12,10 +12,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Build with Maven env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 7a482c8..91d3940 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -21,10 +21,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Publish with Maven env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/LICENSE b/LICENSE index 261eeb9..fccc574 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2023 Heilbronn University of Applied Sciences Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index e9559e6..3d6516d 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,9 @@ -# HiGHmed DSF Example Processes +# DSF Process Hello-World -![Java CI Build with Maven](https://github.com/highmed/example-processes/workflows/Java%20CI%20Build%20with%20Maven/badge.svg) - -In this repository you will find example processes, that can be deployed on the [HiGHmed DSF](https://github.com/highmed/highmed-dsf). +In this repository you will find the hello-world process, which can be deployed on the [DSF](https://github.com/datasharingframework/dsf). ## Development -Branching follows the git-flow model, for the latest development version see branch [develop](https://github.com/highmed/example-processes/tree/develop). +Branching follows the git-flow model, for the latest development version see branch [develop](https://github.com/datasharingframework/dsf-process-hello-world/tree/develop). ## License -All code of the HiGHmed DSF Example Processes is published under the [Apache-2.0 License](LICENSE). - -## Wiki -A full documentation can be found in the [HiGHmed DSF Wiki](https://github.com/highmed/highmed-dsf/wiki). - -## Building the Project -Prerequisite: Java 11, Maven >= 3.6 - -* Add the Github Package Registry server to your Maven `.m2/settings.xml`. Instructions on how to generate the `USERNAME` and `TOKEN` can be found in the HiGHmed DSF Wiki page with the name [Using the Github Maven Package Registry](https://github.com/highmed/highmed-dsf/wiki/Using-the-Github-Maven-Package-Registry). - - ``` - - - github - USERNAME - TOKEN - - - ``` - -* Build the project from the root directory of this repository by executing the following command. If you want to copy the artifacts into the test folders of the **highmed-dsf** repository, make sure that the **example-processes** repository resides in the same folder as the **higmmed-dsf** repository and activate the profile `copy-to-highmed-dsf-process` in the build command. - - ``` - mvn clean install (-P copy-to-highmed-dsf-process) - ``` - -## Implementing new Processes -Instructions on how to implement a new process can be found in the HiGHmed DSF Wiki page with the name [Adding a new BPMN Process](https://github.com/highmed/highmed-dsf/wiki/Adding-BPMN-Processes). \ No newline at end of file +All code is published under the [Apache-2.0 License](LICENSE). \ No newline at end of file diff --git a/dsf-bpe-process-hello-world/pom.xml b/dsf-bpe-process-hello-world/pom.xml deleted file mode 100755 index 05235b7..0000000 --- a/dsf-bpe-process-hello-world/pom.xml +++ /dev/null @@ -1,295 +0,0 @@ - - 4.0.0 - - dsf-bpe-process-hello-world - - - org.highmed.dsf - dsf-bpe-example-processes-pom - 0.9.0 - - - - ${project.basedir}/.. - ../../highmed-dsf - - - - - org.highmed.dsf - dsf-bpe-process-base - provided - - - - org.highmed.dsf - dsf-fhir-validation - test - - - de.hs-heilbronn.mi - log4j2-utils - test - - - junit - junit - test - - - org.highmed.dsf - dsf-bpe-process-base - test - test-jar - - - - - - copy-to-highmed-dsf-process - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-process-to-docker-test-setup - package - - copy - - - - - ${project.groupId} - ${project.artifactId} - ${project.version} - - - ${dsf.location}/dsf-docker-test-setup/bpe/process - - - - copy-process-to-docker-test-setup-3medic-ttp/medic1 - package - - copy - - - - - ${project.groupId} - ${project.artifactId} - ${project.version} - - - ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process - - - - - copy-process-to-docker-test-setup-3medic-ttp/medic2 - package - - copy - - - - - ${project.groupId} - ${project.artifactId} - ${project.version} - - - ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process - - - - - copy-process-to-docker-test-setup-3medic-ttp/medic3 - package - - copy - - - - - ${project.groupId} - ${project.artifactId} - ${project.version} - - - ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process - - - - - copy-process-to-docker-test-setup-3medic-ttp/ttp - package - - copy - - - - - ${project.groupId} - ${project.artifactId} - ${project.version} - - - ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/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 - - - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - ${dsf.location}/dsf-docker-test-setup/bpe/process - - ${project.artifactId}-${project.version}.jar - - false - - - ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic1/bpe/process - - ${project.artifactId}-${project.version}.jar - - false - - - ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic2/bpe/process - - ${project.artifactId}-${project.version}.jar - - false - - - ${dsf.location}/dsf-docker-test-setup-3medic-ttp/medic3/bpe/process - - ${project.artifactId}-${project.version}.jar - - false - - - ${dsf.location}/dsf-docker-test-setup-3medic-ttp/ttp/bpe/process - - ${project.artifactId}-${project.version}.jar - - 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 - - - - - - - - - \ No newline at end of file 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 deleted file mode 100644 index d452e34..0000000 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/ConstantsHelloWorld.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.highmed.dsf.bpe; - -import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; -import static org.highmed.dsf.bpe.HelloWorldProcessPluginDefinition.VERSION; - -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 = 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 = "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 deleted file mode 100644 index 2bb80a5..0000000 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/HelloWorldProcessPluginDefinition.java +++ /dev/null @@ -1,77 +0,0 @@ -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; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -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; - -import ca.uhn.fhir.context.FhirContext; - -public class HelloWorldProcessPluginDefinition implements ProcessPluginDefinition -{ - 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-and-user"; - } - - @Override - public String getVersion() - { - return VERSION; - } - - @Override - public LocalDate getReleaseDate() - { - return RELEASE_DATE; - } - - @Override - public Stream getBpmnFiles() - { - return Stream.of("bpe/helloWorld.bpmn", "bpe/helloUser.bpmn"); - } - - @Override - public Stream> getSpringConfigClasses() - { - return Stream.of(HelloWorldConfig.class); - } - - @Override - 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-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_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, - resourcesByProcessKeyAndVersion); - } -} 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 deleted file mode 100644 index ae78e57..0000000 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/HelloWorld.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.highmed.dsf.bpe.service; - -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; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class HelloWorld extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(HelloWorld.class); - - public HelloWorld(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - ReadAccessHelper readAccessHelper) - { - super(clientProvider, taskHelper, readAccessHelper); - } - - @Override - public void doExecute(DelegateExecution execution) - { - 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/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 deleted file mode 100755 index 62dddc9..0000000 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/spring/config/HelloWorldConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -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.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 -{ - @Autowired - private FhirWebserviceClientProvider clientProvider; - - @Autowired - private TaskHelper taskHelper; - - @Autowired - private ReadAccessHelper readAccessHelper; - - @Autowired - private FhirContext fhirContext; - - @Bean - public HelloWorld helloWorld() - { - return new HelloWorld(clientProvider, taskHelper, readAccessHelper); - } - - @Bean - public LogUserTaskResponse logUserTaskResponse() - { - return new LogUserTaskResponse(clientProvider, taskHelper, readAccessHelper, fhirContext); - } -} diff --git a/dsf-bpe-process-hello-world/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition b/dsf-bpe-process-hello-world/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition deleted file mode 100644 index f3385d8..0000000 --- a/dsf-bpe-process-hello-world/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition +++ /dev/null @@ -1 +0,0 @@ -org.highmed.dsf.bpe.HelloWorldProcessPluginDefinition \ 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 deleted file mode 100644 index 194fa38..0000000 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-world.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloProcessPluginDefinitionTest.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloProcessPluginDefinitionTest.java deleted file mode 100644 index f29e2ac..0000000 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/HelloProcessPluginDefinitionTest.java +++ /dev/null @@ -1,44 +0,0 @@ -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; -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 HelloProcessPluginDefinitionTest -{ - @Test - 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(), - new StandardEnvironment()); - assertNotNull(provider); - - var helloWorld = provider.getResources(PROCESS_NAME_FULL_HELLO_WORLD + "/" + VERSION, - s -> ResourceProvider.empty()); - assertNotNull(helloWorld); - 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 deleted file mode 100644 index 523d5fa..0000000 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/AbstractHelloUser3MedicTtpExampleStarter.java +++ /dev/null @@ -1,47 +0,0 @@ -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/AbstractHelloWorld3MedicTtpExampleStarter.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/AbstractHelloWorld3MedicTtpExampleStarter.java deleted file mode 100644 index 3b4ff52..0000000 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/AbstractHelloWorld3MedicTtpExampleStarter.java +++ /dev/null @@ -1,47 +0,0 @@ -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_WORLD_AND_LATEST_VERSION; -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; -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 AbstractHelloWorld3MedicTtpExampleStarter -{ - 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_WORLD_AND_LATEST_VERSION); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_HELLO_WORLD_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_WORLD_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 deleted file mode 100644 index 4acecd6..0000000 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpDockerExampleStarter.java +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index dcf325b..0000000 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloUser3MedicTtpExampleStarter.java +++ /dev/null @@ -1,15 +0,0 @@ -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/bpe/start/HelloWorld3MedicTtpDockerExampleStarter.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloWorld3MedicTtpDockerExampleStarter.java deleted file mode 100644 index 28c76a8..0000000 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloWorld3MedicTtpDockerExampleStarter.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.highmed.dsf.bpe.start; - -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_DOCKER_FHIR_BASE_URL; - -public class HelloWorld3MedicTtpDockerExampleStarter extends AbstractHelloWorld3MedicTtpExampleStarter -{ - // 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 HelloWorld3MedicTtpDockerExampleStarter().main(args, MEDIC_1_DOCKER_FHIR_BASE_URL); - } -} diff --git a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloWorld3MedicTtpExampleStarter.java b/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloWorld3MedicTtpExampleStarter.java deleted file mode 100644 index b9d9748..0000000 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/bpe/start/HelloWorld3MedicTtpExampleStarter.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.highmed.dsf.bpe.start; - -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; - -public class HelloWorld3MedicTtpExampleStarter extends AbstractHelloWorld3MedicTtpExampleStarter -{ - // 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 HelloWorld3MedicTtpExampleStarter().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 deleted file mode 100644 index a48bd0e..0000000 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/ActivityDefinitionProfileTest.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.highmed.dsf.fhir.profile; - -import static org.highmed.dsf.bpe.HelloWorldProcessPluginDefinition.RELEASE_DATE; -import static org.highmed.dsf.bpe.HelloWorldProcessPluginDefinition.VERSION; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -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, RELEASE_DATE, - 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 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 - { - ActivityDefinition ad = validationRule - .readActivityDefinition(Paths.get("src/main/resources/fhir/ActivityDefinition/highmed-helloWorld.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)); - } -} \ 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 deleted file mode 100644 index 317ffa2..0000000 --- a/dsf-bpe-process-hello-world/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.highmed.dsf.fhir.profile; - -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; -import static org.highmed.dsf.bpe.HelloWorldProcessPluginDefinition.RELEASE_DATE; -import static org.highmed.dsf.bpe.HelloWorldProcessPluginDefinition.VERSION; -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.Date; - -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.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; -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 TaskProfileTest -{ - private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); - - @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, RELEASE_DATE, - 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")); - - private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), - validationRule.getValidationSupport()); - - @Test - public void testTaskHelloUserValid() - { - Task task = createValidTaskHelloUser(); - - 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 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; - } - - @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(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_HELLO_WORLD); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_HELLO_WORLD_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_WORLD_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/resources/log4j2.xml b/dsf-bpe-process-hello-world/src/test/resources/log4j2.xml deleted file mode 100644 index f1afe81..0000000 --- a/dsf-bpe-process-hello-world/src/test/resources/log4j2.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/eclipse-formatter-config.xml b/eclipse-formatter-config.xml similarity index 99% rename from src/main/resources/eclipse-formatter-config.xml rename to eclipse-formatter-config.xml index fa14909..0c015e3 100644 --- a/src/main/resources/eclipse-formatter-config.xml +++ b/eclipse-formatter-config.xml @@ -1,6 +1,6 @@ - + diff --git a/pom.xml b/pom.xml index e87881e..71fe505 100644 --- a/pom.xml +++ b/pom.xml @@ -1,36 +1,30 @@ - 4.0.0 - org.highmed.dsf - dsf-bpe-example-processes-pom - 0.9.0 - pom - - - dsf-bpe-process-hello-world - + dev.dsf + dsf-process-hello-world + 1.0.0.0 + jar UTF-8 - 11 - 11 - - 0.9.0 + 17 + 17 - ${project.basedir} + 1.1.0 + ../dsf - example-processes - Example processes to be deployed on the HiGHmed DSF - https://github.com/highmed/example-processes + dsf-process-hello-world + Hello World DSF process + https://github.com/datasharingframework/dsf-process-hello-world - scm:git:git://github.com/highmed/example-processes.git - scm:git:git@github.com:highmed/example-processes.git - https://github.com/highmed/example-processes + scm:git:git://github.com/datasharingframework/dsf-process-hello-world.git + scm:git:git@github.com:datasharingframework/dsf-process-hello-world.git + https://github.com/datasharingframework/dsf-process-hello-wold @@ -41,116 +35,95 @@ - - - - - org.highmed.dsf - dsf-bpe-process-base - ${dsf.version} - - - org.highmed.dsf - dsf-bpe-process-hello-world - ${dsf.version} - - - org.highmed.dsf - dsf-fhir-validation - ${dsf.version} - + + + dev.dsf + dsf-bpe-process-api-v1 + ${dsf.version} + provided + - - - de.hs-heilbronn.mi - log4j2-utils - 0.13.0 - + + org.slf4j + slf4j-api + 2.0.7 + provided + - - - junit - junit - 4.13.2 - - - org.highmed.dsf - dsf-bpe-process-base - ${dsf.version} - test - test-jar - - - + + + dev.dsf + dsf-bpe-process-api-v1 + ${dsf.version} + test + test-jar + + + dev.dsf + dsf-fhir-validation + ${dsf.version} + test + + + junit + junit + 4.13.2 + test + + - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.10.1 - - ${compileSource} - ${compileTarget} - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M5 - - - org.apache.maven.plugins - maven-jar-plugin - 3.2.2 - - - - true - true - - - ${buildNumber} - ${scmBranch} - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.3.0 - - - org.apache.maven.plugins - maven-clean-plugin - 3.1.0 - - - net.revelc.code.formatter - formatter-maven-plugin - 2.18.0 - - - net.revelc.code - impsort-maven-plugin - 1.6.2 - - - - + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + ${compileSource} + ${compileTarget} + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + true + true + + + ${buildNumber} + ${scmBranch} + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.0 + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.0 + + + org.apache.maven.plugins + maven-clean-plugin + 3.3.1 + org.codehaus.mojo buildnumber-maven-plugin + 1.4 @@ -168,19 +141,38 @@ net.revelc.code.formatter formatter-maven-plugin + 2.23.0 - ${main.basedir}/src/main/resources/eclipse-formatter-config.xml + eclipse-formatter-config.xml net.revelc.code impsort-maven-plugin + 1.9.0 - 11 + 17 java.,javax.,org.,com. java,* + + dev.dsf + dsf-tools-documentation-generator + ${dsf.version} + + + + generate + + + + + + dev.dsf.bpe + + + @@ -191,18 +183,15 @@ github GitHub Packages - https://maven.pkg.github.com/highmed/example-processes + https://maven.pkg.github.com/datasharingframework/dsf-process-hello-world github - GitHub HiGHmed Apache Maven Packages - https://maven.pkg.github.com/highmed/highmed-dsf - - true - + GitHub DSF Apache Maven Packages + https://maven.pkg.github.com/datasharingframework/dsf true @@ -211,7 +200,10 @@ - format-and-sort + validate-and-check + + true + @@ -221,7 +213,7 @@ - format + validate @@ -232,7 +224,7 @@ - sort + check @@ -241,10 +233,7 @@ - validate-and-check - - true - + format-and-sort @@ -254,7 +243,7 @@ - validate + format @@ -265,7 +254,7 @@ - check + sort @@ -273,5 +262,75 @@ + + copy-to-dsf + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-process-plugin-to-docker-test-setup + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup/bpe/process + + + + copy-process-plugin-to-docker-test-setup-3dic-ttp/dic1 + package + + copy + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${dsf.location}/dsf-docker-test-setup-3dic-ttp/dic1/bpe/process + + + + + + org.apache.maven.plugins + maven-clean-plugin + + + + ${dsf.location}/dsf-docker-test-setup/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + ${dsf.location}/dsf-docker-test-setup-3dic-ttp/dic1/bpe/process + + ${project.artifactId}-${project.version}.jar + + false + + + + + + + - \ No newline at end of file + diff --git a/src/main/java/dev/dsf/bpe/ConstantsHelloWorld.java b/src/main/java/dev/dsf/bpe/ConstantsHelloWorld.java new file mode 100644 index 0000000..bc7cf35 --- /dev/null +++ b/src/main/java/dev/dsf/bpe/ConstantsHelloWorld.java @@ -0,0 +1,20 @@ +package dev.dsf.bpe; + +public interface ConstantsHelloWorld +{ + String PROCESS_NAME_HELLO_WORLD = "helloWorld"; + String PROCESS_NAME_FULL_HELLO_WORLD = "dsfdev_" + PROCESS_NAME_HELLO_WORLD; + + String PROCESS_NAME_HELLO_USER = "helloUser"; + String PROCESS_NAME_FULL_HELLO_USER = "dsfdev_" + PROCESS_NAME_HELLO_USER; + + String PROCESS_DSF_URI_BASE = "http://dsf.dev/bpe/Process/"; + + String PROFILE_DSF_TASK_TASK_HELLO_WORLD = "http://dsf.dev/fhir/StructureDefinition/task-hello-world"; + String PROFILE_DSF_TASK_HELLO_WORLD_PROCESS_URI = PROCESS_DSF_URI_BASE + PROCESS_NAME_HELLO_WORLD; + String PROFILE_DSF_TASK_HELLO_WORLD_MESSAGE_NAME = "helloWorld"; + + String PROFILE_DSF_TASK_TASK_HELLO_USER = "http://dsf.dev/fhir/StructureDefinition/task-hello-user"; + String PROFILE_DSF_TASK_HELLO_USER_PROCESS_URI = PROCESS_DSF_URI_BASE + PROCESS_NAME_HELLO_USER; + String PROFILE_DSF_TASK_HELLO_USER_MESSAGE_NAME = "helloUser"; +} diff --git a/src/main/java/dev/dsf/bpe/HelloWorldProcessPluginDefinition.java b/src/main/java/dev/dsf/bpe/HelloWorldProcessPluginDefinition.java new file mode 100644 index 0000000..6f4df6f --- /dev/null +++ b/src/main/java/dev/dsf/bpe/HelloWorldProcessPluginDefinition.java @@ -0,0 +1,69 @@ +package dev.dsf.bpe; + +import java.time.LocalDate; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import dev.dsf.bpe.spring.config.HelloWorldConfig; +import dev.dsf.bpe.v1.ProcessPluginDefinition; + +public class HelloWorldProcessPluginDefinition implements ProcessPluginDefinition +{ + public static final String VERSION = "1.0.0.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2023, 8, 22); + + @Override + public String getName() + { + return "dsf-process-hello-world"; + } + + @Override + public String getVersion() + { + return VERSION; + } + + @Override + public LocalDate getReleaseDate() + { + return RELEASE_DATE; + } + + @Override + public List getProcessModels() + { + return List.of("bpe/hello-world.bpmn", "bpe/hello-user.bpmn"); + } + + @Override + public List> getSpringConfigurations() + { + return List.of(HelloWorldConfig.class); + } + + @Override + public Map> getFhirResourcesByProcessId() + { + var aHelloUser = "fhir/ActivityDefinition/dsf-hello-user.xml"; + var aHelloWorld = "fhir/ActivityDefinition/dsf-hello-world.xml"; + + var cHelloWorld = "fhir/CodeSystem/dsf-hello-world.xml"; + + var qHelloWorld = "fhir/Questionnaire/dsf-hello-user.xml"; + + var sHelloUser = "fhir/StructureDefinition/dsf-task-hello-user.xml"; + var sHelloWorld = "fhir/StructureDefinition/dsf-task-hello-world.xml"; + + var tHelloUser = "fhir/Task/dsf-task-hello-user.xml"; + var tHelloWorld = "fhir/Task/dsf-task-hello-world.xml"; + + var vHelloWorld = "fhir/ValueSet/dsf-hello-world.xml"; + + return Map.of(ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_USER, + Arrays.asList(aHelloUser, qHelloWorld, sHelloUser, tHelloUser), + ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_WORLD, + Arrays.asList(aHelloWorld, cHelloWorld, sHelloWorld, tHelloWorld, vHelloWorld)); + } +} diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/message/README.md b/src/main/java/dev/dsf/bpe/message/README.md similarity index 100% rename from dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/message/README.md rename to src/main/java/dev/dsf/bpe/message/README.md diff --git a/src/main/java/dev/dsf/bpe/service/HelloWorld.java b/src/main/java/dev/dsf/bpe/service/HelloWorld.java new file mode 100644 index 0000000..0c372bd --- /dev/null +++ b/src/main/java/dev/dsf/bpe/service/HelloWorld.java @@ -0,0 +1,28 @@ +package dev.dsf.bpe.service; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.hl7.fhir.r4.model.Task; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import dev.dsf.bpe.v1.ProcessPluginApi; +import dev.dsf.bpe.v1.activity.AbstractServiceDelegate; +import dev.dsf.bpe.v1.variables.Variables; + +public class HelloWorld extends AbstractServiceDelegate +{ + private static final Logger logger = LoggerFactory.getLogger(HelloWorld.class); + + public HelloWorld(ProcessPluginApi api) + { + super(api); + } + + @Override + protected void doExecute(DelegateExecution execution, Variables variables) + { + Task task = variables.getStartTask(); + logger.info("Hello World from organization with identifier '{}'", + task.getRequester().getIdentifier().getValue()); + } +} diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java b/src/main/java/dev/dsf/bpe/service/LogUserTaskResponse.java similarity index 52% rename from dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java rename to src/main/java/dev/dsf/bpe/service/LogUserTaskResponse.java index b8be7a1..2a7f365 100644 --- a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/service/LogUserTaskResponse.java +++ b/src/main/java/dev/dsf/bpe/service/LogUserTaskResponse.java @@ -1,20 +1,17 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_QUESTIONNAIRE_RESPONSE_COMPLETED; +package dev.dsf.bpe.service; 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.task.TaskHelper; 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; +import dev.dsf.bpe.v1.ProcessPluginApi; +import dev.dsf.bpe.v1.activity.AbstractServiceDelegate; +import dev.dsf.bpe.v1.variables.Variables; public class LogUserTaskResponse extends AbstractServiceDelegate implements InitializingBean { @@ -22,10 +19,9 @@ public class LogUserTaskResponse extends AbstractServiceDelegate implements Init private final FhirContext fhirContext; - public LogUserTaskResponse(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - ReadAccessHelper readAccessHelper, FhirContext fhirContext) + public LogUserTaskResponse(ProcessPluginApi api, FhirContext fhirContext) { - super(clientProvider, taskHelper, readAccessHelper); + super(api); this.fhirContext = fhirContext; } @@ -37,10 +33,9 @@ public void afterPropertiesSet() throws Exception } @Override - protected void doExecute(DelegateExecution execution) + protected void doExecute(DelegateExecution execution, Variables variables) { - QuestionnaireResponse questionnaireResponse = (QuestionnaireResponse) execution - .getVariable(BPMN_EXECUTION_VARIABLE_QUESTIONNAIRE_RESPONSE_COMPLETED); + QuestionnaireResponse questionnaireResponse = variables.getLatestReceivedQuestionnaireResponse(); logger.info("Completed QuestionnaireResponse: {}", fhirContext.newXmlParser().setPrettyPrint(true).encodeResourceToString(questionnaireResponse)); diff --git a/src/main/java/dev/dsf/bpe/spring/config/HelloWorldConfig.java b/src/main/java/dev/dsf/bpe/spring/config/HelloWorldConfig.java new file mode 100755 index 0000000..723e049 --- /dev/null +++ b/src/main/java/dev/dsf/bpe/spring/config/HelloWorldConfig.java @@ -0,0 +1,36 @@ +package dev.dsf.bpe.spring.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; + +import ca.uhn.fhir.context.FhirContext; +import dev.dsf.bpe.service.HelloWorld; +import dev.dsf.bpe.service.LogUserTaskResponse; +import dev.dsf.bpe.v1.ProcessPluginApi; + +@Configuration +public class HelloWorldConfig +{ + @Autowired + private ProcessPluginApi api; + + @Autowired + private FhirContext fhirContext; + + @Bean + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) + public HelloWorld helloWorld() + { + return new HelloWorld(api); + } + + @Bean + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) + public LogUserTaskResponse logUserTaskResponse() + { + return new LogUserTaskResponse(api, fhirContext); + } +} diff --git a/dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/variable/README.md b/src/main/java/dev/dsf/bpe/variable/README.md similarity index 100% rename from dsf-bpe-process-hello-world/src/main/java/org/highmed/dsf/bpe/variable/README.md rename to src/main/java/dev/dsf/bpe/variable/README.md diff --git a/src/main/resources/META-INF/services/dev.dsf.bpe.v1.ProcessPluginDefinition b/src/main/resources/META-INF/services/dev.dsf.bpe.v1.ProcessPluginDefinition new file mode 100644 index 0000000..5ee9242 --- /dev/null +++ b/src/main/resources/META-INF/services/dev.dsf.bpe.v1.ProcessPluginDefinition @@ -0,0 +1 @@ +dev.dsf.bpe.HelloWorldProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloUser.bpmn b/src/main/resources/bpe/hello-user.bpmn similarity index 90% rename from dsf-bpe-process-hello-world/src/main/resources/bpe/helloUser.bpmn rename to src/main/resources/bpe/hello-user.bpmn index 2a480ec..f77e90c 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloUser.bpmn +++ b/src/main/resources/bpe/hello-user.bpmn @@ -1,6 +1,6 @@ - + Flow_034bfq7 @@ -10,19 +10,19 @@ - + SequenceFlow_0bbhq2r Flow_00nx7hv - + Flow_00nx7hv Flow_034bfq7 - + diff --git a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn b/src/main/resources/bpe/hello-world.bpmn similarity index 90% rename from dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn rename to src/main/resources/bpe/hello-world.bpmn index 68bb0f1..744adeb 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/bpe/helloWorld.bpmn +++ b/src/main/resources/bpe/hello-world.bpmn @@ -1,12 +1,12 @@ - + SequenceFlow_0oyvmcd - + SequenceFlow_0bbhq2r SequenceFlow_0oyvmcd @@ -17,7 +17,7 @@ - + diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloUser.xml b/src/main/resources/fhir/ActivityDefinition/dsf-hello-user.xml similarity index 51% rename from dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloUser.xml rename to src/main/resources/fhir/ActivityDefinition/dsf-hello-user.xml index acb32fa..8aa641f 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloUser.xml +++ b/src/main/resources/fhir/ActivityDefinition/dsf-hello-user.xml @@ -1,31 +1,43 @@ - + - + - + - + + + + + + + + + + + + + - + - + @@ -36,12 +48,12 @@ - + - + - + diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloWorld.xml b/src/main/resources/fhir/ActivityDefinition/dsf-hello-world.xml similarity index 50% rename from dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloWorld.xml rename to src/main/resources/fhir/ActivityDefinition/dsf-hello-world.xml index c260fea..ff7f1f1 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/ActivityDefinition/highmed-helloWorld.xml +++ b/src/main/resources/fhir/ActivityDefinition/dsf-hello-world.xml @@ -1,31 +1,43 @@ - + - + - + - + + + + + + + + + + + + + - + - + @@ -36,12 +48,12 @@ - + - + - + diff --git a/src/main/resources/fhir/CodeSystem/dsf-hello-world.xml b/src/main/resources/fhir/CodeSystem/dsf-hello-world.xml new file mode 100644 index 0000000..4b8a18a --- /dev/null +++ b/src/main/resources/fhir/CodeSystem/dsf-hello-world.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + <!-- status managed by bpe --> + <status value="unknown" /> + <experimental value="false" /> + <!-- date managed by bpe --> + <date value="#{date}" /> + <publisher value="DSF" /> + <description value="CodeSystem with standard values for the hello world process" /> + <caseSensitive value="true" /> + <hierarchyMeaning value="grouped-by" /> + <versionNeeded value="false" /> + <content value="complete" /> + <concept> + <code value="string-example" /> + <display value="String Example" /> + <definition value="Example string input value" /> + </concept> + <concept> + <code value="integer-example" /> + <display value="Integer Example" /> + <definition value="Example integer input value" /> + </concept> + <concept> + <code value="decimal-example" /> + <display value="Decimal Example" /> + <definition value="Example decimal input value" /> + </concept> + <concept> + <code value="boolean-example" /> + <display value="Boolean Example" /> + <definition value="Example boolean input value" /> + </concept> + <concept> + <code value="date-example" /> + <display value="Date Example" /> + <definition value="Example date input value" /> + </concept> + <concept> + <code value="time-example" /> + <display value="Time Example" /> + <definition value="Example time input value" /> + </concept> + <concept> + <code value="date-time-example" /> + <display value="Date/Time Example" /> + <definition value="Example date/time input value" /> + </concept> + <concept> + <code value="instant-example" /> + <display value="Instant Example" /> + <definition value="Example instant input value" /> + </concept> + <concept> + <code value="uri-example" /> + <display value="URI Example" /> + <definition value="Example uri input value" /> + </concept> + <concept> + <code value="reference-example" /> + <display value="Reference Example" /> + <definition value="Example reference input value" /> + </concept> + <concept> + <code value="reference-identifier-example" /> + <display value="Reference-Identifier Example" /> + <definition value="Example reference-identifier input value" /> + </concept> + <concept> + <code value="identifier-example" /> + <display value="Identifier Example" /> + <definition value="Example identifier input value" /> + </concept> + <concept> + <code value="coding-example" /> + <display value="Coding Example" /> + <definition value="Example coding input value" /> + </concept> +</CodeSystem> \ No newline at end of file diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-user.xml b/src/main/resources/fhir/Questionnaire/dsf-hello-user.xml similarity index 92% rename from dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-user.xml rename to src/main/resources/fhir/Questionnaire/dsf-hello-user.xml index d3cd664..76f8958 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/Questionnaire/highmed-questionnaire-hello-user.xml +++ b/src/main/resources/fhir/Questionnaire/dsf-hello-user.xml @@ -1,12 +1,12 @@ <Questionnaire xmlns="http://hl7.org/fhir"> <meta> - <profile value="http://highmed.org/fhir/StructureDefinition/questionnaire|0.9.0"/> + <profile value="http://dsf.dev/fhir/StructureDefinition/questionnaire|1.0.0"/> <tag> - <system value="http://highmed.org/fhir/CodeSystem/read-access-tag"/> + <system value="http://dsf.dev/fhir/CodeSystem/read-access-tag"/> <code value="ALL"/> </tag> </meta> - <url value="http://highmed.org/fhir/Questionnaire/hello-user"/> + <url value="http://dsf.dev/fhir/Questionnaire/hello-user"/> <!-- version managed by bpe --> <version value="#{version}"/> <!-- date managed by bpe --> diff --git a/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-user.xml b/src/main/resources/fhir/StructureDefinition/dsf-task-hello-user.xml similarity index 71% rename from dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-user.xml rename to src/main/resources/fhir/StructureDefinition/dsf-task-hello-user.xml index 01a3b58..d961a05 100644 --- a/dsf-bpe-process-hello-world/src/main/resources/fhir/StructureDefinition/highmed-task-hello-user.xml +++ b/src/main/resources/fhir/StructureDefinition/dsf-task-hello-user.xml @@ -1,11 +1,11 @@ <StructureDefinition xmlns="http://hl7.org/fhir"> <meta> <tag> - <system value="http://highmed.org/fhir/CodeSystem/read-access-tag" /> + <system value="http://dsf.dev/fhir/CodeSystem/read-access-tag" /> <code value="ALL" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-hello-user" /> + <url value="http://dsf.dev/fhir/StructureDefinition/task-hello-user" /> <!-- version managed by bpe --> <version value="#{version}" /> <name value="helloUserProcess" /> @@ -18,19 +18,19 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> + <baseDefinition value="http://dsf.dev/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}" /> + <fixedUri value="http://dsf.dev/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" /> + <max value="2" /> </element> <element id="Task.input:message-name"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -43,14 +43,6 @@ <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" /> diff --git a/src/main/resources/fhir/StructureDefinition/dsf-task-hello-world.xml b/src/main/resources/fhir/StructureDefinition/dsf-task-hello-world.xml new file mode 100644 index 0000000..40a6b57 --- /dev/null +++ b/src/main/resources/fhir/StructureDefinition/dsf-task-hello-world.xml @@ -0,0 +1,548 @@ +<StructureDefinition xmlns="http://hl7.org/fhir"> + <meta> + <tag> + <system value="http://dsf.dev/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> + </tag> + </meta> + <url value="http://dsf.dev/fhir/StructureDefinition/task-hello-world" /> + <!-- version managed by bpe --> + <version value="#{version}" /> + <name value="helloWorldProcess" /> + <!-- 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://dsf.dev/fhir/StructureDefinition/task-base" /> + <derivation value="constraint" /> + <differential> + <element id="Task.instantiatesUri"> + <path value="Task.instantiatesUri" /> + <fixedUri value="http://dsf.dev/bpe/Process/helloWorld/#{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" /> + </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="helloWorld" /> + </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> + <element id="Task.input:string-example"> + <path value="Task.input" /> + <sliceName value="string-example" /> + <min value="1" /> + <max value="*" /> + </element> + <element id="Task.input:string-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:string-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:string-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:string-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="string-example" /> + </element> + <element id="Task.input:string-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="string" /> + </type> + <min value="1" /> + </element> + <element id="Task.input:integer-example"> + <path value="Task.input" /> + <sliceName value="integer-example" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:integer-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:integer-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:integer-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:integer-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="integer-example" /> + </element> + <element id="Task.input:integer-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="integer" /> + </type> + <min value="1" /> + </element> + <element id="Task.input:decimal-example"> + <path value="Task.input" /> + <sliceName value="decimal-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:decimal-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:decimal-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:decimal-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:decimal-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="decimal-example" /> + </element> + <element id="Task.input:decimal-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="decimal" /> + </type> + <min value="1" /> + </element> + <element id="Task.input:boolean-example"> + <path value="Task.input" /> + <sliceName value="boolean-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:boolean-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:boolean-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:boolean-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:boolean-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="boolean-example" /> + </element> + <element id="Task.input:boolean-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="boolean" /> + </type> + <min value="1" /> + </element> + <element id="Task.input:date-example"> + <path value="Task.input" /> + <sliceName value="date-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:date-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:date-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:date-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:date-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="date-example" /> + </element> + <element id="Task.input:date-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="date" /> + </type> + <min value="1" /> + </element> + <element id="Task.input:time-example"> + <path value="Task.input" /> + <sliceName value="time-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:time-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:time-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:time-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:time-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="time-example" /> + </element> + <element id="Task.input:time-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="time" /> + </type> + <min value="1" /> + </element> + <element id="Task.input:date-time-example"> + <path value="Task.input" /> + <sliceName value="date-time-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:date-time-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:date-time-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:date-time-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:date-time-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="date-time-example" /> + </element> + <element id="Task.input:date-time-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="dateTime" /> + </type> + <min value="1" /> + </element> + <element id="Task.input:instant-example"> + <path value="Task.input" /> + <sliceName value="instant-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:instant-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:instant-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:instant-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:instant-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="instant-example" /> + </element> + <element id="Task.input:instant-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="instant" /> + </type> + <min value="1" /> + </element> + <element id="Task.input:uri-example"> + <path value="Task.input" /> + <sliceName value="uri-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:uri-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:uri-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:uri-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:uri-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="uri-example" /> + </element> + <element id="Task.input:uri-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="uri" /> + </type> + <min value="1" /> + </element> + <element id="Task.input:reference-example"> + <path value="Task.input" /> + <sliceName value="reference-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:reference-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:reference-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:reference-example.type.coding.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:reference-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="reference-example" /> + </element> + <element id="Task.input:reference-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="Reference" /> + <targetProfile value="http://hl7.org/fhir/Patient" /> + </type> + </element> + <element id="Task.input:reference-example.value[x].reference"> + <path value="Task.input.value[x].reference" /> + <min value="1" /> + </element> + <element id="Task.input:reference-example.value[x].identifier"> + <path value="Task.input.value[x].identifier" /> + <max value="0" /> + </element> + <element id="Task.input:reference-identifier-example"> + <path value="Task.input" /> + <sliceName value="reference-identifier-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:reference-identifier-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:reference-identifier-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:reference-identifier-example.type.coding.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:reference-identifier-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="reference-identifier-example" /> + </element> + <element id="Task.input:reference-identifier-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="Reference" /> + <targetProfile value="http://hl7.org/fhir/Patient" /> + </type> + </element> + <element id="Task.input:reference-identifier-example.value[x].reference"> + <path value="Task.input.value[x].reference" /> + <max value="0" /> + </element> + <element id="Task.input:reference-identifier-example.value[x].identifier"> + <path value="Task.input.value[x].identifier" /> + <min value="1" /> + </element> + <element id="Task.input:identifier-example.value[x].identifier.system"> + <path value="Task.input.value[x].identifier.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/sid/hello-world-identifier" /> + </element> + <element id="Task.input:identifier-example.value[x].identifier.value"> + <path value="Task.input.value[x].identifier.value" /> + <min value="1" /> + </element> + <element id="Task.input:identifier-example"> + <path value="Task.input" /> + <sliceName value="identifier-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:identifier-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:identifier-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:identifier-example.type.coding.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:identifier-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="identifier-example" /> + </element> + <element id="Task.input:identifier-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="Identifier" /> + </type> + </element> + <element id="Task.input:identifier-example.value[x].system"> + <path value="Task.input.value[x].system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/sid/hello-world-identifier" /> + </element> + <element id="Task.input:identifier-example.value[x].value"> + <path value="Task.input.value[x].value" /> + <min value="1" /> + </element> + <element id="Task.input:coding-example"> + <path value="Task.input" /> + <sliceName value="coding-example" /> + <min value="0" /> + <max value="1" /> + </element> + <element id="Task.input:coding-example.type"> + <path value="Task.input.type" /> + <binding> + <strength value="required" /> + <valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" /> + </binding> + </element> + <element id="Task.input:coding-example.type.coding"> + <path value="Task.input.type.coding" /> + <min value="1" /> + <max value="1" /> + </element> + <element id="Task.input:coding-example.system"> + <path value="Task.input.type.coding.system" /> + <min value="1" /> + <fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </element> + <element id="Task.input:coding-example.type.coding.code"> + <path value="Task.input.type.coding.code" /> + <min value="1" /> + <fixedCode value="coding-example" /> + </element> + <element id="Task.input:coding-example.value[x]"> + <path value="Task.input.value[x]" /> + <type> + <code value="Coding" /> + </type> + </element> + <element id="Task.input:coding-example.value[x].system"> + <path value="Task.input.value[x].system" /> + <min value="1" /> + </element> + <element id="Task.input:coding-example.value[x].code"> + <path value="Task.input.value[x].code" /> + </element> + </differential> +</StructureDefinition> \ No newline at end of file diff --git a/src/main/resources/fhir/Task/dsf-task-hello-user.xml b/src/main/resources/fhir/Task/dsf-task-hello-user.xml new file mode 100644 index 0000000..a5818d8 --- /dev/null +++ b/src/main/resources/fhir/Task/dsf-task-hello-user.xml @@ -0,0 +1,38 @@ +<Task xmlns="http://hl7.org/fhir"> + <meta> + <profile value="http://dsf.dev/fhir/StructureDefinition/task-hello-user|#{version}"/> + </meta> + <identifier> + <system value="http://dsf.dev/sid/task-identifier"/> + <value value="http://dsf.dev/bpe/Process/helloUser/#{version}/task-hello-user"/> + </identifier> + <instantiatesCanonical value="http://dsf.dev/bpe/Process/helloUser|#{version}"/> + <status value="draft"/> + <intent value="order"/> + <authoredOn value="#{date}"/> + <requester> + <type value="Organization"/> + <identifier> + <system value="http://dsf.dev/sid/organization-identifier"/> + <value value="#{organization}"/> + </identifier> + </requester> + <restriction> + <recipient> + <type value="Organization"/> + <identifier> + <system value="http://dsf.dev/sid/organization-identifier"/> + <value value="#{organization}"/> + </identifier> + </recipient> + </restriction> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/bpmn-message"/> + <code value="message-name"/> + </coding> + </type> + <valueString value="helloUser"/> + </input> +</Task> \ No newline at end of file diff --git a/src/main/resources/fhir/Task/dsf-task-hello-world.xml b/src/main/resources/fhir/Task/dsf-task-hello-world.xml new file mode 100644 index 0000000..1db9e48 --- /dev/null +++ b/src/main/resources/fhir/Task/dsf-task-hello-world.xml @@ -0,0 +1,169 @@ +<Task xmlns="http://hl7.org/fhir"> + <meta> + <profile value="http://dsf.dev/fhir/StructureDefinition/task-hello-world|#{version}"/> + </meta> + <identifier> + <system value="http://dsf.dev/sid/task-identifier"/> + <value value="http://dsf.dev/bpe/Process/helloWorld/#{version}/task-hello-world"/> + </identifier> + <instantiatesCanonical value="http://dsf.dev/bpe/Process/helloWorld|#{version}"/> + <status value="draft"/> + <intent value="order"/> + <authoredOn value="#{date}"/> + <requester> + <type value="Organization"/> + <identifier> + <system value="http://dsf.dev/sid/organization-identifier"/> + <value value="#{organization}"/> + </identifier> + </requester> + <restriction> + <recipient> + <type value="Organization"/> + <identifier> + <system value="http://dsf.dev/sid/organization-identifier"/> + <value value="#{organization}"/> + </identifier> + </recipient> + </restriction> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/bpmn-message"/> + <code value="message-name"/> + </coding> + </type> + <valueString value="helloWorld"/> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="string-example" /> + </coding> + </type> + <valueString value="string-value" /> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="integer-example" /> + </coding> + </type> + <valueInteger value="1" /> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="decimal-example" /> + </coding> + </type> + <valueDecimal value="1.1" /> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="boolean-example" /> + </coding> + </type> + <valueBoolean value="true" /> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="date-example" /> + </coding> + </type> + <valueDate value="2023-06-25" /> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="time-example" /> + </coding> + </type> + <valueTime value="10:00:00" /> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="date-time-example" /> + </coding> + </type> + <valueDateTime value="2023-06-25T15:31:19+02:00" /> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="instant-example" /> + </coding> + </type> + <valueInstant value="2023-06-25T15:31:19.984+02:00" /> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="uri-example" /> + </coding> + </type> + <valueUri value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="reference-example" /> + </coding> + </type> + <valueReference> + <reference value="http://hl7.org/fhir/Patient/example-id" /> + </valueReference> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="reference-identifier-example" /> + </coding> + </type> + <valueReference> + <type value="Patient" /> + <identifier> + <system value="http://dsf.dev/sid/hello-world-identifier" /> + <value value="identifier-value" /> + </identifier> + </valueReference> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="identifier-example" /> + </coding> + </type> + <valueIdentifier> + <system value="http://dsf.dev/sid/hello-world-identifier" /> + <value value="identifier-value" /> + </valueIdentifier> + </input> + <input> + <type> + <coding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="coding-example" /> + </coding> + </type> + <valueCoding> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <code value="coding-example" /> + </valueCoding> + </input> +</Task> \ No newline at end of file diff --git a/src/main/resources/fhir/ValueSet/dsf-hello-world.xml b/src/main/resources/fhir/ValueSet/dsf-hello-world.xml new file mode 100644 index 0000000..4aba52b --- /dev/null +++ b/src/main/resources/fhir/ValueSet/dsf-hello-world.xml @@ -0,0 +1,27 @@ +<ValueSet xmlns="http://hl7.org/fhir"> + <meta> + <tag> + <system value="http://dsf.dev/fhir/CodeSystem/read-access-tag" /> + <code value="ALL" /> + </tag> + </meta> + <url value="http://dsf.dev/fhir/ValueSet/hello-world" /> + <!-- version managed by bpe --> + <version value="#{version}" /> + <name value="DSF_Hello_World" /> + <title value="DSF Hello World" /> + <!-- status managed by bpe --> + <status value="unknown" /> + <experimental value="false" /> + <!-- date managed by bpe --> + <date value="#{date}" /> + <publisher value="DSF" /> + <description value="ValueSet with standard values for the hello world process" /> + <immutable value="true" /> + <compose> + <include> + <system value="http://dsf.dev/fhir/CodeSystem/hello-world" /> + <version value="#{version}" /> + </include> + </compose> +</ValueSet> \ No newline at end of file diff --git a/src/test/java/dev/dsf/bpe/HelloProcessPluginDefinitionTest.java b/src/test/java/dev/dsf/bpe/HelloProcessPluginDefinitionTest.java new file mode 100644 index 0000000..d637a37 --- /dev/null +++ b/src/test/java/dev/dsf/bpe/HelloProcessPluginDefinitionTest.java @@ -0,0 +1,34 @@ +package dev.dsf.bpe; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.util.List; +import java.util.Map; + +import org.junit.Test; + +import dev.dsf.bpe.v1.ProcessPluginDefinition; + +public class HelloProcessPluginDefinitionTest +{ + @Test + public void testResourceLoading() + { + ProcessPluginDefinition definition = new HelloWorldProcessPluginDefinition(); + Map<String, List<String>> resourcesByProcessId = definition.getFhirResourcesByProcessId(); + + var helloWorld = resourcesByProcessId.get(ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_WORLD); + assertNotNull(helloWorld); + assertEquals(5, helloWorld.stream().filter(this::exists).count()); + + var helloUser = resourcesByProcessId.get(ConstantsHelloWorld.PROCESS_NAME_FULL_HELLO_USER); + assertNotNull(helloUser); + assertEquals(4, helloUser.stream().filter(this::exists).count()); + } + + private boolean exists(String file) + { + return getClass().getClassLoader().getResourceAsStream(file) != null; + } +} diff --git a/src/test/java/dev/dsf/bpe/start/HelloUserExampleStarter.java b/src/test/java/dev/dsf/bpe/start/HelloUserExampleStarter.java new file mode 100644 index 0000000..8087719 --- /dev/null +++ b/src/test/java/dev/dsf/bpe/start/HelloUserExampleStarter.java @@ -0,0 +1,47 @@ +package dev.dsf.bpe.start; + +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 dev.dsf.bpe.ConstantsHelloWorld; +import dev.dsf.bpe.HelloWorldProcessPluginDefinition; +import dev.dsf.bpe.v1.constants.CodeSystems; +import dev.dsf.bpe.v1.constants.NamingSystems; + +public class HelloUserExampleStarter +{ + // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate + // 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 + { + ExampleStarter.forServer(args, ConstantsExampleStarters.DIC_1_FHIR_BASE_URL).startWith(task()); + } + + private static Task task() + { + var def = new HelloWorldProcessPluginDefinition(); + + Task task = new Task(); + task.getMeta().addProfile(ConstantsHelloWorld.PROFILE_DSF_TASK_TASK_HELLO_USER); + task.setInstantiatesCanonical( + ConstantsHelloWorld.PROFILE_DSF_TASK_HELLO_USER_PROCESS_URI + "|" + def.getResourceVersion()); + task.setStatus(Task.TaskStatus.REQUESTED); + task.setIntent(Task.TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType(ResourceType.Organization.name()).setIdentifier(NamingSystems.OrganizationIdentifier + .withValue(ConstantsExampleStarters.NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_DIC_1)); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()) + .setIdentifier(NamingSystems.OrganizationIdentifier + .withValue(ConstantsExampleStarters.NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_DIC_1)); + + task.addInput().setValue(new StringType(ConstantsHelloWorld.PROFILE_DSF_TASK_HELLO_USER_MESSAGE_NAME)).getType() + .addCoding(CodeSystems.BpmnMessage.messageName()); + + return task; + } +} diff --git a/src/test/java/dev/dsf/bpe/start/HelloWorldExampleStarter.java b/src/test/java/dev/dsf/bpe/start/HelloWorldExampleStarter.java new file mode 100644 index 0000000..18bf380 --- /dev/null +++ b/src/test/java/dev/dsf/bpe/start/HelloWorldExampleStarter.java @@ -0,0 +1,47 @@ +package dev.dsf.bpe.start; + +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 dev.dsf.bpe.ConstantsHelloWorld; +import dev.dsf.bpe.HelloWorldProcessPluginDefinition; +import dev.dsf.bpe.v1.constants.CodeSystems; +import dev.dsf.bpe.v1.constants.NamingSystems; + +public class HelloWorldExampleStarter +{ + // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate + // 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 + { + ExampleStarter.forServer(args, ConstantsExampleStarters.DIC_1_FHIR_BASE_URL).startWith(task()); + } + + private static Task task() + { + var def = new HelloWorldProcessPluginDefinition(); + + Task task = new Task(); + task.getMeta().addProfile(ConstantsHelloWorld.PROFILE_DSF_TASK_TASK_HELLO_WORLD); + task.setInstantiatesCanonical( + ConstantsHelloWorld.PROFILE_DSF_TASK_HELLO_WORLD_PROCESS_URI + "|" + def.getResourceVersion()); + task.setStatus(Task.TaskStatus.REQUESTED); + task.setIntent(Task.TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType(ResourceType.Organization.name()).setIdentifier(NamingSystems.OrganizationIdentifier + .withValue(ConstantsExampleStarters.NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_DIC_1)); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()) + .setIdentifier(NamingSystems.OrganizationIdentifier + .withValue(ConstantsExampleStarters.NAMINGSYSTEM_DSF_ORGANIZATION_IDENTIFIER_VALUE_DIC_1)); + + task.addInput().setValue(new StringType(ConstantsHelloWorld.PROFILE_DSF_TASK_HELLO_WORLD_MESSAGE_NAME)) + .getType().addCoding(CodeSystems.BpmnMessage.messageName()); + + return task; + } +} diff --git a/src/test/java/dev/dsf/fhir/profile/ActivityDefinitionProfileTest.java b/src/test/java/dev/dsf/fhir/profile/ActivityDefinitionProfileTest.java new file mode 100644 index 0000000..9df9502 --- /dev/null +++ b/src/test/java/dev/dsf/fhir/profile/ActivityDefinitionProfileTest.java @@ -0,0 +1,88 @@ +package dev.dsf.fhir.profile; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.nio.file.Paths; +import java.util.Arrays; + +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; +import dev.dsf.bpe.HelloWorldProcessPluginDefinition; +import dev.dsf.fhir.authorization.process.ProcessAuthorizationHelper; +import dev.dsf.fhir.authorization.process.ProcessAuthorizationHelperImpl; +import dev.dsf.fhir.validation.ResourceValidator; +import dev.dsf.fhir.validation.ResourceValidatorImpl; +import dev.dsf.fhir.validation.ValidationSupportRule; + +public class ActivityDefinitionProfileTest +{ + private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionProfileTest.class); + + @ClassRule + public static final ValidationSupportRule validationRule = new ValidationSupportRule( + HelloWorldProcessPluginDefinition.VERSION, HelloWorldProcessPluginDefinition.RELEASE_DATE, + Arrays.asList("dsf-activity-definition-1.0.0.xml", "dsf-extension-process-authorization-1.0.0.xml", + "dsf-extension-process-authorization-organization-1.0.0.xml", + "dsf-extension-process-authorization-organization-practitioner-1.0.0.xml", + "dsf-extension-process-authorization-parent-organization-role-1.0.0.xml", + "dsf-extension-process-authorization-parent-organization-role-practitioner-1.0.0.xml", + "dsf-extension-process-authorization-practitioner-1.0.0.xml", + "dsf-coding-process-authorization-local-all-1.0.0.xml", + "dsf-coding-process-authorization-local-all-practitioner-1.0.0.xml", + "dsf-coding-process-authorization-local-organization-1.0.0.xml", + "dsf-coding-process-authorization-local-organization-practitioner-1.0.0.xml", + "dsf-coding-process-authorization-local-parent-organization-role-1.0.0.xml", + "dsf-coding-process-authorization-local-parent-organization-role-practitioner-1.0.0.xml", + "dsf-coding-process-authorization-remote-all-1.0.0.xml", + "dsf-coding-process-authorization-remote-parent-organization-role-1.0.0.xml", + "dsf-coding-process-authorization-remote-organization-1.0.0.xml"), + Arrays.asList("dsf-organization-role-1.0.0.xml", "dsf-practitioner-role-1.0.0.xml", + "dsf-process-authorization-1.0.0.xml", "dsf-read-access-tag-1.0.0.xml", "dsf-hello-world.xml"), + Arrays.asList("dsf-organization-role-1.0.0.xml", "dsf-practitioner-role-1.0.0.xml", + "dsf-process-authorization-recipient-1.0.0.xml", "dsf-process-authorization-requester-1.0.0.xml", + "dsf-read-access-tag-1.0.0.xml", "dsf-hello-world.xml")); + + private final ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + private final ProcessAuthorizationHelper processAuthorizationHelper = new ProcessAuthorizationHelperImpl(); + + @Test + public void testHelloWorldValid() throws Exception + { + ActivityDefinition ad = validationRule + .readActivityDefinition(Paths.get("src/main/resources/fhir/ActivityDefinition/dsf-hello-world.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, practitionerRole -> true, + orgIdentifier -> true, organizationRole -> true)); + } + + @Test + public void testHelloUserValid() throws Exception + { + ActivityDefinition ad = validationRule + .readActivityDefinition(Paths.get("src/main/resources/fhir/ActivityDefinition/dsf-hello-user.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, practitionerRole -> true, + orgIdentifier -> true, organizationRole -> true)); + } +} diff --git a/src/test/java/dev/dsf/fhir/profile/TaskProfileTest.java b/src/test/java/dev/dsf/fhir/profile/TaskProfileTest.java new file mode 100644 index 0000000..200b798 --- /dev/null +++ b/src/test/java/dev/dsf/fhir/profile/TaskProfileTest.java @@ -0,0 +1,168 @@ +package dev.dsf.fhir.profile; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import java.util.Date; + +import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.Coding; +import org.hl7.fhir.r4.model.DateTimeType; +import org.hl7.fhir.r4.model.DateType; +import org.hl7.fhir.r4.model.DecimalType; +import org.hl7.fhir.r4.model.Identifier; +import org.hl7.fhir.r4.model.InstantType; +import org.hl7.fhir.r4.model.IntegerType; +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; +import org.hl7.fhir.r4.model.TimeType; +import org.hl7.fhir.r4.model.UriType; +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; +import dev.dsf.bpe.ConstantsHelloWorld; +import dev.dsf.bpe.HelloWorldProcessPluginDefinition; +import dev.dsf.bpe.v1.constants.CodeSystems; +import dev.dsf.bpe.v1.constants.NamingSystems; +import dev.dsf.fhir.validation.ResourceValidator; +import dev.dsf.fhir.validation.ResourceValidatorImpl; +import dev.dsf.fhir.validation.ValidationSupportRule; + +public class TaskProfileTest +{ + private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); + + private static final HelloWorldProcessPluginDefinition def = new HelloWorldProcessPluginDefinition(); + + @ClassRule + public static final ValidationSupportRule validationRule = new ValidationSupportRule(def.getResourceVersion(), + def.getReleaseDate(), + Arrays.asList("dsf-task-base-1.0.0.xml", "dsf-task-hello-world.xml", "dsf-task-hello-user.xml"), + Arrays.asList("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "dsf-hello-world.xml"), + Arrays.asList("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "dsf-hello-world.xml")); + + private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + @Test + public void testMinimalTaskHelloWorldValid() + { + 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()); + } + + @Test + public void testMaximalTaskHelloWorldValid() + { + Task task = createValidTaskHelloWorld(); + + task.addInput().setValue(new DecimalType(1.1)).getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("decimal-example")); + task.addInput().setValue(new BooleanType(true)).getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("boolean-example")); + task.addInput().setValue(new DateType(new Date())).getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("date-example")); + task.addInput().setValue(new TimeType("10:00:00")).getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("time-example")); + task.addInput().setValue(new DateTimeType(new Date())).getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("date-time-example")); + task.addInput().setValue(new InstantType(new Date())).getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("instant-example")); + task.addInput().setValue(new UriType("http://dsf.dev/fhir/CodeSystem/hello-world")).getType() + .addCoding(new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("uri-example")); + task.addInput().setValue(new Reference("http://hl7.org/fhir/Patient/example-id")).getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("reference-example")); + task.addInput() + .setValue(new Reference().setType("Patient") + .setIdentifier(new Identifier().setSystem("http://dsf.dev/sid/hello-world-identifier") + .setValue("identifier-value"))) + .getType().addCoding(new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world") + .setCode("reference-identifier-example")); + task.addInput() + .setValue(new Identifier().setSystem("http://dsf.dev/sid/hello-world-identifier") + .setValue("identifier-value")) + .getType().addCoding(new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world") + .setCode("identifier-example")); + task.addInput() + .setValue( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("coding-example")) + .getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("coding-example")); + + 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(); + task.getMeta().addProfile(ConstantsHelloWorld.PROFILE_DSF_TASK_TASK_HELLO_WORLD); + task.setInstantiatesCanonical( + ConstantsHelloWorld.PROFILE_DSF_TASK_HELLO_WORLD_PROCESS_URI + "|" + def.getVersion()); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType(ResourceType.Organization.name()) + .setIdentifier(NamingSystems.OrganizationIdentifier.withValue("Test_DIC_1")); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()) + .setIdentifier(NamingSystems.OrganizationIdentifier.withValue("Test_DIC_1")); + + task.addInput().setValue(new StringType(ConstantsHelloWorld.PROFILE_DSF_TASK_HELLO_WORLD_MESSAGE_NAME)) + .getType().addCoding(CodeSystems.BpmnMessage.messageName()); + + task.addInput().setValue(new StringType("string-value")).getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("string-example")); + task.addInput().setValue(new IntegerType(1)).getType().addCoding( + new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("integer-example")); + + return task; + } + + @Test + public void testTaskHelloUserValid() + { + Task task = createValidTaskHelloUser(); + + 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 createValidTaskHelloUser() + { + Task task = new Task(); + task.getMeta().addProfile(ConstantsHelloWorld.PROFILE_DSF_TASK_TASK_HELLO_USER); + task.setInstantiatesCanonical( + ConstantsHelloWorld.PROFILE_DSF_TASK_HELLO_USER_PROCESS_URI + "|" + def.getVersion()); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType(ResourceType.Organization.name()) + .setIdentifier(NamingSystems.OrganizationIdentifier.withValue("Test_DIC_1")); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()) + .setIdentifier(NamingSystems.OrganizationIdentifier.withValue("Test_DIC_1")); + + task.addInput().setValue(new StringType(ConstantsHelloWorld.PROFILE_DSF_TASK_HELLO_USER_MESSAGE_NAME)).getType() + .addCoding(CodeSystems.BpmnMessage.messageName()); + + return task; + } +} diff --git a/src/test/resources/log4j2.xml b/src/test/resources/log4j2.xml new file mode 100644 index 0000000..191e09b --- /dev/null +++ b/src/test/resources/log4j2.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Configuration status="INFO" monitorInterval="30" + verbose="false"> + + <Appenders> + <Console name="CONSOLE" target="SYSTEM_OUT"> + <PatternLayout pattern="%p\t%t - %C{1}.%M(%L) | %m%n"/> + </Console> + </Appenders> + + <Loggers> + <Logger name="dev.dsf" level="TRACE"/> + <Logger name="org.apache" level="WARN"/> + <Logger name="org.springframework" level="WARN"/> + <Logger name="jndi" level="WARN"/> + <Logger name="org.eclipse.jetty" level="INFO"/> + <Logger name="com.sun.jersey" level="WARN"/> + <Logger name="liquibase" level="WARN"/> + <Logger name="ca.uhn.hl7v2" level="WARN"/> + + <Root level="WARN"> + <AppenderRef ref="CONSOLE"/> + </Root> + </Loggers> +</Configuration> \ No newline at end of file