From d99c27647e5b718a852e2cffd7ec9f9ea76e17fe Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 3 Nov 2020 16:41:40 +0100 Subject: [PATCH 01/75] new development cycle: 0.3.0 -> 0.4.0-SNAPSHOT --- dsf-bpe/dsf-bpe-process-base/pom.xml | 2 +- dsf-bpe/dsf-bpe-process-feasibility/pom.xml | 2 +- dsf-bpe/dsf-bpe-process-local-services/pom.xml | 2 +- dsf-bpe/dsf-bpe-process-ping/pom.xml | 2 +- .../dsf-bpe-process-child/pom.xml | 2 +- .../dsf-bpe-process-parent/pom.xml | 2 +- .../dsf-bpe-process-service-overwrite/pom.xml | 2 +- dsf-bpe/dsf-bpe-process-plugin-example/pom.xml | 2 +- dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml | 2 +- dsf-bpe/dsf-bpe-process-update-resources/pom.xml | 2 +- dsf-bpe/dsf-bpe-server-jetty/pom.xml | 2 +- dsf-bpe/dsf-bpe-server/pom.xml | 2 +- dsf-bpe/dsf-bpe-webservice-client/pom.xml | 2 +- dsf-bpe/pom.xml | 2 +- dsf-fhir/dsf-fhir-rest-adapter/pom.xml | 2 +- dsf-fhir/dsf-fhir-server-jetty/pom.xml | 2 +- dsf-fhir/dsf-fhir-server/pom.xml | 4 ++-- dsf-fhir/dsf-fhir-webservice-client/pom.xml | 2 +- dsf-fhir/dsf-fhir-websocket-client/pom.xml | 2 +- dsf-fhir/pom.xml | 2 +- dsf-mpi/dsf-mpi-client-pdq/pom.xml | 2 +- dsf-mpi/dsf-mpi-client-stub/pom.xml | 2 +- dsf-mpi/dsf-mpi-client/pom.xml | 2 +- dsf-mpi/pom.xml | 2 +- dsf-openehr/dsf-openehr-client-impl/pom.xml | 2 +- dsf-openehr/dsf-openehr-client-stub/pom.xml | 2 +- dsf-openehr/dsf-openehr-client/pom.xml | 2 +- dsf-openehr/dsf-openehr-model/pom.xml | 2 +- dsf-openehr/pom.xml | 2 +- dsf-pseudonymization/dsf-pseudonymization-base/pom.xml | 2 +- dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml | 2 +- dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml | 2 +- dsf-pseudonymization/pom.xml | 2 +- dsf-tools/dsf-tools-build-info-reader/pom.xml | 2 +- dsf-tools/dsf-tools-bundle-generator/pom.xml | 2 +- dsf-tools/dsf-tools-db-migration/pom.xml | 2 +- dsf-tools/dsf-tools-proxy-test/pom.xml | 2 +- dsf-tools/dsf-tools-test-data-generator/pom.xml | 2 +- dsf-tools/pom.xml | 2 +- pom.xml | 2 +- 40 files changed, 41 insertions(+), 41 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/pom.xml b/dsf-bpe/dsf-bpe-process-base/pom.xml index 98c614234..5640c25ef 100755 --- a/dsf-bpe/dsf-bpe-process-base/pom.xml +++ b/dsf-bpe/dsf-bpe-process-base/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml index 103ea2ad6..c2345eda3 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml @@ -8,7 +8,7 @@ dsf-bpe-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-process-local-services/pom.xml b/dsf-bpe/dsf-bpe-process-local-services/pom.xml index 3b49c30a1..2ade49b30 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/pom.xml @@ -9,7 +9,7 @@ dsf-bpe-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-process-ping/pom.xml b/dsf-bpe/dsf-bpe-process-ping/pom.xml index 459f8bf3c..d069c6a34 100755 --- a/dsf-bpe/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe/dsf-bpe-process-ping/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml index 3d60f062f..2411a77a3 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml @@ -8,7 +8,7 @@ dsf-bpe-process-plugin-example org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml index 55676f702..c3e468fcd 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml @@ -8,7 +8,7 @@ dsf-bpe-process-plugin-example org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/pom.xml index 7b5931d29..057b22971 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/pom.xml +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/pom.xml @@ -8,7 +8,7 @@ dsf-bpe-process-plugin-example org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/pom.xml index bd745ac58..b84a4a17f 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/pom.xml +++ b/dsf-bpe/dsf-bpe-process-plugin-example/pom.xml @@ -7,7 +7,7 @@ dsf-bpe-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT dsf-bpe-process-plugin-example diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml index 064da782c..04306b488 100755 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml index 67c5bdf43..6d476061c 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-server-jetty/pom.xml b/dsf-bpe/dsf-bpe-server-jetty/pom.xml index 2253f7f03..e6a779ae3 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/pom.xml +++ b/dsf-bpe/dsf-bpe-server-jetty/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-server/pom.xml b/dsf-bpe/dsf-bpe-server/pom.xml index ff86e8bcf..c6a7fe19c 100755 --- a/dsf-bpe/dsf-bpe-server/pom.xml +++ b/dsf-bpe/dsf-bpe-server/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/dsf-bpe-webservice-client/pom.xml b/dsf-bpe/dsf-bpe-webservice-client/pom.xml index 5523f9e97..ccd73afbc 100755 --- a/dsf-bpe/dsf-bpe-webservice-client/pom.xml +++ b/dsf-bpe/dsf-bpe-webservice-client/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-bpe-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-bpe/pom.xml b/dsf-bpe/pom.xml index a6d9dadce..bd03879c5 100755 --- a/dsf-bpe/pom.xml +++ b/dsf-bpe/pom.xml @@ -8,7 +8,7 @@ org.highmed.dsf dsf-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-fhir/dsf-fhir-rest-adapter/pom.xml b/dsf-fhir/dsf-fhir-rest-adapter/pom.xml index 94c77ba3a..7cb3e758c 100755 --- a/dsf-fhir/dsf-fhir-rest-adapter/pom.xml +++ b/dsf-fhir/dsf-fhir-rest-adapter/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-fhir-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-fhir/dsf-fhir-server-jetty/pom.xml b/dsf-fhir/dsf-fhir-server-jetty/pom.xml index 9bbbcc3ca..56845acb1 100755 --- a/dsf-fhir/dsf-fhir-server-jetty/pom.xml +++ b/dsf-fhir/dsf-fhir-server-jetty/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-fhir-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-fhir/dsf-fhir-server/pom.xml b/dsf-fhir/dsf-fhir-server/pom.xml index 802860cf2..050a6334b 100755 --- a/dsf-fhir/dsf-fhir-server/pom.xml +++ b/dsf-fhir/dsf-fhir-server/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-fhir-pom - 0.3.0 + 0.4.0-SNAPSHOT @@ -290,7 +290,7 @@ - diff --git a/dsf-fhir/dsf-fhir-webservice-client/pom.xml b/dsf-fhir/dsf-fhir-webservice-client/pom.xml index 5f284152d..7f66e85ad 100755 --- a/dsf-fhir/dsf-fhir-webservice-client/pom.xml +++ b/dsf-fhir/dsf-fhir-webservice-client/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-fhir-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-fhir/dsf-fhir-websocket-client/pom.xml b/dsf-fhir/dsf-fhir-websocket-client/pom.xml index 9029ad6d1..a846d5066 100755 --- a/dsf-fhir/dsf-fhir-websocket-client/pom.xml +++ b/dsf-fhir/dsf-fhir-websocket-client/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-fhir-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-fhir/pom.xml b/dsf-fhir/pom.xml index fdf7386b3..e1fe7fb19 100755 --- a/dsf-fhir/pom.xml +++ b/dsf-fhir/pom.xml @@ -8,7 +8,7 @@ org.highmed.dsf dsf-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-mpi/dsf-mpi-client-pdq/pom.xml b/dsf-mpi/dsf-mpi-client-pdq/pom.xml index da8b1ac20..e5edbb3b9 100644 --- a/dsf-mpi/dsf-mpi-client-pdq/pom.xml +++ b/dsf-mpi/dsf-mpi-client-pdq/pom.xml @@ -9,7 +9,7 @@ dsf-mpi-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-mpi/dsf-mpi-client-stub/pom.xml b/dsf-mpi/dsf-mpi-client-stub/pom.xml index a079541f2..b3c996c0f 100644 --- a/dsf-mpi/dsf-mpi-client-stub/pom.xml +++ b/dsf-mpi/dsf-mpi-client-stub/pom.xml @@ -9,7 +9,7 @@ dsf-mpi-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-mpi/dsf-mpi-client/pom.xml b/dsf-mpi/dsf-mpi-client/pom.xml index 3619928e3..2171cf110 100644 --- a/dsf-mpi/dsf-mpi-client/pom.xml +++ b/dsf-mpi/dsf-mpi-client/pom.xml @@ -9,6 +9,6 @@ dsf-mpi-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT \ No newline at end of file diff --git a/dsf-mpi/pom.xml b/dsf-mpi/pom.xml index 6a45696ee..253cbc042 100644 --- a/dsf-mpi/pom.xml +++ b/dsf-mpi/pom.xml @@ -10,7 +10,7 @@ dsf-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-openehr/dsf-openehr-client-impl/pom.xml b/dsf-openehr/dsf-openehr-client-impl/pom.xml index 574cc66e1..b66f4d902 100644 --- a/dsf-openehr/dsf-openehr-client-impl/pom.xml +++ b/dsf-openehr/dsf-openehr-client-impl/pom.xml @@ -9,7 +9,7 @@ dsf-openehr-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-openehr/dsf-openehr-client-stub/pom.xml b/dsf-openehr/dsf-openehr-client-stub/pom.xml index 1654ad97b..3082776f8 100644 --- a/dsf-openehr/dsf-openehr-client-stub/pom.xml +++ b/dsf-openehr/dsf-openehr-client-stub/pom.xml @@ -9,7 +9,7 @@ dsf-openehr-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-openehr/dsf-openehr-client/pom.xml b/dsf-openehr/dsf-openehr-client/pom.xml index 81e1597f9..acf20b18d 100644 --- a/dsf-openehr/dsf-openehr-client/pom.xml +++ b/dsf-openehr/dsf-openehr-client/pom.xml @@ -8,7 +8,7 @@ dsf-openehr-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-openehr/dsf-openehr-model/pom.xml b/dsf-openehr/dsf-openehr-model/pom.xml index d40c7a96f..857a9156d 100644 --- a/dsf-openehr/dsf-openehr-model/pom.xml +++ b/dsf-openehr/dsf-openehr-model/pom.xml @@ -7,7 +7,7 @@ dsf-openehr-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-openehr/pom.xml b/dsf-openehr/pom.xml index 99229609e..b327177d3 100755 --- a/dsf-openehr/pom.xml +++ b/dsf-openehr/pom.xml @@ -10,7 +10,7 @@ dsf-pom org.highmed.dsf - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-pseudonymization/dsf-pseudonymization-base/pom.xml b/dsf-pseudonymization/dsf-pseudonymization-base/pom.xml index 92a48f18a..ba12fd7e9 100644 --- a/dsf-pseudonymization/dsf-pseudonymization-base/pom.xml +++ b/dsf-pseudonymization/dsf-pseudonymization-base/pom.xml @@ -7,6 +7,6 @@ org.highmed.dsf dsf-pseudonymization-pom - 0.3.0 + 0.4.0-SNAPSHOT \ No newline at end of file diff --git a/dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml b/dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml index 2693e7dc8..9444ad572 100644 --- a/dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml +++ b/dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-pseudonymization-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml b/dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml index cbfcac607..ce69128d4 100644 --- a/dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml +++ b/dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-pseudonymization-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-pseudonymization/pom.xml b/dsf-pseudonymization/pom.xml index 3afca6539..72a20f854 100644 --- a/dsf-pseudonymization/pom.xml +++ b/dsf-pseudonymization/pom.xml @@ -8,7 +8,7 @@ org.highmed.dsf dsf-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-tools/dsf-tools-build-info-reader/pom.xml b/dsf-tools/dsf-tools-build-info-reader/pom.xml index a1d63f68c..aa7a8ecdc 100644 --- a/dsf-tools/dsf-tools-build-info-reader/pom.xml +++ b/dsf-tools/dsf-tools-build-info-reader/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-tools-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-tools/dsf-tools-bundle-generator/pom.xml b/dsf-tools/dsf-tools-bundle-generator/pom.xml index c42852980..398eb66be 100755 --- a/dsf-tools/dsf-tools-bundle-generator/pom.xml +++ b/dsf-tools/dsf-tools-bundle-generator/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-tools-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-tools/dsf-tools-db-migration/pom.xml b/dsf-tools/dsf-tools-db-migration/pom.xml index cef23baec..8cddc6df7 100755 --- a/dsf-tools/dsf-tools-db-migration/pom.xml +++ b/dsf-tools/dsf-tools-db-migration/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-tools-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-tools/dsf-tools-proxy-test/pom.xml b/dsf-tools/dsf-tools-proxy-test/pom.xml index 645450e96..2ec1520ae 100755 --- a/dsf-tools/dsf-tools-proxy-test/pom.xml +++ b/dsf-tools/dsf-tools-proxy-test/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-tools-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-tools/dsf-tools-test-data-generator/pom.xml b/dsf-tools/dsf-tools-test-data-generator/pom.xml index 926c557a1..02084a27e 100755 --- a/dsf-tools/dsf-tools-test-data-generator/pom.xml +++ b/dsf-tools/dsf-tools-test-data-generator/pom.xml @@ -7,7 +7,7 @@ org.highmed.dsf dsf-tools-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/dsf-tools/pom.xml b/dsf-tools/pom.xml index 4c4f9c5b6..b1f2f1e4d 100755 --- a/dsf-tools/pom.xml +++ b/dsf-tools/pom.xml @@ -8,7 +8,7 @@ org.highmed.dsf dsf-pom - 0.3.0 + 0.4.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index f1aef4798..68019d4c2 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.highmed.dsf dsf-pom - 0.3.0 + 0.4.0-SNAPSHOT pom From 43c1501ccfdd89830d9ac416d7385bd37d78cf81 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Mon, 9 Nov 2020 20:20:44 +0100 Subject: [PATCH 02/75] initial process plugin class loader implementation Process plugins are expected to supply an instance of org.highmed.dsf.ProcessPluginDefinition via the java service loader mechanism. Processes are later loaded via a classloader per process allowing multiple versions of the same process and implementing java classes to be used in parallel. Per process java service delegates are expected to be defined as spring beans. Every process plugin has its own spring context with the the main process engines spring context set as parent. --- .gitignore | 1 + dsf-bpe/dsf-bpe-process-base/pom.xml | 19 ++ .../highmed/dsf/ProcessPluginDefinition.java | 45 +++ .../plugin/AbstractProcessEnginePlugin.java | 46 --- dsf-bpe/dsf-bpe-process-feasibility/pom.xml | 25 +- .../FeasibilityProcessPluginDefinition.java | 22 ++ .../dsf/bpe/plugin/FeasibilityPlugin.java | 24 -- .../bpe/spring/config/FeasibilityConfig.java | 8 - .../org.highmed.dsf.ProcessPluginDefinition | 1 + .../dsf-bpe-process-local-services/pom.xml | 12 +- .../LocalServicesProcessPluginDefinition.java | 29 ++ .../dsf/bpe/plugin/LocalServicesPlugin.java | 16 - .../spring/config/LocalServicesConfig.java | 106 ++++++- .../org.highmed.dsf.ProcessPluginDefinition | 1 + dsf-bpe/dsf-bpe-process-ping/pom.xml | 2 + .../dsf/bpe/PingProcessPluginDefinition.java | 21 ++ .../highmed/dsf/bpe/plugin/PingPlugin.java | 20 -- .../dsf/bpe/spring/config/PingConfig.java | 8 - .../org.highmed.dsf.ProcessPluginDefinition | 1 + .../Ping3MedicFromTtpExampleStarter.java | 6 +- .../dsf-bpe-process-child/pom.xml | 1 + .../dsf/bpe/ChildProcessPluginDefinition.java | 21 ++ .../highmed/dsf/bpe/plugin/ChildPlugin.java | 16 - .../dsf/bpe/spring/config/ChildConfig.java | 7 - .../org.highmed.dsf.ProcessPluginDefinition | 1 + .../dsf-bpe-process-parent/pom.xml | 1 + .../bpe/ParentProcessPluginDefinition.java | 21 ++ .../highmed/dsf/bpe/plugin/ParentPlugin.java | 16 - .../dsf/bpe/spring/config/ParentConfig.java | 7 - .../org.highmed.dsf.ProcessPluginDefinition | 1 + .../dsf-bpe-process-update-allow-list/pom.xml | 2 + .../bpe/UpdateAllowListPluginDefinition.java | 21 ++ .../dsf/bpe/plugin/UpdateAllowListPlugin.java | 20 -- .../spring/config/UpdateAllowListConfig.java | 8 - .../org.highmed.dsf.ProcessPluginDefinition | 1 + .../dsf-bpe-process-update-resources/pom.xml | 2 + .../bpe/UpdateResourcesPluginDefinition.java | 21 ++ .../dsf/bpe/plugin/UpdateResourcesPlugin.java | 20 -- .../spring/config/UpdateResourcesConfig.java | 8 - .../org.highmed.dsf.ProcessPluginDefinition | 1 + .../conf/config.properties | 1 + .../dsf-bpe-server-jetty/plugin/.gitignore | 1 - dsf-bpe/dsf-bpe-server-jetty/pom.xml | 61 +++- .../dsf-bpe-server-jetty/process/README.md | 1 + dsf-bpe/dsf-bpe-server/pom.xml | 30 -- .../bpe/camunda/MultiVersionBpmnParse.java | 48 +++ .../camunda/MultiVersionBpmnParseFactory.java | 22 ++ ...iVersionClassDelegateActivityBehavior.java | 72 +++++ ...rsionSpringProcessEngineConfiguration.java | 12 + .../dsf/bpe/delegate/DelegateProvider.java | 35 +++ .../bpe/delegate/DelegateProviderImpl.java | 73 +++++ .../highmed/dsf/bpe/plugin/ProcessPlugin.java | 112 +++++++ ...ProcessPluginDefinitionAndClassLoader.java | 67 ++++ .../dsf/bpe/plugin/ProcessPluginProvider.java | 42 +++ .../bpe/plugin/ProcessPluginProviderImpl.java | 296 ++++++++++++++++++ .../BpmnServiceDelegateValidationService.java | 72 +++-- .../dsf/bpe/spring/config/CamundaConfig.java | 62 +++- .../config/MasterPatientIndexConfig.java | 5 +- .../dsf/bpe/spring/config/OpenEhrConfig.java | 7 +- .../bpe/spring/config/ValidationConfig.java | 8 +- dsf-mpi/dsf-mpi-client-stub/pom.xml | 58 ---- dsf-openehr/dsf-openehr-client-stub/pom.xml | 63 +--- 62 files changed, 1293 insertions(+), 464 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java delete mode 100755 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/plugin/AbstractProcessEnginePlugin.java create mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/plugin/FeasibilityPlugin.java create mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition create mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/plugin/LocalServicesPlugin.java create mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition create mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/plugin/PingPlugin.java create mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition create mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/plugin/ChildPlugin.java create mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition create mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/plugin/ParentPlugin.java create mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition create mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java delete mode 100755 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowListPlugin.java create mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition create mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java delete mode 100755 dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/plugin/UpdateResourcesPlugin.java create mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition delete mode 100644 dsf-bpe/dsf-bpe-server-jetty/plugin/.gitignore create mode 100644 dsf-bpe/dsf-bpe-server-jetty/process/README.md create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionBpmnParse.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionBpmnParseFactory.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionClassDelegateActivityBehavior.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionSpringProcessEngineConfiguration.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPlugin.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java diff --git a/.gitignore b/.gitignore index 65c1b958f..68b656ad5 100755 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ dsf-bpe/dsf-bpe-server-jetty/docker/dsf_bpe.jar dsf-bpe/dsf-bpe-server-jetty/docker/lib/*.jar dsf-bpe/dsf-bpe-server-jetty/docker/plugin/*.jar +dsf-bpe/dsf-bpe-server-jetty/process/*.jar ### # dsf-fhir ignores diff --git a/dsf-bpe/dsf-bpe-process-base/pom.xml b/dsf-bpe/dsf-bpe-process-base/pom.xml index 5640c25ef..c13242436 100755 --- a/dsf-bpe/dsf-bpe-process-base/pom.xml +++ b/dsf-bpe/dsf-bpe-process-base/pom.xml @@ -15,6 +15,25 @@ org.highmed.dsf dsf-fhir-webservice-client + + + org.highmed.dsf + dsf-pseudonymization-medic + + + org.highmed.dsf + dsf-pseudonymization-ttp + + + + org.highmed.dsf + dsf-mpi-client + + + + org.highmed.dsf + dsf-openehr-model + org.highmed.dsf dsf-openehr-client diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java new file mode 100644 index 000000000..6d3e03991 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java @@ -0,0 +1,45 @@ +package org.highmed.dsf; + +import java.util.Collections; +import java.util.List; +import java.util.ServiceLoader; +import java.util.stream.Stream; + +import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * A provider configuration file named "org.highmed.dsf.DsfProcessPluginDefinition" containing the canonical name of the + * class implementing this interface needs to be part of the process plugin at "/META-INF/services/". For more details + * on the content of the provider configuration file, see {@link ServiceLoader}. + * + * Additional {@link TypedValueSerializer}s to be registered inside the camunda process engine need be defined as beans + * in the process plugins spring context. + */ +public interface ProcessPluginDefinition +{ + /** + * Return Stream.of("foo.bpmn"); for a foo.bpmn file located in the root folder of the process plugin + * jar. The returned files will be read via {@link ClassLoader#getResourceAsStream(String)}. + * + * @return *.bpmn files inside process plugin jar + * + * @see ClassLoader#getResourceAsStream(String) + */ + Stream getBpmnFiles(); + + /** + * @return @{@link Configuration} annotated classes defining @{@link Bean} annotated factory methods + */ + Stream> getSpringConfigClasses(); + + /** + * @return dependencies to other processes by jar name (excluding '.jar'). The system will add ".jar" and + * "-SNAPSHOT.jar" while searching for jars + */ + default List getDependencyJarNames() + { + return Collections.emptyList(); + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/plugin/AbstractProcessEnginePlugin.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/plugin/AbstractProcessEnginePlugin.java deleted file mode 100755 index 91a80febb..000000000 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/plugin/AbstractProcessEnginePlugin.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.highmed.dsf.bpe.plugin; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.engine.RepositoryService; -import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; -import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; -import org.camunda.bpm.engine.repository.Deployment; -import org.camunda.bpm.model.bpmn.Bpmn; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public abstract class AbstractProcessEnginePlugin implements ProcessEnginePlugin -{ - private static final Logger logger = LoggerFactory.getLogger(AbstractProcessEnginePlugin.class); - - @Override - public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) - { - } - - @Override - public void postInit(ProcessEngineConfigurationImpl processEngineConfiguration) - { - } - - protected void deploy(ProcessEngine processEngine, String modelFilename, BpmnModelInstance model) - { - RepositoryService repositoryService = processEngine.getRepositoryService(); - - Deployment deployment = repositoryService.createDeployment().name(modelFilename).source(modelFilename) - .addModelInstance(modelFilename, model).enableDuplicateFiltering(true).deploy(); - - logger.info("Process {} deployed with id {}", modelFilename, deployment.getId()); - } - - protected BpmnModelInstance readAndValidateModel(String modelFilename) - { - BpmnModelInstance model = Bpmn - .readModelFromStream(AbstractProcessEnginePlugin.class.getResourceAsStream(modelFilename)); - - Bpmn.validateModel(model); - - return model; - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml index c2345eda3..e36ea1108 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml @@ -15,31 +15,8 @@ org.highmed.dsf dsf-bpe-process-base + provided - - org.highmed.dsf - dsf-pseudonymization-medic - - - org.highmed.dsf - dsf-pseudonymization-ttp - - - - org.highmed.dsf - dsf-mpi-client - - - - - org.highmed.dsf - dsf-openehr-model - - - org.highmed.dsf - dsf-openehr-client - - de.hs-heilbronn.mi diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java new file mode 100644 index 000000000..d3aacc57c --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -0,0 +1,22 @@ +package org.highmed.dsf.bpe; + +import java.util.stream.Stream; + +import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.spring.config.FeasibilityConfig; +import org.highmed.dsf.bpe.spring.config.FeasibilitySerializerConfig; + +public class FeasibilityProcessPluginDefinition implements ProcessPluginDefinition +{ + @Override + public Stream getBpmnFiles() + { + return Stream.of("requestSimpleFeasibility.bpmn","computeSimpleFeasibility.bpmn", "executeSimpleFeasibility.bpmn"); + } + + @Override + public Stream> getSpringConfigClasses() + { + return Stream.of(FeasibilityConfig.class, FeasibilitySerializerConfig.class); + } +} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/plugin/FeasibilityPlugin.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/plugin/FeasibilityPlugin.java deleted file mode 100755 index e07be102d..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/plugin/FeasibilityPlugin.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.highmed.dsf.bpe.plugin; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; - -public class FeasibilityPlugin extends AbstractProcessEnginePlugin -{ - private static final String REQUEST_FILE = "requestSimpleFeasibility.bpmn"; - private static final String COMPUTATION_FILE = "computeSimpleFeasibility.bpmn"; - private static final String EXECUTION_FILE = "executeSimpleFeasibility.bpmn"; - - @Override - public void postProcessEngineBuild(ProcessEngine processEngine) - { - BpmnModelInstance requestProcess = readAndValidateModel("/" + REQUEST_FILE); - deploy(processEngine, REQUEST_FILE, requestProcess); - - BpmnModelInstance computationProcess = readAndValidateModel("/" + COMPUTATION_FILE); - deploy(processEngine, COMPUTATION_FILE, computationProcess); - - BpmnModelInstance executionProcess = readAndValidateModel("/" + EXECUTION_FILE); - deploy(processEngine, EXECUTION_FILE, executionProcess); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java index ef8c2b6eb..37b50c932 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java @@ -1,13 +1,11 @@ package org.highmed.dsf.bpe.spring.config; import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; import org.highmed.dsf.bpe.message.SendMedicRequest; import org.highmed.dsf.bpe.message.SendMultiMedicErrors; import org.highmed.dsf.bpe.message.SendMultiMedicResults; import org.highmed.dsf.bpe.message.SendSingleMedicResults; import org.highmed.dsf.bpe.message.SendTtpRequest; -import org.highmed.dsf.bpe.plugin.FeasibilityPlugin; import org.highmed.dsf.bpe.service.CalculateMultiMedicResults; import org.highmed.dsf.bpe.service.CheckFeasibilityResources; import org.highmed.dsf.bpe.service.CheckMultiMedicResults; @@ -82,12 +80,6 @@ public class FeasibilityConfig @Value("${org.highmed.dsf.bpe.openehr.subject_external_id.path:/ehr_status/subject/external_ref/id/value}") private String ehrIdColumnPath; - @Bean - public ProcessEnginePlugin feasibilityPlugin() - { - return new FeasibilityPlugin(); - } - // // process requestSimpleFeasibility implementations // diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition new file mode 100644 index 000000000..4905d96a0 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition @@ -0,0 +1 @@ +org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-local-services/pom.xml b/dsf-bpe/dsf-bpe-process-local-services/pom.xml index 2ade49b30..b234aaeea 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/pom.xml @@ -15,17 +15,13 @@ org.highmed.dsf - dsf-bpe-process-feasibility + dsf-bpe-process-base + provided - org.highmed.dsf - dsf-mpi-client - - - - org.highmed.dsf - dsf-openehr-client + dsf-bpe-process-feasibility + provided diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java new file mode 100644 index 000000000..e89cdbf36 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -0,0 +1,29 @@ +package org.highmed.dsf.bpe; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.spring.config.LocalServicesConfig; + +public class LocalServicesProcessPluginDefinition implements ProcessPluginDefinition +{ + @Override + public Stream getBpmnFiles() + { + return Stream.of("localServicesIntegration.bpmn"); + } + + @Override + public Stream> getSpringConfigClasses() + { + return Stream.of(LocalServicesConfig.class); + } + + @Override + public List getDependencyJarNames() + { + return Arrays.asList("dsf-bpe-process-feasibility-0.4.0"); + } +} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/plugin/LocalServicesPlugin.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/plugin/LocalServicesPlugin.java deleted file mode 100644 index e9f24a21b..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/plugin/LocalServicesPlugin.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.highmed.dsf.bpe.plugin; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; - -public class LocalServicesPlugin extends AbstractProcessEnginePlugin -{ - private static final String LOCAL_SERVICE_INTEGRATION_FILE = "localServicesIntegration.bpmn"; - - @Override - public void postProcessEngineBuild(ProcessEngine processEngine) - { - BpmnModelInstance requestProcess = readAndValidateModel("/" + LOCAL_SERVICE_INTEGRATION_FILE); - deploy(processEngine, LOCAL_SERVICE_INTEGRATION_FILE, requestProcess); - } -} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java index a9c2c9df5..c351806a0 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java @@ -1,14 +1,30 @@ package org.highmed.dsf.bpe.spring.config; -import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; -import org.highmed.dsf.bpe.plugin.LocalServicesPlugin; +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.highmed.dsf.bpe.service.CheckQueries; +import org.highmed.dsf.bpe.service.CheckSingleMedicResults; +import org.highmed.dsf.bpe.service.ExecuteQueries; import org.highmed.dsf.bpe.service.ExtractInputValues; +import org.highmed.dsf.bpe.service.FilterQueryResultsByConsent; +import org.highmed.dsf.bpe.service.GenerateBloomFilters; +import org.highmed.dsf.bpe.service.GenerateCountFromIds; +import org.highmed.dsf.bpe.service.ModifyQueries; import org.highmed.dsf.bpe.service.StoreResult; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.group.GroupHelper; +import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; +import org.highmed.mpi.client.MasterPatientIndexClient; +import org.highmed.mpi.client.MasterPatientIndexClientFactory; +import org.highmed.openehr.client.OpenEhrClient; +import org.highmed.openehr.client.OpenEhrClientFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; + +import com.fasterxml.jackson.databind.ObjectMapper; @Configuration public class LocalServicesConfig @@ -16,14 +32,29 @@ public class LocalServicesConfig @Autowired private FhirWebserviceClientProvider fhirClientProvider; + @Autowired + private MasterPatientIndexClientFactory masterPatientIndexClientFactory; + + @Autowired + private OpenEhrClientFactory openEhrClientFactory; + + @Autowired + private OrganizationProvider organizationProvider; + @Autowired private TaskHelper taskHelper; - @Bean - public ProcessEnginePlugin localServicesPlugin() - { - return new LocalServicesPlugin(); - } + @Autowired + private GroupHelper groupHelper; + + @Autowired + private ObjectMapper objectMapper; + + @Autowired + private Environment environment; + + @Value("${org.highmed.dsf.bpe.openehr.subject_external_id.path:/ehr_status/subject/external_ref/id/value}") + private String ehrIdColumnPath; @Bean public ExtractInputValues extractInputValues() @@ -36,4 +67,65 @@ public StoreResult storeResult() { return new StoreResult(fhirClientProvider, taskHelper); } + + @Bean + public CheckSingleMedicResults checkSingleMedicResults() + { + return new CheckSingleMedicResults(fhirClientProvider, taskHelper); + } + + @Bean + public ModifyQueries modifyQueries() + { + return new ModifyQueries(fhirClientProvider, taskHelper, ehrIdColumnPath); + } + + @Bean + public FilterQueryResultsByConsent filterQueryResultsByConsent() + { + return new FilterQueryResultsByConsent(fhirClientProvider, taskHelper); + } + + @Bean + public GenerateBloomFilters generateBloomFilters() + { + return new GenerateBloomFilters(fhirClientProvider, taskHelper, ehrIdColumnPath, masterPatientIndexClient(), + objectMapper, bouncyCastleProvider()); + } + + @Bean + public MasterPatientIndexClient masterPatientIndexClient() + { + return masterPatientIndexClientFactory.createClient(environment::getProperty); + } + + @Bean + public BouncyCastleProvider bouncyCastleProvider() + { + return new BouncyCastleProvider(); + } + + @Bean + public GenerateCountFromIds generateCountFromIds() + { + return new GenerateCountFromIds(fhirClientProvider, taskHelper); + } + + @Bean + public ExecuteQueries executeQueries() + { + return new ExecuteQueries(fhirClientProvider, openEhrClient(), taskHelper, organizationProvider); + } + + @Bean + public OpenEhrClient openEhrClient() + { + return openEhrClientFactory.createClient(environment::getProperty); + } + + @Bean + public CheckQueries checkQueries() + { + return new CheckQueries(fhirClientProvider, taskHelper, groupHelper); + } } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition new file mode 100644 index 000000000..215b62c5b --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition @@ -0,0 +1 @@ +org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/pom.xml b/dsf-bpe/dsf-bpe-process-ping/pom.xml index d069c6a34..d5b75a28c 100755 --- a/dsf-bpe/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe/dsf-bpe-process-ping/pom.xml @@ -14,7 +14,9 @@ org.highmed.dsf dsf-bpe-process-base + provided + de.hs-heilbronn.mi log4j2-utils diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java new file mode 100644 index 000000000..9474dd1ac --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java @@ -0,0 +1,21 @@ +package org.highmed.dsf.bpe; + +import java.util.stream.Stream; + +import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.spring.config.PingConfig; + +public class PingProcessPluginDefinition implements ProcessPluginDefinition +{ + @Override + public Stream getBpmnFiles() + { + return Stream.of("ping.bpmn", "pong.bpmn"); + } + + @Override + public Stream> getSpringConfigClasses() + { + return Stream.of(PingConfig.class); + } +} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/plugin/PingPlugin.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/plugin/PingPlugin.java deleted file mode 100755 index a4c02357a..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/plugin/PingPlugin.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.highmed.dsf.bpe.plugin; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; - -public class PingPlugin extends AbstractProcessEnginePlugin -{ - private static final String PING_FILE = "ping.bpmn"; - private static final String PONG_FILE = "pong.bpmn"; - - @Override - public void postProcessEngineBuild(ProcessEngine processEngine) - { - BpmnModelInstance pingProcess = readAndValidateModel("/" + PING_FILE); - deploy(processEngine, PING_FILE, pingProcess); - - BpmnModelInstance pongProcess = readAndValidateModel("/" + PONG_FILE); - deploy(processEngine, PONG_FILE, pongProcess); - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java index 932fbdfe6..b1dd4a666 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java @@ -1,9 +1,7 @@ package org.highmed.dsf.bpe.spring.config; -import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; import org.highmed.dsf.bpe.message.SendPing; import org.highmed.dsf.bpe.message.SendPong; -import org.highmed.dsf.bpe.plugin.PingPlugin; import org.highmed.dsf.bpe.service.LogPing; import org.highmed.dsf.bpe.service.LogPong; import org.highmed.dsf.bpe.service.SelectPingTargets; @@ -32,12 +30,6 @@ public class PingConfig @Autowired private FhirContext fhirContext; - @Bean - public ProcessEnginePlugin pingPlugin() - { - return new PingPlugin(); - } - @Bean public SendPing sendPing() { diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition new file mode 100644 index 000000000..a74d5aa92 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition @@ -0,0 +1 @@ +org.highmed.dsf.bpe.PingProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index 4f5c6c83c..8bc574911 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -35,7 +35,7 @@ public static void main(String[] args) FhirContext context = FhirContext.forR4(); ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey("https://ttp/fhir/", trustStore, keyStore, + FhirWebserviceClient client = new FhirWebserviceClientJersey("https://localhost:8001/fhir/", trustStore, keyStore, keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); Task task = new Task(); @@ -45,9 +45,9 @@ public static void main(String[] args) task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_Organization"); task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_Organization"); task.addInput().setValue(new StringType("startPingProcessMessage")).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml index 2411a77a3..2a668c40c 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml @@ -15,6 +15,7 @@ org.highmed.dsf dsf-bpe-process-base + provided \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java new file mode 100644 index 000000000..ad3675c98 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java @@ -0,0 +1,21 @@ +package org.highmed.dsf.bpe; + +import java.util.stream.Stream; + +import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.spring.config.ChildConfig; + +public class ChildProcessPluginDefinition implements ProcessPluginDefinition +{ + @Override + public Stream getBpmnFiles() + { + return Stream.of("child.bpmn"); + } + + @Override + public Stream> getSpringConfigClasses() + { + return Stream.of(ChildConfig.class); + } +} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/plugin/ChildPlugin.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/plugin/ChildPlugin.java deleted file mode 100644 index ca389f309..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/plugin/ChildPlugin.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.highmed.dsf.bpe.plugin; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; - -public class ChildPlugin extends AbstractProcessEnginePlugin -{ - private static final String CHILD_FILE = "child.bpmn"; - - @Override - public void postProcessEngineBuild(ProcessEngine processEngine) - { - BpmnModelInstance childProcess = readAndValidateModel("/" + CHILD_FILE); - deploy(processEngine, CHILD_FILE, childProcess); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/spring/config/ChildConfig.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/spring/config/ChildConfig.java index 1186ac694..5c1ec6d71 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/spring/config/ChildConfig.java +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/spring/config/ChildConfig.java @@ -1,6 +1,5 @@ package org.highmed.dsf.bpe.spring.config; -import org.highmed.dsf.bpe.plugin.ChildPlugin; import org.highmed.dsf.bpe.service.ExecutePlugin; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -17,12 +16,6 @@ public class ChildConfig @Autowired private TaskHelper taskHelper; - @Bean - public ChildPlugin childPlugin() - { - return new ChildPlugin(); - } - @Bean public ExecutePlugin executePlugin() { diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition new file mode 100644 index 000000000..a74d5aa92 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition @@ -0,0 +1 @@ +org.highmed.dsf.bpe.PingProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml index c3e468fcd..5bd65ad42 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml @@ -15,6 +15,7 @@ org.highmed.dsf dsf-bpe-process-base + provided \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java new file mode 100644 index 000000000..8c9879e11 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java @@ -0,0 +1,21 @@ +package org.highmed.dsf.bpe; + +import java.util.stream.Stream; + +import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.spring.config.ParentConfig; + +public class ParentProcessPluginDefinition implements ProcessPluginDefinition +{ + @Override + public Stream getBpmnFiles() + { + return Stream.of("parent.bpmn"); + } + + @Override + public Stream> getSpringConfigClasses() + { + return Stream.of(ParentConfig.class); + } +} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/plugin/ParentPlugin.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/plugin/ParentPlugin.java deleted file mode 100644 index 3be415a69..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/plugin/ParentPlugin.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.highmed.dsf.bpe.plugin; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; - -public class ParentPlugin extends AbstractProcessEnginePlugin -{ - private static final String PARENT_FILE = "parent.bpmn"; - - @Override - public void postProcessEngineBuild(ProcessEngine processEngine) - { - BpmnModelInstance parentProcess = readAndValidateModel("/" + PARENT_FILE); - deploy(processEngine, PARENT_FILE, parentProcess); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/spring/config/ParentConfig.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/spring/config/ParentConfig.java index 650635bc6..f0b9bf9b5 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/spring/config/ParentConfig.java +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/spring/config/ParentConfig.java @@ -1,6 +1,5 @@ package org.highmed.dsf.bpe.spring.config; -import org.highmed.dsf.bpe.plugin.ParentPlugin; import org.highmed.dsf.bpe.service.AfterPlugin; import org.highmed.dsf.bpe.service.BeforePlugin; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; @@ -18,12 +17,6 @@ public class ParentConfig @Autowired private TaskHelper taskHelper; - @Bean - public ParentPlugin parentPlugin() - { - return new ParentPlugin(); - } - @Bean public BeforePlugin beforePlugin() { diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition new file mode 100644 index 000000000..58b6f2b66 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition @@ -0,0 +1 @@ +org.highmed.dsf.bpe.ParentProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml index 04306b488..f5ba8bc77 100755 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml @@ -14,7 +14,9 @@ org.highmed.dsf dsf-bpe-process-base + provided + de.hs-heilbronn.mi log4j2-utils diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java new file mode 100644 index 000000000..fdd9989e7 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java @@ -0,0 +1,21 @@ +package org.highmed.dsf.bpe; + +import java.util.stream.Stream; + +import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.spring.config.UpdateAllowListConfig; + +public class UpdateAllowListPluginDefinition implements ProcessPluginDefinition +{ + @Override + public Stream getBpmnFiles() + { + return Stream.of("updateAllowList.bpmn", "downloadAllowList.bpmn"); + } + + @Override + public Stream> getSpringConfigClasses() + { + return Stream.of(UpdateAllowListConfig.class); + } +} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowListPlugin.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowListPlugin.java deleted file mode 100755 index ecab0a3fc..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/plugin/UpdateAllowListPlugin.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.highmed.dsf.bpe.plugin; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; - -public class UpdateAllowListPlugin extends AbstractProcessEnginePlugin -{ - private static final String UPDATE_ALLOW_LIST_FILE = "updateAllowList.bpmn"; - private static final String DOWNLOAD_ALLOW_LIST_FILE = "downloadAllowList.bpmn"; - - @Override - public void postProcessEngineBuild(ProcessEngine processEngine) - { - BpmnModelInstance updateAllowListProcess = readAndValidateModel("/" + UPDATE_ALLOW_LIST_FILE); - deploy(processEngine, UPDATE_ALLOW_LIST_FILE, updateAllowListProcess); - - BpmnModelInstance downloadAllowListProcess = readAndValidateModel("/" + DOWNLOAD_ALLOW_LIST_FILE); - deploy(processEngine, DOWNLOAD_ALLOW_LIST_FILE, downloadAllowListProcess); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java index f0f4505f3..55702ba92 100755 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java @@ -1,7 +1,5 @@ package org.highmed.dsf.bpe.spring.config; -import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; -import org.highmed.dsf.bpe.plugin.UpdateAllowListPlugin; import org.highmed.dsf.bpe.service.DownloadAllowList; import org.highmed.dsf.bpe.service.UpdateAllowList; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; @@ -28,12 +26,6 @@ public class UpdateAllowListConfig @Autowired private FhirContext fhirContext; - @Bean - public ProcessEnginePlugin updateAllowListPlugin() - { - return new UpdateAllowListPlugin(); - } - @Bean public UpdateAllowList updateAllowList() { diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition new file mode 100644 index 000000000..446f88a30 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition @@ -0,0 +1 @@ +org.highmed.dsf.bpe.UpdateAllowListPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml index 6d476061c..8cbc56e42 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml @@ -14,7 +14,9 @@ org.highmed.dsf dsf-bpe-process-base + provided + de.hs-heilbronn.mi log4j2-utils diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java new file mode 100644 index 000000000..05ef20fcf --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java @@ -0,0 +1,21 @@ +package org.highmed.dsf.bpe; + +import java.util.stream.Stream; + +import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.spring.config.UpdateResourcesConfig; + +public class UpdateResourcesPluginDefinition implements ProcessPluginDefinition +{ + @Override + public Stream getBpmnFiles() + { + return Stream.of("executeUpdateResources.bpmn", "requestUpdateResources.bpmn"); + } + + @Override + public Stream> getSpringConfigClasses() + { + return Stream.of(UpdateResourcesConfig.class); + } +} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/plugin/UpdateResourcesPlugin.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/plugin/UpdateResourcesPlugin.java deleted file mode 100755 index 31f144095..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/plugin/UpdateResourcesPlugin.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.highmed.dsf.bpe.plugin; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; - -public class UpdateResourcesPlugin extends AbstractProcessEnginePlugin -{ - private static final String EXECUTE_UPDATE_RESOURCES_FILE = "executeUpdateResources.bpmn"; - private static final String REQUEST_UPDATE_RESOURCES_FILE = "requestUpdateResources.bpmn"; - - @Override - public void postProcessEngineBuild(ProcessEngine processEngine) - { - BpmnModelInstance executeUpdateResourcesProcess = readAndValidateModel("/" + EXECUTE_UPDATE_RESOURCES_FILE); - deploy(processEngine, EXECUTE_UPDATE_RESOURCES_FILE, executeUpdateResourcesProcess); - - BpmnModelInstance requestUpdateResourcesProcess = readAndValidateModel("/" + REQUEST_UPDATE_RESOURCES_FILE); - deploy(processEngine, REQUEST_UPDATE_RESOURCES_FILE, requestUpdateResourcesProcess); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java index 5b54df166..8625f6f6f 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java @@ -1,8 +1,6 @@ package org.highmed.dsf.bpe.spring.config; -import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; import org.highmed.dsf.bpe.message.SendRequest; -import org.highmed.dsf.bpe.plugin.UpdateResourcesPlugin; import org.highmed.dsf.bpe.service.CheckRequest; import org.highmed.dsf.bpe.service.SelectResourceAndTargets; import org.highmed.dsf.bpe.service.UpdateResources; @@ -30,12 +28,6 @@ public class UpdateResourcesConfig @Autowired private FhirContext fhirContext; - @Bean - public ProcessEnginePlugin updateResourcesPlugin() - { - return new UpdateResourcesPlugin(); - } - @Bean public SendRequest sendRequest() { diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition new file mode 100644 index 000000000..775c8c6fa --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition @@ -0,0 +1 @@ +org.highmed.dsf.bpe.UpdateResourcesPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties b/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties index f7519e513..9beb888aa 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties +++ b/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties @@ -59,3 +59,4 @@ org.highmed.dsf.bpe.db.camunda_user_password=arpJ2FgJuYvUJhbxeuh7 org.highmed.dsf.bpe.cors.origins= +#org.highmed.dsf.bpe.process_plugin_directroy=process diff --git a/dsf-bpe/dsf-bpe-server-jetty/plugin/.gitignore b/dsf-bpe/dsf-bpe-server-jetty/plugin/.gitignore deleted file mode 100644 index f23b9489f..000000000 --- a/dsf-bpe/dsf-bpe-server-jetty/plugin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.jar \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server-jetty/pom.xml b/dsf-bpe/dsf-bpe-server-jetty/pom.xml index e6a779ae3..621645854 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/pom.xml +++ b/dsf-bpe/dsf-bpe-server-jetty/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 dsf-bpe-server-jetty @@ -35,6 +35,15 @@ javax.mail mail + + + org.highmed.dsf + dsf-openehr-client-stub + + + org.highmed.dsf + dsf-mpi-client-stub + @@ -54,7 +63,7 @@ - + org.apache.maven.plugins @@ -74,7 +83,7 @@ maven-dependency-plugin - copy-dependencies + copy-dependencies-to-docker package copy-dependencies @@ -85,7 +94,7 @@ - copy + copy-server-jar-to-docker package copy @@ -102,6 +111,43 @@ docker + + copy-process-plugins-for-testing + package + + copy + + + + + ${project.groupId} + dsf-bpe-process-ping + ${project.version} + + + ${project.groupId} + dsf-bpe-process-update-allow-list + ${project.version} + + + ${project.groupId} + dsf-bpe-process-update-resources + ${project.version} + + + ${project.groupId} + dsf-bpe-process-feasibility + ${project.version} + + + ${project.groupId} + dsf-bpe-process-local-services + ${project.version} + + + process + + @@ -117,6 +163,13 @@ false + + process + + *.jar + + false + diff --git a/dsf-bpe/dsf-bpe-server-jetty/process/README.md b/dsf-bpe/dsf-bpe-server-jetty/process/README.md new file mode 100644 index 000000000..6c7aa1e6d --- /dev/null +++ b/dsf-bpe/dsf-bpe-server-jetty/process/README.md @@ -0,0 +1 @@ +Empty process directory for jar-files with process definition diff --git a/dsf-bpe/dsf-bpe-server/pom.xml b/dsf-bpe/dsf-bpe-server/pom.xml index c6a7fe19c..c8119f07c 100755 --- a/dsf-bpe/dsf-bpe-server/pom.xml +++ b/dsf-bpe/dsf-bpe-server/pom.xml @@ -15,28 +15,6 @@ org.highmed.dsf dsf-bpe-process-base - - org.highmed.dsf - dsf-bpe-process-feasibility - - - org.highmed.dsf - dsf-bpe-process-local-services - - - - org.highmed.dsf - dsf-bpe-process-ping - - - org.highmed.dsf - dsf-bpe-process-update-resources - - - org.highmed.dsf - dsf-bpe-process-update-allow-list - org.highmed.dsf dsf-fhir-websocket-client @@ -49,10 +27,6 @@ org.highmed.dsf dsf-openehr-client - - org.highmed.dsf - dsf-openehr-client-stub - org.highmed.dsf dsf-openehr-model @@ -61,10 +35,6 @@ org.highmed.dsf dsf-mpi-client - - org.highmed.dsf - dsf-mpi-client-stub - org.highmed.dsf dsf-tools-build-info-reader diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionBpmnParse.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionBpmnParse.java new file mode 100644 index 000000000..a3dc064ce --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionBpmnParse.java @@ -0,0 +1,48 @@ +package org.highmed.dsf.bpe.camunda; + +import java.util.List; + +import org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior; +import org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse; +import org.camunda.bpm.engine.impl.bpmn.parser.BpmnParser; +import org.camunda.bpm.engine.impl.bpmn.parser.FieldDeclaration; +import org.camunda.bpm.engine.impl.pvm.process.ActivityImpl; +import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl; +import org.camunda.bpm.engine.impl.util.xml.Element; +import org.highmed.dsf.bpe.delegate.DelegateProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MultiVersionBpmnParse extends BpmnParse +{ + private static final Logger logger = LoggerFactory.getLogger(MultiVersionBpmnParse.class); + + private final DelegateProvider delegateProvider; + + public MultiVersionBpmnParse(BpmnParser parser, DelegateProvider delegateProvider) + { + super(parser); + + this.delegateProvider = delegateProvider; + } + + @Override + public ActivityImpl parseServiceTaskLike(String elementName, Element serviceTaskElement, ScopeImpl scope) + { + ActivityImpl activity = super.parseServiceTaskLike(elementName, serviceTaskElement, scope); + + if (activity.getActivityBehavior() instanceof ClassDelegateActivityBehavior) + { + String className = serviceTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_CLASS); + List fieldDeclarations = parseFieldDeclarations(serviceTaskElement); + + logger.debug("Modifying {} for {}", activity.getActivityBehavior().getClass().getSimpleName(), className); + activity.setActivityBehavior( + new MultiVersionClassDelegateActivityBehavior(className, fieldDeclarations, delegateProvider)); + } + else + logger.debug("Not modifying {}", activity.getActivityBehavior().getClass().getCanonicalName()); + + return activity; + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionBpmnParseFactory.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionBpmnParseFactory.java new file mode 100644 index 000000000..593ff7c71 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionBpmnParseFactory.java @@ -0,0 +1,22 @@ +package org.highmed.dsf.bpe.camunda; + +import org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse; +import org.camunda.bpm.engine.impl.bpmn.parser.BpmnParser; +import org.camunda.bpm.engine.impl.cfg.BpmnParseFactory; +import org.highmed.dsf.bpe.delegate.DelegateProvider; + +public class MultiVersionBpmnParseFactory implements BpmnParseFactory +{ + private final DelegateProvider delegateProvider; + + public MultiVersionBpmnParseFactory(DelegateProvider delegateProvider) + { + this.delegateProvider = delegateProvider; + } + + @Override + public BpmnParse createBpmnParse(BpmnParser bpmnParser) + { + return new MultiVersionBpmnParse(bpmnParser, delegateProvider); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionClassDelegateActivityBehavior.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionClassDelegateActivityBehavior.java new file mode 100644 index 000000000..8101c529d --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionClassDelegateActivityBehavior.java @@ -0,0 +1,72 @@ +package org.highmed.dsf.bpe.camunda; + +import java.util.List; + +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.camunda.bpm.engine.impl.ProcessEngineLogger; +import org.camunda.bpm.engine.impl.bpmn.behavior.ClassDelegateActivityBehavior; +import org.camunda.bpm.engine.impl.bpmn.behavior.CustomActivityBehavior; +import org.camunda.bpm.engine.impl.bpmn.behavior.ServiceTaskJavaDelegateActivityBehavior; +import org.camunda.bpm.engine.impl.bpmn.parser.FieldDeclaration; +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; +import org.camunda.bpm.engine.impl.pvm.delegate.ActivityBehavior; +import org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution; +import org.camunda.bpm.engine.impl.util.ClassDelegateUtil; +import org.highmed.dsf.bpe.delegate.DelegateProvider; + +public class MultiVersionClassDelegateActivityBehavior extends ClassDelegateActivityBehavior +{ + private final DelegateProvider delegateProvider; + + public MultiVersionClassDelegateActivityBehavior(String className, List fieldDeclarations, + DelegateProvider delegateProvider) + { + super(className, fieldDeclarations); + + this.delegateProvider = delegateProvider; + } + + @Override + protected ActivityBehavior getActivityBehaviorInstance(ActivityExecution execution) + { + ExecutionEntity e = (ExecutionEntity) execution; + String processDefinitionKey = e.getProcessDefinition().getKey(); + String processDefinitionVersionTag = e.getProcessDefinition().getVersionTag(); + + Object delegateInstance = instantiateDelegate(processDefinitionKey, processDefinitionVersionTag, className, + fieldDeclarations); + + if (delegateInstance instanceof ActivityBehavior) + { + return new CustomActivityBehavior((ActivityBehavior) delegateInstance); + } + else if (delegateInstance instanceof JavaDelegate) + { + return new ServiceTaskJavaDelegateActivityBehavior((JavaDelegate) delegateInstance); + } + else + { + throw LOG.missingDelegateParentClassException(delegateInstance.getClass().getName(), + JavaDelegate.class.getName(), ActivityBehavior.class.getName()); + } + }; + + private Object instantiateDelegate(String processDefinitionKey, String processDefinitionVersionTag, + String className, List fieldDeclarations) + { + try + { + Class clazz = delegateProvider.getClassLoader(processDefinitionKey, processDefinitionVersionTag) + .loadClass(className); + Object object = delegateProvider.getApplicationContext(processDefinitionKey, processDefinitionVersionTag) + .getBean(clazz); + + ClassDelegateUtil.applyFieldDeclaration(fieldDeclarations, object); + return object; + } + catch (Exception e) + { + throw ProcessEngineLogger.UTIL_LOGGER.exceptionWhileInstantiatingClass(className, e); + } + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionSpringProcessEngineConfiguration.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionSpringProcessEngineConfiguration.java new file mode 100644 index 000000000..c6523c912 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionSpringProcessEngineConfiguration.java @@ -0,0 +1,12 @@ +package org.highmed.dsf.bpe.camunda; + +import org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration; +import org.highmed.dsf.bpe.delegate.DelegateProvider; + +public class MultiVersionSpringProcessEngineConfiguration extends SpringProcessEngineConfiguration +{ + public MultiVersionSpringProcessEngineConfiguration(DelegateProvider delegateProvider) + { + bpmnParseFactory = new MultiVersionBpmnParseFactory(delegateProvider); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java new file mode 100644 index 000000000..164d94c69 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java @@ -0,0 +1,35 @@ +package org.highmed.dsf.bpe.delegate; + +import java.util.stream.Stream; + +import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; +import org.springframework.context.ApplicationContext; + +public interface DelegateProvider +{ + /** + * @param processDefinitionKey + * not null + * @param processDefinitionVersion + * not null + * @return returns the default class loader if no special class loader is registered for the given + * processDefinitionKey and processDefinitionVersion + */ + ClassLoader getClassLoader(String processDefinitionKey, String processDefinitionVersion); + + /** + * @param processDefinitionKey + * not null + * @param processDefinitionVersion + * not null + * @return returns the default application context if no special application context is registered for the given + * processDefinitionKey and processDefinitionVersion + */ + ApplicationContext getApplicationContext(String processDefinitionKey, String processDefinitionVersion); + + /** + * @return additional {@link TypedValueSerializer}s from the plugin to deploy into the process engine + */ + @SuppressWarnings("rawtypes") + Stream getAdditionalTypedValueSerializers(); +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java new file mode 100644 index 000000000..ccdb654de --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java @@ -0,0 +1,73 @@ +package org.highmed.dsf.bpe.delegate; + +import java.util.Map; +import java.util.Objects; +import java.util.stream.Stream; + +import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationContext; + +public class DelegateProviderImpl implements DelegateProvider, InitializingBean +{ + private final Map classLoaderByProcessDefinitionKeyAndVersion; + private final ClassLoader defaultClassLoader; + private final Map applicationContextByProcessDefinitionKeyAndVersion; + private final ApplicationContext defaultApplicationContext; + + public DelegateProviderImpl(Map classLoaderByProcessDefinitionKeyAndVersion, + ClassLoader defaultClassLoader, + Map applicationContextByProcessDefinitionKeyAndVersion, + ApplicationContext defaultApplicationContext) + { + this.classLoaderByProcessDefinitionKeyAndVersion = classLoaderByProcessDefinitionKeyAndVersion; + this.defaultClassLoader = defaultClassLoader; + this.applicationContextByProcessDefinitionKeyAndVersion = applicationContextByProcessDefinitionKeyAndVersion; + this.defaultApplicationContext = defaultApplicationContext; + } + + @Override + public void afterPropertiesSet() throws Exception + { + Objects.requireNonNull(classLoaderByProcessDefinitionKeyAndVersion, + "classLoaderByProcessDefinitionKeyAndVersion"); + Objects.requireNonNull(defaultClassLoader, "defaultClassLoader"); + Objects.requireNonNull(applicationContextByProcessDefinitionKeyAndVersion, + "applicationContextByProcessDefinitionKeyAndVersion"); + Objects.requireNonNull(defaultApplicationContext, "defaultApplicationContext"); + } + + @Override + public ClassLoader getClassLoader(String processDefinitionKey, String processDefinitionVersion) + { + Objects.requireNonNull(processDefinitionKey, "processDefinitionKey"); + Objects.requireNonNull(processDefinitionVersion, "processDefinitionVersion"); + + return classLoaderByProcessDefinitionKeyAndVersion.getOrDefault( + toProcessDefinitionKeyAndVersion(processDefinitionKey, processDefinitionVersion), defaultClassLoader); + } + + @Override + public ApplicationContext getApplicationContext(String processDefinitionKey, String processDefinitionVersion) + { + Objects.requireNonNull(processDefinitionKey, "processDefinitionKey"); + Objects.requireNonNull(processDefinitionVersion, "processDefinitionVersion"); + + return applicationContextByProcessDefinitionKeyAndVersion.getOrDefault( + toProcessDefinitionKeyAndVersion(processDefinitionKey, processDefinitionVersion), + defaultApplicationContext); + } + + private String toProcessDefinitionKeyAndVersion(String processDefinitionKey, String processDefinitionVersion) + { + return processDefinitionKey + "/" + processDefinitionVersion; + } + + @SuppressWarnings("rawtypes") + @Override + public Stream getAdditionalTypedValueSerializers() + { + return applicationContextByProcessDefinitionKeyAndVersion.values().stream() + .map(ctx -> ctx.getBeansOfType(TypedValueSerializer.class)).flatMap(m -> m.values().stream()); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPlugin.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPlugin.java new file mode 100644 index 000000000..24d679e96 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPlugin.java @@ -0,0 +1,112 @@ +package org.highmed.dsf.bpe.plugin; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.camunda.bpm.engine.ProcessEngine; +import org.camunda.bpm.engine.RepositoryService; +import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; +import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; +import org.camunda.bpm.engine.repository.Deployment; +import org.camunda.bpm.model.bpmn.Bpmn; +import org.camunda.bpm.model.bpmn.BpmnModelInstance; +import org.camunda.bpm.model.bpmn.instance.Process; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProcessPlugin implements ProcessEnginePlugin +{ + private static final Logger logger = LoggerFactory.getLogger(ProcessPlugin.class); + + private static final class BpmnFileAndModel + { + final String file; + final BpmnModelInstance model; + + BpmnFileAndModel(String file, BpmnModelInstance model) + { + this.file = file; + this.model = model; + } + } + + private final List jars = new ArrayList<>(); + private final List models = new ArrayList<>(); + + public static ProcessPlugin loadAndValidateModels(List jars, Stream bpmnFiles, + ClassLoader classLoader) + { + List models = bpmnFiles.map(file -> loadAndValidateModel(file, classLoader)) + .collect(Collectors.toList()); + return new ProcessPlugin(jars, models); + } + + private static BpmnFileAndModel loadAndValidateModel(String bpmnFile, ClassLoader classLoader) + { + BpmnModelInstance model = Bpmn.readModelFromStream(classLoader.getResourceAsStream(bpmnFile)); + Bpmn.validateModel(model); + return new BpmnFileAndModel(bpmnFile, model); + } + + private ProcessPlugin(List jars, List models) + { + if (jars != null) + this.jars.addAll(jars); + if (models != null) + this.models.addAll(models); + } + + @Override + public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) + { + } + + @Override + public void postInit(ProcessEngineConfigurationImpl processEngineConfiguration) + { + } + + @Override + public void postProcessEngineBuild(ProcessEngine processEngine) + { + models.forEach(fileAndModel -> deploy(processEngine, fileAndModel)); + } + + public List getProcessKeysAndVersions() + { + return models.stream().flatMap(fileAndModel -> + { + Collection processes = fileAndModel.model.getModelElementsByType(Process.class); + return processes.stream().map(p -> toProcessDefinitionKeyAndVersion(p.getId(), p.getCamundaVersionTag())); + }).collect(Collectors.toList()); + } + + private String toProcessDefinitionKeyAndVersion(String processDefinitionKey, String processDefinitionVersion) + { + return processDefinitionKey + "/" + processDefinitionVersion; + } + + private void deploy(ProcessEngine processEngine, BpmnFileAndModel fileAndModel) + { + RepositoryService repositoryService = processEngine.getRepositoryService(); + + Deployment deployment = repositoryService.createDeployment().name(fileAndModel.file).source(fileAndModel.file) + .addModelInstance(fileAndModel.file, fileAndModel.model).enableDuplicateFiltering(true).deploy(); + + if (logger.isInfoEnabled()) + { + Collection processes = fileAndModel.model.getModelElementsByType(Process.class); + String processDefinitionKeysAndVersions = processes.stream() + .map(p -> p.getId() + "/" + p.getCamundaVersionTag()).collect(Collectors.joining(", ")); + + logger.info("Process{} {} from {}://{} deployed with id {}", processes.size() > 1 ? "es" : "", + processDefinitionKeysAndVersions, + jars.stream().map(Path::toString).collect(Collectors.joining("; ")), fileAndModel.file, + deployment.getId()); + } + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java new file mode 100644 index 000000000..513355d85 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java @@ -0,0 +1,67 @@ +package org.highmed.dsf.bpe.plugin; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.highmed.dsf.ProcessPluginDefinition; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +public class ProcessPluginDefinitionAndClassLoader +{ + private final List jars = new ArrayList<>(); + private final ProcessPluginDefinition definition; + private final ClassLoader classLoader; + + private ProcessPlugin processPlugin; + + public ProcessPluginDefinitionAndClassLoader(List jars, ProcessPluginDefinition definition, + ClassLoader classLoader) + { + if (jars != null) + this.jars.addAll(jars); + + this.definition = definition; + this.classLoader = classLoader; + } + + public List getJars() + { + return Collections.unmodifiableList(jars); + } + + public ProcessPluginDefinition getDefinition() + { + return definition; + } + + public ClassLoader getClassLoader() + { + return classLoader; + } + + public ApplicationContext createPluginApplicationContext(ApplicationContext mainContext) + { + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); + context.setParent(mainContext); + context.setClassLoader(getClassLoader()); + context.register(getDefinition().getSpringConfigClasses().toArray(Class[]::new)); + context.refresh(); + return context; + } + + public ProcessPlugin getProcessPlugin() + { + if (processPlugin == null) + processPlugin = ProcessPlugin.loadAndValidateModels(jars, getDefinition().getBpmnFiles(), getClassLoader()); + + return processPlugin; + } + + public List getProcessKeysAndVersions() + { + return getProcessPlugin().getProcessKeysAndVersions(); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java new file mode 100644 index 000000000..3fe292b2d --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java @@ -0,0 +1,42 @@ +package org.highmed.dsf.bpe.plugin; + +import java.util.List; +import java.util.Map; + +import org.springframework.context.ApplicationContext; + +public interface ProcessPluginProvider +{ + /** + * Expected folder/file structure: + * + *
+	 * {@link #pluginDirectory}/foo_plugin.jar
+	 * 
+	 * {@link #pluginDirectory}/bar_plugin.jar
+	 * 
+	 * {@link #pluginDirectory}/baz_plugin/plugin.jar
+	 * {@link #pluginDirectory}/baz_plugin/helper.jar
+	 * 
+ * + * The folder structure above will result in three separate class loaders being used. The jar files foo_plugin.jar + * and bar_plugin.jar will be loaded in a separate class loader each. All jar files in the baz_plugin directory will + * be loaded within the same class loader. + * + * @return Plug in definitions found in jar files within {@link #pluginDirectory} or jar files within folders within + * {@link #pluginDirectory} and associated class loaders + */ + List getDefinitions(); + + /** + * @return class loaders for process plugin jars by process definition key / version + * @see #getDefinitions() + */ + Map getClassLoadersByProcessDefinitionKeyAndVersion(); + + /** + * @return application contexts for process plugin jars by process definition key / version + * @see #getDefinitions() + */ + Map getApplicationContextsByProcessDefinitionKeyAndVersion(); +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java new file mode 100644 index 000000000..c6a57e468 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java @@ -0,0 +1,296 @@ +package org.highmed.dsf.bpe.plugin; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.ServiceLoader; +import java.util.ServiceLoader.Provider; +import java.util.function.BinaryOperator; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.highmed.dsf.ProcessPluginDefinition; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationContext; + +public class ProcessPluginProviderImpl implements ProcessPluginProvider, InitializingBean +{ + private static final class Pair + { + final K k; + final V v; + + Pair(K k, V v) + { + this.k = k; + this.v = v; + } + } + + private static final Logger logger = LoggerFactory.getLogger(ProcessPluginProviderImpl.class); + + private final Path pluginDirectory; + private final ApplicationContext mainApplicationContext; + + private List definitions; + + public ProcessPluginProviderImpl(Path pluginDirectory, ApplicationContext mainApplicationContext) + { + this.pluginDirectory = pluginDirectory; + this.mainApplicationContext = mainApplicationContext; + } + + @Override + public void afterPropertiesSet() throws Exception + { + Objects.requireNonNull(pluginDirectory, "pluginDirectory"); + Objects.requireNonNull(mainApplicationContext, "mainApplicationContext"); + } + + @Override + public List getDefinitions() + { + if (definitions == null) + { + synchronized (this) + { + if (definitions == null) + definitions = handleDependencies(loadDefinitions()); + } + } + + return definitions; + } + + private List loadDefinitions() + { + try (DirectoryStream directoryStream = Files.newDirectoryStream(pluginDirectory)) + { + List definitions = new ArrayList<>(); + + directoryStream.forEach(p -> + { + if (Files.isReadable(p) && p.getFileName().toString().endsWith(".jar")) + { + ProcessPluginDefinitionAndClassLoader def = toJarDefinition(p); + if (def != null) + definitions.add(def); + } + else if (Files.isDirectory(p)) + { + ProcessPluginDefinitionAndClassLoader def = toFolderDefinition(p); + if (def != null) + definitions.add(def); + } + else + logger.warn("Ignoring folder/file {}", p.toAbsolutePath().toString()); + }); + + return definitions; + } + catch (IOException e) + { + logger.warn("Error loading process plugin definitions", e); + throw new RuntimeException(e); + } + } + + private ProcessPluginDefinitionAndClassLoader toJarDefinition(Path jarFile) + { + URLClassLoader classLoader = new URLClassLoader(jarFile.getFileName().toString(), new URL[] { toUrl(jarFile) }, + ClassLoader.getSystemClassLoader()); + + return toDefinition(classLoader, null, Collections.singletonList(jarFile)); + } + + private ProcessPluginDefinitionAndClassLoader toFolderDefinition(Path folder) + { + List jars = getJars(folder); + URLClassLoader classLoader = new URLClassLoader(folder.getFileName().toString(), + jars.stream().map(this::toUrl).toArray(URL[]::new), ClassLoader.getSystemClassLoader()); + + return toDefinition(classLoader, folder, jars); + } + + private ProcessPluginDefinitionAndClassLoader toDefinition(ClassLoader classLoader, Path folder, List jars) + { + List> definitions = ServiceLoader + .load(ProcessPluginDefinition.class, classLoader).stream().collect(Collectors.toList()); + + if (definitions.size() < 1) + { + logger.warn("Ignoring {} no {} found", jars.size() == 1 ? jars.toString() : folder.toString(), + ProcessPluginDefinition.class.getName()); + return null; + } + else if (definitions.size() > 1) + { + logger.warn("Ignoring {} more than one {} found", folder.toString(), + ProcessPluginDefinition.class.getName()); + return null; + } + + return new ProcessPluginDefinitionAndClassLoader(jars, definitions.get(0).get(), classLoader); + } + + private List getJars(Path folder) + { + try (DirectoryStream directoryStream = Files.newDirectoryStream(folder)) + { + List jarFiles = new ArrayList<>(); + + directoryStream.forEach(p -> + { + if (Files.isReadable(p) && p.getFileName().toString().endsWith(".jar")) + jarFiles.add(p); + else + logger.warn("Ignoring folder/file {}", p.toAbsolutePath().toString()); + }); + + return jarFiles; + } + catch (IOException e) + { + throw new RuntimeException(e); + } + } + + private URL toUrl(Path p) + { + try + { + return p.toUri().toURL(); + } + catch (MalformedURLException e) + { + throw new RuntimeException(e); + } + } + + private List handleDependencies( + List definitions) + { + Map definitionsByJar = new HashMap<>(); + definitions.stream() + .forEach(def -> def.getJars().forEach(p -> definitionsByJar.put(p.getFileName().toString(), def))); + + return definitions.stream().map(def -> withDependencies(def, definitionsByJar)).collect(Collectors.toList()); + } + + private ProcessPluginDefinitionAndClassLoader withDependencies(ProcessPluginDefinitionAndClassLoader definition, + Map definitionsByJar) + { + if (definition.getDefinition().getDependencyJarNames().isEmpty()) + return definition; + else + { + if (definition.getClassLoader() instanceof URLClassLoader) + { + try + { + ((URLClassLoader) definition.getClassLoader()).close(); + } + catch (IOException e) + { + logger.warn("Error while closing not needed, initial url class loader {}", + definition.getClassLoader().getName()); + } + } + + String definitionClassName = definition.getDefinition().getClass().getName(); + List dependencyJars = definition.getDefinition().getDependencyJarNames().stream() + .flatMap(dependency -> findDefinition(definitionsByJar, dependency)).collect(Collectors.toList()); + + if (definition.getJars().size() == 1) + return toJarDefinitionWithDependencies(definitionClassName, definition.getJars().get(0), + dependencyJars); + else + return toFolderDefinitionWithDependencies(definitionClassName, definition.getJars().get(0).getParent(), + dependencyJars); + } + } + + private Stream findDefinition(Map definitionsByJar, + String dependency) + { + ProcessPluginDefinitionAndClassLoader byJar = definitionsByJar.get(dependency + ".jar"); + if (byJar != null) + return byJar.getJars().stream(); + + ProcessPluginDefinitionAndClassLoader bySnapshotJar = definitionsByJar.get(dependency + "-SNAPSHOT.jar"); + if (bySnapshotJar != null) + return bySnapshotJar.getJars().stream(); + + throw new RuntimeException("Dependency " + dependency + " not found"); + } + + private ProcessPluginDefinitionAndClassLoader toJarDefinitionWithDependencies(String definitionClassName, + Path jarFile, List dependencyJars) + { + URLClassLoader classLoader = new URLClassLoader(jarFile.getFileName().toString(), + Stream.concat(Stream.of(jarFile), dependencyJars.stream()).map(this::toUrl).toArray(URL[]::new), + ClassLoader.getSystemClassLoader()); + + return toDefinitionWithDependency(definitionClassName, classLoader, null, Collections.singletonList(jarFile)); + } + + private ProcessPluginDefinitionAndClassLoader toFolderDefinitionWithDependencies(String definitionClassName, + Path folder, List dependencyJars) + { + List jars = getJars(folder); + URLClassLoader classLoader = new URLClassLoader(folder.getFileName().toString(), + Stream.concat(jars.stream(), dependencyJars.stream()).map(this::toUrl).toArray(URL[]::new), + ClassLoader.getSystemClassLoader()); + + return toDefinitionWithDependency(definitionClassName, classLoader, folder, jars); + } + + private ProcessPluginDefinitionAndClassLoader toDefinitionWithDependency(String definitionClassName, + ClassLoader classLoader, Path folder, List jars) + { + List> definitions = ServiceLoader + .load(ProcessPluginDefinition.class, classLoader).stream().collect(Collectors.toList()); + + ProcessPluginDefinition definition = definitions.stream().map(provider -> provider.get()) + .filter(def -> def.getClass().getName().equals(definitionClassName)).findFirst().orElseThrow( + () -> new RuntimeException("ProcessPluginDefinition " + definitionClassName + " not found")); + + return new ProcessPluginDefinitionAndClassLoader(jars, definition, classLoader); + } + + public Map getClassLoadersByProcessDefinitionKeyAndVersion() + { + return getDefinitions().stream() + .flatMap(def -> def.getProcessPlugin().getProcessKeysAndVersions().stream() + .map(keyAndVersion -> new Pair<>(keyAndVersion, def.getClassLoader()))) + .collect(Collectors.toMap(p -> p.k, p -> p.v, dupplicatedProcessKeyVersion())); + } + + private BinaryOperator dupplicatedProcessKeyVersion() + { + return (v1, v2) -> + { + throw new RuntimeException("duplicate processes, check process keys/versions"); + }; + } + + @Override + public Map getApplicationContextsByProcessDefinitionKeyAndVersion() + { + return getDefinitions().stream().flatMap(def -> def.getProcessPlugin().getProcessKeysAndVersions().stream().map( + keyAndVersion -> new Pair<>(keyAndVersion, def.createPluginApplicationContext(mainApplicationContext)))) + .collect(Collectors.toMap(p -> p.k, p -> p.v, dupplicatedProcessKeyVersion())); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationService.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationService.java index 88355cc7c..720bf8f89 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationService.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationService.java @@ -1,6 +1,5 @@ package org.highmed.dsf.bpe.service; -import java.util.Collection; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -11,12 +10,12 @@ import org.camunda.bpm.model.bpmn.BpmnModelInstance; import org.camunda.bpm.model.bpmn.instance.Process; import org.camunda.bpm.model.bpmn.instance.ServiceTask; -import org.camunda.bpm.model.xml.instance.ModelElementInstance; -import org.camunda.bpm.model.xml.type.ModelElementType; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.bpe.delegate.DelegateProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationContext; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.EventListener; @@ -25,26 +24,26 @@ public class BpmnServiceDelegateValidationService implements InitializingBean private static final Logger logger = LoggerFactory.getLogger(BpmnServiceDelegateValidationService.class); private final ProcessEngine processEngine; - private final List serviceDelegateClassNames; + private final DelegateProvider delegateProvider; - public BpmnServiceDelegateValidationService(ProcessEngine processEngine, List serviceBeans) + public BpmnServiceDelegateValidationService(ProcessEngine processEngine, DelegateProvider delegateProvider) { this.processEngine = processEngine; - - Objects.requireNonNull(serviceBeans, "serviceBeans"); - this.serviceDelegateClassNames = serviceBeans.stream().map(b -> b.getClass().getCanonicalName()) - .collect(Collectors.toList()); + this.delegateProvider = delegateProvider; } @Override public void afterPropertiesSet() throws Exception { Objects.requireNonNull(processEngine, "processEngine"); + Objects.requireNonNull(delegateProvider, "delegateProvider"); } @EventListener({ ContextRefreshedEvent.class }) public void onContextRefreshedEvent(ContextRefreshedEvent event) { + logger.debug("Validating bpmn models, checking service delegate availability"); + RepositoryService repositoryService = processEngine.getRepositoryService(); List deployedProcesses = repositoryService.createProcessDefinitionQuery().active() @@ -57,28 +56,51 @@ public void onContextRefreshedEvent(ContextRefreshedEvent event) private void validateBeanAvailabilityForModel(BpmnModelInstance model) { - ModelElementType processType = model.getModel().getType(Process.class); - String processId = model.getModelElementsByType(processType).stream().findFirst() - .orElseThrow(() -> new RuntimeException("Process id is not set")).getAttributeValue("id"); - - ModelElementType serviceType = model.getModel().getType(ServiceTask.class); - Collection serviceTasks = model.getModelElementsByType(serviceType); + model.getModelElementsByType(Process.class).stream().forEach(this::validateBeanAvailabilityForProcess); + } - serviceTasks.stream().filter(t -> t instanceof ServiceTask).map(t -> (ServiceTask) t) - .forEach(t -> isBeanAvailableForServiceTask(t, processId)); + private void validateBeanAvailabilityForProcess(Process process) + { + process.getChildElementsByType(ServiceTask.class).stream() + .forEach(task -> validateBeanAvailabilityForTask(process.getId(), process.getCamundaVersionTag(), + task.getCamundaClass())); + } - logger.info("Process {} passed all validations", processId); + private void validateBeanAvailabilityForTask(String processDefinitionKey, String processDefinitionVersion, + String className) + { + Class serviceClass = loadClass(processDefinitionKey, processDefinitionVersion, className); + loadBean(processDefinitionKey, processDefinitionVersion, serviceClass); } - private void isBeanAvailableForServiceTask(ServiceTask serviceTask, String processId) + private void loadBean(String processDefinitionKey, String processDefinitionVersion, Class serviceClass) { - String referencedClassName = serviceTask.getCamundaClass(); + try + { + ApplicationContext applicationContext = delegateProvider.getApplicationContext(processDefinitionKey, + processDefinitionVersion); + applicationContext.getBean(serviceClass); + } + catch (BeansException e) + { + logger.warn("Error while getting service delegate bean of type {} defined in process {}/{} not found", + serviceClass.getName(), processDefinitionKey, processDefinitionVersion); + throw new RuntimeException(e); + } + } - if (!serviceDelegateClassNames.contains(referencedClassName)) + private Class loadClass(String processDefinitionKey, String processDefinitionVersion, String className) + { + try + { + ClassLoader classLoader = delegateProvider.getClassLoader(processDefinitionKey, processDefinitionVersion); + return classLoader.loadClass(className); + } + catch (ClassNotFoundException e) { - logger.error("Could not find bean for service task {} in process {}", referencedClassName, processId); - throw new RuntimeException( - "Could not find bean for service task " + referencedClassName + " in process " + processId); + logger.warn("Service delegate class {} defined in process {}/{} not found", className, processDefinitionKey, + processDefinitionVersion); + throw new RuntimeException(e); } } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java index daf509995..7c94fc758 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java @@ -1,23 +1,35 @@ package org.highmed.dsf.bpe.spring.config; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.List; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.commons.dbcp2.BasicDataSource; import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; import org.camunda.bpm.engine.spring.ProcessEngineFactoryBean; import org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration; +import org.highmed.dsf.bpe.camunda.MultiVersionSpringProcessEngineConfiguration; +import org.highmed.dsf.bpe.delegate.DelegateProvider; +import org.highmed.dsf.bpe.delegate.DelegateProviderImpl; import org.highmed.dsf.bpe.listener.CallActivityListener; import org.highmed.dsf.bpe.listener.DefaultBpmnParseListener; import org.highmed.dsf.bpe.listener.EndListener; import org.highmed.dsf.bpe.listener.StartListener; +import org.highmed.dsf.bpe.plugin.ProcessPluginDefinitionAndClassLoader; +import org.highmed.dsf.bpe.plugin.ProcessPluginProvider; +import org.highmed.dsf.bpe.plugin.ProcessPluginProviderImpl; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.postgresql.Driver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.datasource.DataSourceTransactionManager; @@ -38,12 +50,18 @@ public class CamundaConfig @Value("${org.highmed.dsf.bpe.db.camunda_user_password}") private String dbPasswordCamunda; + @Value("${org.highmed.dsf.bpe.process_plugin_directroy:process}") + private String pluginDirectory; + @Autowired private FhirConfig fhirConfig; @Autowired private FhirWebserviceClientProvider clientProvider; + @Autowired + private ApplicationContext applicationContext; + @Bean public PlatformTransactionManager transactionManager() { @@ -96,9 +114,19 @@ public DefaultBpmnParseListener defaultBpmnParseListener() @Bean public SpringProcessEngineConfiguration processEngineConfiguration( - @SuppressWarnings("rawtypes") List serializers, List plugins) + @SuppressWarnings("rawtypes") List baseSerializers) throws IOException { - var c = new SpringProcessEngineConfiguration(); + List definitions = processPluginProvider().getDefinitions(); + + @SuppressWarnings("rawtypes") + List serializers = Stream + .concat(baseSerializers.stream(), delegateProvider().getAdditionalTypedValueSerializers()) + .collect(Collectors.toList()); + + List plugins = definitions.stream() + .map(ProcessPluginDefinitionAndClassLoader::getProcessPlugin).collect(Collectors.toList()); + + var c = new MultiVersionSpringProcessEngineConfiguration(delegateProvider()); c.setProcessEngineName("highmed"); c.setDataSource(transactionAwareDataSource()); c.setTransactionManager(transactionManager()); @@ -111,20 +139,40 @@ public SpringProcessEngineConfiguration processEngineConfiguration( serializers.stream().map(p -> p.getClass().getName()).collect(Collectors.joining(", ", "[", "]"))); c.setCustomPreVariableSerializers(serializers); - logger.info("{} process engine plugin{} configured", plugins.size(), plugins.size() != 1 ? "s" : ""); - logger.debug("Process engine plugin{}: {}", plugins.size() != 1 ? "s" : "", - plugins.stream().map(p -> p.getClass().getName()).collect(Collectors.joining(", ", "[", "]"))); + logger.info("{} process plugin{} configured", plugins.size(), plugins.size() != 1 ? "s" : ""); + logger.debug("Process plugin{}: {}", plugins.size() != 1 ? "s" : "", + definitions.stream().map(def -> def.getDefinition()).map(p -> p.getClass().getName()) + .collect(Collectors.joining(", ", "[", "]"))); c.setProcessEnginePlugins(plugins); return c; } + @Bean + public DelegateProvider delegateProvider() throws IOException + { + return new DelegateProviderImpl(processPluginProvider().getClassLoadersByProcessDefinitionKeyAndVersion(), + ClassLoader.getSystemClassLoader(), + processPluginProvider().getApplicationContextsByProcessDefinitionKeyAndVersion(), applicationContext); + } + @Bean public ProcessEngineFactoryBean processEngineFactory( - @SuppressWarnings("rawtypes") List serializers, List plugins) + @SuppressWarnings("rawtypes") List baseSerializers) throws IOException { var f = new ProcessEngineFactoryBean(); - f.setProcessEngineConfiguration(processEngineConfiguration(serializers, plugins)); + f.setProcessEngineConfiguration(processEngineConfiguration(baseSerializers)); return f; } + + @Bean + public ProcessPluginProvider processPluginProvider() throws IOException + { + Path pluginDirectoryPath = Paths.get(pluginDirectory); + + if (!Files.isDirectory(pluginDirectoryPath)) + throw new IOException("Process plug in directory '" + pluginDirectoryPath.toString() + "' not readable"); + + return new ProcessPluginProviderImpl(pluginDirectoryPath, applicationContext); + } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/MasterPatientIndexConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/MasterPatientIndexConfig.java index bbe402089..7d374f607 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/MasterPatientIndexConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/MasterPatientIndexConfig.java @@ -4,7 +4,6 @@ import org.highmed.mpi.client.MasterPatientIndexClientFactory; import org.highmed.mpi.client.MasterPatientIndexClientServiceLoader; -import org.highmed.mpi.client.stub.MasterPatientIndexClientStubFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -31,9 +30,9 @@ public MasterPatientIndexClientFactory masterPatientIndexClientFactory() MasterPatientIndexClientFactory factory = masterPatientIndexClientServiceLoader() .getMasterPatientIndexClientFactory(masterPatientIndexClientFactoryClass) .orElseThrow(() -> new NoSuchElementException("Master patient index client factory with classname='" - + masterPatientIndexClientFactoryClass + "' not found")); + + masterPatientIndexClientFactoryClass + "' not found")); - if(factory instanceof MasterPatientIndexClientStubFactory) + if ("org.highmed.mpi.client.stub.MasterPatientIndexClientStubFactory".equals(factory.getClass().getName())) logger.warn("Using {} as MPI client factory", factory.getClass().getName()); else logger.info("Using {} as MPI client factory", factory.getClass().getName()); diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/OpenEhrConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/OpenEhrConfig.java index 10e37e4a1..fd74899e0 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/OpenEhrConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/OpenEhrConfig.java @@ -4,7 +4,6 @@ import org.highmed.openehr.client.OpenEhrClientFactory; import org.highmed.openehr.client.OpenEhrClientServiceLoader; -import org.highmed.openehr.client.stub.OpenEhrClientStubFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; @@ -32,10 +31,10 @@ public OpenEhrClientFactory openEhrClientFactory() .orElseThrow(() -> new NoSuchElementException( "openEhr client factory with classname='" + openEhrClientFactoryClass + "' not found")); - if (factory instanceof OpenEhrClientStubFactory) - logger.warn("Using {} as openEhr client factory", factory.getClass().getName()); + if ("org.highmed.openehr.client.stub.OpenEhrClientStubFactory".equals(factory.getClass().getName())) + logger.warn("Using {} as openEHR client factory", factory.getClass().getName()); else - logger.info("Using {} as openEhr client factory", factory.getClass().getName()); + logger.info("Using {} as openEHR client factory", factory.getClass().getName()); return factory; } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/ValidationConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/ValidationConfig.java index 073414993..711ec90ff 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/ValidationConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/ValidationConfig.java @@ -1,9 +1,7 @@ package org.highmed.dsf.bpe.spring.config; -import java.util.List; - import org.camunda.bpm.engine.ProcessEngine; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; +import org.highmed.dsf.bpe.delegate.DelegateProvider; import org.highmed.dsf.bpe.service.BpmnServiceDelegateValidationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; @@ -13,7 +11,7 @@ public class ValidationConfig { @Autowired - private List serviceBeans; + private DelegateProvider delegateProvider; @Autowired private ProcessEngine processEngine; @@ -21,6 +19,6 @@ public class ValidationConfig @Bean protected BpmnServiceDelegateValidationService bpmnServiceDelegateValidationService() { - return new BpmnServiceDelegateValidationService(processEngine, serviceBeans); + return new BpmnServiceDelegateValidationService(processEngine, delegateProvider); } } diff --git a/dsf-mpi/dsf-mpi-client-stub/pom.xml b/dsf-mpi/dsf-mpi-client-stub/pom.xml index b3c996c0f..d89bc04cf 100644 --- a/dsf-mpi/dsf-mpi-client-stub/pom.xml +++ b/dsf-mpi/dsf-mpi-client-stub/pom.xml @@ -18,62 +18,4 @@ dsf-mpi-client
- - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy - package - - copy - - - - - ${project.groupId} - ${project.artifactId} - ${project.version} - mpi_client_stub.jar - ../../dsf-bpe/dsf-bpe-server-jetty/plugin - - - ${project.groupId} - ${project.artifactId} - ${project.version} - mpi_client_stub.jar - ../../dsf-bpe/dsf-bpe-server-jetty/docker/plugin - - - - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - ../../dsf-bpe/dsf-bpe-server-jetty/plugin - - mpi_client_stub.jar - - false - - - ../../dsf-bpe/dsf-bpe-server-jetty/docker/plugin - - mpi_client_stub.jar - - false - - - - - - \ No newline at end of file diff --git a/dsf-openehr/dsf-openehr-client-stub/pom.xml b/dsf-openehr/dsf-openehr-client-stub/pom.xml index 3082776f8..49ee75728 100644 --- a/dsf-openehr/dsf-openehr-client-stub/pom.xml +++ b/dsf-openehr/dsf-openehr-client-stub/pom.xml @@ -1,7 +1,6 @@ - + 4.0.0 dsf-openehr-client-stub @@ -18,62 +17,4 @@ dsf-openehr-client
- - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy - package - - copy - - - - - ${project.groupId} - ${project.artifactId} - ${project.version} - openehr_client_stub.jar - ../../dsf-bpe/dsf-bpe-server-jetty/plugin - - - ${project.groupId} - ${project.artifactId} - ${project.version} - openehr_client_stub.jar - ../../dsf-bpe/dsf-bpe-server-jetty/docker/plugin - - - - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - ../../dsf-bpe/dsf-bpe-server-jetty/plugin - - openehr_client_stub.jar - - false - - - ../../dsf-bpe/dsf-bpe-server-jetty/docker/plugin - - openehr_client_stub.jar - - false - - - - - - \ No newline at end of file From f38c2321c0c1f4de9e64eea209ee2625e1969ea8 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Mon, 9 Nov 2020 20:45:23 +0100 Subject: [PATCH 03/75] adding processes as runtime dependencies to influence maven build order --- dsf-bpe/dsf-bpe-server-jetty/pom.xml | 53 ++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/dsf-bpe/dsf-bpe-server-jetty/pom.xml b/dsf-bpe/dsf-bpe-server-jetty/pom.xml index 621645854..efaa947f4 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/pom.xml +++ b/dsf-bpe/dsf-bpe-server-jetty/pom.xml @@ -19,30 +19,55 @@ org.highmed.dsf dsf-tools-db-migration - - javax.servlet - javax.servlet-api - compile + org.highmed.dsf + dsf-openehr-client-stub + + + org.highmed.dsf + dsf-mpi-client-stub de.hs-heilbronn.mi jetty-utils + + javax.servlet + javax.servlet-api + compile + javax.mail mail + org.highmed.dsf - dsf-openehr-client-stub + dsf-bpe-process-ping + runtime - org.highmed.dsf - dsf-mpi-client-stub + ${project.groupId} + dsf-bpe-process-update-allow-list + runtime + + + ${project.groupId} + dsf-bpe-process-update-resources + runtime + + + ${project.groupId} + dsf-bpe-process-feasibility + runtime + + + ${project.groupId} + dsf-bpe-process-local-services + runtime
@@ -102,8 +127,8 @@ - ${project.groupId} - ${project.artifactId} + org.highmed.dsf + dsf-bpe-server-jetty ${project.version} dsf_bpe.jar @@ -120,27 +145,27 @@ - ${project.groupId} + org.highmed.dsf dsf-bpe-process-ping ${project.version} - ${project.groupId} + org.highmed.dsf dsf-bpe-process-update-allow-list ${project.version} - ${project.groupId} + org.highmed.dsf dsf-bpe-process-update-resources ${project.version} - ${project.groupId} + org.highmed.dsf dsf-bpe-process-feasibility ${project.version} - ${project.groupId} + org.highmed.dsf dsf-bpe-process-local-services ${project.version} From 41640126dda482c3d6269882e18e56b7e901e911 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 10 Nov 2020 01:19:40 +0100 Subject: [PATCH 04/75] automatic process suspended/active state based on jar availability --- dsf-bpe/dsf-bpe-server-jetty/pom.xml | 55 ++++----- .../BpmnProcessStateChangeService.java | 6 + .../BpmnProcessStateChangeServiceImpl.java | 78 +++++++++++++ .../BpmnServiceDelegateValidationService.java | 104 +----------------- ...nServiceDelegateValidationServiceImpl.java | 104 ++++++++++++++++++ .../dsf/bpe/spring/config/CamundaConfig.java | 7 +- .../config/PostProcessDeployConfig.java | 46 ++++++++ .../bpe/spring/config/ValidationConfig.java | 24 ---- 8 files changed, 269 insertions(+), 155 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeService.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeServiceImpl.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationServiceImpl.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java delete mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/ValidationConfig.java diff --git a/dsf-bpe/dsf-bpe-server-jetty/pom.xml b/dsf-bpe/dsf-bpe-server-jetty/pom.xml index efaa947f4..ac31b5f95 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/pom.xml +++ b/dsf-bpe/dsf-bpe-server-jetty/pom.xml @@ -42,33 +42,6 @@ javax.mail mail - - - - org.highmed.dsf - dsf-bpe-process-ping - runtime - - - ${project.groupId} - dsf-bpe-process-update-allow-list - runtime - - - ${project.groupId} - dsf-bpe-process-update-resources - runtime - - - ${project.groupId} - dsf-bpe-process-feasibility - runtime - - - ${project.groupId} - dsf-bpe-process-local-services - runtime -
@@ -174,6 +147,34 @@ + + + + org.highmed.dsf + dsf-bpe-process-ping + ${project.version} + + + org.highmed.dsf + dsf-bpe-process-update-allow-list + ${project.version} + + + org.highmed.dsf + dsf-bpe-process-update-resources + ${project.version} + + + org.highmed.dsf + dsf-bpe-process-feasibility + ${project.version} + + + org.highmed.dsf + dsf-bpe-process-local-services + ${project.version} + +
org.apache.maven.plugins diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeService.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeService.java new file mode 100644 index 000000000..8cc239125 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeService.java @@ -0,0 +1,6 @@ +package org.highmed.dsf.bpe.service; + +public interface BpmnProcessStateChangeService +{ + void suspendOrActivateProcesses(); +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeServiceImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeServiceImpl.java new file mode 100644 index 000000000..80a57a0ba --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeServiceImpl.java @@ -0,0 +1,78 @@ +package org.highmed.dsf.bpe.service; + +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import org.camunda.bpm.engine.RepositoryService; +import org.camunda.bpm.engine.repository.ProcessDefinition; +import org.highmed.dsf.bpe.plugin.ProcessPluginProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; + +public class BpmnProcessStateChangeServiceImpl implements BpmnProcessStateChangeService, InitializingBean +{ + private static final Logger logger = LoggerFactory.getLogger(BpmnProcessStateChangeServiceImpl.class); + + private final RepositoryService repositoryService; + private final ProcessPluginProvider processPluginProvider; + + public BpmnProcessStateChangeServiceImpl(RepositoryService repositoryService, + ProcessPluginProvider processPluginProvider) + { + this.repositoryService = repositoryService; + this.processPluginProvider = processPluginProvider; + } + + @Override + public void afterPropertiesSet() throws Exception + { + Objects.requireNonNull(repositoryService, "repositoryService"); + Objects.requireNonNull(processPluginProvider, "processPluginProvider"); + } + + @Override + public void suspendOrActivateProcesses() + { + List deployedProcessDefinitions = repositoryService.createProcessDefinitionQuery().list(); + List expectedProcessDefinitionKeysAndVersions = processPluginProvider.getDefinitions().stream() + .map(def -> def.getProcessKeysAndVersions()).flatMap(List::stream).sorted() + .collect(Collectors.toList()); + + logger.debug("Deployed process definitions: {} (before potential state change)", + deployedProcessDefinitions.stream() + .map(def -> toProcessDefinitionKeyAndVersion(def.getKey(), def.getVersionTag()) + " " + + (def.isSuspended() ? "(suspended)" : "(active)")) + .sorted().collect(Collectors.joining(", ", "[", "]"))); + logger.debug("Expected process definitions: {}", expectedProcessDefinitionKeysAndVersions); + + for (ProcessDefinition definition : deployedProcessDefinitions) + { + String definitionKeyAndVersion = toProcessDefinitionKeyAndVersion(definition.getKey(), + definition.getVersionTag()); + if (expectedProcessDefinitionKeysAndVersions.contains(definitionKeyAndVersion) && definition.isSuspended()) + { + logger.info("Activating process {}", definitionKeyAndVersion); + repositoryService.activateProcessDefinitionById(definition.getId()); + } + else if (!expectedProcessDefinitionKeysAndVersions.contains(definitionKeyAndVersion) + && !definition.isSuspended()) + { + logger.info("Suspending process {}", definitionKeyAndVersion); + repositoryService.suspendProcessDefinitionById(definition.getId()); + } + } + + logger.info("Deployed process definitions: {}", + repositoryService.createProcessDefinitionQuery().list().stream() + .map(def -> toProcessDefinitionKeyAndVersion(def.getKey(), def.getVersionTag()) + " " + + (def.isSuspended() ? "(suspended)" : "(active)")) + .sorted().collect(Collectors.joining(", ", "[", "]"))); + } + + private String toProcessDefinitionKeyAndVersion(String processDefinitionKey, String processDefinitionVersion) + { + return processDefinitionKey + "/" + processDefinitionVersion; + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationService.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationService.java index 720bf8f89..970a5c3e5 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationService.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationService.java @@ -1,106 +1,8 @@ package org.highmed.dsf.bpe.service; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.engine.RepositoryService; -import org.camunda.bpm.engine.repository.ProcessDefinition; -import org.camunda.bpm.model.bpmn.BpmnModelInstance; -import org.camunda.bpm.model.bpmn.instance.Process; -import org.camunda.bpm.model.bpmn.instance.ServiceTask; -import org.highmed.dsf.bpe.delegate.DelegateProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.context.ApplicationContext; -import org.springframework.context.event.ContextRefreshedEvent; -import org.springframework.context.event.EventListener; - -public class BpmnServiceDelegateValidationService implements InitializingBean +public interface BpmnServiceDelegateValidationService { - private static final Logger logger = LoggerFactory.getLogger(BpmnServiceDelegateValidationService.class); - - private final ProcessEngine processEngine; - private final DelegateProvider delegateProvider; - - public BpmnServiceDelegateValidationService(ProcessEngine processEngine, DelegateProvider delegateProvider) - { - this.processEngine = processEngine; - this.delegateProvider = delegateProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - Objects.requireNonNull(processEngine, "processEngine"); - Objects.requireNonNull(delegateProvider, "delegateProvider"); - } - - @EventListener({ ContextRefreshedEvent.class }) - public void onContextRefreshedEvent(ContextRefreshedEvent event) - { - logger.debug("Validating bpmn models, checking service delegate availability"); - - RepositoryService repositoryService = processEngine.getRepositoryService(); - - List deployedProcesses = repositoryService.createProcessDefinitionQuery().active() - .latestVersion().list(); - List models = deployedProcesses.stream() - .map(p -> repositoryService.getBpmnModelInstance(p.getId())).collect(Collectors.toList()); - - models.forEach(this::validateBeanAvailabilityForModel); - } - - private void validateBeanAvailabilityForModel(BpmnModelInstance model) - { - model.getModelElementsByType(Process.class).stream().forEach(this::validateBeanAvailabilityForProcess); - } - - private void validateBeanAvailabilityForProcess(Process process) - { - process.getChildElementsByType(ServiceTask.class).stream() - .forEach(task -> validateBeanAvailabilityForTask(process.getId(), process.getCamundaVersionTag(), - task.getCamundaClass())); - } - - private void validateBeanAvailabilityForTask(String processDefinitionKey, String processDefinitionVersion, - String className) - { - Class serviceClass = loadClass(processDefinitionKey, processDefinitionVersion, className); - loadBean(processDefinitionKey, processDefinitionVersion, serviceClass); - } - private void loadBean(String processDefinitionKey, String processDefinitionVersion, Class serviceClass) - { - try - { - ApplicationContext applicationContext = delegateProvider.getApplicationContext(processDefinitionKey, - processDefinitionVersion); - applicationContext.getBean(serviceClass); - } - catch (BeansException e) - { - logger.warn("Error while getting service delegate bean of type {} defined in process {}/{} not found", - serviceClass.getName(), processDefinitionKey, processDefinitionVersion); - throw new RuntimeException(e); - } - } + void validateModels(); - private Class loadClass(String processDefinitionKey, String processDefinitionVersion, String className) - { - try - { - ClassLoader classLoader = delegateProvider.getClassLoader(processDefinitionKey, processDefinitionVersion); - return classLoader.loadClass(className); - } - catch (ClassNotFoundException e) - { - logger.warn("Service delegate class {} defined in process {}/{} not found", className, processDefinitionKey, - processDefinitionVersion); - throw new RuntimeException(e); - } - } -} +} \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationServiceImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationServiceImpl.java new file mode 100644 index 000000000..c31a12186 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationServiceImpl.java @@ -0,0 +1,104 @@ +package org.highmed.dsf.bpe.service; + +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import org.camunda.bpm.engine.ProcessEngine; +import org.camunda.bpm.engine.RepositoryService; +import org.camunda.bpm.engine.repository.ProcessDefinition; +import org.camunda.bpm.model.bpmn.BpmnModelInstance; +import org.camunda.bpm.model.bpmn.instance.Process; +import org.camunda.bpm.model.bpmn.instance.ServiceTask; +import org.highmed.dsf.bpe.delegate.DelegateProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationContext; + +public class BpmnServiceDelegateValidationServiceImpl implements BpmnServiceDelegateValidationService, InitializingBean +{ + private static final Logger logger = LoggerFactory.getLogger(BpmnServiceDelegateValidationServiceImpl.class); + + private final ProcessEngine processEngine; + private final DelegateProvider delegateProvider; + + public BpmnServiceDelegateValidationServiceImpl(ProcessEngine processEngine, DelegateProvider delegateProvider) + { + this.processEngine = processEngine; + this.delegateProvider = delegateProvider; + } + + @Override + public void afterPropertiesSet() throws Exception + { + Objects.requireNonNull(processEngine, "processEngine"); + Objects.requireNonNull(delegateProvider, "delegateProvider"); + } + + @Override + public void validateModels() + { + logger.debug("Validating bpmn models, checking service delegate availability"); + + RepositoryService repositoryService = processEngine.getRepositoryService(); + + List deployedProcesses = repositoryService.createProcessDefinitionQuery().active() + .latestVersion().list(); + List models = deployedProcesses.stream() + .map(p -> repositoryService.getBpmnModelInstance(p.getId())).collect(Collectors.toList()); + + models.forEach(this::validateBeanAvailabilityForModel); + } + + private void validateBeanAvailabilityForModel(BpmnModelInstance model) + { + model.getModelElementsByType(Process.class).stream().forEach(this::validateBeanAvailabilityForProcess); + } + + private void validateBeanAvailabilityForProcess(Process process) + { + process.getChildElementsByType(ServiceTask.class).stream() + .forEach(task -> validateBeanAvailabilityForTask(process.getId(), process.getCamundaVersionTag(), + task.getCamundaClass())); + } + + private void validateBeanAvailabilityForTask(String processDefinitionKey, String processDefinitionVersion, + String className) + { + Class serviceClass = loadClass(processDefinitionKey, processDefinitionVersion, className); + loadBean(processDefinitionKey, processDefinitionVersion, serviceClass); + } + + private void loadBean(String processDefinitionKey, String processDefinitionVersion, Class serviceClass) + { + try + { + ApplicationContext applicationContext = delegateProvider.getApplicationContext(processDefinitionKey, + processDefinitionVersion); + applicationContext.getBean(serviceClass); + } + catch (BeansException e) + { + logger.warn("Error while getting service delegate bean of type {} defined in process {}/{} not found", + serviceClass.getName(), processDefinitionKey, processDefinitionVersion); + throw new RuntimeException(e); + } + } + + private Class loadClass(String processDefinitionKey, String processDefinitionVersion, String className) + { + try + { + ClassLoader classLoader = delegateProvider.getClassLoader(processDefinitionKey, processDefinitionVersion); + return classLoader.loadClass(className); + } + catch (ClassNotFoundException e) + { + logger.warn("Service delegate class {} defined in process {}/{} not found", className, processDefinitionKey, + processDefinitionVersion); + throw new RuntimeException(e); + } + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java index 7c94fc758..5a32354f1 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java @@ -149,7 +149,7 @@ public SpringProcessEngineConfiguration processEngineConfiguration( } @Bean - public DelegateProvider delegateProvider() throws IOException + public DelegateProvider delegateProvider() { return new DelegateProviderImpl(processPluginProvider().getClassLoadersByProcessDefinitionKeyAndVersion(), ClassLoader.getSystemClassLoader(), @@ -166,12 +166,13 @@ public ProcessEngineFactoryBean processEngineFactory( } @Bean - public ProcessPluginProvider processPluginProvider() throws IOException + public ProcessPluginProvider processPluginProvider() { Path pluginDirectoryPath = Paths.get(pluginDirectory); if (!Files.isDirectory(pluginDirectoryPath)) - throw new IOException("Process plug in directory '" + pluginDirectoryPath.toString() + "' not readable"); + throw new RuntimeException( + "Process plug in directory '" + pluginDirectoryPath.toString() + "' not readable"); return new ProcessPluginProviderImpl(pluginDirectoryPath, applicationContext); } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java new file mode 100644 index 000000000..e85ae2d39 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java @@ -0,0 +1,46 @@ +package org.highmed.dsf.bpe.spring.config; + +import org.camunda.bpm.engine.ProcessEngine; +import org.highmed.dsf.bpe.delegate.DelegateProvider; +import org.highmed.dsf.bpe.plugin.ProcessPluginProvider; +import org.highmed.dsf.bpe.service.BpmnProcessStateChangeService; +import org.highmed.dsf.bpe.service.BpmnProcessStateChangeServiceImpl; +import org.highmed.dsf.bpe.service.BpmnServiceDelegateValidationService; +import org.highmed.dsf.bpe.service.BpmnServiceDelegateValidationServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.context.event.EventListener; + +@Configuration +public class PostProcessDeployConfig +{ + @Autowired + private ProcessEngine processEngine; + + @Autowired + private DelegateProvider delegateProvider; + + @Autowired + private ProcessPluginProvider processPluginProvider; + + @EventListener({ ContextRefreshedEvent.class }) + public void onContextRefreshedEvent(ContextRefreshedEvent event) + { + bpmnProcessStateChangeService().suspendOrActivateProcesses(); + bpmnServiceDelegateValidationService().validateModels(); + } + + @Bean + public BpmnServiceDelegateValidationService bpmnServiceDelegateValidationService() + { + return new BpmnServiceDelegateValidationServiceImpl(processEngine, delegateProvider); + } + + @Bean + public BpmnProcessStateChangeService bpmnProcessStateChangeService() + { + return new BpmnProcessStateChangeServiceImpl(processEngine.getRepositoryService(), processPluginProvider); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/ValidationConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/ValidationConfig.java deleted file mode 100644 index 711ec90ff..000000000 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/ValidationConfig.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.camunda.bpm.engine.ProcessEngine; -import org.highmed.dsf.bpe.delegate.DelegateProvider; -import org.highmed.dsf.bpe.service.BpmnServiceDelegateValidationService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class ValidationConfig -{ - @Autowired - private DelegateProvider delegateProvider; - - @Autowired - private ProcessEngine processEngine; - - @Bean - protected BpmnServiceDelegateValidationService bpmnServiceDelegateValidationService() - { - return new BpmnServiceDelegateValidationService(processEngine, delegateProvider); - } -} From 8dac3dbf0e7cec790cb50d65c0d7ac2ac5d5733c Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 10 Nov 2020 11:46:57 +0100 Subject: [PATCH 05/75] now only showing non duplicate supportedProfiles (active/draft) sorted Only StructureDefinitions with status active or draft are shown (without duplicates) alphabetically sorted as supportedProfile. --- .../impl/ConformanceServiceImpl.java | 57 ++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ConformanceServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ConformanceServiceImpl.java index f9305c5c3..3bd99714f 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ConformanceServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ConformanceServiceImpl.java @@ -3,6 +3,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.Comparator; +import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -138,6 +139,58 @@ public class ConformanceServiceImpl extends AbstractBasicService implements ConformanceService, InitializingBean { + private static final class StructureDefinitionDistinctByUrl implements Comparable + { + final StructureDefinition structureDefinition; + final String url; + + public StructureDefinitionDistinctByUrl(StructureDefinition structureDefinition) + { + this.structureDefinition = structureDefinition; + this.url = structureDefinition.getUrl(); + } + + public StructureDefinition get() + { + return structureDefinition; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((url == null) ? 0 : url.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + StructureDefinitionDistinctByUrl other = (StructureDefinitionDistinctByUrl) obj; + if (url == null) + { + if (other.url != null) + return false; + } + else if (!url.equals(other.url)) + return false; + return true; + } + + @Override + public int compareTo(StructureDefinitionDistinctByUrl o) + { + return url.compareTo(o.url); + } + } + private final String serverBase; private final int defaultPageCount; private final BuildInfoReader buildInfoReader; @@ -284,8 +337,10 @@ private CapabilityStatement createCapabilityStatement() Map> profileUrlsByResource = validationSupport.fetchAllStructureDefinitions() .stream().filter(r -> r instanceof StructureDefinition).map(r -> (StructureDefinition) r) .filter(s -> StructureDefinitionKind.RESOURCE.equals(s.getKind()) && !s.getAbstract() + && EnumSet.of(PublicationStatus.ACTIVE, PublicationStatus.DRAFT).contains(s.getStatus()) && !s.getUrl().contains("hl7.org")) - .collect(Collectors.groupingBy(StructureDefinition::getType, + .map(StructureDefinitionDistinctByUrl::new).distinct().sorted() + .map(StructureDefinitionDistinctByUrl::get).collect(Collectors.groupingBy(StructureDefinition::getType, Collectors.mapping(s -> new CanonicalType(s.getUrl()), Collectors.toList()))); for (Class resource : resources) From eedcaaab544f4e0199bcb0fd9ad78036e7d956fd Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 10 Nov 2020 17:30:02 +0100 Subject: [PATCH 06/75] refactor multi instance targets to support single instance targets --- .../org/highmed/dsf/bpe/ConstantsBase.java | 4 +- .../fhir/task/AbstractTaskMessageSend.java | 62 +++++++-------- .../fhir/variables/MultiInstanceTarget.java | 29 ------- .../variables/MultiInstanceTargetValues.java | 54 ------------- .../fhir/variables/MultiInstanceTargets.java | 31 -------- .../variables/MultiInstanceTargetsValues.java | 54 ------------- .../highmed/dsf/fhir/variables/Target.java | 49 ++++++++++++ ...tSerializer.java => TargetSerializer.java} | 24 +++--- .../dsf/fhir/variables/TargetValues.java | 53 +++++++++++++ .../highmed/dsf/fhir/variables/Targets.java | 31 ++++++++ ...Serializer.java => TargetsSerializer.java} | 26 +++---- .../dsf/fhir/variables/TargetsValues.java | 53 +++++++++++++ .../dsf/bpe/message/SendTtpRequest.java | 7 +- .../dsf/bpe/service/SelectRequestTargets.java | 33 ++++---- .../service/SelectResponseTargetMedic.java | 13 +--- .../bpe/service/SelectResponseTargetTtp.java | 9 +-- .../dsf/bpe/service/StoreCorrelationKeys.java | 14 ++-- .../resources/computeSimpleFeasibility.bpmn | 78 +++++++++---------- .../resources/requestSimpleFeasibility.bpmn | 2 +- .../dsf/bpe/service/SelectPingTargets.java | 14 ++-- .../dsf/bpe/service/SelectPongTarget.java | 13 ++-- .../src/main/resources/ping.bpmn | 8 +- .../bpe/service/SelectResourceAndTargets.java | 16 ++-- .../resources/requestUpdateResources.bpmn | 18 ++--- .../bpe/spring/config/SerializerConfig.java | 12 +-- 25 files changed, 353 insertions(+), 354 deletions(-) delete mode 100755 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTarget.java delete mode 100755 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetValues.java delete mode 100755 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargets.java delete mode 100755 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetsValues.java create mode 100755 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Target.java rename dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/{MultiInstanceTargetSerializer.java => TargetSerializer.java} (53%) create mode 100755 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetValues.java create mode 100755 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Targets.java rename dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/{MultiInstanceTargetsSerializer.java => TargetsSerializer.java} (53%) create mode 100755 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetsValues.java diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java index ace8c55c1..2981c3ef3 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java @@ -10,8 +10,8 @@ public interface ConstantsBase String VARIABLE_PROFILE = "profile"; // String VARIABLE_TARGET_ORGANIZATION_ID = "targetOrganizationId"; // String VARIABLE_CORRELATION_KEY = "correlationKey"; - String VARIABLE_MULTI_INSTANCE_TARGET = "multiInstanceTarget"; - String VARIABLE_MULTI_INSTANCE_TARGETS = "multiInstanceTargets"; + String VARIABLE_TARGET = "target"; + String VARIABLE_TARGETS = "targets"; String VARIABLE_TASK = "task"; String VARIABLE_LEADING_TASK = "leadingTask"; String VARIABLE_BUNDLE_ID = "bundleId"; diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java index 69e0ecfe0..25c94ffe4 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java @@ -9,8 +9,8 @@ import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.variables.MultiInstanceTarget; -import org.highmed.dsf.fhir.variables.MultiInstanceTargets; +import org.highmed.dsf.fhir.variables.Target; +import org.highmed.dsf.fhir.variables.Targets; import org.highmed.fhir.client.FhirWebserviceClient; import org.hl7.fhir.r4.model.CodeableConcept; import org.hl7.fhir.r4.model.Coding; @@ -64,7 +64,7 @@ public void doExecute(DelegateExecution execution) throws Exception // String targetOrganizationId = (String) execution.getVariable(Constants.VARIABLE_TARGET_ORGANIZATION_ID); // String correlationKey = (String) execution.getVariable(Constants.VARIABLE_CORRELATION_KEY); - MultiInstanceTarget target = getMultiInstanceTarget(execution); + Target target = getTarget(execution); try { @@ -73,17 +73,17 @@ public void doExecute(DelegateExecution execution) throws Exception } catch (Exception e) { - String errorMessage = "Error while sending Task (process: " + processDefinitionKey + ", version: " - + versionTag + ", message-name: " + messageName + ", business-key: " + businessKey - + ", correlation-key: " + target.getCorrelationKey() + ") to organization with identifier " - + target.getTargetOrganizationIdentifierValue() + ": " + e.getMessage(); + String errorMessage = + "Error while sending Task (process: " + processDefinitionKey + ", version: " + versionTag + + ", message-name: " + messageName + ", business-key: " + businessKey + + ", correlation-key: " + target.getCorrelationKey() + ") to organization with identifier " + + target.getTargetOrganizationIdentifierValue() + ": " + e.getMessage(); logger.warn(errorMessage); logger.debug("Error while sending Task", e); - logger.debug("Removing target organization {} with error {} from multi instance target list", + logger.debug("Removing target organization {} with error {} from target list", target.getTargetOrganizationIdentifierValue(), e.getMessage()); - MultiInstanceTargets targets = (MultiInstanceTargets) execution - .getVariable(ConstantsBase.VARIABLE_MULTI_INSTANCE_TARGETS); + Targets targets = (Targets) execution.getVariable(ConstantsBase.VARIABLE_TARGETS); targets.removeTarget(target); Task task = getLeadingTaskFromExecutionVariables(); @@ -93,16 +93,15 @@ public void doExecute(DelegateExecution execution) throws Exception } /** - * Override this method to set a different multiinstance target then the one defined in the process variable - * {@link ConstantsBase#VARIABLE_MULTI_INSTANCE_TARGET} + * Override this method to set a different target then the one defined in the process variable + * {@link ConstantsBase#VARIABLE_TARGET} * - * @param execution - * the delegate execution of this process instance - * @return {@link MultiInstanceTarget} that should receive the message + * @param execution the delegate execution of this process instance + * @return {@link Target} that should receive the message */ - protected MultiInstanceTarget getMultiInstanceTarget(DelegateExecution execution) + protected Target getTarget(DelegateExecution execution) { - return (MultiInstanceTarget) execution.getVariable(ConstantsBase.VARIABLE_MULTI_INSTANCE_TARGET); + return (Target) execution.getVariable(ConstantsBase.VARIABLE_TARGET); } /** @@ -137,26 +136,26 @@ protected void sendTask(String targetOrganizationIdentifierValue, String process // http://highmed.org/bpe/Process/processDefinitionKey // http://highmed.org/bpe/Process/processDefinitionKey/versionTag - String instantiatesUri = ConstantsBase.PROCESS_URI_BASE + processDefinitionKey - + (versionTag != null && !versionTag.isEmpty() ? ("/" + versionTag) : ""); + String instantiatesUri = + ConstantsBase.PROCESS_URI_BASE + processDefinitionKey + (versionTag != null && !versionTag.isEmpty() ? + ("/" + versionTag) : + ""); task.setInstantiatesUri(instantiatesUri); - ParameterComponent messageNameInput = new ParameterComponent( - new CodeableConcept(new Coding(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME, null)), - new StringType(messageName)); + ParameterComponent messageNameInput = new ParameterComponent(new CodeableConcept( + new Coding(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME, null)), new StringType(messageName)); task.getInput().add(messageNameInput); - ParameterComponent businessKeyInput = new ParameterComponent( - new CodeableConcept(new Coding(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY, null)), - new StringType(businessKey)); + ParameterComponent businessKeyInput = new ParameterComponent(new CodeableConcept( + new Coding(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY, null)), new StringType(businessKey)); task.getInput().add(businessKeyInput); if (correlationKey != null) { - ParameterComponent correlationKeyInput = new ParameterComponent( - new CodeableConcept(new Coding(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, + ParameterComponent correlationKeyInput = new ParameterComponent(new CodeableConcept( + new Coding(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY, null)), new StringType(correlationKey)); task.getInput().add(correlationKeyInput); @@ -184,8 +183,9 @@ private FhirWebserviceClient getFhirClient(Task task, String targetOrganizationI else { logger.trace("Using remote webservice client"); - return getFhirWebserviceClientProvider().getRemoteWebserviceClient( - organizationProvider.getDefaultIdentifierSystem(), targetOrganizationIdentifierValue); + return getFhirWebserviceClientProvider() + .getRemoteWebserviceClient(organizationProvider.getDefaultIdentifierSystem(), + targetOrganizationIdentifierValue); } } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTarget.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTarget.java deleted file mode 100755 index a427905c0..000000000 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTarget.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.highmed.dsf.fhir.variables; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class MultiInstanceTarget -{ - private final String targetOrganizationIdentifierValue; - private final String correlationKey; - - @JsonCreator - public MultiInstanceTarget( - @JsonProperty("targetOrganizationIdentifierValue") String targetOrganizationIdentifierValue, - @JsonProperty("correlationKey") String correlationKey) - { - this.targetOrganizationIdentifierValue = targetOrganizationIdentifierValue; - this.correlationKey = correlationKey; - } - - public String getTargetOrganizationIdentifierValue() - { - return targetOrganizationIdentifierValue; - } - - public String getCorrelationKey() - { - return correlationKey; - } -} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetValues.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetValues.java deleted file mode 100755 index a56a596e3..000000000 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetValues.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.highmed.dsf.fhir.variables; - -import java.util.Map; - -import org.camunda.bpm.engine.variable.impl.type.PrimitiveValueTypeImpl; -import org.camunda.bpm.engine.variable.impl.value.PrimitiveTypeValueImpl; -import org.camunda.bpm.engine.variable.type.PrimitiveValueType; -import org.camunda.bpm.engine.variable.value.PrimitiveValue; -import org.camunda.bpm.engine.variable.value.TypedValue; - -public final class MultiInstanceTargetValues -{ - public static interface MultiInstanceTargetValue extends PrimitiveValue - { - } - - private static class MultiInstanceTargetValueImpl extends PrimitiveTypeValueImpl - implements MultiInstanceTargetValue - { - private static final long serialVersionUID = 1L; - - public MultiInstanceTargetValueImpl(MultiInstanceTarget value, PrimitiveValueType type) - { - super(value, type); - } - } - - public static class MultiInstanceTargetValueTypeImpl extends PrimitiveValueTypeImpl - { - private static final long serialVersionUID = 1L; - - private MultiInstanceTargetValueTypeImpl() - { - super(MultiInstanceTarget.class); - } - - @Override - public TypedValue createValue(Object value, Map valueInfo) - { - return new MultiInstanceTargetValueImpl((MultiInstanceTarget) value, VALUE_TYPE); - } - } - - public static final PrimitiveValueType VALUE_TYPE = new MultiInstanceTargetValueTypeImpl(); - - private MultiInstanceTargetValues() - { - } - - public static MultiInstanceTargetValue create(MultiInstanceTarget value) - { - return new MultiInstanceTargetValueImpl(value, VALUE_TYPE); - } -} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargets.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargets.java deleted file mode 100755 index 60fcaaf51..000000000 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargets.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.highmed.dsf.fhir.variables; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class MultiInstanceTargets -{ - private final List targets = new ArrayList<>(); - - @JsonCreator - public MultiInstanceTargets(@JsonProperty("targets") Collection targets) - { - if (targets != null) - this.targets.addAll(targets); - } - - public List getTargets() - { - return Collections.unmodifiableList(targets); - } - - public void removeTarget(MultiInstanceTarget target) - { - targets.remove(target); - } -} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetsValues.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetsValues.java deleted file mode 100755 index 3a6b907ae..000000000 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetsValues.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.highmed.dsf.fhir.variables; - -import java.util.Map; - -import org.camunda.bpm.engine.variable.impl.type.PrimitiveValueTypeImpl; -import org.camunda.bpm.engine.variable.impl.value.PrimitiveTypeValueImpl; -import org.camunda.bpm.engine.variable.type.PrimitiveValueType; -import org.camunda.bpm.engine.variable.value.PrimitiveValue; -import org.camunda.bpm.engine.variable.value.TypedValue; - -public final class MultiInstanceTargetsValues -{ - public static interface MultiInstanceTargetsValue extends PrimitiveValue - { - } - - private static class MultiInstanceTargetsValueImpl extends PrimitiveTypeValueImpl - implements MultiInstanceTargetsValue - { - private static final long serialVersionUID = 1L; - - public MultiInstanceTargetsValueImpl(MultiInstanceTargets value, PrimitiveValueType type) - { - super(value, type); - } - } - - public static class MultiInstanceTargetsValueTypeImpl extends PrimitiveValueTypeImpl - { - private static final long serialVersionUID = 1L; - - private MultiInstanceTargetsValueTypeImpl() - { - super(MultiInstanceTargets.class); - } - - @Override - public TypedValue createValue(Object value, Map valueInfo) - { - return new MultiInstanceTargetsValueImpl((MultiInstanceTargets) value, VALUE_TYPE); - } - } - - public static final PrimitiveValueType VALUE_TYPE = new MultiInstanceTargetsValueTypeImpl(); - - private MultiInstanceTargetsValues() - { - } - - public static MultiInstanceTargetsValue create(MultiInstanceTargets value) - { - return new MultiInstanceTargetsValueImpl(value, VALUE_TYPE); - } -} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Target.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Target.java new file mode 100755 index 000000000..3f5a9b628 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Target.java @@ -0,0 +1,49 @@ +package org.highmed.dsf.fhir.variables; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Target +{ + private static final Logger logger = LoggerFactory.getLogger(Target.class); + + private final String targetOrganizationIdentifierValue; + private final String correlationKey; + + @JsonCreator + private Target( + @JsonProperty("targetOrganizationIdentifierValue") + String targetOrganizationIdentifierValue, + @JsonProperty("correlationKey") + String correlationKey) + { + this.targetOrganizationIdentifierValue = targetOrganizationIdentifierValue; + this.correlationKey = correlationKey; + } + + public static Target createSingleInstanceTarget(String targetOrganizationIdentifierValue) + { + return new Target(targetOrganizationIdentifierValue, null); + } + + public static Target createMultiInstanceTarget(String targetOrganizationIdentifierValue, String correlationKey) + { + return new Target(targetOrganizationIdentifierValue, correlationKey); + } + + public String getTargetOrganizationIdentifierValue() + { + return targetOrganizationIdentifierValue; + } + + public String getCorrelationKey() + { + if (correlationKey == null) + logger.debug("SingleInstanceTargets do not have a correlation key"); + + return correlationKey; + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetSerializer.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetSerializer.java similarity index 53% rename from dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetSerializer.java rename to dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetSerializer.java index 7993c0ed0..e74499733 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetSerializer.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetSerializer.java @@ -6,20 +6,19 @@ import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer; import org.camunda.bpm.engine.impl.variable.serializer.ValueFields; import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetValues.MultiInstanceTargetValue; +import org.highmed.dsf.fhir.variables.TargetValues.TargetValue; import org.springframework.beans.factory.InitializingBean; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -public class MultiInstanceTargetSerializer extends PrimitiveValueSerializer - implements InitializingBean +public class TargetSerializer extends PrimitiveValueSerializer implements InitializingBean { private final ObjectMapper objectMapper; - public MultiInstanceTargetSerializer(ObjectMapper objectMapper) + public TargetSerializer(ObjectMapper objectMapper) { - super(MultiInstanceTargetValues.VALUE_TYPE); + super(TargetValues.VALUE_TYPE); this.objectMapper = objectMapper; } @@ -31,9 +30,9 @@ public void afterPropertiesSet() throws Exception } @Override - public void writeValue(MultiInstanceTargetValue value, ValueFields valueFields) + public void writeValue(TargetValue value, ValueFields valueFields) { - MultiInstanceTarget target = value.getValue(); + Target target = value.getValue(); try { if (target != null) @@ -46,21 +45,20 @@ public void writeValue(MultiInstanceTargetValue value, ValueFields valueFields) } @Override - public MultiInstanceTargetValue convertToTypedValue(UntypedValueImpl untypedValue) + public TargetValue convertToTypedValue(UntypedValueImpl untypedValue) { - return MultiInstanceTargetValues.create((MultiInstanceTarget) untypedValue.getValue()); + return TargetValues.create((Target) untypedValue.getValue()); } @Override - public MultiInstanceTargetValue readValue(ValueFields valueFields, boolean asTransientValue) + public TargetValue readValue(ValueFields valueFields, boolean asTransientValue) { byte[] bytes = valueFields.getByteArrayValue(); try { - MultiInstanceTarget target = (bytes == null || bytes.length <= 0) ? null - : objectMapper.readValue(bytes, MultiInstanceTarget.class); - return MultiInstanceTargetValues.create(target); + Target target = (bytes == null || bytes.length <= 0) ? null : objectMapper.readValue(bytes, Target.class); + return TargetValues.create(target); } catch (IOException e) { diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetValues.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetValues.java new file mode 100755 index 000000000..217845055 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetValues.java @@ -0,0 +1,53 @@ +package org.highmed.dsf.fhir.variables; + +import java.util.Map; + +import org.camunda.bpm.engine.variable.impl.type.PrimitiveValueTypeImpl; +import org.camunda.bpm.engine.variable.impl.value.PrimitiveTypeValueImpl; +import org.camunda.bpm.engine.variable.type.PrimitiveValueType; +import org.camunda.bpm.engine.variable.value.PrimitiveValue; +import org.camunda.bpm.engine.variable.value.TypedValue; + +public final class TargetValues +{ + public static interface TargetValue extends PrimitiveValue + { + } + + private static class TargetValueImpl extends PrimitiveTypeValueImpl implements TargetValue + { + private static final long serialVersionUID = 1L; + + public TargetValueImpl(Target value, PrimitiveValueType type) + { + super(value, type); + } + } + + public static class TargetValueTypeImpl extends PrimitiveValueTypeImpl + { + private static final long serialVersionUID = 1L; + + private TargetValueTypeImpl() + { + super(Target.class); + } + + @Override + public TypedValue createValue(Object value, Map valueInfo) + { + return new TargetValueImpl((Target) value, VALUE_TYPE); + } + } + + public static final PrimitiveValueType VALUE_TYPE = new TargetValueTypeImpl(); + + private TargetValues() + { + } + + public static TargetValue create(Target value) + { + return new TargetValueImpl(value, VALUE_TYPE); + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Targets.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Targets.java new file mode 100755 index 000000000..f29650dbb --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Targets.java @@ -0,0 +1,31 @@ +package org.highmed.dsf.fhir.variables; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Targets +{ + private final List entries = new ArrayList<>(); + + @JsonCreator + public Targets(@JsonProperty("entries") Collection targets) + { + if (targets != null) + this.entries.addAll(targets); + } + + public List getEntries() + { + return Collections.unmodifiableList(entries); + } + + public void removeTarget(Target target) + { + entries.remove(target); + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetsSerializer.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetsSerializer.java similarity index 53% rename from dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetsSerializer.java rename to dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetsSerializer.java index add2f433f..d4ebea721 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/MultiInstanceTargetsSerializer.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetsSerializer.java @@ -6,20 +6,19 @@ import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer; import org.camunda.bpm.engine.impl.variable.serializer.ValueFields; import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetsValues.MultiInstanceTargetsValue; +import org.highmed.dsf.fhir.variables.TargetsValues.TargetsValue; import org.springframework.beans.factory.InitializingBean; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -public class MultiInstanceTargetsSerializer extends PrimitiveValueSerializer - implements InitializingBean +public class TargetsSerializer extends PrimitiveValueSerializer implements InitializingBean { private final ObjectMapper objectMapper; - public MultiInstanceTargetsSerializer(ObjectMapper objectMapper) + public TargetsSerializer(ObjectMapper objectMapper) { - super(MultiInstanceTargetsValues.VALUE_TYPE); + super(TargetsValues.VALUE_TYPE); this.objectMapper = objectMapper; } @@ -31,9 +30,9 @@ public void afterPropertiesSet() throws Exception } @Override - public void writeValue(MultiInstanceTargetsValue value, ValueFields valueFields) + public void writeValue(TargetsValue value, ValueFields valueFields) { - MultiInstanceTargets targets = value.getValue(); + Targets targets = value.getValue(); try { if (targets != null) @@ -46,21 +45,22 @@ public void writeValue(MultiInstanceTargetsValue value, ValueFields valueFields) } @Override - public MultiInstanceTargetsValue convertToTypedValue(UntypedValueImpl untypedValue) + public TargetsValue convertToTypedValue(UntypedValueImpl untypedValue) { - return MultiInstanceTargetsValues.create((MultiInstanceTargets) untypedValue.getValue()); + return TargetsValues.create((Targets) untypedValue.getValue()); } @Override - public MultiInstanceTargetsValue readValue(ValueFields valueFields, boolean asTransientValue) + public TargetsValue readValue(ValueFields valueFields, boolean asTransientValue) { byte[] bytes = valueFields.getByteArrayValue(); try { - MultiInstanceTargets targets = (bytes == null || bytes.length <= 0) ? null - : objectMapper.readValue(bytes, MultiInstanceTargets.class); - return MultiInstanceTargetsValues.create(targets); + Targets targets = (bytes == null || bytes.length <= 0) ? + null : + objectMapper.readValue(bytes, Targets.class); + return TargetsValues.create(targets); } catch (IOException e) { diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetsValues.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetsValues.java new file mode 100755 index 000000000..0c23abf3d --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/TargetsValues.java @@ -0,0 +1,53 @@ +package org.highmed.dsf.fhir.variables; + +import java.util.Map; + +import org.camunda.bpm.engine.variable.impl.type.PrimitiveValueTypeImpl; +import org.camunda.bpm.engine.variable.impl.value.PrimitiveTypeValueImpl; +import org.camunda.bpm.engine.variable.type.PrimitiveValueType; +import org.camunda.bpm.engine.variable.value.PrimitiveValue; +import org.camunda.bpm.engine.variable.value.TypedValue; + +public final class TargetsValues +{ + public static interface TargetsValue extends PrimitiveValue + { + } + + private static class TargetsValueImpl extends PrimitiveTypeValueImpl implements TargetsValue + { + private static final long serialVersionUID = 1L; + + public TargetsValueImpl(Targets value, PrimitiveValueType type) + { + super(value, type); + } + } + + public static class TargetsValueTypeImpl extends PrimitiveValueTypeImpl + { + private static final long serialVersionUID = 1L; + + private TargetsValueTypeImpl() + { + super(Targets.class); + } + + @Override + public TypedValue createValue(Object value, Map valueInfo) + { + return new TargetsValueImpl((Targets) value, VALUE_TYPE); + } + } + + public static final PrimitiveValueType VALUE_TYPE = new TargetsValueTypeImpl(); + + private TargetsValues() + { + } + + public static TargetsValue create(Targets value) + { + return new TargetsValueImpl(value, VALUE_TYPE); + } +} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java index 86d20eb14..cf1bf6848 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java @@ -9,7 +9,7 @@ import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.MultiInstanceTargets; +import org.highmed.dsf.fhir.variables.Targets; import org.hl7.fhir.r4.model.Task; import ca.uhn.fhir.context.FhirContext; @@ -25,10 +25,9 @@ public SendTtpRequest(FhirWebserviceClientProvider clientProvider, TaskHelper ta @Override protected Stream getAdditionalInputParameters(DelegateExecution execution) { - MultiInstanceTargets multiInstanceTargets = (MultiInstanceTargets) execution - .getVariable(ConstantsBase.VARIABLE_MULTI_INSTANCE_TARGETS); + Targets multiInstanceTargets = (Targets) execution.getVariable(ConstantsBase.VARIABLE_TARGETS); - Stream inputTargets = multiInstanceTargets.getTargets().stream() + Stream inputTargets = multiInstanceTargets.getEntries().stream() .map(target -> getTaskHelper().createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY, target.getCorrelationKey())); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java index 27fb94f30..867e32572 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java @@ -19,10 +19,10 @@ import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.MultiInstanceTarget; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetValues; -import org.highmed.dsf.fhir.variables.MultiInstanceTargets; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetsValues; +import org.highmed.dsf.fhir.variables.Target; +import org.highmed.dsf.fhir.variables.TargetValues; +import org.highmed.dsf.fhir.variables.Targets; +import org.highmed.dsf.fhir.variables.TargetsValues; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResearchStudy; @@ -67,11 +67,9 @@ protected void doExecute(DelegateExecution execution) throws Exception ResearchStudy researchStudy = (ResearchStudy) execution .getVariable(ConstantsFeasibility.VARIABLE_RESEARCH_STUDY); - execution.setVariable(ConstantsBase.VARIABLE_MULTI_INSTANCE_TARGETS, - MultiInstanceTargetsValues.create(getMedicTargets(researchStudy))); + execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(getMedicTargets(researchStudy))); - execution.setVariable(ConstantsBase.VARIABLE_MULTI_INSTANCE_TARGET, - MultiInstanceTargetValues.create(getTtpTarget(researchStudy))); + execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues.create(getTtpTarget(researchStudy))); Boolean needsRecordLinkage = (Boolean) execution .getVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE); @@ -88,25 +86,20 @@ private BloomFilterConfig createBloomFilterConfig() hmacSha3Generator.generateKey()); } - private MultiInstanceTargets getMedicTargets(ResearchStudy researchStudy) + private Targets getMedicTargets(ResearchStudy researchStudy) { - List targets = researchStudy - .getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI).stream() - .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> new MultiInstanceTarget(r.getIdentifier().getValue(), UUID.randomUUID().toString())) + List targets = researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI) + .stream().filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) + .map(r -> Target.createMultiInstanceTarget(r.getIdentifier().getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); - return new MultiInstanceTargets(targets); + return new Targets(targets); } - private MultiInstanceTarget getTtpTarget(ResearchStudy researchStudy) + private Target getTtpTarget(ResearchStudy researchStudy) { - // correlation key is null because only one recipient and therefore message-name based correlation - // is sufficient --> see https://github.com/highmed/highmed-dsf/issues/144 - // TODO: replace MultiInstanceTarget with SingleInstanceTarget return researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI).stream() .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> new MultiInstanceTarget(r.getIdentifier().getValue(), null)) - .findFirst().get(); + .map(r -> Target.createSingleInstanceTarget(r.getIdentifier().getValue())).findFirst().get(); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java index 121890c3d..918a2d4bd 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java @@ -8,8 +8,8 @@ import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.MultiInstanceTarget; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetValues; +import org.highmed.dsf.fhir.variables.Target; +import org.highmed.dsf.fhir.variables.TargetValues; import org.hl7.fhir.r4.model.Task; import org.springframework.beans.factory.InitializingBean; @@ -38,12 +38,7 @@ protected void doExecute(DelegateExecution execution) throws Exception { Task task = getLeadingTaskFromExecutionVariables(); - // correlation key is null because only one recipient and therefore message-name based correlation - // is sufficient --> see https://github.com/highmed/highmed-dsf/issues/144 - // TODO: replace MultiInstanceTarget with SingleInstanceTarget - MultiInstanceTarget medicTarget = new MultiInstanceTarget(task.getRequester().getIdentifier().getValue(), - null); - execution.setVariable(ConstantsBase.VARIABLE_MULTI_INSTANCE_TARGET, - MultiInstanceTargetValues.create(medicTarget)); + Target medicTarget = Target.createSingleInstanceTarget(task.getRequester().getIdentifier().getValue()); + execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues.create(medicTarget)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java index 69e205f06..49ce2d921 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java @@ -8,8 +8,8 @@ import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.MultiInstanceTarget; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetValues; +import org.highmed.dsf.fhir.variables.Target; +import org.highmed.dsf.fhir.variables.TargetValues; import org.hl7.fhir.r4.model.Task; import org.springframework.beans.factory.InitializingBean; @@ -37,9 +37,8 @@ protected void doExecute(DelegateExecution execution) throws Exception String ttpIdentifier = (String) execution.getVariable(ConstantsBase.VARIABLE_TTP_IDENTIFIER); String correlationKey = getCorrelationKey(execution); - MultiInstanceTarget ttpTarget = new MultiInstanceTarget(ttpIdentifier, correlationKey); - execution - .setVariable(ConstantsBase.VARIABLE_MULTI_INSTANCE_TARGET, MultiInstanceTargetValues.create(ttpTarget)); + Target ttpTarget = Target.createMultiInstanceTarget(ttpIdentifier, correlationKey); + execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues.create(ttpTarget)); } private String getCorrelationKey(DelegateExecution execution) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java index 7684305fd..1b8fc52b2 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java @@ -11,9 +11,9 @@ import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.MultiInstanceTarget; -import org.highmed.dsf.fhir.variables.MultiInstanceTargets; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetsValues; +import org.highmed.dsf.fhir.variables.Target; +import org.highmed.dsf.fhir.variables.Targets; +import org.highmed.dsf.fhir.variables.TargetsValues; import org.hl7.fhir.r4.model.Task; public class StoreCorrelationKeys extends AbstractServiceDelegate @@ -28,13 +28,13 @@ protected void doExecute(DelegateExecution execution) throws Exception { Task task = getCurrentTaskFromExecutionVariables(); - List targets = getTaskHelper() + List targets = getTaskHelper() .getInputParameterStringValues(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY) - .map(correlationKey -> new MultiInstanceTarget("", correlationKey)).collect(Collectors.toList()); + .map(correlationKey -> Target.createMultiInstanceTarget("", correlationKey)) + .collect(Collectors.toList()); - execution.setVariable(ConstantsBase.VARIABLE_MULTI_INSTANCE_TARGETS, - MultiInstanceTargetsValues.create(new MultiInstanceTargets(targets))); + execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); execution.setVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn index dbe5546dd..e8e6a23e6 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn @@ -4,7 +4,7 @@ SequenceFlow_1lfe4wr SequenceFlow_0xxpamp - + SequenceFlow_0mj024w @@ -15,7 +15,7 @@ - ${multiInstanceTarget.correlationKey} + ${target.correlationKey} SequenceFlow_0qjt33w @@ -126,6 +126,23 @@ + + + + + + + + + + + + + + + + + @@ -170,41 +187,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -244,6 +226,12 @@ + + + + + + @@ -256,15 +244,27 @@ + + + - - + + + + + + + + + + + diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn index dde69d917..c94787741 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn @@ -20,7 +20,7 @@ SequenceFlow_035oihl Flow_0c15t3c - + diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java index 749a62a79..ac898f3d2 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java @@ -6,13 +6,14 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.MultiInstanceTarget; -import org.highmed.dsf.fhir.variables.MultiInstanceTargets; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetsValues; +import org.highmed.dsf.fhir.variables.Target; +import org.highmed.dsf.fhir.variables.Targets; +import org.highmed.dsf.fhir.variables.TargetsValues; import org.springframework.beans.factory.InitializingBean; public class SelectPingTargets extends AbstractServiceDelegate implements InitializingBean @@ -37,11 +38,10 @@ public void afterPropertiesSet() throws Exception @Override public void doExecute(DelegateExecution execution) throws Exception { - List targets = organizationProvider.getRemoteIdentifiers().stream() - .map(identifier -> new MultiInstanceTarget(identifier.getValue(), UUID.randomUUID().toString())) + List targets = organizationProvider.getRemoteIdentifiers().stream().map(identifier -> Target + .createMultiInstanceTarget(identifier.getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); - execution.setVariable("multiInstanceTargets", - MultiInstanceTargetsValues.create(new MultiInstanceTargets(targets))); + execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); } } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java index 0be04b35e..6ad9d6486 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java @@ -5,8 +5,8 @@ import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.MultiInstanceTarget; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetValues; +import org.highmed.dsf.fhir.variables.Target; +import org.highmed.dsf.fhir.variables.TargetValues; import org.hl7.fhir.r4.model.Identifier; import org.hl7.fhir.r4.model.Task; import org.springframework.beans.factory.InitializingBean; @@ -23,11 +23,12 @@ public void doExecute(DelegateExecution execution) throws Exception { Task task = getCurrentTaskFromExecutionVariables(); - String correlationKey = getTaskHelper().getFirstInputParameterStringValue(task, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN, ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).get(); + String correlationKey = getTaskHelper() + .getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).get(); Identifier targetOrganizationIdentifier = task.getRequester().getIdentifier(); - execution.setVariable(ConstantsBase.VARIABLE_MULTI_INSTANCE_TARGET, MultiInstanceTargetValues - .create(new MultiInstanceTarget(targetOrganizationIdentifier.getValue(), correlationKey))); + execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues + .create(Target.createMultiInstanceTarget(targetOrganizationIdentifier.getValue(), correlationKey))); } } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn index 4a234e34d..d1221c89c 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn @@ -1,5 +1,5 @@ - + @@ -18,12 +18,12 @@ SequenceFlow_05ia6lz SequenceFlow_1vng5zz - + SequenceFlow_1vng5zz SequenceFlow_10d3jfk - + SequenceFlow_1jv4kfm @@ -39,7 +39,7 @@ - ${multiInstanceTarget.correlationKey} + ${target.correlationKey} SequenceFlow_1jv4kfm diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java index b444eca16..e7b535c3b 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java @@ -12,9 +12,9 @@ import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.MultiInstanceTarget; -import org.highmed.dsf.fhir.variables.MultiInstanceTargets; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetsValues; +import org.highmed.dsf.fhir.variables.Target; +import org.highmed.dsf.fhir.variables.Targets; +import org.highmed.dsf.fhir.variables.TargetsValues; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Task; import org.slf4j.Logger; @@ -75,14 +75,10 @@ else if (!BUNDLE_ID_PATTERN.matcher(references.get(0).getReference()).matches()) ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER) .collect(Collectors.toList()); - // correlation key is null because no backwards communication is needed - // --> see https://github.com/highmed/highmed-dsf/issues/144 - // TODO: replace MultiInstanceTarget with SingleInstanceTarget - List targets = targetIdentifierSearchParameters.stream() + List targets = targetIdentifierSearchParameters.stream() .flatMap(organizationProvider::searchRemoteOrganizationsIdentifiers) - .map(identifier -> new MultiInstanceTarget(identifier.getValue(), null)) + .map(identifier -> Target.createSingleInstanceTarget(identifier.getValue())) .collect(Collectors.toList()); - execution.setVariable("multiInstanceTargets", - MultiInstanceTargetsValues.create(new MultiInstanceTargets(targets))); + execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn index de3b17b66..68222fc84 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn @@ -1,5 +1,5 @@ - + @@ -18,7 +18,7 @@ SequenceFlow_1u4zxix SequenceFlow_1xwki6k - + SequenceFlow_1ryplwc @@ -32,21 +32,21 @@ - - - + + + + + + + - - - - diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/SerializerConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/SerializerConfig.java index 7aa4d4cd3..723f37461 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/SerializerConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/SerializerConfig.java @@ -4,8 +4,8 @@ import org.highmed.dsf.fhir.variables.FhirResourceJacksonSerializer; import org.highmed.dsf.fhir.variables.FhirResourceSerializer; import org.highmed.dsf.fhir.variables.FhirResourcesListSerializer; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetSerializer; -import org.highmed.dsf.fhir.variables.MultiInstanceTargetsSerializer; +import org.highmed.dsf.fhir.variables.TargetSerializer; +import org.highmed.dsf.fhir.variables.TargetsSerializer; import org.highmed.openehr.json.OpenEhrObjectMapperFactory; import org.hl7.fhir.r4.model.Resource; import org.springframework.beans.factory.annotation.Autowired; @@ -55,14 +55,14 @@ public FhirResourcesListSerializer fhirResourcesListSerializer() } @Bean - public MultiInstanceTargetSerializer multiInstanceTargetSerializer() + public TargetSerializer targetSerializer() { - return new MultiInstanceTargetSerializer(objectMapper()); + return new TargetSerializer(objectMapper()); } @Bean - public MultiInstanceTargetsSerializer multiInstanceTargetsSerializer() + public TargetsSerializer targetsSerializer() { - return new MultiInstanceTargetsSerializer(objectMapper()); + return new TargetsSerializer(objectMapper()); } } From 17ee9bf45fe5b752f1547f2359d0b29d04b3d791 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Sun, 15 Nov 2020 20:13:35 +0100 Subject: [PATCH 07/75] adds workflow to publish packages to github --- .../workflows/{maven.yml => maven-build.yml} | 2 +- .github/workflows/maven-publish.yml | 29 +++++++++++++++++++ pom.xml | 15 ++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) rename .github/workflows/{maven.yml => maven-build.yml} (93%) create mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven-build.yml similarity index 93% rename from .github/workflows/maven.yml rename to .github/workflows/maven-build.yml index bda9fed7c..53d26ee9f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven-build.yml @@ -1,7 +1,7 @@ # This workflow will build a Java project with Maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -name: Java CI with Maven +name: Java CI Build with Maven on: [push, pull_request] diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 000000000..e3e77d439 --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,29 @@ +# This workflow will publish a Java project with Maven +# For more information see: https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-java-packages-with-maven + +name: Java CI Publish with Maven + +on: + pull_request: + types: [closed] + branches: [master, develop] + +jobs: + publish: + + # Only run if pull requests are merged, + # omit running if pull requests are closed without merging + if: github.event.pull_request.merged + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Publish with Maven + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: mvn -B deploy --file pom.xml \ No newline at end of file diff --git a/pom.xml b/pom.xml index 68019d4c2..cc7d242e2 100755 --- a/pom.xml +++ b/pom.xml @@ -466,6 +466,21 @@ + + + + github + GitHub Packages + https://maven.pkg.github.com/highmed/highmed-dsf + + + github + GitHub Packages + https://maven.pkg.github.com/highmed/highmed-dsf + + + sonatype-snapshot From 22a42cd071eba6ddc85fe07c034b085dc7db9808 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 17 Nov 2020 15:55:22 +0100 Subject: [PATCH 08/75] moving processes to bpe folders --- .../src/main/resources/{ => bpe}/computeSimpleFeasibility.bpmn | 0 .../src/main/resources/{ => bpe}/executeSimpleFeasibility.bpmn | 0 .../src/main/resources/{ => bpe}/requestSimpleFeasibility.bpmn | 0 .../src/main/resources/{ => bpe}/localServicesIntegration.bpmn | 0 .../dsf-bpe-process-ping/src/main/resources/{ => bpe}/ping.bpmn | 0 .../dsf-bpe-process-ping/src/main/resources/{ => bpe}/pong.bpmn | 0 .../src/main/resources/{ => bpe}/parent.bpmn | 0 .../fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml | 0 .../StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post | 0 .../src/main/resources/{ => bpe}/downloadAllowList.bpmn | 0 .../src/main/resources/{ => bpe}/updateAllowList.bpmn | 0 .../src/main/resources/{ => bpe}/executeUpdateResources.bpmn | 0 .../src/main/resources/{ => bpe}/requestUpdateResources.bpmn | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/{ => bpe}/computeSimpleFeasibility.bpmn (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/{ => bpe}/executeSimpleFeasibility.bpmn (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/{ => bpe}/requestSimpleFeasibility.bpmn (100%) rename dsf-bpe/dsf-bpe-process-local-services/src/main/resources/{ => bpe}/localServicesIntegration.bpmn (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/{ => bpe}/ping.bpmn (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/{ => bpe}/pong.bpmn (100%) rename dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/{ => bpe}/parent.bpmn (100%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent}/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml (100%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent}/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/{ => bpe}/downloadAllowList.bpmn (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/{ => bpe}/updateAllowList.bpmn (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/{ => bpe}/executeUpdateResources.bpmn (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/{ => bpe}/requestUpdateResources.bpmn (100%) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/executeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeSimpleFeasibility.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/executeSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeSimpleFeasibility.bpmn diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/localServicesIntegration.bpmn b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-local-services/src/main/resources/localServicesIntegration.bpmn rename to dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/pong.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/pong.bpmn rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/parent.bpmn b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/parent.bpmn rename to dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post rename to dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/downloadAllowList.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/downloadAllowList.bpmn rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/updateAllowList.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/updateAllowList.bpmn rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/executeUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/executeUpdateResources.bpmn rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn From b97ed15e380c631eef039072d12f509ce330b98a Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 17 Nov 2020 16:00:22 +0100 Subject: [PATCH 09/75] UTF-8 encoding fix --- .../java/org/highmed/dsf/tools/generator/BundleGenerator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dsf-tools/dsf-tools-bundle-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java b/dsf-tools/dsf-tools-bundle-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java index ea2238b9c..e177ab767 100755 --- a/dsf-tools/dsf-tools-bundle-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java +++ b/dsf-tools/dsf-tools-bundle-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java @@ -4,6 +4,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; import java.nio.file.FileVisitor; import java.nio.file.Files; import java.nio.file.Path; @@ -114,7 +115,7 @@ public Bundle generateBundle() throws IOException private void saveBundle(Bundle bundle) throws IOException { try (OutputStream out = Files.newOutputStream(getBundleFilename()); - OutputStreamWriter writer = new OutputStreamWriter(out)) + OutputStreamWriter writer = new OutputStreamWriter(out, StandardCharsets.UTF_8)) { newXmlParser().encodeResourceToWriter(bundle, writer); } From aeb46c4aad11e491a8d1eb95273a9254222e99a4 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 17 Nov 2020 16:03:10 +0100 Subject: [PATCH 10/75] java util logging via slf4j config --- dsf-bpe/dsf-bpe-server-jetty/pom.xml | 5 +++++ .../src/main/java/org/highmed/dsf/bpe/BpeServer.java | 7 +++++++ dsf-fhir/dsf-fhir-server-jetty/pom.xml | 5 +++++ .../src/main/java/org/highmed/dsf/fhir/FhirServer.java | 7 +++++++ 4 files changed, 24 insertions(+) diff --git a/dsf-bpe/dsf-bpe-server-jetty/pom.xml b/dsf-bpe/dsf-bpe-server-jetty/pom.xml index ac31b5f95..35dc2779f 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/pom.xml +++ b/dsf-bpe/dsf-bpe-server-jetty/pom.xml @@ -42,6 +42,11 @@ javax.mail mail + + + org.slf4j + jul-to-slf4j +
diff --git a/dsf-bpe/dsf-bpe-server-jetty/src/main/java/org/highmed/dsf/bpe/BpeServer.java b/dsf-bpe/dsf-bpe-server-jetty/src/main/java/org/highmed/dsf/bpe/BpeServer.java index eb6f4c396..6cbd598da 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/src/main/java/org/highmed/dsf/bpe/BpeServer.java +++ b/dsf-bpe/dsf-bpe-server-jetty/src/main/java/org/highmed/dsf/bpe/BpeServer.java @@ -30,6 +30,7 @@ import org.eclipse.jetty.server.handler.ErrorHandler; import org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer; import org.highmed.dsf.tools.db.DbMigrator; +import org.slf4j.bridge.SLF4JBridgeHandler; import org.springframework.web.SpringServletContainerInitializer; import org.springframework.web.filter.CorsFilter; @@ -38,6 +39,12 @@ public final class BpeServer { + static + { + SLF4JBridgeHandler.removeHandlersForRootLogger(); + SLF4JBridgeHandler.install(); + } + public static void startHttpServer() { startServer(JettyServer::forwardedSecureRequestCustomizer, JettyServer::httpConnector); diff --git a/dsf-fhir/dsf-fhir-server-jetty/pom.xml b/dsf-fhir/dsf-fhir-server-jetty/pom.xml index 56845acb1..546893d1f 100755 --- a/dsf-fhir/dsf-fhir-server-jetty/pom.xml +++ b/dsf-fhir/dsf-fhir-server-jetty/pom.xml @@ -47,6 +47,11 @@ javax.mail mail + + + org.slf4j + jul-to-slf4j +
diff --git a/dsf-fhir/dsf-fhir-server-jetty/src/main/java/org/highmed/dsf/fhir/FhirServer.java b/dsf-fhir/dsf-fhir-server-jetty/src/main/java/org/highmed/dsf/fhir/FhirServer.java index fbaa5ac58..344aad92d 100755 --- a/dsf-fhir/dsf-fhir-server-jetty/src/main/java/org/highmed/dsf/fhir/FhirServer.java +++ b/dsf-fhir/dsf-fhir-server-jetty/src/main/java/org/highmed/dsf/fhir/FhirServer.java @@ -34,6 +34,7 @@ import org.highmed.dsf.fhir.authentication.AuthenticationFilter; import org.highmed.dsf.fhir.cors.CorsFilter; import org.highmed.dsf.tools.db.DbMigrator; +import org.slf4j.bridge.SLF4JBridgeHandler; import org.springframework.web.SpringServletContainerInitializer; import de.rwh.utils.jetty.JettyServer; @@ -41,6 +42,12 @@ public final class FhirServer { + static + { + SLF4JBridgeHandler.removeHandlersForRootLogger(); + SLF4JBridgeHandler.install(); + } + public static void startHttpServer() { startServer(JettyServer::forwardedSecureRequestCustomizer, JettyServer::httpConnector); From f165510628bbd50bd17db8bbb2508be7e51c0ab7 Mon Sep 17 00:00:00 2001 From: Hauke Hund Date: Tue, 17 Nov 2020 16:06:52 +0100 Subject: [PATCH 11/75] moving process specific fhir resources to process modules FHIR Metadata resource state (DRAFT, ACTIVE, RETIRED) will be managed by BPE. Status property in Resources will be overridden if necessary. --- .../fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml | 2 +- .../fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml | 2 +- .../fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml | 2 +- .../src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml | 2 +- .../src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml | 2 +- .../main/resources/fhir/NamingSystem/highmed-research-study.xml | 2 +- .../StructureDefinition/highmed-extension-group-id-0.3.0.xml | 2 +- .../highmed-extension-participating-medic-0.3.0.xml | 2 +- .../highmed-extension-participating-ttp-0.3.0.xml | 2 +- .../fhir/StructureDefinition/highmed-extension-query-0.3.0.xml | 2 +- .../resources/fhir/StructureDefinition/highmed-group-0.3.0.xml | 2 +- .../highmed-research-study-feasibility-0.3.0.xml | 2 +- .../highmed-task-compute-simple-feasibility-0.3.0.xml | 2 +- .../highmed-task-error-simple-feasibility-0.3.0.xml | 2 +- .../highmed-task-execute-simple-feasibility-0.3.0.xml | 2 +- ...highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml | 2 +- .../highmed-task-request-simple-feasibility-0.3.0.xml | 2 +- ...ighmed-task-single-medic-result-simple-feasibility-0.3.0.xml | 2 +- .../src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml | 2 +- .../src/main/resources/fhir/ValueSet/query-type-0.3.0.xml | 2 +- .../fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml | 2 +- .../highmed-task-local-services-integration-0.3.0.xml | 2 +- .../src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml | 0 .../src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml | 0 .../fhir/StructureDefinition/highmed-task-ping-0.3.0.xml | 0 .../fhir/StructureDefinition/highmed-task-pong-0.3.0.xml | 0 .../highmed-task-start-ping-process-0.3.0.xml | 0 .../fhir/ActivityDefinition/downloadAllowList-0.3.0.xml | 2 +- .../resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml | 2 +- .../main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml | 2 +- .../highmed-task-download-allow-list-0.3.0.xml | 2 +- .../highmed-task-update-allow-list-0.3.0.xml | 2 +- .../main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml | 2 +- .../fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml | 2 +- .../fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml | 2 +- .../main/resources/fhir/CodeSystem/update-resources-0.3.0.xml | 2 +- .../highmed-task-execute-update-resources-0.3.0.xml | 2 +- .../highmed-task-request-update-resources-0.3.0.xml | 2 +- .../src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml | 2 +- .../ActivityDefinition/computeSimpleFeasibility-0.3.0.xml.post | 1 - .../fhir/ActivityDefinition/downloadAllowList-0.3.0.xml.post | 1 - .../ActivityDefinition/executeSimpleFeasibility-0.3.0.xml.post | 1 - .../ActivityDefinition/executeUpdateResources-0.3.0.xml.post | 1 - .../ActivityDefinition/localServicesIntegration-0.3.0.xml.post | 1 - .../main/resources/fhir/ActivityDefinition/ping-0.3.0.xml.post | 1 - .../main/resources/fhir/ActivityDefinition/pong-0.3.0.xml.post | 1 - .../ActivityDefinition/requestSimpleFeasibility-0.3.0.xml.post | 1 - .../ActivityDefinition/requestUpdateResources-0.3.0.xml.post | 1 - .../fhir/ActivityDefinition/updateAllowList-0.3.0.xml.post | 1 - .../main/resources/fhir/CodeSystem/feasibility-0.3.0.xml.post | 1 - .../main/resources/fhir/CodeSystem/query-type-0.3.0.xml.post | 1 - .../resources/fhir/CodeSystem/update-allow-list-0.3.0.xml.post | 1 - .../resources/fhir/CodeSystem/update-resources-0.3.0.xml.post | 1 - .../resources/fhir/NamingSystem/highmed-research-study.xml.post | 1 - .../highmed-extension-group-id-0.3.0.xml.post | 1 - .../highmed-extension-participating-medic-0.3.0.xml.post | 1 - .../highmed-extension-participating-ttp-0.3.0.xml.post | 1 - .../StructureDefinition/highmed-extension-query-0.3.0.xml.post | 1 - .../fhir/StructureDefinition/highmed-group-0.3.0.xml.post | 1 - .../highmed-research-study-feasibility-0.3.0.xml.post | 1 - .../highmed-task-compute-simple-feasibility-0.3.0.xml.post | 1 - .../highmed-task-download-allow-list-0.3.0.xml.post | 1 - .../highmed-task-error-simple-feasibility-0.3.0.xml.post | 1 - .../highmed-task-execute-simple-feasibility-0.3.0.xml.post | 1 - .../highmed-task-execute-update-resources-0.3.0.xml.post | 1 - .../highmed-task-local-services-integration-0.3.0.xml.post | 1 - ...ed-task-multi-medic-result-simple-feasibility-0.3.0.xml.post | 1 - .../fhir/StructureDefinition/highmed-task-ping-0.3.0.xml.post | 1 - .../fhir/StructureDefinition/highmed-task-pong-0.3.0.xml.post | 1 - .../highmed-task-request-simple-feasibility-0.3.0.xml.post | 1 - .../highmed-task-request-update-resources-0.3.0.xml.post | 1 - ...d-task-single-medic-result-simple-feasibility-0.3.0.xml.post | 1 - .../highmed-task-start-ping-process-0.3.0.xml.post | 1 - .../highmed-task-update-allow-list-0.3.0.xml.post | 1 - .../src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml.post | 1 - .../src/main/resources/fhir/ValueSet/query-type-0.3.0.xml.post | 1 - .../resources/fhir/ValueSet/update-allow-list-0.3.0.xml.post | 1 - .../resources/fhir/ValueSet/update-resources-0.3.0.xml.post | 1 - 78 files changed, 34 insertions(+), 73 deletions(-) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml (96%) mode change 100755 => 100644 rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/NamingSystem/highmed-research-study.xml (95%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml (98%) mode change 100755 => 100644 rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml (97%) mode change 100755 => 100644 rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml (97%) mode change 100755 => 100644 rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml (98%) mode change 100755 => 100644 rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml (95%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-feasibility}/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml (96%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-local-services}/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-local-services}/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-ping}/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml (100%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-ping}/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml (100%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-ping}/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml (100%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-ping}/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml (100%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-ping}/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml (100%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-allow-list}/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-allow-list}/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-allow-list}/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml (96%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-allow-list}/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-allow-list}/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-allow-list}/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml (95%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-resources}/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-resources}/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml (98%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-resources}/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml (97%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-resources}/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-resources}/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml (99%) rename {dsf-fhir/dsf-fhir-server => dsf-bpe/dsf-bpe-process-update-resources}/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml (95%) delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml.post delete mode 100755 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-research-study.xml.post delete mode 100755 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml.post delete mode 100755 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml.post delete mode 100755 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml.post delete mode 100755 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml.post delete mode 100755 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml.post delete mode 100755 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml.post delete mode 100644 dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml index a98ebc1d7..3aba9912a 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml @@ -74,7 +74,7 @@ <subtitle value="Process to compute simple feasibility result" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <publisher value="HiGHmed" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml index e27387322..85eec099f 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml @@ -48,7 +48,7 @@ <name value="ExecuteSimpleFeasibility" /> <title value="Execute a Simple Feasibility" /> <subtitle value="Process to execute a simple feasibility query" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <publisher value="HiGHmed" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml index fc3b9fcb0..842b0f5ad 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml @@ -106,7 +106,7 @@ <name value="RequestSimpleFeasibility" /> <title value="Request simple feasibility" /> <subtitle value="Feasibility Request Process" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <publisher value="HiGHmed" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml index 78576320c..bf62c1894 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml @@ -9,7 +9,7 @@ <version value="0.3.0"/> <name value="HiGHmed_Feasibility"/> <title value="HiGHmed Feasibility"/> - <status value="active"/> + <!-- status managed by bpe --> <experimental value="false"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml old mode 100755 new mode 100644 similarity index 96% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml index 5669fb762..9a1b7d038 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml @@ -9,7 +9,7 @@ <version value="0.3.0"/> <name value="HiGHmed_Query_Type"/> <title value="HiGHmed Query Type"/> - <status value="active"/> + <!-- status managed by bpe --> <experimental value="false"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-research-study.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study.xml similarity index 95% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-research-study.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study.xml index a3fd710ca..0fbf15032 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-research-study.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study.xml @@ -6,7 +6,7 @@ </tag> </meta> <name value="HiGHmed_ResearchStudy_Identifier"/> - <status value="active"/> + <!-- status managed by bpe --> <kind value="identifier"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml index 830949b24..a82e548fc 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/group-id" /> <version value="0.3.0" /> <name value="GroupId" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml old mode 100755 new mode 100644 similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml index b2c2681d1..ae64235e6 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/participating-medic" /> <version value="0.3.0" /> <name value="ParticipatingMedic" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml index ca14d109a..8fdbd05ff 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/participating-ttp" /> <version value="0.3.0" /> <name value="ParticipatingTtp" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml old mode 100755 new mode 100644 similarity index 97% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml index 998b67234..979dffc9a --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/query" /> <version value="0.3.0" /> <name value="Query" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml old mode 100755 new mode 100644 similarity index 97% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml index 88d382588..cbaa4bd0b --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-group" /> <version value="0.3.0" /> <name value="Group" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml old mode 100755 new mode 100644 similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml index 862dcc26a..094a8c092 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility" /> <version value="0.3.0" /> <name value="ResearchStudyFeasibility" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml index ce821228a..58d63f7c1 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility" /> <version value="0.3.0" /> <name value="TaskComputeSimpleFeasibility" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml index 47c1810ee..5a2360e85 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml @@ -9,7 +9,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-error-simple-feasibility" /> <version value="0.3.0" /> <name value="TaskErrorSimpleFeasibility" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml index 1ac7ea913..f32898878 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility" /> <version value="0.3.0" /> <name value="TaskExecuteSimpleFeasibility" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml index 0b3190a96..81c9cb9a1 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility" /> <version value="0.3.0" /> <name value="TaskMultiMedicResultSimpleFeasibility" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml index bb5c9020f..57343fc89 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility" /> <version value="0.3.0" /> <name value="TaskRequestSimpleFeasibility" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml index 9ff02ada7..4a265d667 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility" /> <version value="0.3.0" /> <name value="TaskSingleMedicResultSimpleFeasibility" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml similarity index 95% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml index 2172fc800..521b08a2e 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml @@ -9,7 +9,7 @@ <version value="0.3.0"/> <name value="HiGHmed_Feasibility"/> <title value="HiGHmed Feasibility"/> - <status value="active"/> + <!-- status managed by bpe --> <experimental value="false"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml similarity index 96% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml index 89888d4fc..3ac00d49f 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml @@ -9,7 +9,7 @@ <version value="0.3.0"/> <name value="HiGHmed_Query_Type"/> <title value="HiGHmed Query Type"/> - <status value="active"/> + <!-- status managed by bpe --> <experimental value="false"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml index 2d0ded527..9d327b4b3 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml @@ -43,7 +43,7 @@ <name value="LocalServicesIntegration"/> <title value="Local services integration"/> <subtitle value="Service integration process"/> - <status value="active"/> + <!-- status managed by bpe --> <experimental value="false"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml index 6d8a858d0..bbf062265 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml @@ -9,7 +9,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration" /> <version value="0.3.0" /> <name value="TaskLocalServicesIntegration" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml index ba798c189..3df2e8871 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml @@ -54,7 +54,7 @@ <name value="DownloadAllowList" /> <title value="Download Allow List" /> <subtitle value="Download Allow List Bundle Process" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <publisher value="HiGHmed" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml index 7c4da15dc..d2c3180a8 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml @@ -42,7 +42,7 @@ <name value="UpdateAllowList" /> <title value="Update Allow List" /> <subtitle value="Update Allow List Bundle Process" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <publisher value="HiGHmed" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml similarity index 96% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml index 7e9d7a34f..1a0e25176 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml @@ -9,7 +9,7 @@ <version value="0.3.0"/> <name value="HiGHmed_Update_Allow_List"/> <title value="HiGHmed Update Allow List"/> - <status value="active"/> + <!-- status managed by bpe --> <experimental value="false"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml index 79c7c3685..0cb093246 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml @@ -9,7 +9,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list" /> <version value="0.3.0" /> <name value="TaskDownloadAllowList" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml index 84a571059..db494a3f7 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list" /> <version value="0.3.0" /> <name value="TaskUpdateAllowList" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml similarity index 95% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml index a06fc5538..80ce22bb5 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml @@ -9,7 +9,7 @@ <version value="0.3.0"/> <name value="HiGHmed_Update_Allow_List"/> <title value="HiGHmed Update Allow List"/> - <status value="active"/> + <!-- status managed by bpe --> <experimental value="false"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml index a395b0320..d54f34476 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml @@ -48,7 +48,7 @@ <name value="ExecuteUpdateResources" /> <title value="Execute Update of Resources" /> <subtitle value="Process to Download and Execute FHIR Bundle" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <publisher value="HiGHmed" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml index 09b867836..ac74a115c 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml @@ -42,7 +42,7 @@ <name value="RequestUpdateResources" /> <title value="Request Update of Resources" /> <subtitle value="Process to Request a Bundle Download" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <publisher value="HiGHmed" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml similarity index 97% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml index 165fac5e2..43e75136a 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml @@ -9,7 +9,7 @@ <version value="0.3.0"/> <name value="HiGHmed_Update_Resources"/> <title value="HiGHmed Update Resources"/> - <status value="active"/> + <!-- status managed by bpe --> <experimental value="false"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml index 34bf0819b..b93a83c46 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources" /> <version value="0.3.0" /> <name value="TaskExecuteUpdateResources" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml similarity index 99% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml index 147d12396..e7c1c468f 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml @@ -8,7 +8,7 @@ <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources" /> <version value="0.3.0" /> <name value="TaskRequestUpdateResources" /> - <status value="active" /> + <!-- status managed by bpe --> <experimental value="false" /> <date value="2020-11-03" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml similarity index 95% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml index f3d57212e..e9367ef9b 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml @@ -9,7 +9,7 @@ <version value="0.3.0"/> <name value="HiGHmed_Update_Resources"/> <title value="HiGHmed Update Resources"/> - <status value="active"/> + <!-- status managed by bpe --> <experimental value="false"/> <date value="2020-11-03"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml.post deleted file mode 100644 index 9bd297972..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/computeSimpleFeasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml.post deleted file mode 100644 index caba3c4b6..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/downloadAllowList&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml.post deleted file mode 100644 index cbde64758..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/executeSimpleFeasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml.post deleted file mode 100644 index 5c305a5b5..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/executeUpdateResources&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml.post deleted file mode 100644 index 3f8f17054..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/localServicesIntegration&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml.post deleted file mode 100644 index 3fcf2e4b5..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/ping&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml.post deleted file mode 100644 index d6dffdaee..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/pong&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml.post deleted file mode 100644 index b3774ac0b..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/requestSimpleFeasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml.post deleted file mode 100644 index 70c1d533d..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/requestUpdateResources&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml.post deleted file mode 100644 index 95e360e6c..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/bpe/Process/updateAllowList&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml.post deleted file mode 100644 index 0d315e1ca..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/CodeSystem/feasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml.post deleted file mode 100755 index 49fe64f32..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/CodeSystem/query-type&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml.post deleted file mode 100644 index c97e1d1b4..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/CodeSystem/update-allow-list&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml.post deleted file mode 100644 index d2b5bd9ee..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/CodeSystem/update-resources&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-research-study.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-research-study.xml.post deleted file mode 100644 index a63f52dd4..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-research-study.xml.post +++ /dev/null @@ -1 +0,0 @@ -name=HiGHmed_ResearchStudy_Identifier \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml.post deleted file mode 100755 index bf2efdc1f..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/group-id&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml.post deleted file mode 100755 index faabb1411..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/participating-medic&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml.post deleted file mode 100644 index 5668bd011..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/participating-ttp&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml.post deleted file mode 100755 index 04cf724c3..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/query&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml.post deleted file mode 100755 index f83f8a9f0..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-group&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml.post deleted file mode 100755 index 4c6e908f9..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml.post deleted file mode 100644 index 57633ca67..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml.post deleted file mode 100644 index ec0d00b6c..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml.post deleted file mode 100644 index 53be2a946..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-error-simple-feasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml.post deleted file mode 100644 index 9b71d49a9..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml.post deleted file mode 100644 index 9cf59d1d0..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml.post deleted file mode 100644 index c746a8d27..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml.post deleted file mode 100644 index 4c0247389..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml.post deleted file mode 100644 index d266f2243..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-ping&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml.post deleted file mode 100644 index 14ff7b23e..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-pong&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml.post deleted file mode 100644 index 4a5a55177..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml.post deleted file mode 100644 index a1bca2940..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml.post deleted file mode 100644 index 959868261..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml.post deleted file mode 100644 index 384e64986..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml.post deleted file mode 100644 index 95e29475f..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml.post deleted file mode 100644 index 3984aa553..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/ValueSet/feasibility&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml.post deleted file mode 100755 index e25417496..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/ValueSet/query-type&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml.post deleted file mode 100644 index 50356b429..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/ValueSet/update-allow-list&version=0.3.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml.post b/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml.post deleted file mode 100644 index d5bbda127..000000000 --- a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/ValueSet/update-resources&version=0.3.0 \ No newline at end of file From cd91ab458f536501c362c8977c21df4149d00b32 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 17 Nov 2020 16:11:13 +0100 Subject: [PATCH 12/75] New NamingSystem status search parameter, :not modifier for token params Reworked token search parameters and added new AbstractStatusParameter. --- .../fhir/dao/jdbc/NamingSystemDaoJdbc.java | 3 +- .../parameters/ActivityDefinitionStatus.java | 101 +--------------- .../search/parameters/BinaryContentType.java | 9 +- .../search/parameters/BundleIdentifier.java | 12 +- .../search/parameters/CodeSystemStatus.java | 102 +--------------- .../search/parameters/EndpointStatus.java | 9 +- .../search/parameters/NamingSystemStatus.java | 15 +++ .../search/parameters/OrganizationType.java | 22 +++- .../parameters/StructureDefinitionStatus.java | 104 +--------------- .../parameters/SubscriptionPayload.java | 9 +- .../search/parameters/SubscriptionStatus.java | 9 +- .../search/parameters/SubscriptionType.java | 9 +- .../fhir/search/parameters/TaskStatus.java | 9 +- .../search/parameters/ValueSetStatus.java | 101 +--------------- .../basic/AbstractIdentifierParameter.java | 16 ++- .../basic/AbstractStatusParameter.java | 114 ++++++++++++++++++ .../basic/AbstractTokenParameter.java | 30 ++++- .../basic/AbstractVersionParameter.java | 7 +- .../basic/TokenValueAndSearchType.java | 22 +++- .../impl/ConformanceServiceImpl.java | 3 +- 20 files changed, 264 insertions(+), 442 deletions(-) create mode 100644 dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/NamingSystemStatus.java create mode 100644 dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractStatusParameter.java diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/NamingSystemDaoJdbc.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/NamingSystemDaoJdbc.java index 014042e70..c3fa88580 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/NamingSystemDaoJdbc.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/NamingSystemDaoJdbc.java @@ -11,6 +11,7 @@ import org.highmed.dsf.fhir.dao.NamingSystemDao; import org.highmed.dsf.fhir.search.parameters.NamingSystemName; +import org.highmed.dsf.fhir.search.parameters.NamingSystemStatus; import org.highmed.dsf.fhir.search.parameters.user.NamingSystemUserFilter; import org.hl7.fhir.r4.model.NamingSystem; import org.slf4j.Logger; @@ -25,7 +26,7 @@ public class NamingSystemDaoJdbc extends AbstractResourceDaoJdbc<NamingSystem> i public NamingSystemDaoJdbc(DataSource dataSource, FhirContext fhirContext) { super(dataSource, fhirContext, NamingSystem.class, "naming_systems", "naming_system", "naming_system_id", - NamingSystemUserFilter::new, with(NamingSystemName::new), with()); + NamingSystemUserFilter::new, with(NamingSystemName::new, NamingSystemStatus::new), with()); } @Override diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/ActivityDefinitionStatus.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/ActivityDefinitionStatus.java index f44d84aef..76dcd7ec3 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/ActivityDefinitionStatus.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/ActivityDefinitionStatus.java @@ -1,110 +1,15 @@ package org.highmed.dsf.fhir.search.parameters; -import java.sql.Array; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import javax.ws.rs.core.UriBuilder; - -import org.highmed.dsf.fhir.function.BiFunctionWithSqlException; import org.highmed.dsf.fhir.search.SearchQueryParameter.SearchParameterDefinition; -import org.highmed.dsf.fhir.search.SearchQueryParameterError; -import org.highmed.dsf.fhir.search.SearchQueryParameterError.SearchQueryParameterErrorType; -import org.highmed.dsf.fhir.search.parameters.basic.AbstractTokenParameter; -import org.highmed.dsf.fhir.search.parameters.basic.TokenSearchType; -import org.hl7.fhir.exceptions.FHIRException; +import org.highmed.dsf.fhir.search.parameters.basic.AbstractStatusParameter; import org.hl7.fhir.r4.model.ActivityDefinition; -import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; import org.hl7.fhir.r4.model.Enumerations.SearchParamType; -import org.hl7.fhir.r4.model.Resource; @SearchParameterDefinition(name = ActivityDefinitionStatus.PARAMETER_NAME, definition = "http://hl7.org/fhir/SearchParameter/ActivityDefinition-status", type = SearchParamType.TOKEN, documentation = "The current status of the activity definition") -public class ActivityDefinitionStatus extends AbstractTokenParameter<ActivityDefinition> +public class ActivityDefinitionStatus extends AbstractStatusParameter<ActivityDefinition> { - public static final String PARAMETER_NAME = "status"; - - private PublicationStatus status; - public ActivityDefinitionStatus() { - super(PARAMETER_NAME); - } - - @Override - protected void configureSearchParameter(Map<String, List<String>> queryParameters) - { - super.configureSearchParameter(queryParameters); - - if (valueAndType != null && valueAndType.type == TokenSearchType.CODE) - status = toStatus(valueAndType.codeValue, queryParameters.get(parameterName)); - } - - private PublicationStatus toStatus(String status, List<String> parameterValues) - { - if (status == null || status.isBlank()) - return null; - - try - { - return PublicationStatus.fromCode(status); - } - catch (FHIRException e) - { - addError(new SearchQueryParameterError(SearchQueryParameterErrorType.UNPARSABLE_VALUE, parameterName, - parameterValues, e)); - return null; - } - } - - @Override - public boolean isDefined() - { - return super.isDefined() && status != null; - } - - @Override - public String getFilterQuery() - { - return "activity_definition->>'status' = ?"; - } - - @Override - public int getSqlParameterCount() - { - return 1; - } - - @Override - public void modifyStatement(int parameterIndex, int subqueryParameterIndex, PreparedStatement statement, - BiFunctionWithSqlException<String, Object[], Array> arrayCreator) throws SQLException - { - statement.setString(parameterIndex, status.toCode()); - } - - @Override - public void modifyBundleUri(UriBuilder bundleUri) - { - bundleUri.replaceQueryParam(PARAMETER_NAME, status.toCode()); - } - - @Override - public boolean matches(Resource resource) - { - if (!isDefined()) - throw notDefined(); - - if (!(resource instanceof ActivityDefinition)) - return false; - - return Objects.equals(((ActivityDefinition) resource).getStatus(), status); - } - - @Override - protected String getSortSql(String sortDirectionWithSpacePrefix) - { - return "activity_definition->>'status'" + sortDirectionWithSpacePrefix; + super("activity_definition", ActivityDefinition.class); } } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BinaryContentType.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BinaryContentType.java index 1d09bb501..9e751163b 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BinaryContentType.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BinaryContentType.java @@ -55,7 +55,7 @@ public boolean isDefined() @Override public String getFilterQuery() { - return "binary_json->>'contentType' = ?"; + return "binary_json->>'contentType' " + (valueAndType.negated ? "<>" : "=") + " ?"; } @Override @@ -74,7 +74,7 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep @Override public void modifyBundleUri(UriBuilder bundleUri) { - bundleUri.replaceQueryParam(PARAMETER_NAME, contentType.getValue()); + bundleUri.replaceQueryParam(PARAMETER_NAME + (valueAndType.negated ? ":not" : ""), contentType.getValue()); } @Override @@ -86,7 +86,10 @@ public boolean matches(Resource resource) if (!(resource instanceof Binary)) return false; - return ((Binary) resource).getContentType().equals(contentType.getValue()); + if (valueAndType.negated) + return !((Binary) resource).getContentType().equals(contentType.getValue()); + else + return ((Binary) resource).getContentType().equals(contentType.getValue()); } @Override diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BundleIdentifier.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BundleIdentifier.java index e35d46fe5..aea46994f 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BundleIdentifier.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BundleIdentifier.java @@ -31,9 +31,12 @@ public String getFilterQuery() case CODE: case CODE_AND_SYSTEM: case SYSTEM: - return "bundle->'identifier' = ?::jsonb"; + return "bundle->'identifier' " + (valueAndType.negated ? "<>" : "=") + " ?"; case CODE_AND_NO_SYSTEM_PROPERTY: - return "bundle->'identifier'->>'value' = ? AND NOT (bundle->'identifier' ?? 'system')"; + if (valueAndType.negated) + return "bundle->'identifier'->>'value' <> ? OR (bundle->'identifier' ?? 'system')"; + else + return "bundle->'identifier'->>'value' = ? AND NOT (bundle->'identifier' ?? 'system')"; default: return ""; } @@ -69,7 +72,10 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep private boolean identifierMatches(Identifier identifier) { - return AbstractIdentifierParameter.identifierMatches(valueAndType, identifier); + if (valueAndType.negated) + return !AbstractIdentifierParameter.identifierMatches(valueAndType, identifier); + else + return AbstractIdentifierParameter.identifierMatches(valueAndType, identifier); } @Override diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/CodeSystemStatus.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/CodeSystemStatus.java index c04618d9d..22815081d 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/CodeSystemStatus.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/CodeSystemStatus.java @@ -1,111 +1,15 @@ package org.highmed.dsf.fhir.search.parameters; -import java.sql.Array; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import javax.ws.rs.core.UriBuilder; - -import org.highmed.dsf.fhir.function.BiFunctionWithSqlException; import org.highmed.dsf.fhir.search.SearchQueryParameter.SearchParameterDefinition; -import org.highmed.dsf.fhir.search.SearchQueryParameterError; -import org.highmed.dsf.fhir.search.SearchQueryParameterError.SearchQueryParameterErrorType; -import org.highmed.dsf.fhir.search.parameters.basic.AbstractTokenParameter; -import org.highmed.dsf.fhir.search.parameters.basic.TokenSearchType; -import org.hl7.fhir.exceptions.FHIRException; +import org.highmed.dsf.fhir.search.parameters.basic.AbstractStatusParameter; import org.hl7.fhir.r4.model.CodeSystem; -import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; import org.hl7.fhir.r4.model.Enumerations.SearchParamType; -import org.hl7.fhir.r4.model.Resource; -import org.hl7.fhir.r4.model.ValueSet; @SearchParameterDefinition(name = CodeSystemStatus.PARAMETER_NAME, definition = "http://hl7.org/fhir/SearchParameter/CodeSystem-status", type = SearchParamType.TOKEN, documentation = "The current status of the code system") -public class CodeSystemStatus extends AbstractTokenParameter<CodeSystem> +public class CodeSystemStatus extends AbstractStatusParameter<CodeSystem> { - public static final String PARAMETER_NAME = "status"; - - private PublicationStatus status; - public CodeSystemStatus() { - super(PARAMETER_NAME); - } - - @Override - protected void configureSearchParameter(Map<String, List<String>> queryParameters) - { - super.configureSearchParameter(queryParameters); - - if (valueAndType != null && valueAndType.type == TokenSearchType.CODE) - status = toStatus(valueAndType.codeValue, queryParameters.get(parameterName)); - } - - private PublicationStatus toStatus(String status, List<String> parameterValues) - { - if (status == null || status.isBlank()) - return null; - - try - { - return PublicationStatus.fromCode(status); - } - catch (FHIRException e) - { - addError(new SearchQueryParameterError(SearchQueryParameterErrorType.UNPARSABLE_VALUE, parameterName, - parameterValues, e)); - return null; - } - } - - @Override - public boolean isDefined() - { - return super.isDefined() && status != null; - } - - @Override - public String getFilterQuery() - { - return "code_system->>'status' = ?"; - } - - @Override - public int getSqlParameterCount() - { - return 1; - } - - @Override - public void modifyStatement(int parameterIndex, int subqueryParameterIndex, PreparedStatement statement, - BiFunctionWithSqlException<String, Object[], Array> arrayCreator) throws SQLException - { - statement.setString(parameterIndex, status.toCode()); - } - - @Override - public void modifyBundleUri(UriBuilder bundleUri) - { - bundleUri.replaceQueryParam(PARAMETER_NAME, status.toCode()); - } - - @Override - public boolean matches(Resource resource) - { - if (!isDefined()) - throw notDefined(); - - if (!(resource instanceof ValueSet)) - return false; - - return Objects.equals(((ValueSet) resource).getStatus(), status); - } - - @Override - protected String getSortSql(String sortDirectionWithSpacePrefix) - { - return "code_system->>'status'" + sortDirectionWithSpacePrefix; + super("code_system", CodeSystem.class); } } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/EndpointStatus.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/EndpointStatus.java index 4138c325b..d77aa4e9e 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/EndpointStatus.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/EndpointStatus.java @@ -67,7 +67,7 @@ public boolean isDefined() @Override public String getFilterQuery() { - return "endpoint->>'status' = ?"; + return "endpoint->>'status' " + (valueAndType.negated ? "<>" : "=") + " ?"; } @Override @@ -86,7 +86,7 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep @Override public void modifyBundleUri(UriBuilder bundleUri) { - bundleUri.replaceQueryParam(PARAMETER_NAME, status.toCode()); + bundleUri.replaceQueryParam(PARAMETER_NAME + (valueAndType.negated ? ":not" : ""), status.toCode()); } @Override @@ -98,7 +98,10 @@ public boolean matches(Resource resource) if (!(resource instanceof Endpoint)) return false; - return Objects.equals(((Endpoint) resource).getStatus(), status); + if (valueAndType.negated) + return !Objects.equals(((Endpoint) resource).getStatus(), status); + else + return Objects.equals(((Endpoint) resource).getStatus(), status); } @Override diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/NamingSystemStatus.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/NamingSystemStatus.java new file mode 100644 index 000000000..203084afa --- /dev/null +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/NamingSystemStatus.java @@ -0,0 +1,15 @@ +package org.highmed.dsf.fhir.search.parameters; + +import org.highmed.dsf.fhir.search.SearchQueryParameter.SearchParameterDefinition; +import org.highmed.dsf.fhir.search.parameters.basic.AbstractStatusParameter; +import org.hl7.fhir.r4.model.Enumerations.SearchParamType; +import org.hl7.fhir.r4.model.NamingSystem; + +@SearchParameterDefinition(name = NamingSystemStatus.PARAMETER_NAME, definition = "http://hl7.org/fhir/SearchParameter/NamingSystem-status", type = SearchParamType.TOKEN, documentation = "The current status of the naming system") +public class NamingSystemStatus extends AbstractStatusParameter<NamingSystem> +{ + public NamingSystemStatus() + { + super("naming_system", NamingSystem.class); + } +} diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/OrganizationType.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/OrganizationType.java index e049bd1ab..de2a54320 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/OrganizationType.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/OrganizationType.java @@ -36,12 +36,21 @@ public String getFilterQuery() case CODE: case CODE_AND_SYSTEM: case SYSTEM: - return "(SELECT jsonb_agg(coding) FROM jsonb_array_elements(" + RESOURCE_COLUMN - + "->'type') AS type, jsonb_array_elements(type->'coding') AS coding) @> ?::jsonb"; + if (valueAndType.negated) + return "NOT ((SELECT jsonb_agg(coding) FROM jsonb_array_elements(" + RESOURCE_COLUMN + + "->'type') AS type, jsonb_array_elements(type->'coding') AS coding) @> ?::jsonb)"; + else + return "(SELECT jsonb_agg(coding) FROM jsonb_array_elements(" + RESOURCE_COLUMN + + "->'type') AS type, jsonb_array_elements(type->'coding') AS coding) @> ?::jsonb"; case CODE_AND_NO_SYSTEM_PROPERTY: - return "(SELECT COUNT(*) FROM jsonb_array_elements(" + RESOURCE_COLUMN - + "->'type') AS type, jsonb_array_elements(type->'coding') AS coding " - + "WHERE coding->>'code' = ? AND NOT (coding ?? 'system')) > 0"; + if (valueAndType.negated) + return "(SELECT COUNT(*) FROM jsonb_array_elements(" + RESOURCE_COLUMN + + "->'type') AS type, jsonb_array_elements(type->'coding') AS coding " + + "WHERE coding->>'code' <> ? OR (coding ?? 'system')) > 0"; + else + return "(SELECT COUNT(*) FROM jsonb_array_elements(" + RESOURCE_COLUMN + + "->'type') AS type, jsonb_array_elements(type->'coding') AS coding " + + "WHERE coding->>'code' = ? AND NOT (coding ?? 'system')) > 0"; default: return ""; } @@ -77,7 +86,8 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep protected boolean codingMatches(List<Identifier> identifiers) { - return identifiers.stream().anyMatch(i -> codingMatches(valueAndType, i)); + return identifiers.stream() + .anyMatch(i -> valueAndType.negated ? !codingMatches(valueAndType, i) : codingMatches(valueAndType, i)); } public static boolean codingMatches(TokenValueAndSearchType valueAndType, Identifier identifier) diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/StructureDefinitionStatus.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/StructureDefinitionStatus.java index 26492ed7f..5bdc04df6 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/StructureDefinitionStatus.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/StructureDefinitionStatus.java @@ -1,35 +1,14 @@ package org.highmed.dsf.fhir.search.parameters; -import java.sql.Array; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import javax.ws.rs.core.UriBuilder; - -import org.highmed.dsf.fhir.function.BiFunctionWithSqlException; import org.highmed.dsf.fhir.search.SearchQueryParameter.SearchParameterDefinition; -import org.highmed.dsf.fhir.search.SearchQueryParameterError; -import org.highmed.dsf.fhir.search.SearchQueryParameterError.SearchQueryParameterErrorType; -import org.highmed.dsf.fhir.search.parameters.basic.AbstractTokenParameter; -import org.highmed.dsf.fhir.search.parameters.basic.TokenSearchType; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; +import org.highmed.dsf.fhir.search.parameters.basic.AbstractStatusParameter; import org.hl7.fhir.r4.model.Enumerations.SearchParamType; -import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.StructureDefinition; @SearchParameterDefinition(name = StructureDefinitionStatus.PARAMETER_NAME, definition = "http://hl7.org/fhir/SearchParameter/StructureDefinition-status", type = SearchParamType.TOKEN, documentation = "The current status of the structure definition") -public class StructureDefinitionStatus extends AbstractTokenParameter<StructureDefinition> +public class StructureDefinitionStatus extends AbstractStatusParameter<StructureDefinition> { public static final String RESOURCE_COLUMN = "structure_definition"; - public static final String PARAMETER_NAME = "status"; - - private final String resourceColumn; - - private PublicationStatus status; public StructureDefinitionStatus() { @@ -38,83 +17,6 @@ public StructureDefinitionStatus() public StructureDefinitionStatus(String resourceColumn) { - super(PARAMETER_NAME); - - this.resourceColumn = resourceColumn; - } - - @Override - protected void configureSearchParameter(Map<String, List<String>> queryParameters) - { - super.configureSearchParameter(queryParameters); - - if (valueAndType != null && valueAndType.type == TokenSearchType.CODE) - status = toStatus(valueAndType.codeValue, queryParameters.get(parameterName)); - } - - private PublicationStatus toStatus(String status, List<String> parameterValues) - { - if (status == null || status.isBlank()) - return null; - - try - { - return PublicationStatus.fromCode(status); - } - catch (FHIRException e) - { - addError(new SearchQueryParameterError(SearchQueryParameterErrorType.UNPARSABLE_VALUE, parameterName, - parameterValues, e)); - return null; - } - } - - @Override - public boolean isDefined() - { - return super.isDefined() && status != null; - } - - @Override - public String getFilterQuery() - { - return resourceColumn + "->>'status' = ?"; - } - - @Override - public int getSqlParameterCount() - { - return 1; - } - - @Override - public void modifyStatement(int parameterIndex, int subqueryParameterIndex, PreparedStatement statement, - BiFunctionWithSqlException<String, Object[], Array> arrayCreator) throws SQLException - { - statement.setString(parameterIndex, status.toCode()); - } - - @Override - public void modifyBundleUri(UriBuilder bundleUri) - { - bundleUri.replaceQueryParam(PARAMETER_NAME, status.toCode()); - } - - @Override - public boolean matches(Resource resource) - { - if (!isDefined()) - throw notDefined(); - - if (!(resource instanceof StructureDefinition)) - return false; - - return Objects.equals(((StructureDefinition) resource).getStatus(), status); - } - - @Override - protected String getSortSql(String sortDirectionWithSpacePrefix) - { - return resourceColumn + "->>'status'" + sortDirectionWithSpacePrefix; + super(resourceColumn, StructureDefinition.class); } } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionPayload.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionPayload.java index 341bf2252..8df2e6d8c 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionPayload.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionPayload.java @@ -47,7 +47,7 @@ public boolean isDefined() @Override public String getFilterQuery() { - return "subscription->'channel'->>'payload' = ?"; + return "subscription->'channel'->>'payload' " + (valueAndType.negated ? "<>" : "=") + " ?"; } @Override @@ -66,7 +66,7 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep @Override public void modifyBundleUri(UriBuilder bundleUri) { - bundleUri.replaceQueryParam(PARAMETER_NAME, payloadMimeType); + bundleUri.replaceQueryParam(PARAMETER_NAME + (valueAndType.negated ? ":not" : ""), payloadMimeType); } @Override @@ -78,7 +78,10 @@ public boolean matches(Resource resource) if (!(resource instanceof Subscription)) return false; - return Objects.equals(((Subscription) resource).getChannel().getPayload(), payloadMimeType); + if (valueAndType.negated) + return !Objects.equals(((Subscription) resource).getChannel().getPayload(), payloadMimeType); + else + return Objects.equals(((Subscription) resource).getChannel().getPayload(), payloadMimeType); } @Override diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionStatus.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionStatus.java index df7d60cf5..a7e37107c 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionStatus.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionStatus.java @@ -63,7 +63,7 @@ public boolean isDefined() @Override public String getFilterQuery() { - return "subscription->>'status' = ?"; + return "subscription->>'status' " + (valueAndType.negated ? "<>" : "=") + " ?"; } @Override @@ -82,7 +82,7 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep @Override public void modifyBundleUri(UriBuilder bundleUri) { - bundleUri.replaceQueryParam(PARAMETER_NAME, status.toCode()); + bundleUri.replaceQueryParam(PARAMETER_NAME + (valueAndType.negated ? ":not" : ""), status.toCode()); } @Override @@ -94,7 +94,10 @@ public boolean matches(Resource resource) if (!(resource instanceof Subscription)) return false; - return Objects.equals(((Subscription) resource).getStatus(), status); + if (valueAndType.negated) + return !Objects.equals(((Subscription) resource).getStatus(), status); + else + return Objects.equals(((Subscription) resource).getStatus(), status); } @Override diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionType.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionType.java index 406d2f15f..88aa740e7 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionType.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/SubscriptionType.java @@ -63,7 +63,7 @@ public boolean isDefined() @Override public String getFilterQuery() { - return "subscription->'channel'->>'type' = ?"; + return "subscription->'channel'->>'type' " + (valueAndType.negated ? "<>" : "=") + " ?"; } @Override @@ -82,7 +82,7 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep @Override public void modifyBundleUri(UriBuilder bundleUri) { - bundleUri.replaceQueryParam(PARAMETER_NAME, channelType.toCode()); + bundleUri.replaceQueryParam(PARAMETER_NAME + (valueAndType.negated ? ":not" : ""), channelType.toCode()); } @Override @@ -94,7 +94,10 @@ public boolean matches(Resource resource) if (!(resource instanceof Subscription)) return false; - return Objects.equals(((Subscription) resource).getChannel().getType(), channelType); + if (valueAndType.negated) + return !Objects.equals(((Subscription) resource).getChannel().getType(), channelType); + else + return Objects.equals(((Subscription) resource).getChannel().getType(), channelType); } @Override diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/TaskStatus.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/TaskStatus.java index 69aa51abd..40640266f 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/TaskStatus.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/TaskStatus.java @@ -67,7 +67,7 @@ public boolean isDefined() @Override public String getFilterQuery() { - return "task->>'status' = ?"; + return "task->>'status' " + (valueAndType.negated ? "<>" : "=") + " ?"; } @Override @@ -86,7 +86,7 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep @Override public void modifyBundleUri(UriBuilder bundleUri) { - bundleUri.replaceQueryParam(PARAMETER_NAME, status.toCode()); + bundleUri.replaceQueryParam(PARAMETER_NAME + (valueAndType.negated ? ":not" : ""), status.toCode()); } @Override @@ -98,7 +98,10 @@ public boolean matches(Resource resource) if (!(resource instanceof Task)) return false; - return Objects.equals(((Task) resource).getStatus(), status); + if (valueAndType.negated) + return !Objects.equals(((Task) resource).getStatus(), status); + else + return Objects.equals(((Task) resource).getStatus(), status); } @Override diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/ValueSetStatus.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/ValueSetStatus.java index 1c5e25250..973d283c2 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/ValueSetStatus.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/ValueSetStatus.java @@ -1,110 +1,15 @@ package org.highmed.dsf.fhir.search.parameters; -import java.sql.Array; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import javax.ws.rs.core.UriBuilder; - -import org.highmed.dsf.fhir.function.BiFunctionWithSqlException; import org.highmed.dsf.fhir.search.SearchQueryParameter.SearchParameterDefinition; -import org.highmed.dsf.fhir.search.SearchQueryParameterError; -import org.highmed.dsf.fhir.search.SearchQueryParameterError.SearchQueryParameterErrorType; -import org.highmed.dsf.fhir.search.parameters.basic.AbstractTokenParameter; -import org.highmed.dsf.fhir.search.parameters.basic.TokenSearchType; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; +import org.highmed.dsf.fhir.search.parameters.basic.AbstractStatusParameter; import org.hl7.fhir.r4.model.Enumerations.SearchParamType; -import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ValueSet; @SearchParameterDefinition(name = ValueSetStatus.PARAMETER_NAME, definition = "http://hl7.org/fhir/SearchParameter/ValueSet-status", type = SearchParamType.TOKEN, documentation = "The current status of the value set") -public class ValueSetStatus extends AbstractTokenParameter<ValueSet> +public class ValueSetStatus extends AbstractStatusParameter<ValueSet> { - public static final String PARAMETER_NAME = "status"; - - private PublicationStatus status; - public ValueSetStatus() { - super(PARAMETER_NAME); - } - - @Override - protected void configureSearchParameter(Map<String, List<String>> queryParameters) - { - super.configureSearchParameter(queryParameters); - - if (valueAndType != null && valueAndType.type == TokenSearchType.CODE) - status = toStatus(valueAndType.codeValue, queryParameters.get(parameterName)); - } - - private PublicationStatus toStatus(String status, List<String> parameterValues) - { - if (status == null || status.isBlank()) - return null; - - try - { - return PublicationStatus.fromCode(status); - } - catch (FHIRException e) - { - addError(new SearchQueryParameterError(SearchQueryParameterErrorType.UNPARSABLE_VALUE, parameterName, - parameterValues, e)); - return null; - } - } - - @Override - public boolean isDefined() - { - return super.isDefined() && status != null; - } - - @Override - public String getFilterQuery() - { - return "value_set->>'status' = ?"; - } - - @Override - public int getSqlParameterCount() - { - return 1; - } - - @Override - public void modifyStatement(int parameterIndex, int subqueryParameterIndex, PreparedStatement statement, - BiFunctionWithSqlException<String, Object[], Array> arrayCreator) throws SQLException - { - statement.setString(parameterIndex, status.toCode()); - } - - @Override - public void modifyBundleUri(UriBuilder bundleUri) - { - bundleUri.replaceQueryParam(PARAMETER_NAME, status.toCode()); - } - - @Override - public boolean matches(Resource resource) - { - if (!isDefined()) - throw notDefined(); - - if (!(resource instanceof ValueSet)) - return false; - - return Objects.equals(((ValueSet) resource).getStatus(), status); - } - - @Override - protected String getSortSql(String sortDirectionWithSpacePrefix) - { - return "value_set->>'status'" + sortDirectionWithSpacePrefix; + super("value_set", ValueSet.class); } } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractIdentifierParameter.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractIdentifierParameter.java index d6f3eef5f..3373c15c4 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractIdentifierParameter.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractIdentifierParameter.java @@ -31,10 +31,17 @@ public String getFilterQuery() case CODE: case CODE_AND_SYSTEM: case SYSTEM: - return resourceColumn + "->'identifier' @> ?::jsonb"; + if (valueAndType.negated) + return "NOT (" + resourceColumn + "->'identifier' @> ?::jsonb)"; + else + return resourceColumn + "->'identifier' @> ?::jsonb"; case CODE_AND_NO_SYSTEM_PROPERTY: - return "(SELECT count(*) FROM jsonb_array_elements(" + resourceColumn - + "->'identifier') identifier WHERE identifier->>'value' = ? AND NOT (identifier ?? 'system')) > 0"; + if (valueAndType.negated) + return "(SELECT count(*) FROM jsonb_array_elements(" + resourceColumn + + "->'identifier') identifier WHERE identifier->>'value' <> ? OR (identifier ?? 'system')) > 0"; + else + return "(SELECT count(*) FROM jsonb_array_elements(" + resourceColumn + + "->'identifier') identifier WHERE identifier->>'value' = ? AND NOT (identifier ?? 'system')) > 0"; default: return ""; } @@ -70,7 +77,8 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep protected boolean identifierMatches(List<Identifier> identifiers) { - return identifiers.stream().anyMatch(i -> identifierMatches(valueAndType, i)); + return identifiers.stream().anyMatch( + i -> valueAndType.negated ? !identifierMatches(valueAndType, i) : identifierMatches(valueAndType, i)); } public static boolean identifierMatches(TokenValueAndSearchType valueAndType, Identifier identifier) diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractStatusParameter.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractStatusParameter.java new file mode 100644 index 000000000..9d3a48c2c --- /dev/null +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractStatusParameter.java @@ -0,0 +1,114 @@ +package org.highmed.dsf.fhir.search.parameters.basic; + +import java.sql.Array; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import javax.ws.rs.core.UriBuilder; + +import org.highmed.dsf.fhir.function.BiFunctionWithSqlException; +import org.highmed.dsf.fhir.search.SearchQueryParameterError; +import org.highmed.dsf.fhir.search.SearchQueryParameterError.SearchQueryParameterErrorType; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; +import org.hl7.fhir.r4.model.MetadataResource; +import org.hl7.fhir.r4.model.Resource; + +public class AbstractStatusParameter<R extends MetadataResource> extends AbstractTokenParameter<R> +{ + public static final String PARAMETER_NAME = "status"; + + private final String resourceColumn; + private final Class<R> resourceType; + + private PublicationStatus status; + + public AbstractStatusParameter(String resourceColumn, Class<R> resourceType) + { + super(PARAMETER_NAME); + + this.resourceColumn = resourceColumn; + this.resourceType = resourceType; + } + + @Override + protected void configureSearchParameter(Map<String, List<String>> queryParameters) + { + super.configureSearchParameter(queryParameters); + + if (valueAndType != null && valueAndType.type == TokenSearchType.CODE) + status = toStatus(valueAndType.codeValue, queryParameters.get(parameterName)); + } + + private PublicationStatus toStatus(String status, List<String> parameterValues) + { + if (status == null || status.isBlank()) + return null; + + try + { + return PublicationStatus.fromCode(status); + } + catch (FHIRException e) + { + addError(new SearchQueryParameterError(SearchQueryParameterErrorType.UNPARSABLE_VALUE, parameterName, + parameterValues, e)); + return null; + } + } + + @Override + public boolean isDefined() + { + return super.isDefined() && status != null; + } + + @Override + public String getFilterQuery() + { + return resourceColumn + "->>'status' " + (valueAndType.negated ? "<>" : "=") + " ?"; + } + + @Override + public int getSqlParameterCount() + { + return 1; + } + + @Override + public void modifyStatement(int parameterIndex, int subqueryParameterIndex, PreparedStatement statement, + BiFunctionWithSqlException<String, Object[], Array> arrayCreator) throws SQLException + { + statement.setString(parameterIndex, status.toCode()); + } + + @Override + public void modifyBundleUri(UriBuilder bundleUri) + { + bundleUri.replaceQueryParam(PARAMETER_NAME + (valueAndType.negated ? ":not" : ""), status.toCode()); + } + + @Override + public boolean matches(Resource resource) + { + if (!isDefined()) + throw notDefined(); + + if (!resourceType.isInstance(resource)) + return false; + + if (valueAndType.negated) + return !Objects.equals(((MetadataResource) resource).getStatus(), status); + else + return Objects.equals(((MetadataResource) resource).getStatus(), status); + } + + @Override + protected String getSortSql(String sortDirectionWithSpacePrefix) + { + return resourceColumn + "->>'status'" + sortDirectionWithSpacePrefix; + } +} diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractTokenParameter.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractTokenParameter.java index 1760d9332..0ce531c11 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractTokenParameter.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractTokenParameter.java @@ -1,7 +1,9 @@ package org.highmed.dsf.fhir.search.parameters.basic; +import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.stream.Stream; import javax.ws.rs.core.UriBuilder; @@ -18,13 +20,23 @@ public AbstractTokenParameter(String parameterName) super(parameterName); } + @Override + protected Stream<String> getModifiedParameterNames() + { + return Stream.of(parameterName + TokenValueAndSearchType.NOT); + } + @Override protected void configureSearchParameter(Map<String, List<String>> queryParameters) { valueAndType = TokenValueAndSearchType.fromParamValue(parameterName, queryParameters, this::addError) .orElse(null); - if (queryParameters.get(parameterName) != null && queryParameters.get(parameterName).size() > 1) + if ((queryParameters.get(parameterName) != null + || queryParameters.get(parameterName + TokenValueAndSearchType.NOT) != null) + && ((queryParameters.getOrDefault(parameterName, Collections.emptyList())).size() + + (queryParameters.getOrDefault(parameterName + TokenValueAndSearchType.NOT, + Collections.emptyList())).size()) > 1) addError(new SearchQueryParameterError(SearchQueryParameterErrorType.UNSUPPORTED_NUMBER_OF_VALUES, parameterName, queryParameters.get(parameterName))); } @@ -41,19 +53,27 @@ public void modifyBundleUri(UriBuilder bundleUri) switch (valueAndType.type) { case CODE: - bundleUri.replaceQueryParam(parameterName, valueAndType.codeValue); + bundleUri.replaceQueryParam( + valueAndType.negated ? parameterName + TokenValueAndSearchType.NOT : parameterName, + valueAndType.codeValue); break; case CODE_AND_SYSTEM: - bundleUri.replaceQueryParam(parameterName, valueAndType.systemValue + "|" + valueAndType.codeValue); + bundleUri.replaceQueryParam( + valueAndType.negated ? parameterName + TokenValueAndSearchType.NOT : parameterName, + valueAndType.systemValue + "|" + valueAndType.codeValue); break; case CODE_AND_NO_SYSTEM_PROPERTY: - bundleUri.replaceQueryParam(parameterName, "|" + valueAndType.codeValue); + bundleUri.replaceQueryParam( + valueAndType.negated ? parameterName + TokenValueAndSearchType.NOT : parameterName, + "|" + valueAndType.codeValue); break; case SYSTEM: - bundleUri.replaceQueryParam(parameterName, valueAndType.systemValue + "|"); + bundleUri.replaceQueryParam( + valueAndType.negated ? parameterName + TokenValueAndSearchType.NOT : parameterName, + valueAndType.systemValue + "|"); break; } } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractVersionParameter.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractVersionParameter.java index 60e1fbcb1..0dbe4cbcc 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractVersionParameter.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/AbstractVersionParameter.java @@ -49,7 +49,7 @@ public boolean isDefined() @Override public String getFilterQuery() { - return resourceColumn + "->>'version' = ?"; + return resourceColumn + "->>'version' " + (valueAndType.negated ? "<>" : "=") + " ?"; } @Override @@ -78,7 +78,10 @@ public boolean matches(Resource resource) MetadataResource mRes = (MetadataResource) resource; - return Objects.equals(mRes.getVersion(), version); + if (valueAndType.negated) + return !Objects.equals(mRes.getVersion(), version); + else + return Objects.equals(mRes.getVersion(), version); } @Override diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/TokenValueAndSearchType.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/TokenValueAndSearchType.java index e9a311f35..5ef2dc639 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/TokenValueAndSearchType.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/basic/TokenValueAndSearchType.java @@ -9,15 +9,19 @@ public class TokenValueAndSearchType { + static final String NOT = ":not"; + public final String systemValue; public final String codeValue; public final TokenSearchType type; + public final boolean negated; - private TokenValueAndSearchType(String systemValue, String codeValue, TokenSearchType type) + private TokenValueAndSearchType(String systemValue, String codeValue, TokenSearchType type, boolean negated) { this.systemValue = systemValue; this.codeValue = codeValue; this.type = type; + this.negated = negated; } public static Optional<TokenValueAndSearchType> fromParamValue(String parameterName, @@ -26,22 +30,28 @@ public static Optional<TokenValueAndSearchType> fromParamValue(String parameterN String param = null; if (queryParameters.containsKey(parameterName) && !queryParameters.get(parameterName).isEmpty()) param = queryParameters.get(parameterName).get(0); + else if (queryParameters.containsKey(parameterName + NOT) + && !queryParameters.get(parameterName + NOT).isEmpty()) + param = queryParameters.get(parameterName + NOT).get(0); if (param != null && !param.isBlank()) { + boolean negated = queryParameters.containsKey(parameterName + NOT) + && !queryParameters.get(parameterName + NOT).isEmpty(); + if (param.indexOf('|') == -1) - return Optional.of(new TokenValueAndSearchType(null, param, TokenSearchType.CODE)); + return Optional.of(new TokenValueAndSearchType(null, param, TokenSearchType.CODE, negated)); else if (param.charAt(0) == '|') return Optional.of(new TokenValueAndSearchType(null, param.substring(1), - TokenSearchType.CODE_AND_NO_SYSTEM_PROPERTY)); + TokenSearchType.CODE_AND_NO_SYSTEM_PROPERTY, negated)); else if (param.charAt(param.length() - 1) == '|') return Optional.of(new TokenValueAndSearchType(param.substring(0, param.length() - 1), null, - TokenSearchType.SYSTEM)); + TokenSearchType.SYSTEM, negated)); else { String[] splitAtPipe = param.split("[|]"); - return Optional.of( - new TokenValueAndSearchType(splitAtPipe[0], splitAtPipe[1], TokenSearchType.CODE_AND_SYSTEM)); + return Optional.of(new TokenValueAndSearchType(splitAtPipe[0], splitAtPipe[1], + TokenSearchType.CODE_AND_SYSTEM, negated)); } } else diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ConformanceServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ConformanceServiceImpl.java index 3bd99714f..9d1272d52 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ConformanceServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ConformanceServiceImpl.java @@ -38,6 +38,7 @@ import org.highmed.dsf.fhir.search.parameters.HealthcareServiceIdentifier; import org.highmed.dsf.fhir.search.parameters.LocationIdentifier; import org.highmed.dsf.fhir.search.parameters.NamingSystemName; +import org.highmed.dsf.fhir.search.parameters.NamingSystemStatus; import org.highmed.dsf.fhir.search.parameters.OrganizationActive; import org.highmed.dsf.fhir.search.parameters.OrganizationEndpoint; import org.highmed.dsf.fhir.search.parameters.OrganizationIdentifier; @@ -295,7 +296,7 @@ private CapabilityStatement createCapabilityStatement() searchParameters.put(Location.class, Arrays.asList(LocationIdentifier.class)); - searchParameters.put(NamingSystem.class, Arrays.asList(NamingSystemName.class)); + searchParameters.put(NamingSystem.class, Arrays.asList(NamingSystemName.class, NamingSystemStatus.class)); searchParameters.put(Organization.class, Arrays.asList(OrganizationActive.class, OrganizationEndpoint.class, OrganizationIdentifier.class, OrganizationName.class, OrganizationType.class)); From 120af96c2f08d244c7385fe313ffd4343fbfed05 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 17 Nov 2020 16:21:36 +0100 Subject: [PATCH 13/75] fhir resource and process sate management Process state are tracked by the BPE and stored in the DB. FHIR resources are created/updated or deleted accordingly. Process state can be: NEW -> Found in jars, not deployed yet ACTIVE -> Found in jars, not excluded by property, not retired by property, not draft by -SNAPSHOT.jar as end of jar name or -SNAPSHOT as end of folder name RETIRED -> Found in jars, retired by property DRAFT -> Found in jars, jar name ends with -SNAPSHOT.jar or folder name ends with -SNAPSHOT EXCLUDED -> Not found in jars (aka jar deleted or jar renamed to e.g. ...jar.off), or excluded by property FHIR resources for processes with status DRAFT will be updated in FHIR server on every restart. FHIR resources for processes with status ACTIVE will only be updated if the status changes to ACTIVE but not on restart without status change. A status change to EXCLUDED will result in deletions of resources that are not needed by other processes. --- .../highmed/dsf/ProcessPluginDefinition.java | 20 + .../dsf/fhir/resources/AbstractResource.java | 61 +++ .../resources/ActivityDefinitionResource.java | 28 ++ .../fhir/resources/CodeSystemResource.java | 27 ++ .../fhir/resources/NamingSystemResource.java | 28 ++ .../dsf/fhir/resources/ResourceProvider.java | 109 +++++ .../fhir/resources/ResourceProviderImpl.java | 290 +++++++++++ .../StructureDefinitionResource.java | 28 ++ .../dsf/fhir/resources/ValueSetResource.java | 27 ++ .../FeasibilityProcessPluginDefinition.java | 68 ++- .../LocalServicesProcessPluginDefinition.java | 46 +- .../dsf/bpe/PingProcessPluginDefinition.java | 34 +- .../dsf/bpe/ChildProcessPluginDefinition.java | 6 + .../bpe/ParentProcessPluginDefinition.java | 26 + .../highmed-task-parent-plugin-0.3.0.xml.post | 1 - .../bpe/UpdateAllowListPluginDefinition.java | 37 +- .../bpe/UpdateResourcesPluginDefinition.java | 38 +- .../conf/config.properties | 10 +- ...iVersionClassDelegateActivityBehavior.java | 22 +- .../highmed/dsf/bpe/dao/AbstractDaoJdbc.java | 22 + .../bpe/dao/ProcessPluginResourcesDao.java | 19 + .../dao/ProcessPluginResourcesDaoJdbc.java | 208 ++++++++ .../highmed/dsf/bpe/dao/ProcessStateDao.java | 14 + .../dsf/bpe/dao/ProcessStateDaoJdbc.java | 76 +++ .../dsf/bpe/delegate/DelegateProvider.java | 13 +- .../bpe/delegate/DelegateProviderImpl.java | 30 +- .../highmed/dsf/bpe/plugin/ProcessPlugin.java | 10 +- ...ProcessPluginDefinitionAndClassLoader.java | 65 ++- .../dsf/bpe/plugin/ProcessPluginProvider.java | 18 +- .../bpe/plugin/ProcessPluginProviderImpl.java | 64 ++- .../dsf/bpe/process/BpmnFileAndModel.java | 39 ++ .../dsf/bpe/process/ProcessKeyAndVersion.java | 106 ++++ .../highmed/dsf/bpe/process/ProcessState.java | 18 + .../process/ProcessStateChangeOutcome.java | 39 ++ .../dsf/bpe/process/ProcessesResource.java | 148 ++++++ .../highmed/dsf/bpe/process/ResourceInfo.java | 160 ++++++ .../BpmnProcessStateChangeService.java | 13 +- .../BpmnProcessStateChangeServiceImpl.java | 174 +++++-- ...nServiceDelegateValidationServiceImpl.java | 27 +- .../dsf/bpe/service/FhirResourceHandler.java | 15 + .../bpe/service/FhirResourceHandlerImpl.java | 458 ++++++++++++++++++ .../dsf/bpe/spring/config/CamundaConfig.java | 21 +- .../dsf/bpe/spring/config/DaoConfig.java | 51 ++ .../config/PostProcessDeployConfig.java | 43 +- .../src/main/resources/db/db.changelog.xml | 3 + ...ocess_plugin_resources.changelog-0.4.0.xml | 34 ++ .../db/db.process_states.changelog-0.4.0.xml | 27 ++ 47 files changed, 2683 insertions(+), 138 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/AbstractResource.java create mode 100644 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ActivityDefinitionResource.java create mode 100644 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/CodeSystemResource.java create mode 100644 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/NamingSystemResource.java create mode 100644 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProvider.java create mode 100644 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java create mode 100644 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/StructureDefinitionResource.java create mode 100644 dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ValueSetResource.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/AbstractDaoJdbc.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDao.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDaoJdbc.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessStateDao.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessStateDaoJdbc.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/BpmnFileAndModel.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessKeyAndVersion.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessState.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessStateChangeOutcome.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessesResource.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ResourceInfo.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandler.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/DaoConfig.java create mode 100644 dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_plugin_resources.changelog-0.4.0.xml create mode 100644 dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_states.changelog-0.4.0.xml diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java index 6d3e03991..defb744c9 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java @@ -6,9 +6,12 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; +import org.highmed.dsf.fhir.resources.ResourceProvider; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import ca.uhn.fhir.context.FhirContext; + /** * A provider configuration file named "org.highmed.dsf.DsfProcessPluginDefinition" containing the canonical name of the * class implementing this interface needs to be part of the process plugin at "/META-INF/services/". For more details @@ -19,6 +22,11 @@ */ public interface ProcessPluginDefinition { + /** + * @return jar name used by other processes when defining dependencies + */ + String getJarName(); + /** * Return <code>Stream.of("foo.bpmn");</code> for a foo.bpmn file located in the root folder of the process plugin * jar. The returned files will be read via {@link ClassLoader#getResourceAsStream(String)}. @@ -34,6 +42,18 @@ public interface ProcessPluginDefinition */ Stream<Class<?>> getSpringConfigClasses(); + /** + * @param fhirContext + * the applications fhir context, never <code>null</code> + * @param classLoader + * the classLoader that was used to initialize the process plugin, never <code>null</code> + * @return {@link ResourceProvider} with FHIR resources needed to enable the included processes + */ + default ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + { + return ResourceProvider.empty(); + } + /** * @return dependencies to other processes by jar name (excluding '.jar'). The system will add ".jar" and * "-SNAPSHOT.jar" while searching for jars diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/AbstractResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/AbstractResource.java new file mode 100644 index 000000000..69290e948 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/AbstractResource.java @@ -0,0 +1,61 @@ +package org.highmed.dsf.fhir.resources; + +import org.hl7.fhir.r4.model.MetadataResource; + +public abstract class AbstractResource +{ + private final Class<? extends MetadataResource> type; + + private final String dependecyJarName; + private final String url; + private final String version; + private final String name; + + private final String fileName; + + AbstractResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, String version, + String name, String fileName) + { + this.type = type; + this.dependecyJarName = dependecyJarName; + this.url = url; + this.version = version; + this.name = name; + this.fileName = fileName; + } + + public Class<? extends MetadataResource> getType() + { + return type; + } + + public String getDependecyJarName() + { + return dependecyJarName; + } + + public String getUrl() + { + return url; + } + + public String getVersion() + { + return version; + } + + public String getName() + { + return name; + } + + public String getFileName() + { + return fileName; + } + + public boolean isDependencyResource() + { + return dependecyJarName != null; + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ActivityDefinitionResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ActivityDefinitionResource.java new file mode 100644 index 000000000..7f87af589 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ActivityDefinitionResource.java @@ -0,0 +1,28 @@ +package org.highmed.dsf.fhir.resources; + +import java.util.Objects; + +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.hl7.fhir.r4.model.MetadataResource; + +public class ActivityDefinitionResource extends AbstractResource +{ + private ActivityDefinitionResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, + String version, String name, String fileName) + { + super(type, dependecyJarName, url, version, name, fileName); + } + + public static ActivityDefinitionResource file(String fileName) + { + return new ActivityDefinitionResource(ActivityDefinition.class, null, null, null, null, + Objects.requireNonNull(fileName, "fileName")); + } + + public static ActivityDefinitionResource dependency(String dependecyJarName, String url, String version) + { + return new ActivityDefinitionResource(ActivityDefinition.class, + Objects.requireNonNull(dependecyJarName, "dependecyJarName"), Objects.requireNonNull(url, "url"), + Objects.requireNonNull(version, "version"), null, null); + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/CodeSystemResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/CodeSystemResource.java new file mode 100644 index 000000000..0d1d30508 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/CodeSystemResource.java @@ -0,0 +1,27 @@ +package org.highmed.dsf.fhir.resources; + +import java.util.Objects; + +import org.hl7.fhir.r4.model.CodeSystem; +import org.hl7.fhir.r4.model.MetadataResource; + +public class CodeSystemResource extends AbstractResource +{ + private CodeSystemResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, + String version, String name, String fileName) + { + super(type, dependecyJarName, url, version, name, fileName); + } + + public static CodeSystemResource file(String fileName) + { + return new CodeSystemResource(CodeSystem.class, null, null, null, null, + Objects.requireNonNull(fileName, "fileName")); + } + + public static CodeSystemResource dependency(String dependecyJarName, String url, String version) + { + return new CodeSystemResource(CodeSystem.class, Objects.requireNonNull(dependecyJarName, "dependecyJarName"), + Objects.requireNonNull(url, "url"), Objects.requireNonNull(version, "version"), null, null); + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/NamingSystemResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/NamingSystemResource.java new file mode 100644 index 000000000..92a32b4df --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/NamingSystemResource.java @@ -0,0 +1,28 @@ +package org.highmed.dsf.fhir.resources; + +import java.util.Objects; + +import org.hl7.fhir.r4.model.MetadataResource; +import org.hl7.fhir.r4.model.NamingSystem; + +public class NamingSystemResource extends AbstractResource +{ + private NamingSystemResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, + String version, String name, String fileName) + { + super(type, dependecyJarName, url, version, name, fileName); + } + + public static NamingSystemResource file(String fileName) + { + return new NamingSystemResource(NamingSystem.class, null, null, null, null, + Objects.requireNonNull(fileName, "fileName")); + } + + public static NamingSystemResource dependency(String dependecyJarName, String name) + { + return new NamingSystemResource(NamingSystem.class, + Objects.requireNonNull(dependecyJarName, "dependecyJarName"), null, null, + Objects.requireNonNull(name, "name"), null); + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProvider.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProvider.java new file mode 100644 index 000000000..5a811b842 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProvider.java @@ -0,0 +1,109 @@ +package org.highmed.dsf.fhir.resources; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Stream; + +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.hl7.fhir.r4.model.CodeSystem; +import org.hl7.fhir.r4.model.MetadataResource; +import org.hl7.fhir.r4.model.NamingSystem; +import org.hl7.fhir.r4.model.StructureDefinition; +import org.hl7.fhir.r4.model.ValueSet; + +import ca.uhn.fhir.parser.IParser; + +public interface ResourceProvider +{ + Optional<ActivityDefinition> getActivityDefinition(String url, String version); + + Optional<CodeSystem> getCodeSystem(String url, String version); + + Optional<NamingSystem> getNamingSystem(String name); + + Optional<StructureDefinition> getStructureDefinition(String url, String version); + + Optional<ValueSet> getValueSet(String url, String version); + + Optional<MetadataResource> getMetadataResouce(AbstractResource resource); + + Stream<MetadataResource> getResources(String processKeyAndVersion, + Function<String, ResourceProvider> providerByJarName); + + boolean isEmpty(); + + static ResourceProvider empty() + { + return new ResourceProvider() + { + @Override + public Optional<ActivityDefinition> getActivityDefinition(String url, String version) + { + return Optional.empty(); + } + + @Override + public Optional<CodeSystem> getCodeSystem(String url, String version) + { + return Optional.empty(); + } + + @Override + public Optional<NamingSystem> getNamingSystem(String name) + { + return Optional.empty(); + } + + @Override + public Optional<StructureDefinition> getStructureDefinition(String url, String version) + { + return Optional.empty(); + } + + @Override + public Optional<ValueSet> getValueSet(String url, String version) + { + return Optional.empty(); + } + + @Override + public Optional<MetadataResource> getMetadataResouce(AbstractResource resource) + { + return Optional.empty(); + } + + @Override + public Stream<MetadataResource> getResources(String processKeyAndVersion, + Function<String, ResourceProvider> providerByJarName) + { + return Stream.empty(); + } + + @Override + public boolean isEmpty() + { + return true; + } + }; + } + + static ResourceProvider of(Map<String, List<MetadataResource>> resourcesByProcessKeyAndVersion) + { + return ResourceProviderImpl.of(resourcesByProcessKeyAndVersion); + } + + static ResourceProvider of(Map<String, List<MetadataResource>> resourcesByProcessKeyAndVersion, + Map<String, List<AbstractResource>> dependencyResourcesByProcessKeyAndVersion) + { + return ResourceProviderImpl.of(resourcesByProcessKeyAndVersion, dependencyResourcesByProcessKeyAndVersion); + } + + static ResourceProvider read(Supplier<IParser> parserSupplier, ClassLoader classLoader, + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion) + { + return ResourceProviderImpl.read(parserSupplier, classLoader, resourcesByProcessKeyAndVersion); + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java new file mode 100644 index 000000000..8411d612a --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java @@ -0,0 +1,290 @@ +package org.highmed.dsf.fhir.resources; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.hl7.fhir.r4.model.CodeSystem; +import org.hl7.fhir.r4.model.MetadataResource; +import org.hl7.fhir.r4.model.NamingSystem; +import org.hl7.fhir.r4.model.StructureDefinition; +import org.hl7.fhir.r4.model.ValueSet; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ca.uhn.fhir.parser.IParser; + +class ResourceProviderImpl implements ResourceProvider +{ + private static final Logger logger = LoggerFactory.getLogger(ResourceProviderImpl.class); + + private final Map<String, List<ActivityDefinition>> activityDefinitionsByProcessKeyAndVersion = new HashMap<>(); + private final Map<String, List<CodeSystem>> codeSystemsByProcessKeyAndVersion = new HashMap<>(); + private final Map<String, List<NamingSystem>> namingSystemsByProcessKeyAndVersion = new HashMap<>(); + private final Map<String, List<StructureDefinition>> structureDefinitionsByProcessKeyAndVersion = new HashMap<>(); + private final Map<String, List<ValueSet>> valueSetsByProcessKeyAndVersion = new HashMap<>(); + + private final Map<String, List<AbstractResource>> dependencyResourcesByProcessKeyAndVersion = new HashMap<>(); + + ResourceProviderImpl(Map<String, List<ActivityDefinition>> activityDefinitionsByProcessKeyAndVersion, + Map<String, List<CodeSystem>> codeSystemsByProcessKeyAndVersion, + Map<String, List<NamingSystem>> namingSystemsByProcessKeyAndVersion, + Map<String, List<StructureDefinition>> structureDefinitionsByProcessKeyAndVersion, + Map<String, List<ValueSet>> valueSetsByProcessKeyAndVersion, + Map<String, List<AbstractResource>> dependencyResourcesByProcessKeyAndVersion) + { + if (activityDefinitionsByProcessKeyAndVersion != null) + this.activityDefinitionsByProcessKeyAndVersion.putAll(activityDefinitionsByProcessKeyAndVersion); + if (codeSystemsByProcessKeyAndVersion != null) + this.codeSystemsByProcessKeyAndVersion.putAll(codeSystemsByProcessKeyAndVersion); + if (namingSystemsByProcessKeyAndVersion != null) + this.namingSystemsByProcessKeyAndVersion.putAll(namingSystemsByProcessKeyAndVersion); + if (structureDefinitionsByProcessKeyAndVersion != null) + this.structureDefinitionsByProcessKeyAndVersion.putAll(structureDefinitionsByProcessKeyAndVersion); + if (valueSetsByProcessKeyAndVersion != null) + this.valueSetsByProcessKeyAndVersion.putAll(valueSetsByProcessKeyAndVersion); + + if (dependencyResourcesByProcessKeyAndVersion != null) + this.dependencyResourcesByProcessKeyAndVersion.putAll(dependencyResourcesByProcessKeyAndVersion); + } + + @Override + public Optional<ActivityDefinition> getActivityDefinition(String url, String version) + { + return getMetadataResource(url, version, activityDefinitionsByProcessKeyAndVersion, ActivityDefinition.class); + } + + @Override + public Optional<CodeSystem> getCodeSystem(String url, String version) + { + return getMetadataResource(url, version, codeSystemsByProcessKeyAndVersion, CodeSystem.class); + } + + @Override + public Optional<NamingSystem> getNamingSystem(String name) + { + Optional<NamingSystem> opt = namingSystemsByProcessKeyAndVersion.values().stream().flatMap(List::stream) + .filter(s -> s.hasName() && s.getName().equals(name)).findFirst(); + + if (opt.isEmpty()) + logger.warn("{} name {} not found", NamingSystem.class.getSimpleName(), name); + else + logger.debug("{} name {} found", NamingSystem.class.getSimpleName(), name); + + return opt; + } + + @Override + public Optional<StructureDefinition> getStructureDefinition(String url, String version) + { + return getMetadataResource(url, version, structureDefinitionsByProcessKeyAndVersion, StructureDefinition.class); + } + + @Override + public Optional<ValueSet> getValueSet(String url, String version) + { + return getMetadataResource(url, version, valueSetsByProcessKeyAndVersion, ValueSet.class); + } + + private <T extends MetadataResource> Optional<T> getMetadataResource(String url, String version, + Map<String, List<T>> resources, Class<T> type) + { + Optional<T> opt = resources.values().stream().flatMap(List::stream) + .filter(r -> r.hasUrl() && r.getUrl().equals(url) && r.hasVersion() && r.getVersion().equals(version)) + .findFirst(); + + if (opt.isEmpty()) + logger.warn("{} url {}, version {} not found", type.getSimpleName(), url, version); + else + logger.debug("{} url {}, version {} found", type.getSimpleName(), url, version); + + return opt; + } + + @Override + public Optional<MetadataResource> getMetadataResouce(AbstractResource resource) + { + if (NamingSystem.class.equals(resource.getType())) + logger.debug("Get {} resource dependency {}, file {}, name {}", resource.getType().getSimpleName(), + resource.getDependecyJarName(), resource.getFileName(), resource.getName()); + else + logger.debug("Get {} resource dependency {}, file {}, url {}, version {}", + resource.getType().getSimpleName(), resource.getDependecyJarName(), resource.getFileName(), + resource.getUrl(), resource.getVersion()); + + if (ActivityDefinition.class.equals(resource.getType())) + return getActivityDefinition(resource.getUrl(), resource.getVersion()).map(r -> (MetadataResource) r); + else if (CodeSystem.class.equals(resource.getType())) + return getCodeSystem(resource.getUrl(), resource.getVersion()).map(r -> (MetadataResource) r); + else if (NamingSystem.class.equals(resource.getType())) + return getNamingSystem(resource.getName()).map(r -> (MetadataResource) r); + else if (StructureDefinition.class.equals(resource.getType())) + return getStructureDefinition(resource.getUrl(), resource.getVersion()).map(r -> (MetadataResource) r); + else if (ValueSet.class.equals(resource.getType())) + return getValueSet(resource.getUrl(), resource.getVersion()).map(r -> (MetadataResource) r); + else + { + logger.warn("Resource of type {} not supported", resource.getType().getSimpleName()); + return Optional.empty(); + } + } + + @Override + public Stream<MetadataResource> getResources(String processKeyAndVersion, + Function<String, ResourceProvider> providerByJarName) + { + List<AbstractResource> list = dependencyResourcesByProcessKeyAndVersion.getOrDefault(processKeyAndVersion, + Collections.emptyList()); + + Stream<MetadataResource> dependencyResources = list.stream() + .map(r -> providerByJarName.apply(r.getDependecyJarName()).getMetadataResouce(r)) + .filter(Optional::isPresent).map(Optional::get); + + Stream<MetadataResource> resources = Arrays + .asList(activityDefinitionsByProcessKeyAndVersion.getOrDefault(processKeyAndVersion, + Collections.emptyList()), + codeSystemsByProcessKeyAndVersion.getOrDefault(processKeyAndVersion, Collections.emptyList()), + namingSystemsByProcessKeyAndVersion.getOrDefault(processKeyAndVersion, Collections.emptyList()), + structureDefinitionsByProcessKeyAndVersion.getOrDefault(processKeyAndVersion, + Collections.emptyList()), + valueSetsByProcessKeyAndVersion.getOrDefault(processKeyAndVersion, Collections.emptyList())) + .stream().flatMap(List::stream); + + return Stream.concat(resources, dependencyResources); + } + + @Override + public boolean isEmpty() + { + return activityDefinitionsByProcessKeyAndVersion.isEmpty() && codeSystemsByProcessKeyAndVersion.isEmpty() + && namingSystemsByProcessKeyAndVersion.isEmpty() && structureDefinitionsByProcessKeyAndVersion.isEmpty() + && valueSetsByProcessKeyAndVersion.isEmpty(); + } + + static ResourceProvider of(Map<String, List<MetadataResource>> resourcesByProcessKeyAndVersion) + { + return of(resourcesByProcessKeyAndVersion, Collections.emptyMap()); + } + + static ResourceProvider of(Map<String, List<MetadataResource>> resourcesByProcessKeyAndVersion, + Map<String, List<AbstractResource>> dependencyResourcesByProcessKeyAndVersion) + { + Map<String, List<ActivityDefinition>> activityDefinitionsByProcessKeyAndVersion = new HashMap<>(); + Map<String, List<CodeSystem>> codeSystemsByProcessKeyAndVersion = new HashMap<>(); + Map<String, List<NamingSystem>> namingSystemsByProcessKeyAndVersion = new HashMap<>(); + Map<String, List<StructureDefinition>> structureDefinitionsByProcessKeyAndVersion = new HashMap<>(); + Map<String, List<ValueSet>> valueSetsByProcessKeyAndVersion = new HashMap<>(); + + resourcesByProcessKeyAndVersion.entrySet().forEach(e -> + { + e.getValue().forEach(r -> + { + if (r instanceof ActivityDefinition) + addOrInsert(activityDefinitionsByProcessKeyAndVersion, e.getKey(), (ActivityDefinition) r); + else if (r instanceof CodeSystem) + addOrInsert(codeSystemsByProcessKeyAndVersion, e.getKey(), (CodeSystem) r); + else if (r instanceof NamingSystem) + addOrInsert(namingSystemsByProcessKeyAndVersion, e.getKey(), (NamingSystem) r); + else if (r instanceof StructureDefinition) + addOrInsert(structureDefinitionsByProcessKeyAndVersion, e.getKey(), (StructureDefinition) r); + else if (r instanceof ValueSet) + addOrInsert(valueSetsByProcessKeyAndVersion, e.getKey(), (ValueSet) r); + else + logger.warn("MetadataResource of type {} not supported, ignoring resource", + r.getResourceType().name()); + }); + }); + + return new ResourceProviderImpl(activityDefinitionsByProcessKeyAndVersion, codeSystemsByProcessKeyAndVersion, + namingSystemsByProcessKeyAndVersion, structureDefinitionsByProcessKeyAndVersion, + valueSetsByProcessKeyAndVersion, dependencyResourcesByProcessKeyAndVersion); + } + + private static <T extends MetadataResource> void addOrInsert(Map<String, List<T>> map, String processKeyAndVersion, + T resource) + { + if (map.containsKey(processKeyAndVersion)) + map.get(processKeyAndVersion).add(resource); + else + { + List<T> list = new ArrayList<>(); + list.add(resource); + map.put(processKeyAndVersion, list); + } + } + + static ResourceProvider read(Supplier<IParser> parserSupplier, ClassLoader classLoader, + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion) + { + Map<String, List<AbstractResource>> dependencyResourcesByProcessKeyAndVersion = new HashMap<>(); + for (Entry<String, List<AbstractResource>> entry : resourcesByProcessKeyAndVersion.entrySet()) + { + dependencyResourcesByProcessKeyAndVersion.put(entry.getKey(), entry.getValue().stream() + .filter(AbstractResource::isDependencyResource).collect(Collectors.toList())); + } + + Map<String, MetadataResource> resourcesByFileName = new HashMap<>(); + Map<String, List<MetadataResource>> resources = new HashMap<>(); + for (Entry<String, List<AbstractResource>> entry : resourcesByProcessKeyAndVersion.entrySet()) + { + resources.put(entry.getKey(), + entry.getValue().stream().filter(Predicate.not(AbstractResource::isDependencyResource)) + .map(r -> read(parserSupplier, classLoader, resourcesByFileName, r)) + .collect(Collectors.toList())); + } + + return of(resources, dependencyResourcesByProcessKeyAndVersion); + } + + private static MetadataResource read(Supplier<IParser> parserSupplier, ClassLoader classLoader, + Map<String, MetadataResource> resourcesByFileName, AbstractResource resources) + { + final String fileName = resources.getFileName(); + final Class<? extends MetadataResource> type = resources.getType(); + + if (resourcesByFileName.containsKey(fileName)) + { + MetadataResource m = resourcesByFileName.get(fileName); + if (type.isInstance(m)) + return m; + else + throw new RuntimeException("Unexpected type (" + m.getClass().getSimpleName() + " vs " + + type.getSimpleName() + ") for file " + fileName + " while retrieving from cache"); + } + else + { + MetadataResource m = parseResource(parserSupplier, classLoader, fileName, type); + resourcesByFileName.put(fileName, m); + + return m; + } + } + + private static <T extends MetadataResource> T parseResource(Supplier<IParser> parserSupplier, + ClassLoader classLoader, String fileName, Class<T> type) + { + logger.debug("Reading {} from {}", type.getSimpleName(), fileName); + + try (InputStream in = classLoader.getResourceAsStream(fileName)) + { + return parserSupplier.get().parseResource(type, in); + } + catch (IOException e) + { + throw new RuntimeException(e); + } + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/StructureDefinitionResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/StructureDefinitionResource.java new file mode 100644 index 000000000..8b36daf84 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/StructureDefinitionResource.java @@ -0,0 +1,28 @@ +package org.highmed.dsf.fhir.resources; + +import java.util.Objects; + +import org.hl7.fhir.r4.model.MetadataResource; +import org.hl7.fhir.r4.model.StructureDefinition; + +public class StructureDefinitionResource extends AbstractResource +{ + private StructureDefinitionResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, + String version, String name, String fileName) + { + super(type, dependecyJarName, url, version, name, fileName); + } + + public static StructureDefinitionResource file(String fileName) + { + return new StructureDefinitionResource(StructureDefinition.class, null, null, null, null, + Objects.requireNonNull(fileName, "fileName")); + } + + public static StructureDefinitionResource dependency(String dependecyJarName, String url, String version) + { + return new StructureDefinitionResource(StructureDefinition.class, + Objects.requireNonNull(dependecyJarName, "dependecyJarName"), Objects.requireNonNull(url, "url"), + Objects.requireNonNull(version, "version"), null, null); + } +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ValueSetResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ValueSetResource.java new file mode 100644 index 000000000..bdfc3f05f --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ValueSetResource.java @@ -0,0 +1,27 @@ +package org.highmed.dsf.fhir.resources; + +import java.util.Objects; + +import org.hl7.fhir.r4.model.MetadataResource; +import org.hl7.fhir.r4.model.ValueSet; + +public class ValueSetResource extends AbstractResource +{ + private ValueSetResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, + String version, String name, String fileName) + { + super(type, dependecyJarName, url, version, name, fileName); + } + + public static ValueSetResource file(String fileName) + { + return new ValueSetResource(ValueSet.class, null, null, null, null, + Objects.requireNonNull(fileName, "fileName")); + } + + public static ValueSetResource dependency(String dependecyJarName, String url, String version) + { + return new ValueSetResource(ValueSet.class, Objects.requireNonNull(dependecyJarName, "dependecyJarName"), + Objects.requireNonNull(url, "url"), Objects.requireNonNull(version, "version"), null, null); + } +} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index d3aacc57c..c4fae8796 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -1,17 +1,36 @@ package org.highmed.dsf.bpe; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import java.util.stream.Stream; import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.FeasibilityConfig; import org.highmed.dsf.bpe.spring.config.FeasibilitySerializerConfig; +import org.highmed.dsf.fhir.resources.AbstractResource; +import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; +import org.highmed.dsf.fhir.resources.CodeSystemResource; +import org.highmed.dsf.fhir.resources.NamingSystemResource; +import org.highmed.dsf.fhir.resources.ResourceProvider; +import org.highmed.dsf.fhir.resources.StructureDefinitionResource; +import org.highmed.dsf.fhir.resources.ValueSetResource; + +import ca.uhn.fhir.context.FhirContext; public class FeasibilityProcessPluginDefinition implements ProcessPluginDefinition { + @Override + public String getJarName() + { + return "dsf-bpe-process-feasibility-0.4.0"; + } + @Override public Stream<String> getBpmnFiles() { - return Stream.of("requestSimpleFeasibility.bpmn","computeSimpleFeasibility.bpmn", "executeSimpleFeasibility.bpmn"); + return Stream.of("bpe/requestSimpleFeasibility.bpmn", "bpe/computeSimpleFeasibility.bpmn", + "bpe/executeSimpleFeasibility.bpmn"); } @Override @@ -19,4 +38,51 @@ public Stream<Class<?>> getSpringConfigClasses() { return Stream.of(FeasibilityConfig.class, FeasibilitySerializerConfig.class); } + + @Override + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + { + var aCom = ActivityDefinitionResource.file("fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml"); + var aExe = ActivityDefinitionResource.file("fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml"); + var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml"); + + var cF = CodeSystemResource.file("fhir/CodeSystem/feasibility-0.3.0.xml"); + var cQT = CodeSystemResource.file("fhir/CodeSystem/query-type-0.3.0.xml"); + + var n = NamingSystemResource.file("fhir/NamingSystem/highmed-research-study.xml"); + + var sExtG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml"); + var sExtPartMeDic = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml"); + var sExtPartTtp = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml"); + var sExtQ = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-query-0.3.0.xml"); + var sG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-group-0.3.0.xml"); + var sR = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml"); + var sTCom = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml"); + var sTErr = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml"); + var sTExe = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml"); + var sTResM = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml"); + var sTReq = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml"); + var sTResS = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml"); + + var vF = ValueSetResource.file("fhir/ValueSet/feasibility-0.3.0.xml"); + var vQT = ValueSetResource.file("fhir/ValueSet/query-type-0.3.0.xml"); + + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("computeSimpleFeasibility/0.3.0", + Arrays.asList(aCom, sTCom, vF, cF, sTResS, sExtG, sG), "executeSimpleFeasibility/0.3.0", + Arrays.asList(aExe, sTExe, vF, cF, sR, sExtPartTtp, sExtPartMeDic, n, sG, sExtQ, vQT, cQT), + "requestSimpleFeasibility/0.3.0", Arrays.asList(aReq, sTReq, vF, cF, sR, sExtPartTtp, sExtPartMeDic, n, + sG, sExtQ, vQT, cQT, sTResM, sExtG, sTErr)); + + return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); + } } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index e89cdbf36..a15553ee0 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -2,17 +2,34 @@ import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.stream.Stream; import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.LocalServicesConfig; +import org.highmed.dsf.fhir.resources.AbstractResource; +import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; +import org.highmed.dsf.fhir.resources.CodeSystemResource; +import org.highmed.dsf.fhir.resources.ResourceProvider; +import org.highmed.dsf.fhir.resources.StructureDefinitionResource; +import org.highmed.dsf.fhir.resources.ValueSetResource; + +import ca.uhn.fhir.context.FhirContext; public class LocalServicesProcessPluginDefinition implements ProcessPluginDefinition { + private static final String DEP_FEASIBILITY = "dsf-bpe-process-feasibility-0.4.0"; + + @Override + public String getJarName() + { + return "dsf-bpe-process-local-services-0.4.0"; + } + @Override public Stream<String> getBpmnFiles() { - return Stream.of("localServicesIntegration.bpmn"); + return Stream.of("bpe/localServicesIntegration.bpmn"); } @Override @@ -24,6 +41,31 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public List<String> getDependencyJarNames() { - return Arrays.asList("dsf-bpe-process-feasibility-0.4.0"); + return Arrays.asList(DEP_FEASIBILITY); + } + + @Override + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + { + var aL = ActivityDefinitionResource.file("fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml"); + var sTL = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml"); + var sExtG = StructureDefinitionResource.dependency(DEP_FEASIBILITY, + "http://highmed.org/fhir/StructureDefinition/group-id", "0.3.0"); + var sExtQ = StructureDefinitionResource.dependency(DEP_FEASIBILITY, + "http://highmed.org/fhir/StructureDefinition/query", "0.3.0"); + + var vF = ValueSetResource.dependency(DEP_FEASIBILITY, "http://highmed.org/fhir/ValueSet/feasibility", "0.3.0"); + var vQt = ValueSetResource.dependency(DEP_FEASIBILITY, "http://highmed.org/fhir/ValueSet/query-type", "0.3.0"); + var cF = CodeSystemResource.dependency(DEP_FEASIBILITY, "http://highmed.org/fhir/CodeSystem/feasibility", + "0.3.0"); + var cQt = CodeSystemResource.dependency(DEP_FEASIBILITY, "http://highmed.org/fhir/CodeSystem/query-type", + "0.3.0"); + + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("localServicesIntegration/0.3.0", + Arrays.asList(aL, sTL, vF, cF, vQt, cQt, sExtG, sExtQ)); + + return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java index 9474dd1ac..213ce9ef0 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java @@ -1,16 +1,31 @@ package org.highmed.dsf.bpe; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import java.util.stream.Stream; import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.PingConfig; +import org.highmed.dsf.fhir.resources.AbstractResource; +import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; +import org.highmed.dsf.fhir.resources.ResourceProvider; +import org.highmed.dsf.fhir.resources.StructureDefinitionResource; + +import ca.uhn.fhir.context.FhirContext; public class PingProcessPluginDefinition implements ProcessPluginDefinition { + @Override + public String getJarName() + { + return "dsf-bpe-process-ping-0.4.0"; + } + @Override public Stream<String> getBpmnFiles() { - return Stream.of("ping.bpmn", "pong.bpmn"); + return Stream.of("bpe/ping.bpmn", "bpe/pong.bpmn"); } @Override @@ -18,4 +33,21 @@ public Stream<Class<?>> getSpringConfigClasses() { return Stream.of(PingConfig.class); } + + @Override + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + { + var aPing = ActivityDefinitionResource.file("fhir/ActivityDefinition/ping-0.3.0.xml"); + var aPong = ActivityDefinitionResource.file("fhir/ActivityDefinition/pong-0.3.0.xml"); + var tPing = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-pong-0.3.0.xml"); + var tStartPing = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml"); + var tPong = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-ping-0.3.0.xml"); + + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("ping/0.3.0", + Arrays.asList(aPing, tPong, tStartPing), "pong/0.3.0", Arrays.asList(aPong, tPing)); + + return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); + } } diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java index ad3675c98..790e5ccb6 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java @@ -7,6 +7,12 @@ public class ChildProcessPluginDefinition implements ProcessPluginDefinition { + @Override + public String getJarName() + { + return "dsf-bpe-process-child-0.4.0"; + } + @Override public Stream<String> getBpmnFiles() { diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java index 8c9879e11..c174ba611 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java @@ -1,12 +1,26 @@ package org.highmed.dsf.bpe; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import java.util.stream.Stream; import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.ParentConfig; +import org.highmed.dsf.fhir.resources.AbstractResource; +import org.highmed.dsf.fhir.resources.ResourceProvider; +import org.highmed.dsf.fhir.resources.StructureDefinitionResource; + +import ca.uhn.fhir.context.FhirContext; public class ParentProcessPluginDefinition implements ProcessPluginDefinition { + @Override + public String getJarName() + { + return "bpe/dsf-bpe-process-parent-0.4.0"; + } + @Override public Stream<String> getBpmnFiles() { @@ -18,4 +32,16 @@ public Stream<Class<?>> getSpringConfigClasses() { return Stream.of(ParentConfig.class); } + + @Override + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + { + var sT = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml"); + + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("parentPlugin/1.0.0", + Arrays.asList(sT)); + + return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); + } } diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post deleted file mode 100644 index e9d20db78..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml.post +++ /dev/null @@ -1 +0,0 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-parent-plugin&version=0.3.0 \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java index fdd9989e7..cc3f075c2 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java @@ -1,16 +1,33 @@ package org.highmed.dsf.bpe; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import java.util.stream.Stream; import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.UpdateAllowListConfig; +import org.highmed.dsf.fhir.resources.AbstractResource; +import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; +import org.highmed.dsf.fhir.resources.CodeSystemResource; +import org.highmed.dsf.fhir.resources.ResourceProvider; +import org.highmed.dsf.fhir.resources.StructureDefinitionResource; +import org.highmed.dsf.fhir.resources.ValueSetResource; + +import ca.uhn.fhir.context.FhirContext; public class UpdateAllowListPluginDefinition implements ProcessPluginDefinition { + @Override + public String getJarName() + { + return "dsf-bpe-process-update-allow-list-0.4.0"; + } + @Override public Stream<String> getBpmnFiles() { - return Stream.of("updateAllowList.bpmn", "downloadAllowList.bpmn"); + return Stream.of("bpe/updateAllowList.bpmn", "bpe/downloadAllowList.bpmn"); } @Override @@ -18,4 +35,22 @@ public Stream<Class<?>> getSpringConfigClasses() { return Stream.of(UpdateAllowListConfig.class); } + + @Override + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + { + var aDown = ActivityDefinitionResource.file("fhir/ActivityDefinition/downloadAllowList-0.3.0.xml"); + var aUp = ActivityDefinitionResource.file("fhir/ActivityDefinition/updateAllowList-0.3.0.xml"); + var c = CodeSystemResource.file("fhir/CodeSystem/update-allow-list-0.3.0.xml"); + var sDown = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml"); + var sUp = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml"); + var v = ValueSetResource.file("fhir/ValueSet/update-allow-list-0.3.0.xml"); + + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("downloadAllowList/0.3.0", + Arrays.asList(aDown, c, sDown, v), "updateAllowList/0.3.0", Arrays.asList(aUp, c, sUp, v)); + + return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); + } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java index 05ef20fcf..eab1947b9 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java @@ -1,16 +1,33 @@ package org.highmed.dsf.bpe; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import java.util.stream.Stream; import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.UpdateResourcesConfig; +import org.highmed.dsf.fhir.resources.AbstractResource; +import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; +import org.highmed.dsf.fhir.resources.CodeSystemResource; +import org.highmed.dsf.fhir.resources.ResourceProvider; +import org.highmed.dsf.fhir.resources.StructureDefinitionResource; +import org.highmed.dsf.fhir.resources.ValueSetResource; + +import ca.uhn.fhir.context.FhirContext; public class UpdateResourcesPluginDefinition implements ProcessPluginDefinition { + @Override + public String getJarName() + { + return "dsf-bpe-process-update-resources-0.4.0"; + } + @Override public Stream<String> getBpmnFiles() { - return Stream.of("executeUpdateResources.bpmn", "requestUpdateResources.bpmn"); + return Stream.of("bpe/executeUpdateResources.bpmn", "bpe/requestUpdateResources.bpmn"); } @Override @@ -18,4 +35,23 @@ public Stream<Class<?>> getSpringConfigClasses() { return Stream.of(UpdateResourcesConfig.class); } + + @Override + public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) + { + var aExec = ActivityDefinitionResource.file("fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml"); + var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml"); + var c = CodeSystemResource.file("fhir/CodeSystem/update-resources-0.3.0.xml"); + var sExec = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml"); + var sReq = StructureDefinitionResource + .file("fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml"); + var v = ValueSetResource.file("fhir/ValueSet/update-resources-0.3.0.xml"); + + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("executeUpdateResources/0.3.0", + Arrays.asList(aExec, c, sExec, v), "requestUpdateResources/0.3.0", Arrays.asList(aReq, c, sReq, v)); + + return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + classLoader, resourcesByProcessKeyAndVersion); + } } diff --git a/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties b/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties index 9beb888aa..8dc10446d 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties +++ b/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties @@ -3,11 +3,11 @@ org.highmed.dsf.bpe.fhir.organization.identifier.localValue=Test_Organization org.highmed.dsf.bpe.fhir.local.webservice.baseUrl=https://localhost:8001/fhir org.highmed.dsf.bpe.fhir.local.webservice.keystore.p12file=target/test-client_certificate.p12 org.highmed.dsf.bpe.fhir.local.webservice.keystore.password=password -org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=1500 -org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=500 +org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=20000 +org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=2000 -org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=2500 -org.highmed.dsf.bpe.fhir.remote.webservice.connectTimeout=1500 +org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=20000 +org.highmed.dsf.bpe.fhir.remote.webservice.connectTimeout=2000 #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.password= #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.username= #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.schemeHostPort= @@ -59,4 +59,6 @@ org.highmed.dsf.bpe.db.camunda_user_password=arpJ2FgJuYvUJhbxeuh7 org.highmed.dsf.bpe.cors.origins= +org.highmed.dsf.bpe.process.excluded= +org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionClassDelegateActivityBehavior.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionClassDelegateActivityBehavior.java index 8101c529d..e068f0a0d 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionClassDelegateActivityBehavior.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/MultiVersionClassDelegateActivityBehavior.java @@ -13,6 +13,7 @@ import org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution; import org.camunda.bpm.engine.impl.util.ClassDelegateUtil; import org.highmed.dsf.bpe.delegate.DelegateProvider; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; public class MultiVersionClassDelegateActivityBehavior extends ClassDelegateActivityBehavior { @@ -30,11 +31,10 @@ public MultiVersionClassDelegateActivityBehavior(String className, List<FieldDec protected ActivityBehavior getActivityBehaviorInstance(ActivityExecution execution) { ExecutionEntity e = (ExecutionEntity) execution; - String processDefinitionKey = e.getProcessDefinition().getKey(); - String processDefinitionVersionTag = e.getProcessDefinition().getVersionTag(); + ProcessKeyAndVersion processKeyAndVersion = new ProcessKeyAndVersion(e.getProcessDefinition().getKey(), + e.getProcessDefinition().getVersionTag()); - Object delegateInstance = instantiateDelegate(processDefinitionKey, processDefinitionVersionTag, className, - fieldDeclarations); + Object delegateInstance = instantiateDelegate(processKeyAndVersion, className, fieldDeclarations); if (delegateInstance instanceof ActivityBehavior) { @@ -51,18 +51,16 @@ else if (delegateInstance instanceof JavaDelegate) } }; - private Object instantiateDelegate(String processDefinitionKey, String processDefinitionVersionTag, - String className, List<FieldDeclaration> fieldDeclarations) + private Object instantiateDelegate(ProcessKeyAndVersion processKeyAndVersion, String className, + List<FieldDeclaration> fieldDeclarations) { try { - Class<?> clazz = delegateProvider.getClassLoader(processDefinitionKey, processDefinitionVersionTag) - .loadClass(className); - Object object = delegateProvider.getApplicationContext(processDefinitionKey, processDefinitionVersionTag) - .getBean(clazz); + Class<?> clazz = delegateProvider.getClassLoader(processKeyAndVersion).loadClass(className); + Object bean = delegateProvider.getApplicationContext(processKeyAndVersion).getBean(clazz); - ClassDelegateUtil.applyFieldDeclaration(fieldDeclarations, object); - return object; + ClassDelegateUtil.applyFieldDeclaration(fieldDeclarations, bean); + return bean; } catch (Exception e) { diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/AbstractDaoJdbc.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/AbstractDaoJdbc.java new file mode 100644 index 000000000..8bef3e28b --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/AbstractDaoJdbc.java @@ -0,0 +1,22 @@ +package org.highmed.dsf.bpe.dao; + +import java.util.Objects; + +import org.apache.commons.dbcp2.BasicDataSource; +import org.springframework.beans.factory.InitializingBean; + +public abstract class AbstractDaoJdbc implements InitializingBean +{ + protected final BasicDataSource dataSource; + + public AbstractDaoJdbc(BasicDataSource dataSource) + { + this.dataSource = dataSource; + } + + @Override + public void afterPropertiesSet() throws Exception + { + Objects.requireNonNull(dataSource, "dataSource"); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDao.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDao.java new file mode 100644 index 000000000..7ba0caef5 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDao.java @@ -0,0 +1,19 @@ +package org.highmed.dsf.bpe.dao; + +import java.sql.SQLException; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.bpe.process.ProcessesResource; +import org.highmed.dsf.bpe.process.ResourceInfo; + +public interface ProcessPluginResourcesDao +{ + List<ResourceInfo> getResources(ProcessKeyAndVersion processKeyAndVersion) throws SQLException; + + Map<ProcessKeyAndVersion, List<ResourceInfo>> getResources() throws SQLException; + + void addResources(Collection<? extends ProcessesResource> newResources) throws SQLException; +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDaoJdbc.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDaoJdbc.java new file mode 100644 index 000000000..17d3238e5 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDaoJdbc.java @@ -0,0 +1,208 @@ +package org.highmed.dsf.bpe.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +import org.apache.commons.dbcp2.BasicDataSource; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.bpe.process.ProcessesResource; +import org.highmed.dsf.bpe.process.ResourceInfo; +import org.postgresql.util.PGobject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ca.uhn.fhir.parser.DataFormatException; + +public class ProcessPluginResourcesDaoJdbc extends AbstractDaoJdbc implements ProcessPluginResourcesDao +{ + private static final Logger logger = LoggerFactory.getLogger(ProcessPluginResourcesDaoJdbc.class); + + public ProcessPluginResourcesDaoJdbc(BasicDataSource dataSource) + { + super(dataSource); + } + + @Override + public List<ResourceInfo> getResources(ProcessKeyAndVersion processKeyAndVersion) throws SQLException + { + Objects.requireNonNull(processKeyAndVersion, "processKeyAndVersion"); + + try (Connection connection = dataSource.getConnection(); + PreparedStatement statement = connection.prepareStatement( + "SELECT resource_type, resource_id, url, version, name FROM process_plugin_resources WHERE process_key_and_version = ?")) + { + statement.setString(1, processKeyAndVersion.toString()); + + logger.trace("Executing query '{}'", statement); + try (ResultSet result = statement.executeQuery()) + { + List<ResourceInfo> resources = new ArrayList<>(); + while (result.next()) + { + String resourceType = result.getString(1); + UUID resourceId = result.getObject(2, UUID.class); + String url = result.getString(3); + String version = result.getString(4); + String name = result.getString(5); + + resources.add(new ResourceInfo(resourceType, url, version, name).setResourceId(resourceId)); + } + + return resources; + } + } + } + + @Override + public Map<ProcessKeyAndVersion, List<ResourceInfo>> getResources() throws SQLException + { + try (Connection connection = dataSource.getConnection(); + PreparedStatement statement = connection.prepareStatement( + "SELECT process_key_and_version, resource_type, resource_id, url, version, name FROM process_plugin_resources ORDER BY process_key_and_version")) + { + logger.trace("Executing query '{}'", statement); + try (ResultSet result = statement.executeQuery()) + { + Map<ProcessKeyAndVersion, List<ResourceInfo>> resources = new HashMap<>(); + + ProcessKeyAndVersion processKeyAndVersion = null; + List<ResourceInfo> processKeyAndVersionResources = null; + while (result.next()) + { + ProcessKeyAndVersion currentProcessKeyAndVersion = ProcessKeyAndVersion + .fromString(result.getString(1)); + + if (!currentProcessKeyAndVersion.equals(processKeyAndVersion)) + { + processKeyAndVersion = currentProcessKeyAndVersion; + processKeyAndVersionResources = new ArrayList<>(); + resources.put(processKeyAndVersion, processKeyAndVersionResources); + } + + String resourceType = result.getString(2); + UUID resourceId = result.getObject(3, UUID.class); + String url = result.getString(4); + String version = result.getString(5); + String name = result.getString(6); + + processKeyAndVersionResources + .add(new ResourceInfo(resourceType, url, version, name).setResourceId(resourceId)); + } + + return resources; + } + } + } + + @Override + public void addResources(Collection<? extends ProcessesResource> newResources) throws SQLException + { + Objects.requireNonNull(newResources, "newResources"); + + if (newResources.isEmpty()) + return; + + try (Connection connection = dataSource.getConnection()) + { + connection.setReadOnly(false); + connection.setAutoCommit(false); + + try (PreparedStatement statement = connection.prepareStatement( + "INSERT INTO process_plugin_resources (process_key_and_version, resource_type, resource_id, url, version) VALUES (?, ?, ?, ?, ?) " + + "ON CONFLICT (process_key_and_version, resource_type, url, version) " + + "WHERE resource_type <> 'NamingSystem'" + " DO UPDATE SET resource_id = ?")) + { + for (ProcessesResource resource : newResources) + { + if ("NamingSystem".equals(resource.getResourceInfo().getResourceType())) + continue; + + for (ProcessKeyAndVersion process : resource.getProcesses()) + { + ResourceInfo resourceInfo = resource.getResourceInfo(); + + statement.setString(1, process.toString()); + statement.setString(2, resourceInfo.getResourceType()); + statement.setObject(3, uuidToPgObject(resourceInfo.getResourceId())); + statement.setString(4, resourceInfo.getUrl()); + statement.setString(5, resourceInfo.getVersion()); + + statement.setObject(6, uuidToPgObject(resourceInfo.getResourceId())); + + statement.addBatch(); + logger.trace("Executing query '{}'", statement); + } + } + + statement.executeBatch(); + } + catch (SQLException e) + { + connection.rollback(); + throw e; + } + + try (PreparedStatement statement = connection.prepareStatement( + "INSERT INTO process_plugin_resources (process_key_and_version, resource_type, resource_id, name) VALUES (?, 'NamingSystem', ?, ?) " + + "ON CONFLICT (process_key_and_version, resource_type, name) " + + "WHERE resource_type = 'NamingSystem'" + " DO UPDATE SET resource_id = ?")) + { + for (ProcessesResource resource : newResources) + { + if (!"NamingSystem".equals(resource.getResourceInfo().getResourceType())) + continue; + + for (ProcessKeyAndVersion process : resource.getProcesses()) + { + ResourceInfo resourceInfo = resource.getResourceInfo(); + + statement.setString(1, process.toString()); + statement.setObject(2, uuidToPgObject(resourceInfo.getResourceId())); + statement.setString(3, resourceInfo.getName()); + + statement.setObject(4, uuidToPgObject(resourceInfo.getResourceId())); + + statement.addBatch(); + logger.trace("Executing query '{}'", statement); + } + } + + statement.executeBatch(); + } + catch (SQLException e) + { + connection.rollback(); + throw e; + } + + connection.commit(); + } + } + + private PGobject uuidToPgObject(UUID uuid) + { + if (uuid == null) + return null; + + try + { + PGobject o = new PGobject(); + o.setType("UUID"); + o.setValue(uuid.toString()); + return o; + } + catch (DataFormatException | SQLException e) + { + throw new RuntimeException(e); + } + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessStateDao.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessStateDao.java new file mode 100644 index 000000000..b923a25b3 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessStateDao.java @@ -0,0 +1,14 @@ +package org.highmed.dsf.bpe.dao; + +import java.sql.SQLException; +import java.util.Map; + +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.bpe.process.ProcessState; + +public interface ProcessStateDao +{ + void updateStates(Map<ProcessKeyAndVersion, ProcessState> states) throws SQLException; + + Map<ProcessKeyAndVersion, ProcessState> getStates() throws SQLException; +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessStateDaoJdbc.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessStateDaoJdbc.java new file mode 100644 index 000000000..0ad4eaa8d --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessStateDaoJdbc.java @@ -0,0 +1,76 @@ +package org.highmed.dsf.bpe.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; + +import org.apache.commons.dbcp2.BasicDataSource; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.bpe.process.ProcessState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProcessStateDaoJdbc extends AbstractDaoJdbc implements ProcessStateDao +{ + private static final Logger logger = LoggerFactory.getLogger(ProcessStateDaoJdbc.class); + + public ProcessStateDaoJdbc(BasicDataSource dataSource) + { + super(dataSource); + } + + @Override + public void updateStates(Map<ProcessKeyAndVersion, ProcessState> states) throws SQLException + { + Objects.requireNonNull(states, "states"); + + if (states.isEmpty()) + return; + + try (Connection connection = dataSource.getConnection()) + { + connection.setReadOnly(false); + + try (PreparedStatement statement = connection.prepareStatement( + "INSERT INTO process_states (process_key_and_version, state) VALUES (?, ?) ON CONFLICT (process_key_and_version) DO UPDATE SET state = ?")) + { + for (Entry<ProcessKeyAndVersion, ProcessState> entry : states.entrySet()) + { + statement.setString(1, entry.getKey().toString()); + statement.setString(2, entry.getValue().name()); + statement.setString(3, entry.getValue().name()); + + statement.addBatch(); + } + + logger.trace("Executing query '{}'", statement); + statement.executeBatch(); + } + } + } + + @Override + public Map<ProcessKeyAndVersion, ProcessState> getStates() throws SQLException + { + try (Connection connection = dataSource.getConnection(); + PreparedStatement statement = connection + .prepareStatement("SELECT process_key_and_version, state FROM process_states"); + ResultSet resultSet = statement.executeQuery()) + { + Map<ProcessKeyAndVersion, ProcessState> states = new HashMap<>(); + while (resultSet.next()) + { + ProcessKeyAndVersion processKeyAndVersion = ProcessKeyAndVersion.fromString(resultSet.getString(1)); + ProcessState state = ProcessState.valueOf(resultSet.getString(2)); + + states.putIfAbsent(processKeyAndVersion, state); + } + return states; + } + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java index 164d94c69..35ac2b2e5 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java @@ -3,29 +3,26 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; import org.springframework.context.ApplicationContext; public interface DelegateProvider { /** - * @param processDefinitionKey - * not <code>null</code> - * @param processDefinitionVersion + * @param processKeyAndVersion * not <code>null</code> * @return returns the default class loader if no special class loader is registered for the given * <b>processDefinitionKey</b> and <b>processDefinitionVersion</b> */ - ClassLoader getClassLoader(String processDefinitionKey, String processDefinitionVersion); + ClassLoader getClassLoader(ProcessKeyAndVersion processKeyAndVersion); /** - * @param processDefinitionKey - * not <code>null</code> - * @param processDefinitionVersion + * @param processKeyAndVersion * not <code>null</code> * @return returns the default application context if no special application context is registered for the given * <b>processDefinitionKey</b> and <b>processDefinitionVersion</b> */ - ApplicationContext getApplicationContext(String processDefinitionKey, String processDefinitionVersion); + ApplicationContext getApplicationContext(ProcessKeyAndVersion processKeyAndVersion); /** * @return additional {@link TypedValueSerializer}s from the plugin to deploy into the process engine diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java index ccdb654de..dfddc9303 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java @@ -5,19 +5,20 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ApplicationContext; public class DelegateProviderImpl implements DelegateProvider, InitializingBean { - private final Map<String, ClassLoader> classLoaderByProcessDefinitionKeyAndVersion; + private final Map<ProcessKeyAndVersion, ClassLoader> classLoaderByProcessDefinitionKeyAndVersion; private final ClassLoader defaultClassLoader; - private final Map<String, ApplicationContext> applicationContextByProcessDefinitionKeyAndVersion; + private final Map<ProcessKeyAndVersion, ApplicationContext> applicationContextByProcessDefinitionKeyAndVersion; private final ApplicationContext defaultApplicationContext; - public DelegateProviderImpl(Map<String, ClassLoader> classLoaderByProcessDefinitionKeyAndVersion, + public DelegateProviderImpl(Map<ProcessKeyAndVersion, ClassLoader> classLoaderByProcessDefinitionKeyAndVersion, ClassLoader defaultClassLoader, - Map<String, ApplicationContext> applicationContextByProcessDefinitionKeyAndVersion, + Map<ProcessKeyAndVersion, ApplicationContext> applicationContextByProcessDefinitionKeyAndVersion, ApplicationContext defaultApplicationContext) { this.classLoaderByProcessDefinitionKeyAndVersion = classLoaderByProcessDefinitionKeyAndVersion; @@ -38,31 +39,22 @@ public void afterPropertiesSet() throws Exception } @Override - public ClassLoader getClassLoader(String processDefinitionKey, String processDefinitionVersion) + public ClassLoader getClassLoader(ProcessKeyAndVersion processKeyAndVersion) { - Objects.requireNonNull(processDefinitionKey, "processDefinitionKey"); - Objects.requireNonNull(processDefinitionVersion, "processDefinitionVersion"); + Objects.requireNonNull(processKeyAndVersion, "processKeyAndVersion"); - return classLoaderByProcessDefinitionKeyAndVersion.getOrDefault( - toProcessDefinitionKeyAndVersion(processDefinitionKey, processDefinitionVersion), defaultClassLoader); + return classLoaderByProcessDefinitionKeyAndVersion.getOrDefault(processKeyAndVersion, defaultClassLoader); } @Override - public ApplicationContext getApplicationContext(String processDefinitionKey, String processDefinitionVersion) + public ApplicationContext getApplicationContext(ProcessKeyAndVersion processKeyAndVersion) { - Objects.requireNonNull(processDefinitionKey, "processDefinitionKey"); - Objects.requireNonNull(processDefinitionVersion, "processDefinitionVersion"); + Objects.requireNonNull(processKeyAndVersion, "processKeyAndVersion"); - return applicationContextByProcessDefinitionKeyAndVersion.getOrDefault( - toProcessDefinitionKeyAndVersion(processDefinitionKey, processDefinitionVersion), + return applicationContextByProcessDefinitionKeyAndVersion.getOrDefault(processKeyAndVersion, defaultApplicationContext); } - private String toProcessDefinitionKeyAndVersion(String processDefinitionKey, String processDefinitionVersion) - { - return processDefinitionKey + "/" + processDefinitionVersion; - } - @SuppressWarnings("rawtypes") @Override public Stream<TypedValueSerializer> getAdditionalTypedValueSerializers() diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPlugin.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPlugin.java index 24d679e96..c01ffc0ac 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPlugin.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPlugin.java @@ -15,6 +15,7 @@ import org.camunda.bpm.model.bpmn.Bpmn; import org.camunda.bpm.model.bpmn.BpmnModelInstance; import org.camunda.bpm.model.bpmn.instance.Process; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,20 +77,15 @@ public void postProcessEngineBuild(ProcessEngine processEngine) models.forEach(fileAndModel -> deploy(processEngine, fileAndModel)); } - public List<String> getProcessKeysAndVersions() + public List<ProcessKeyAndVersion> getProcessKeysAndVersions() { return models.stream().flatMap(fileAndModel -> { Collection<Process> processes = fileAndModel.model.getModelElementsByType(Process.class); - return processes.stream().map(p -> toProcessDefinitionKeyAndVersion(p.getId(), p.getCamundaVersionTag())); + return processes.stream().map(p -> new ProcessKeyAndVersion(p.getId(), p.getCamundaVersionTag())); }).collect(Collectors.toList()); } - private String toProcessDefinitionKeyAndVersion(String processDefinitionKey, String processDefinitionVersion) - { - return processDefinitionKey + "/" + processDefinitionVersion; - } - private void deploy(ProcessEngine processEngine, BpmnFileAndModel fileAndModel) { RepositoryService repositoryService = processEngine.getRepositoryService(); diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java index 513355d85..8badff1ca 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java @@ -2,29 +2,46 @@ import java.nio.file.Path; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.camunda.bpm.model.bpmn.Bpmn; +import org.camunda.bpm.model.bpmn.BpmnModelInstance; +import org.camunda.bpm.model.bpmn.instance.Process; import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.process.BpmnFileAndModel; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.fhir.resources.ResourceProvider; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import ca.uhn.fhir.context.FhirContext; + public class ProcessPluginDefinitionAndClassLoader { + private final FhirContext fhirContext; private final List<Path> jars = new ArrayList<>(); private final ProcessPluginDefinition definition; private final ClassLoader classLoader; + private final boolean draft; - private ProcessPlugin processPlugin; + private List<BpmnFileAndModel> models; + private ResourceProvider resourceProvider; - public ProcessPluginDefinitionAndClassLoader(List<Path> jars, ProcessPluginDefinition definition, - ClassLoader classLoader) + public ProcessPluginDefinitionAndClassLoader(FhirContext fhirContext, List<Path> jars, + ProcessPluginDefinition definition, ClassLoader classLoader, boolean draft) { + this.fhirContext = fhirContext; + if (jars != null) this.jars.addAll(jars); this.definition = definition; this.classLoader = classLoader; + this.draft = draft; } public List<Path> getJars() @@ -52,16 +69,46 @@ public ApplicationContext createPluginApplicationContext(ApplicationContext main return context; } - public ProcessPlugin getProcessPlugin() + public List<ProcessKeyAndVersion> getProcessKeysAndVersions() + { + return getAndValidateModels().stream().flatMap(fileAndModel -> + { + Collection<Process> processes = fileAndModel.getModel().getModelElementsByType(Process.class); + return processes.stream().map(p -> new ProcessKeyAndVersion(p.getId(), p.getCamundaVersionTag())); + }).collect(Collectors.toList()); + } + + public List<BpmnFileAndModel> getAndValidateModels() + { + return getAndValidateModels(jars, getDefinition().getBpmnFiles(), getClassLoader()); + } + + private List<BpmnFileAndModel> getAndValidateModels(List<Path> jars, Stream<String> bpmnFiles, + ClassLoader classLoader) + { + if (models == null) + models = bpmnFiles.map(file -> loadAndValidateModel(file, classLoader, jars)).collect(Collectors.toList()); + + return models; + } + + private BpmnFileAndModel loadAndValidateModel(String bpmnFile, ClassLoader classLoader, List<Path> jars) + { + BpmnModelInstance model = Bpmn.readModelFromStream(classLoader.getResourceAsStream(bpmnFile)); + Bpmn.validateModel(model); + return new BpmnFileAndModel(bpmnFile, model, jars); + } + + public ResourceProvider getResourceProvider() { - if (processPlugin == null) - processPlugin = ProcessPlugin.loadAndValidateModels(jars, getDefinition().getBpmnFiles(), getClassLoader()); + if (resourceProvider == null) + resourceProvider = getDefinition().getResourceProvider(fhirContext, getClassLoader()); - return processPlugin; + return resourceProvider; } - public List<String> getProcessKeysAndVersions() + public boolean isDraft() { - return getProcessPlugin().getProcessKeysAndVersions(); + return draft; } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java index 3fe292b2d..fc9f77fd7 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java @@ -3,6 +3,8 @@ import java.util.List; import java.util.Map; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.fhir.resources.ResourceProvider; import org.springframework.context.ApplicationContext; public interface ProcessPluginProvider @@ -28,15 +30,27 @@ public interface ProcessPluginProvider */ List<ProcessPluginDefinitionAndClassLoader> getDefinitions(); + /** + * @return definitions by {@link ProcessKeyAndVersion} + * @see #getDefinitions() + */ + Map<ProcessKeyAndVersion, ProcessPluginDefinitionAndClassLoader> getDefinitionByProcessKeyAndVersion(); + /** * @return class loaders for process plugin jars by process definition key / version * @see #getDefinitions() */ - Map<String, ClassLoader> getClassLoadersByProcessDefinitionKeyAndVersion(); + Map<ProcessKeyAndVersion, ClassLoader> getClassLoadersByProcessDefinitionKeyAndVersion(); /** * @return application contexts for process plugin jars by process definition key / version * @see #getDefinitions() */ - Map<String, ApplicationContext> getApplicationContextsByProcessDefinitionKeyAndVersion(); + Map<ProcessKeyAndVersion, ApplicationContext> getApplicationContextsByProcessDefinitionKeyAndVersion(); + + Map<String, ResourceProvider> getResouceProvidersByDpendencyJarName(); + + List<ProcessKeyAndVersion> getProcessKeyAndVersions(); + + List<ProcessKeyAndVersion> getDraftProcessKeyAndVersions(); } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java index c6a57e468..c37fb0e63 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java @@ -20,11 +20,15 @@ import java.util.stream.Stream; import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.fhir.resources.ResourceProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ApplicationContext; +import ca.uhn.fhir.context.FhirContext; + public class ProcessPluginProviderImpl implements ProcessPluginProvider, InitializingBean { private static final class Pair<K, V> @@ -39,15 +43,21 @@ private static final class Pair<K, V> } } + public static final String FILE_DRAFT_SUFIX = "-SNAPSHOT.jar"; + public static final String FOLDER_DRAFT_SUFIX = "-SNAPSHOT"; + private static final Logger logger = LoggerFactory.getLogger(ProcessPluginProviderImpl.class); + private final FhirContext fhirContext; private final Path pluginDirectory; private final ApplicationContext mainApplicationContext; private List<ProcessPluginDefinitionAndClassLoader> definitions; - public ProcessPluginProviderImpl(Path pluginDirectory, ApplicationContext mainApplicationContext) + public ProcessPluginProviderImpl(FhirContext fhirContext, Path pluginDirectory, + ApplicationContext mainApplicationContext) { + this.fhirContext = fhirContext; this.pluginDirectory = pluginDirectory; this.mainApplicationContext = mainApplicationContext; } @@ -55,6 +65,7 @@ public ProcessPluginProviderImpl(Path pluginDirectory, ApplicationContext mainAp @Override public void afterPropertiesSet() throws Exception { + Objects.requireNonNull(fhirContext, "fhirContext"); Objects.requireNonNull(pluginDirectory, "pluginDirectory"); Objects.requireNonNull(mainApplicationContext, "mainApplicationContext"); } @@ -95,7 +106,7 @@ else if (Files.isDirectory(p)) definitions.add(def); } else - logger.warn("Ignoring folder/file {}", p.toAbsolutePath().toString()); + logger.warn("Ignoring file/folder {}", p.toAbsolutePath().toString()); }); return definitions; @@ -142,7 +153,11 @@ else if (definitions.size() > 1) return null; } - return new ProcessPluginDefinitionAndClassLoader(jars, definitions.get(0).get(), classLoader); + boolean draft = jars.size() == 1 ? jars.get(0).getFileName().toString().endsWith(FILE_DRAFT_SUFIX) + : folder.toString().endsWith(FOLDER_DRAFT_SUFIX); + + return new ProcessPluginDefinitionAndClassLoader(fhirContext, jars, definitions.get(0).get(), classLoader, + draft); } private List<Path> getJars(Path folder) @@ -267,13 +282,17 @@ private ProcessPluginDefinitionAndClassLoader toDefinitionWithDependency(String .filter(def -> def.getClass().getName().equals(definitionClassName)).findFirst().orElseThrow( () -> new RuntimeException("ProcessPluginDefinition " + definitionClassName + " not found")); - return new ProcessPluginDefinitionAndClassLoader(jars, definition, classLoader); + boolean draft = jars.size() == 1 ? jars.get(0).getFileName().toString().endsWith(FILE_DRAFT_SUFIX) + : folder.toString().endsWith(FOLDER_DRAFT_SUFIX); + + return new ProcessPluginDefinitionAndClassLoader(fhirContext, jars, definition, classLoader, draft); } - public Map<String, ClassLoader> getClassLoadersByProcessDefinitionKeyAndVersion() + @Override + public Map<ProcessKeyAndVersion, ClassLoader> getClassLoadersByProcessDefinitionKeyAndVersion() { return getDefinitions().stream() - .flatMap(def -> def.getProcessPlugin().getProcessKeysAndVersions().stream() + .flatMap(def -> def.getProcessKeysAndVersions().stream() .map(keyAndVersion -> new Pair<>(keyAndVersion, def.getClassLoader()))) .collect(Collectors.toMap(p -> p.k, p -> p.v, dupplicatedProcessKeyVersion())); } @@ -287,10 +306,39 @@ private <T> BinaryOperator<T> dupplicatedProcessKeyVersion() } @Override - public Map<String, ApplicationContext> getApplicationContextsByProcessDefinitionKeyAndVersion() + public Map<ProcessKeyAndVersion, ApplicationContext> getApplicationContextsByProcessDefinitionKeyAndVersion() { - return getDefinitions().stream().flatMap(def -> def.getProcessPlugin().getProcessKeysAndVersions().stream().map( + return getDefinitions().stream().flatMap(def -> def.getProcessKeysAndVersions().stream().map( keyAndVersion -> new Pair<>(keyAndVersion, def.createPluginApplicationContext(mainApplicationContext)))) .collect(Collectors.toMap(p -> p.k, p -> p.v, dupplicatedProcessKeyVersion())); } + + @Override + public Map<ProcessKeyAndVersion, ProcessPluginDefinitionAndClassLoader> getDefinitionByProcessKeyAndVersion() + { + return getDefinitions().stream().flatMap( + def -> def.getProcessKeysAndVersions().stream().map(keyAndVersion -> new Pair<>(keyAndVersion, def))) + .collect(Collectors.toMap(p -> p.k, p -> p.v, dupplicatedProcessKeyVersion())); + } + + @Override + public Map<String, ResourceProvider> getResouceProvidersByDpendencyJarName() + { + return getDefinitions().stream() + .collect(Collectors.toMap(def -> def.getDefinition().getJarName(), def -> def.getResourceProvider())); + } + + @Override + public List<ProcessKeyAndVersion> getProcessKeyAndVersions() + { + return getDefinitions().stream().flatMap(def -> def.getProcessKeysAndVersions().stream()) + .collect(Collectors.toList()); + } + + @Override + public List<ProcessKeyAndVersion> getDraftProcessKeyAndVersions() + { + return getDefinitions().stream().filter(ProcessPluginDefinitionAndClassLoader::isDraft) + .flatMap(def -> def.getProcessKeysAndVersions().stream()).collect(Collectors.toList()); + } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/BpmnFileAndModel.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/BpmnFileAndModel.java new file mode 100644 index 000000000..a172a3ac1 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/BpmnFileAndModel.java @@ -0,0 +1,39 @@ +package org.highmed.dsf.bpe.process; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.camunda.bpm.model.bpmn.BpmnModelInstance; + +public final class BpmnFileAndModel +{ + private final String file; + private final BpmnModelInstance model; + private final List<Path> jars = new ArrayList<>(); + + public BpmnFileAndModel(String file, BpmnModelInstance model, Collection<? extends Path> jars) + { + this.file = file; + this.model = model; + if (jars != null) + this.jars.addAll(jars); + } + + public String getFile() + { + return file; + } + + public BpmnModelInstance getModel() + { + return model; + } + + public List<Path> getJars() + { + return Collections.unmodifiableList(jars); + } +} \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessKeyAndVersion.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessKeyAndVersion.java new file mode 100644 index 000000000..053fe9d09 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessKeyAndVersion.java @@ -0,0 +1,106 @@ +package org.highmed.dsf.bpe.process; + +import java.util.Comparator; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import org.camunda.bpm.engine.repository.ProcessDefinition; + +public class ProcessKeyAndVersion implements Comparable<ProcessKeyAndVersion> +{ + public static ProcessKeyAndVersion fromString(String keyAndVersion) + { + Objects.requireNonNull(keyAndVersion, "keyAndVersion"); + + String[] split = keyAndVersion.split("/"); + if (split.length != 2) + throw new IllegalArgumentException("Format: 'key/version' expected"); + + return new ProcessKeyAndVersion(split[0], split[1]); + } + + public static List<ProcessKeyAndVersion> fromStrings(List<String> keysAndVersions) + { + Objects.requireNonNull(keysAndVersions, "keysAndVersions"); + + return keysAndVersions.stream().filter(s -> s != null && !s.isBlank()).map(ProcessKeyAndVersion::fromString) + .collect(Collectors.toList()); + } + + public static ProcessKeyAndVersion fromDefinition(ProcessDefinition definition) + { + Objects.requireNonNull(definition, "definition"); + + return new ProcessKeyAndVersion(definition.getKey(), definition.getVersionTag()); + } + + private final String key; + private final String version; + + public ProcessKeyAndVersion(String key, String version) + { + this.key = key; + this.version = version; + } + + public String getKey() + { + return key; + } + + public String getVersion() + { + return version; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((key == null) ? 0 : key.hashCode()); + result = prime * result + ((version == null) ? 0 : version.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ProcessKeyAndVersion other = (ProcessKeyAndVersion) obj; + if (key == null) + { + if (other.key != null) + return false; + } + else if (!key.equals(other.key)) + return false; + if (version == null) + { + if (other.version != null) + return false; + } + else if (!version.equals(other.version)) + return false; + return true; + } + + @Override + public String toString() + { + return getKey() + "/" + getVersion(); + } + + @Override + public int compareTo(ProcessKeyAndVersion o) + { + return Comparator.comparing(ProcessKeyAndVersion::getKey).thenComparing(ProcessKeyAndVersion::getVersion) + .compare(this, o); + } +} \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessState.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessState.java new file mode 100644 index 000000000..0791a0a28 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessState.java @@ -0,0 +1,18 @@ +package org.highmed.dsf.bpe.process; + +public enum ProcessState +{ + NEW(-1), ACTIVE(3), DRAFT(2), RETIRED(1), EXCLUDED(0); + + private final int priority; + + private ProcessState(int priority) + { + this.priority = priority; + } + + public boolean isHigherPriority(ProcessState then) + { + return priority > then.priority; + } +} \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessStateChangeOutcome.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessStateChangeOutcome.java new file mode 100644 index 000000000..adcb5b9df --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessStateChangeOutcome.java @@ -0,0 +1,39 @@ +package org.highmed.dsf.bpe.process; + +import java.util.Objects; + +public class ProcessStateChangeOutcome +{ + private final ProcessKeyAndVersion processKeyAndVersion; + private final ProcessState oldProcessState; + private final ProcessState newProcessState; + + public ProcessStateChangeOutcome(ProcessKeyAndVersion processKeyAndVersion, ProcessState oldProcessState, + ProcessState newProcessState) + { + this.processKeyAndVersion = Objects.requireNonNull(processKeyAndVersion, "processKeyAndVersion"); + this.oldProcessState = Objects.requireNonNull(oldProcessState, "oldProcessState"); + this.newProcessState = Objects.requireNonNull(newProcessState, "newProcessState"); + } + + public ProcessKeyAndVersion getProcessKeyAndVersion() + { + return processKeyAndVersion; + } + + public ProcessState getOldProcessState() + { + return oldProcessState; + } + + public ProcessState getNewProcessState() + { + return newProcessState; + } + + @Override + public String toString() + { + return getProcessKeyAndVersion().toString() + " " + getOldProcessState() + " -> " + getNewProcessState(); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessesResource.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessesResource.java new file mode 100644 index 000000000..29306d0d6 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ProcessesResource.java @@ -0,0 +1,148 @@ +package org.highmed.dsf.bpe.process; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import org.hl7.fhir.r4.model.ActivityDefinition; +import org.hl7.fhir.r4.model.CodeSystem; +import org.hl7.fhir.r4.model.MetadataResource; +import org.hl7.fhir.r4.model.NamingSystem; +import org.hl7.fhir.r4.model.StructureDefinition; +import org.hl7.fhir.r4.model.ValueSet; + +import com.google.common.base.Objects; + +public final class ProcessesResource +{ + public static ProcessesResource from(MetadataResource resource) + { + if (resource instanceof ActivityDefinition) + return from((ActivityDefinition) resource); + else if (resource instanceof CodeSystem) + return from((CodeSystem) resource); + else if (resource instanceof NamingSystem) + return from((NamingSystem) resource); + else if (resource instanceof StructureDefinition) + return from((StructureDefinition) resource); + else if (resource instanceof ValueSet) + return from((ValueSet) resource); + else + throw new IllegalArgumentException( + "MetadataResource of type" + resource.getClass().getName() + " not supported"); + } + + public static ProcessesResource from(ActivityDefinition resource) + { + return new ProcessesResource( + new ResourceInfo(resource.getResourceType().name(), resource.getUrl(), resource.getVersion(), null), + resource); + } + + public static ProcessesResource from(CodeSystem resource) + { + return new ProcessesResource( + new ResourceInfo(resource.getResourceType().name(), resource.getUrl(), resource.getVersion(), null), + resource); + } + + public static ProcessesResource from(NamingSystem resource) + { + return new ProcessesResource( + new ResourceInfo(resource.getResourceType().name(), null, null, resource.getName()), resource); + } + + public static ProcessesResource from(StructureDefinition resource) + { + return new ProcessesResource( + new ResourceInfo(resource.getResourceType().name(), resource.getUrl(), resource.getVersion(), null), + resource); + } + + public static ProcessesResource from(ValueSet resource) + { + return new ProcessesResource( + new ResourceInfo(resource.getResourceType().name(), resource.getUrl(), resource.getVersion(), null), + resource); + } + + public static ProcessesResource from(ResourceInfo resourceInfo) + { + return new ProcessesResource(resourceInfo, null); + } + + private final ResourceInfo resourceInfo; + private final MetadataResource resource; + private final Set<ProcessKeyAndVersion> processes = new HashSet<>(); + + private ProcessState oldState; + private ProcessState newState; + + private ProcessesResource(ResourceInfo resourceInfo, MetadataResource resource) + { + this.resourceInfo = resourceInfo; + this.resource = resource; + } + + public ResourceInfo getResourceInfo() + { + return resourceInfo; + } + + public MetadataResource getResource() + { + return resource; + } + + public Set<ProcessKeyAndVersion> getProcesses() + { + return Collections.unmodifiableSet(processes); + } + + public ProcessesResource add(ProcessKeyAndVersion process) + { + processes.add(process); + + return this; + } + + public void addAll(Set<ProcessKeyAndVersion> processes) + { + this.processes.addAll(processes); + } + + public ProcessesResource setOldProcessState(ProcessState oldState) + { + this.oldState = oldState; + + return this; + } + + public ProcessState getOldProcessState() + { + return oldState; + } + + public ProcessesResource setNewProcessState(ProcessState newState) + { + this.newState = newState; + + return this; + } + + public ProcessState getNewProcessState() + { + return newState; + } + + public boolean hasStateChangeOrDraft() + { + return !Objects.equal(getOldProcessState(), getNewProcessState()) + || (ProcessState.DRAFT.equals(getOldProcessState()) && ProcessState.DRAFT.equals(getNewProcessState())); + } + + public boolean notNewToExcludedChange() + { + return !(ProcessState.NEW.equals(getOldProcessState()) && ProcessState.EXCLUDED.equals(getNewProcessState())); + } +} \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ResourceInfo.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ResourceInfo.java new file mode 100644 index 000000000..9187f5521 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ResourceInfo.java @@ -0,0 +1,160 @@ +package org.highmed.dsf.bpe.process; + +import java.util.Comparator; +import java.util.Objects; +import java.util.UUID; + +public class ResourceInfo implements Comparable<ResourceInfo> +{ + private final String resourceType; + private final String url; + private final String version; + private final String name; + + private UUID resourceId; + + public ResourceInfo(String resourceType, String url, String version, String name) + { + this.resourceType = resourceType; + this.url = url; + this.version = version; + this.name = name; + + validate(); + } + + private void validate() + { + Objects.requireNonNull(resourceType, "resourceType"); + + if ("NamingSystem".equals(getResourceType())) + { + if (url != null) + throw new IllegalArgumentException("url not null for " + resourceType); + if (version != null) + throw new IllegalArgumentException("version not null for " + resourceType); + Objects.requireNonNull(name, "name"); + } + else + { + Objects.requireNonNull(url, "url"); + Objects.requireNonNull(version, "version"); + if (name != null) + throw new IllegalArgumentException("name not null for " + resourceType); + } + } + + public String getResourceType() + { + return resourceType; + } + + public String getUrl() + { + return url; + } + + public String getVersion() + { + return version; + } + + public String getName() + { + return name; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode()); + result = prime * result + ((url == null) ? 0 : url.hashCode()); + result = prime * result + ((version == null) ? 0 : version.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ResourceInfo other = (ResourceInfo) obj; + if (resourceType == null) + { + if (other.resourceType != null) + return false; + } + else if (!resourceType.equals(other.resourceType)) + return false; + if (url == null) + { + if (other.url != null) + return false; + } + else if (!url.equals(other.url)) + return false; + if (version == null) + { + if (other.version != null) + return false; + } + else if (!version.equals(other.version)) + return false; + if (name == null) + { + if (other.name != null) + return false; + } + else if (!name.equals(other.name)) + return false; + return true; + } + + @Override + public int compareTo(ResourceInfo o) + { + Comparator<ResourceInfo> comparator; + + if ("NamingSystem".equals(getResourceType())) + comparator = Comparator.comparing(ResourceInfo::getResourceType).thenComparing(ResourceInfo::getName); + else + comparator = Comparator.comparing(ResourceInfo::getResourceType).thenComparing(ResourceInfo::getUrl) + .thenComparing(ResourceInfo::getVersion); + + return comparator.compare(this, o); + } + + @Override + public String toString() + { + return "ResouceInfo [resourceType=" + resourceType + ", url=" + url + ", version=" + version + ", name=" + name + + "]"; + } + + public String toConditionalCreateUrl() + { + if ("NamingSystem".equals(getResourceType())) + return "name=" + getName(); + else + return "url=" + getUrl() + "&version=" + getVersion(); + } + + public UUID getResourceId() + { + return resourceId; + } + + public ResourceInfo setResourceId(UUID resourceId) + { + this.resourceId = resourceId; + + return this; + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeService.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeService.java index 8cc239125..5b66bff7c 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeService.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeService.java @@ -1,6 +1,17 @@ package org.highmed.dsf.bpe.service; +import java.util.List; +import java.util.stream.Stream; + +import org.highmed.dsf.bpe.process.BpmnFileAndModel; +import org.highmed.dsf.bpe.process.ProcessStateChangeOutcome; + public interface BpmnProcessStateChangeService { - void suspendOrActivateProcesses(); + /** + * @param models + * models to deploy, not <code>null</code> + * @return list of state changes + */ + List<ProcessStateChangeOutcome> deploySuspendOrActivateProcesses(Stream<BpmnFileAndModel> models); } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeServiceImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeServiceImpl.java index 80a57a0ba..f2aa52983 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeServiceImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnProcessStateChangeServiceImpl.java @@ -1,12 +1,27 @@ package org.highmed.dsf.bpe.service; +import java.nio.file.Path; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.camunda.bpm.engine.RepositoryService; +import org.camunda.bpm.engine.repository.Deployment; +import org.camunda.bpm.engine.repository.DeploymentBuilder; import org.camunda.bpm.engine.repository.ProcessDefinition; +import org.camunda.bpm.model.bpmn.instance.Process; +import org.highmed.dsf.bpe.dao.ProcessStateDao; import org.highmed.dsf.bpe.plugin.ProcessPluginProvider; +import org.highmed.dsf.bpe.process.BpmnFileAndModel; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.bpe.process.ProcessState; +import org.highmed.dsf.bpe.process.ProcessStateChangeOutcome; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; @@ -16,63 +31,166 @@ public class BpmnProcessStateChangeServiceImpl implements BpmnProcessStateChange private static final Logger logger = LoggerFactory.getLogger(BpmnProcessStateChangeServiceImpl.class); private final RepositoryService repositoryService; + private final ProcessStateDao processStateDao; private final ProcessPluginProvider processPluginProvider; + private final List<ProcessKeyAndVersion> excluded = new ArrayList<>(); + private final List<ProcessKeyAndVersion> retired = new ArrayList<>(); + private final List<ProcessKeyAndVersion> draft = new ArrayList<>(); - public BpmnProcessStateChangeServiceImpl(RepositoryService repositoryService, - ProcessPluginProvider processPluginProvider) + public BpmnProcessStateChangeServiceImpl(RepositoryService repositoryService, ProcessStateDao processStateDao, + ProcessPluginProvider processPluginProvider, List<ProcessKeyAndVersion> excluded, + List<ProcessKeyAndVersion> retired) { this.repositoryService = repositoryService; + this.processStateDao = processStateDao; this.processPluginProvider = processPluginProvider; + + if (excluded != null) + this.excluded.addAll(excluded); + if (retired != null) + this.retired.addAll(retired); + + this.draft.addAll(processPluginProvider.getDraftProcessKeyAndVersions()); } @Override public void afterPropertiesSet() throws Exception { Objects.requireNonNull(repositoryService, "repositoryService"); + Objects.requireNonNull(processStateDao, "processStateDao"); Objects.requireNonNull(processPluginProvider, "processPluginProvider"); } + private Map<ProcessKeyAndVersion, ProcessState> getStates() + { + try + { + return processStateDao.getStates(); + } + catch (SQLException e) + { + logger.warn("Error while retrieving process states from db", e); + throw new RuntimeException(e); + } + } + + private void updateStates(Map<ProcessKeyAndVersion, ProcessState> states) + { + try + { + processStateDao.updateStates(states); + } + catch (SQLException e) + { + logger.warn("Error while updating process states in db", e); + throw new RuntimeException(e); + } + } + @Override - public void suspendOrActivateProcesses() + public List<ProcessStateChangeOutcome> deploySuspendOrActivateProcesses(Stream<BpmnFileAndModel> models) { - List<ProcessDefinition> deployedProcessDefinitions = repositoryService.createProcessDefinitionQuery().list(); - List<String> expectedProcessDefinitionKeysAndVersions = processPluginProvider.getDefinitions().stream() - .map(def -> def.getProcessKeysAndVersions()).flatMap(List::stream).sorted() - .collect(Collectors.toList()); + Objects.requireNonNull(models, "models"); + + Map<ProcessKeyAndVersion, ProcessState> oldProcessStates = getStates(); + Map<ProcessKeyAndVersion, ProcessState> newProcessStates = new HashMap<>(); - logger.debug("Deployed process definitions: {} (before potential state change)", - deployedProcessDefinitions.stream() - .map(def -> toProcessDefinitionKeyAndVersion(def.getKey(), def.getVersionTag()) + " " - + (def.isSuspended() ? "(suspended)" : "(active)")) - .sorted().collect(Collectors.joining(", ", "[", "]"))); - logger.debug("Expected process definitions: {}", expectedProcessDefinitionKeysAndVersions); + logger.debug("Deploying process models ..."); + deployModels(models); - for (ProcessDefinition definition : deployedProcessDefinitions) + List<ProcessKeyAndVersion> loadedProcesses = processPluginProvider.getProcessKeyAndVersions(); + + List<ProcessDefinition> definitions = repositoryService.createProcessDefinitionQuery().list(); + for (ProcessDefinition definition : definitions) { - String definitionKeyAndVersion = toProcessDefinitionKeyAndVersion(definition.getKey(), - definition.getVersionTag()); - if (expectedProcessDefinitionKeysAndVersions.contains(definitionKeyAndVersion) && definition.isSuspended()) + ProcessKeyAndVersion process = ProcessKeyAndVersion.fromDefinition(definition); + + ProcessState oldState = oldProcessStates.getOrDefault(process, ProcessState.NEW); + + ProcessState newState = loadedProcesses.contains(process) ? ProcessState.ACTIVE : ProcessState.EXCLUDED; + if (excluded.contains(process)) + newState = ProcessState.EXCLUDED; + else if (retired.contains(process)) + newState = ProcessState.RETIRED; + else if (draft.contains(process)) + newState = ProcessState.DRAFT; + + newProcessStates.put(process, newState); + + logger.debug("{}: {} -> {}", process.toString(), oldState, newState); + + // NEW -> ACTIVE : - (new process active by default) + // NEW -> DRAFT : - (new process active by default) + // NEW -> RETIRED : suspend + // NEW -> EXCLUDED : suspend + // ACTIVE -> ACTIVE : - + // ACTIVE -> DRAFT : - + // ACTIVE -> RETIRED : suspend + // ACTIVE -> EXCLUDED : suspend + // DRAFT -> ACTIVE : - + // DRAFT -> DRAFT : - + // DRAFT -> RETIRED : suspend + // DRAFT -> EXCLUDED : suspend + // RETIRED -> ACTIVE : activate + // RETIRED -> DRAFT : activate + // RETIRED -> RETIRED : - + // RETIRED -> EXCLUDED : - + // EXCLUDED -> ACTIVE : activate + // EXCLUDED -> DRAFT : activate + // EXCLUDED -> RETIRED : - + // EXCLUDED -> EXCLUDED : - + + if ((ProcessState.RETIRED.equals(oldState) && ProcessState.ACTIVE.equals(newState)) + || (ProcessState.RETIRED.equals(oldState) && ProcessState.DRAFT.equals(newState)) + || (ProcessState.EXCLUDED.equals(oldState) && ProcessState.ACTIVE.equals(newState)) + || (ProcessState.EXCLUDED.equals(oldState) && ProcessState.DRAFT.equals(newState))) { - logger.info("Activating process {}", definitionKeyAndVersion); + logger.info("Activating process {}", process.toString()); repositoryService.activateProcessDefinitionById(definition.getId()); } - else if (!expectedProcessDefinitionKeysAndVersions.contains(definitionKeyAndVersion) - && !definition.isSuspended()) + else if ((ProcessState.NEW.equals(oldState) && ProcessState.RETIRED.equals(newState)) + || (ProcessState.NEW.equals(oldState) && ProcessState.EXCLUDED.equals(newState)) + || (ProcessState.ACTIVE.equals(oldState) && ProcessState.RETIRED.equals(newState)) + || (ProcessState.ACTIVE.equals(oldState) && ProcessState.EXCLUDED.equals(newState)) + || (ProcessState.DRAFT.equals(oldState) && ProcessState.RETIRED.equals(newState)) + || (ProcessState.DRAFT.equals(oldState) && ProcessState.EXCLUDED.equals(newState))) { - logger.info("Suspending process {}", definitionKeyAndVersion); + logger.info("Suspending process {}", process.toString()); repositoryService.suspendProcessDefinitionById(definition.getId()); } } - logger.info("Deployed process definitions: {}", - repositoryService.createProcessDefinitionQuery().list().stream() - .map(def -> toProcessDefinitionKeyAndVersion(def.getKey(), def.getVersionTag()) + " " - + (def.isSuspended() ? "(suspended)" : "(active)")) - .sorted().collect(Collectors.joining(", ", "[", "]"))); + updateStates(newProcessStates); + + return newProcessStates.entrySet().stream() + .map(e -> new ProcessStateChangeOutcome(e.getKey(), + oldProcessStates.getOrDefault(e.getKey(), ProcessState.NEW), e.getValue())) + .collect(Collectors.toList()); } - private String toProcessDefinitionKeyAndVersion(String processDefinitionKey, String processDefinitionVersion) + private void deployModels(Stream<BpmnFileAndModel> models) { - return processDefinitionKey + "/" + processDefinitionVersion; + models.forEach(fileAndModel -> deploy(fileAndModel)); + } + + private void deploy(BpmnFileAndModel fileAndModel) + { + DeploymentBuilder builder = repositoryService.createDeployment().name(fileAndModel.getFile()) + .source(fileAndModel.getFile()).addModelInstance(fileAndModel.getFile(), fileAndModel.getModel()) + .enableDuplicateFiltering(true); + + Deployment deployment = builder.deploy(); + + if (logger.isInfoEnabled()) + { + Collection<Process> processes = fileAndModel.getModel().getModelElementsByType(Process.class); + String processDefinitionKeysAndVersions = processes.stream() + .map(p -> p.getId() + "/" + p.getCamundaVersionTag()).collect(Collectors.joining(", ")); + + logger.info("Process{} {} from {}://{} deployed with id {}", processes.size() > 1 ? "es" : "", + processDefinitionKeysAndVersions, + fileAndModel.getJars().stream().map(Path::toString).collect(Collectors.joining("; ")), + fileAndModel.getFile(), deployment.getId()); + } } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationServiceImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationServiceImpl.java index c31a12186..ad6e4abe5 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationServiceImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/BpmnServiceDelegateValidationServiceImpl.java @@ -11,6 +11,7 @@ import org.camunda.bpm.model.bpmn.instance.Process; import org.camunda.bpm.model.bpmn.instance.ServiceTask; import org.highmed.dsf.bpe.delegate.DelegateProvider; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; @@ -60,44 +61,42 @@ private void validateBeanAvailabilityForModel(BpmnModelInstance model) private void validateBeanAvailabilityForProcess(Process process) { process.getChildElementsByType(ServiceTask.class).stream() - .forEach(task -> validateBeanAvailabilityForTask(process.getId(), process.getCamundaVersionTag(), + .forEach(task -> validateBeanAvailabilityForTask( + new ProcessKeyAndVersion(process.getId(), process.getCamundaVersionTag()), task.getCamundaClass())); } - private void validateBeanAvailabilityForTask(String processDefinitionKey, String processDefinitionVersion, - String className) + private void validateBeanAvailabilityForTask(ProcessKeyAndVersion processKeyAndVersion, String className) { - Class<?> serviceClass = loadClass(processDefinitionKey, processDefinitionVersion, className); - loadBean(processDefinitionKey, processDefinitionVersion, serviceClass); + Class<?> serviceClass = loadClass(processKeyAndVersion, className); + loadBean(processKeyAndVersion, serviceClass); } - private void loadBean(String processDefinitionKey, String processDefinitionVersion, Class<?> serviceClass) + private void loadBean(ProcessKeyAndVersion processKeyAndVersion, Class<?> serviceClass) { try { - ApplicationContext applicationContext = delegateProvider.getApplicationContext(processDefinitionKey, - processDefinitionVersion); + ApplicationContext applicationContext = delegateProvider.getApplicationContext(processKeyAndVersion); applicationContext.getBean(serviceClass); } catch (BeansException e) { - logger.warn("Error while getting service delegate bean of type {} defined in process {}/{} not found", - serviceClass.getName(), processDefinitionKey, processDefinitionVersion); + logger.warn("Error while getting service delegate bean of type {} defined in process {} not found", + serviceClass.getName(), processKeyAndVersion); throw new RuntimeException(e); } } - private Class<?> loadClass(String processDefinitionKey, String processDefinitionVersion, String className) + private Class<?> loadClass(ProcessKeyAndVersion processKeyAndVersion, String className) { try { - ClassLoader classLoader = delegateProvider.getClassLoader(processDefinitionKey, processDefinitionVersion); + ClassLoader classLoader = delegateProvider.getClassLoader(processKeyAndVersion); return classLoader.loadClass(className); } catch (ClassNotFoundException e) { - logger.warn("Service delegate class {} defined in process {}/{} not found", className, processDefinitionKey, - processDefinitionVersion); + logger.warn("Service delegate class {} defined in process {} not found", className, processKeyAndVersion); throw new RuntimeException(e); } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandler.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandler.java new file mode 100644 index 000000000..b1a0fbdae --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandler.java @@ -0,0 +1,15 @@ +package org.highmed.dsf.bpe.service; + +import java.util.List; +import java.util.Map; + +import org.highmed.dsf.bpe.plugin.ProcessPluginDefinitionAndClassLoader; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.bpe.process.ProcessStateChangeOutcome; + +public interface FhirResourceHandler +{ + void applyStateChangesAndStoreNewResourcesInDb( + Map<ProcessKeyAndVersion, ProcessPluginDefinitionAndClassLoader> definitionByProcessKeyAndVersion, + List<ProcessStateChangeOutcome> changes); +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java new file mode 100644 index 000000000..33f216346 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java @@ -0,0 +1,458 @@ +package org.highmed.dsf.bpe.service; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.highmed.dsf.bpe.dao.ProcessPluginResourcesDao; +import org.highmed.dsf.bpe.plugin.ProcessPluginDefinitionAndClassLoader; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.bpe.process.ProcessState; +import org.highmed.dsf.bpe.process.ProcessStateChangeOutcome; +import org.highmed.dsf.bpe.process.ProcessesResource; +import org.highmed.dsf.bpe.process.ResourceInfo; +import org.highmed.dsf.fhir.resources.ResourceProvider; +import org.highmed.fhir.client.FhirWebserviceClient; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent; +import org.hl7.fhir.r4.model.Bundle.BundleType; +import org.hl7.fhir.r4.model.Bundle.HTTPVerb; +import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; +import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.MetadataResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; + +import ca.uhn.fhir.context.FhirContext; + +public class FhirResourceHandlerImpl implements FhirResourceHandler, InitializingBean +{ + private static final Logger logger = LoggerFactory.getLogger(FhirResourceHandlerImpl.class); + + private final FhirWebserviceClient localWebserviceClient; + private final ProcessPluginResourcesDao dao; + private final FhirContext fhirContext; + + private final Map<String, ResourceProvider> resouceProvidersByDpendencyJarName = new HashMap<>(); + + public FhirResourceHandlerImpl(FhirWebserviceClient localWebserviceClient, ProcessPluginResourcesDao dao, + FhirContext fhirContext, Map<String, ResourceProvider> resouceProvidersByDpendencyJarName) + { + this.localWebserviceClient = localWebserviceClient; + this.dao = dao; + this.fhirContext = fhirContext; + + if (resouceProvidersByDpendencyJarName != null) + this.resouceProvidersByDpendencyJarName.putAll(resouceProvidersByDpendencyJarName); + } + + @Override + public void afterPropertiesSet() throws Exception + { + Objects.requireNonNull(localWebserviceClient, "localWebserviceClient"); + Objects.requireNonNull(dao, "dao"); + Objects.requireNonNull(fhirContext, "fhirContext"); + } + + @Override + public void applyStateChangesAndStoreNewResourcesInDb( + Map<ProcessKeyAndVersion, ProcessPluginDefinitionAndClassLoader> definitionByProcessKeyAndVersion, + List<ProcessStateChangeOutcome> changes) + { + Objects.requireNonNull(definitionByProcessKeyAndVersion, "definitionByProcessKeyAndVersion"); + Objects.requireNonNull(changes, "changes"); + + Map<ProcessKeyAndVersion, List<ResourceInfo>> dbResourcesByProcess = getResourceInfosFromDb(); + + Map<ResourceInfo, ProcessesResource> resources = new HashMap<>(); + for (ProcessStateChangeOutcome change : changes) + { + Stream<ProcessesResource> proccessResources = getResources(definitionByProcessKeyAndVersion, + dbResourcesByProcess, change.getProcessKeyAndVersion()); + + proccessResources.forEach(r -> + { + resources.computeIfPresent(r.getResourceInfo(), (k, v) -> + { + v.addAll(r.getProcesses()); + + if (change.getNewProcessState().isHigherPriority(v.getNewProcessState())) + v.setNewProcessState(change.getNewProcessState()); + if (change.getOldProcessState().isHigherPriority(v.getOldProcessState())) + v.setOldProcessState(change.getOldProcessState()); + + return v; + }); + + resources.putIfAbsent(r.getResourceInfo(), r.setNewProcessState(change.getNewProcessState()) + .setOldProcessState(change.getOldProcessState())); + }); + } + + List<ProcessesResource> resourceValues = new ArrayList<>( + resources.values().stream().filter(ProcessesResource::hasStateChangeOrDraft) + .filter(ProcessesResource::notNewToExcludedChange).collect(Collectors.toList())); + + Bundle batchBundle = new Bundle(); + batchBundle.setType(BundleType.BATCH); + + List<BundleEntryComponent> entries = toEntries(resourceValues); + batchBundle.setEntry(entries); + + try + { + if (batchBundle.getEntry().isEmpty()) + logger.debug("No transaction bundle to execute"); + else + { + logger.debug("Executing process plugin resources bundle"); + logger.trace("Bundle: {}", fhirContext.newJsonParser().encodeResourceToString(batchBundle)); + + // // TODO retries + Bundle returnBundle = localWebserviceClient.withMinimalReturn().withRetry(1).postBundle(batchBundle); + + addIds(resourceValues, returnBundle); + + try + { + dao.addResources(resources.values()); + } + catch (SQLException e) + { + logger.error("Error while adding process plugin resource to the db", e); + throw new RuntimeException(e); + } + } + } + catch (Exception e) + { + logger.warn("Error while executing process plugins resource bundle: {}", e.getMessage()); + logger.warn( + "Resources in FHIR server may not be consitent, please check resources and execute the following bundle if necessary: {}", + fhirContext.newJsonParser().encodeResourceToString(batchBundle)); + throw e; + } + } + + private void addIds(List<ProcessesResource> resourceValues, Bundle returnBundle) + { + if (resourceValues.size() != returnBundle.getEntry().size()) + throw new RuntimeException("Return bundle size unexpeced, expected " + resourceValues.size() + " got " + + returnBundle.getEntry().size()); + + for (int i = 0; i < resourceValues.size(); i++) + { + ProcessesResource resource = resourceValues.get(i); + BundleEntryComponent entry = returnBundle.getEntry().get(i); + + if (resource.getResourceInfo().getResourceId() == null + && !entry.getResponse().getStatus().startsWith("201")) + { + throw new RuntimeException("Return status " + entry.getResponse().getStatus() + + " not starting with '201' for new resource " + resource.getResourceInfo().toString() + + " of processes " + resource.getProcesses()); + } + else if (resource.getResourceInfo().getResourceId() != null + && entry.getResponse().getStatus().startsWith("201")) + { + throw new RuntimeException("Return status starting with '201' unexpected for existing resource " + + resource.getResourceInfo().toString() + " of processes " + resource.getProcesses()); + } + + if (!ProcessState.EXCLUDED.equals(resource.getNewProcessState())) + { + IdType id = new IdType(entry.getResponse().getLocation()); + + if (!resource.getResourceInfo().getResourceType().equals(id.getResourceType())) + throw new RuntimeException("Return resource type unexpected, expected " + + resource.getResourceInfo().getResourceType() + " got " + id.getResourceType()); + + resource.getResourceInfo().setResourceId(toUuid(id.getIdPart())); + } + else + resource.getResourceInfo().setResourceId(null); + } + } + + private Stream<ProcessesResource> getResources( + Map<ProcessKeyAndVersion, ProcessPluginDefinitionAndClassLoader> definitionByProcess, + Map<ProcessKeyAndVersion, List<ResourceInfo>> dbResourcesByProcess, ProcessKeyAndVersion process) + { + ProcessPluginDefinitionAndClassLoader definition = definitionByProcess.get(process); + + if (definition != null) + { + Stream<MetadataResource> resources = getResources(process, definition); + return resources.map(fhirResource -> + { + ProcessesResource resource = ProcessesResource.from(fhirResource).add(process); + + Optional<UUID> resourceId = getResourceId(dbResourcesByProcess, process, resource.getResourceInfo()); + resourceId.ifPresent(id -> resource.getResourceInfo().setResourceId(id)); + + return resource; + }); + } + else + { + return dbResourcesByProcess.get(process).stream().map(info -> ProcessesResource.from(info).add(process)); + } + } + + private Stream<MetadataResource> getResources(ProcessKeyAndVersion process, + ProcessPluginDefinitionAndClassLoader definition) + { + Function<String, ResourceProvider> providerByJarName = name -> + { + if (resouceProvidersByDpendencyJarName.containsKey(name)) + { + logger.trace("Resource provider for dependency {} found", name); + return resouceProvidersByDpendencyJarName.get(name); + } + else + { + logger.warn("Resource provider for dependency {} not found", name); + return ResourceProvider.empty(); + } + }; + + return definition.getResourceProvider().getResources(process.toString(), providerByJarName); + } + + private Optional<UUID> getResourceId(Map<ProcessKeyAndVersion, List<ResourceInfo>> dbResourcesByProcess, + ProcessKeyAndVersion process, ResourceInfo resourceInfo) + { + return dbResourcesByProcess.getOrDefault(process, Collections.emptyList()).stream() + .filter(r -> r.equals(resourceInfo)).findFirst().map(ResourceInfo::getResourceId); + } + + private List<BundleEntryComponent> toEntries(List<ProcessesResource> resources) + { + return resources.stream().map(this::toEntry).collect(Collectors.toList()); + } + + private BundleEntryComponent toEntry(ProcessesResource resource) + { + switch (resource.getOldProcessState()) + { + case NEW: + return fromNew(resource); + case ACTIVE: + return fromActive(resource); + case DRAFT: + return fromDraft(resource); + case RETIRED: + return fromRetired(resource); + case EXCLUDED: + return fromExcluded(resource); + default: + throw new RuntimeException( + ProcessState.class.getSimpleName() + " " + resource.getOldProcessState() + " not supported"); + } + } + + private BundleEntryComponent fromNew(ProcessesResource resource) + { + switch (resource.getNewProcessState()) + { + case ACTIVE: + return createAsActive(resource); + case DRAFT: + return createAsDraft(resource); + case RETIRED: + return createAsRetired(resource); + default: + throw new RuntimeException("State change " + resource.getOldProcessState() + " -> " + + resource.getNewProcessState() + " not supported"); + } + } + + private BundleEntryComponent fromActive(ProcessesResource resource) + { + switch (resource.getNewProcessState()) + { + case DRAFT: + return updateToDraft(resource); + case RETIRED: + return updateToRetired(resource); + case EXCLUDED: + return delete(resource); + default: + throw new RuntimeException("State change " + resource.getOldProcessState() + " -> " + + resource.getNewProcessState() + " not supported"); + } + } + + private BundleEntryComponent fromDraft(ProcessesResource resource) + { + switch (resource.getNewProcessState()) + { + case ACTIVE: + return updateToActive(resource); + case DRAFT: + return updateToDraft(resource); + case RETIRED: + return updateToRetired(resource); + case EXCLUDED: + return delete(resource); + default: + throw new RuntimeException("State change " + resource.getOldProcessState() + " -> " + + resource.getNewProcessState() + " not supported"); + } + } + + private BundleEntryComponent fromRetired(ProcessesResource resource) + { + switch (resource.getNewProcessState()) + { + case ACTIVE: + return updateToActive(resource); + case DRAFT: + return updateToDraft(resource); + case EXCLUDED: + return delete(resource); + default: + throw new RuntimeException("State change " + resource.getOldProcessState() + " -> " + + resource.getNewProcessState() + " not supported"); + } + } + + private BundleEntryComponent fromExcluded(ProcessesResource resource) + { + switch (resource.getNewProcessState()) + { + case ACTIVE: + return createAsActive(resource); + case DRAFT: + return createAsDraft(resource); + case RETIRED: + return createAsRetired(resource); + default: + throw new RuntimeException("State change " + resource.getOldProcessState() + " -> " + + resource.getNewProcessState() + " not supported"); + } + } + + private BundleEntryComponent createAsActive(ProcessesResource resource) + { + resource.getResource().setStatus(PublicationStatus.ACTIVE); + return create(resource); + } + + private BundleEntryComponent createAsDraft(ProcessesResource resource) + { + resource.getResource().setStatus(PublicationStatus.DRAFT); + return create(resource); + } + + private BundleEntryComponent createAsRetired(ProcessesResource resource) + { + resource.getResource().setStatus(PublicationStatus.RETIRED); + return create(resource); + } + + private BundleEntryComponent create(ProcessesResource resource) + { + BundleEntryComponent entry = new BundleEntryComponent(); + entry.setResource(resource.getResource()); + entry.setFullUrl("urn:uuid:" + UUID.randomUUID().toString()); + + BundleEntryRequestComponent request = entry.getRequest(); + request.setMethod(HTTPVerb.POST); + request.setUrl(resource.getResourceInfo().getResourceType()); + request.setIfNoneExist(resource.getResourceInfo().toConditionalCreateUrl()); + return entry; + } + + private BundleEntryComponent updateToActive(ProcessesResource resource) + { + resource.getResource().setStatus(PublicationStatus.ACTIVE); + return update(resource); + } + + private BundleEntryComponent updateToDraft(ProcessesResource resource) + { + resource.getResource().setStatus(PublicationStatus.DRAFT); + return update(resource); + } + + private BundleEntryComponent updateToRetired(ProcessesResource resource) + { + resource.getResource().setStatus(PublicationStatus.RETIRED); + return update(resource); + } + + private BundleEntryComponent update(ProcessesResource resource) + { + IdType id = new IdType(localWebserviceClient.getBaseUrl(), resource.getResourceInfo().getResourceType(), + resource.getResourceInfo().getResourceId().toString(), null); + + resource.getResource().setIdElement(id.toUnqualifiedVersionless()); + + BundleEntryComponent entry = new BundleEntryComponent(); + entry.setResource(resource.getResource()); + entry.setFullUrl(id.toString()); + + BundleEntryRequestComponent request = entry.getRequest(); + request.setMethod(HTTPVerb.PUT); + request.setUrl(resource.getResourceInfo().getResourceType() + "/" + + resource.getResourceInfo().getResourceId().toString()); + return entry; + } + + private BundleEntryComponent delete(ProcessesResource resource) + { + IdType id = new IdType(localWebserviceClient.getBaseUrl(), resource.getResourceInfo().getResourceType(), + resource.getResourceInfo().getResourceId().toString(), null); + + BundleEntryComponent entry = new BundleEntryComponent(); + entry.setFullUrl(id.toString()); + + BundleEntryRequestComponent request = entry.getRequest(); + request.setMethod(HTTPVerb.DELETE); + request.setUrl(resource.getResourceInfo().getResourceType() + "/" + + resource.getResourceInfo().getResourceId().toString()); + + return entry; + } + + private Map<ProcessKeyAndVersion, List<ResourceInfo>> getResourceInfosFromDb() + { + try + { + return dao.getResources(); + } + catch (SQLException e) + { + logger.warn("Error while retrieving resource infos from db", e); + throw new RuntimeException(e); + } + } + + private UUID toUuid(String id) + { + if (id == null) + return null; + + // TODO control flow by exception + try + { + return UUID.fromString(id); + } + catch (IllegalArgumentException e) + { + return null; + } + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java index 5a32354f1..a4ed05e75 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java @@ -9,7 +9,6 @@ import java.util.stream.Stream; import org.apache.commons.dbcp2.BasicDataSource; -import org.camunda.bpm.engine.impl.cfg.ProcessEnginePlugin; import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; import org.camunda.bpm.engine.spring.ProcessEngineFactoryBean; import org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration; @@ -20,7 +19,6 @@ import org.highmed.dsf.bpe.listener.DefaultBpmnParseListener; import org.highmed.dsf.bpe.listener.EndListener; import org.highmed.dsf.bpe.listener.StartListener; -import org.highmed.dsf.bpe.plugin.ProcessPluginDefinitionAndClassLoader; import org.highmed.dsf.bpe.plugin.ProcessPluginProvider; import org.highmed.dsf.bpe.plugin.ProcessPluginProviderImpl; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; @@ -65,17 +63,17 @@ public class CamundaConfig @Bean public PlatformTransactionManager transactionManager() { - return new DataSourceTransactionManager(dataSource()); + return new DataSourceTransactionManager(camundaDataSource()); } @Bean public TransactionAwareDataSourceProxy transactionAwareDataSource() { - return new TransactionAwareDataSourceProxy(dataSource()); + return new TransactionAwareDataSourceProxy(camundaDataSource()); } @Bean - public BasicDataSource dataSource() + public BasicDataSource camundaDataSource() { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName(Driver.class.getName()); @@ -116,16 +114,11 @@ public DefaultBpmnParseListener defaultBpmnParseListener() public SpringProcessEngineConfiguration processEngineConfiguration( @SuppressWarnings("rawtypes") List<TypedValueSerializer> baseSerializers) throws IOException { - List<ProcessPluginDefinitionAndClassLoader> definitions = processPluginProvider().getDefinitions(); - @SuppressWarnings("rawtypes") List<TypedValueSerializer> serializers = Stream .concat(baseSerializers.stream(), delegateProvider().getAdditionalTypedValueSerializers()) .collect(Collectors.toList()); - List<ProcessEnginePlugin> plugins = definitions.stream() - .map(ProcessPluginDefinitionAndClassLoader::getProcessPlugin).collect(Collectors.toList()); - var c = new MultiVersionSpringProcessEngineConfiguration(delegateProvider()); c.setProcessEngineName("highmed"); c.setDataSource(transactionAwareDataSource()); @@ -139,12 +132,6 @@ public SpringProcessEngineConfiguration processEngineConfiguration( serializers.stream().map(p -> p.getClass().getName()).collect(Collectors.joining(", ", "[", "]"))); c.setCustomPreVariableSerializers(serializers); - logger.info("{} process plugin{} configured", plugins.size(), plugins.size() != 1 ? "s" : ""); - logger.debug("Process plugin{}: {}", plugins.size() != 1 ? "s" : "", - definitions.stream().map(def -> def.getDefinition()).map(p -> p.getClass().getName()) - .collect(Collectors.joining(", ", "[", "]"))); - c.setProcessEnginePlugins(plugins); - return c; } @@ -174,6 +161,6 @@ public ProcessPluginProvider processPluginProvider() throw new RuntimeException( "Process plug in directory '" + pluginDirectoryPath.toString() + "' not readable"); - return new ProcessPluginProviderImpl(pluginDirectoryPath, applicationContext); + return new ProcessPluginProviderImpl(fhirConfig.fhirContext(), pluginDirectoryPath, applicationContext); } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/DaoConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/DaoConfig.java new file mode 100644 index 000000000..f04a1c0ba --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/DaoConfig.java @@ -0,0 +1,51 @@ +package org.highmed.dsf.bpe.spring.config; + +import org.apache.commons.dbcp2.BasicDataSource; +import org.highmed.dsf.bpe.dao.ProcessPluginResourcesDao; +import org.highmed.dsf.bpe.dao.ProcessPluginResourcesDaoJdbc; +import org.highmed.dsf.bpe.dao.ProcessStateDao; +import org.highmed.dsf.bpe.dao.ProcessStateDaoJdbc; +import org.postgresql.Driver; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class DaoConfig +{ + @Value("${org.highmed.dsf.bpe.db.url}") + private String dbUrl; + + @Value("${org.highmed.dsf.bpe.db.server_user}") + private String dbUsername; + + @Value("${org.highmed.dsf.bpe.db.server_user_password}") + private String dbPassword; + + @Bean + public BasicDataSource dataSource() + { + BasicDataSource dataSource = new BasicDataSource(); + dataSource.setDriverClassName(Driver.class.getName()); + dataSource.setUrl(dbUrl); + dataSource.setUsername(dbUsername); + dataSource.setPassword(dbPassword); + dataSource.setDefaultReadOnly(true); + + dataSource.setTestOnBorrow(true); + dataSource.setValidationQuery("SELECT 1"); + return dataSource; + } + + @Bean + public ProcessPluginResourcesDao processPluginResourcesDao() + { + return new ProcessPluginResourcesDaoJdbc(dataSource()); + } + + @Bean + public ProcessStateDao processStateDao() + { + return new ProcessStateDaoJdbc(dataSource()); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java index e85ae2d39..0045add85 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java @@ -1,13 +1,22 @@ package org.highmed.dsf.bpe.spring.config; +import java.util.List; +import java.util.stream.Stream; + import org.camunda.bpm.engine.ProcessEngine; import org.highmed.dsf.bpe.delegate.DelegateProvider; import org.highmed.dsf.bpe.plugin.ProcessPluginProvider; +import org.highmed.dsf.bpe.process.BpmnFileAndModel; +import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; +import org.highmed.dsf.bpe.process.ProcessStateChangeOutcome; import org.highmed.dsf.bpe.service.BpmnProcessStateChangeService; import org.highmed.dsf.bpe.service.BpmnProcessStateChangeServiceImpl; import org.highmed.dsf.bpe.service.BpmnServiceDelegateValidationService; import org.highmed.dsf.bpe.service.BpmnServiceDelegateValidationServiceImpl; +import org.highmed.dsf.bpe.service.FhirResourceHandler; +import org.highmed.dsf.bpe.service.FhirResourceHandlerImpl; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.event.ContextRefreshedEvent; @@ -25,11 +34,31 @@ public class PostProcessDeployConfig @Autowired private ProcessPluginProvider processPluginProvider; + @Autowired + private FhirConfig fhirConfig; + + @Autowired + private DaoConfig daoConfig; + + @Value("#{'${org.highmed.dsf.bpe.process.excluded}'.split(',')}") + private List<String> excluded; + + @Value("#{'${org.highmed.dsf.bpe.process.retired}'.split(',')}") + private List<String> retired; + @EventListener({ ContextRefreshedEvent.class }) public void onContextRefreshedEvent(ContextRefreshedEvent event) { - bpmnProcessStateChangeService().suspendOrActivateProcesses(); + Stream<BpmnFileAndModel> models = processPluginProvider.getDefinitions().stream() + .flatMap(def -> def.getAndValidateModels().stream()); + + List<ProcessStateChangeOutcome> changes = bpmnProcessStateChangeService() + .deploySuspendOrActivateProcesses(models); + bpmnServiceDelegateValidationService().validateModels(); + + fhirResourceHandler().applyStateChangesAndStoreNewResourcesInDb( + processPluginProvider.getDefinitionByProcessKeyAndVersion(), changes); } @Bean @@ -41,6 +70,16 @@ public BpmnServiceDelegateValidationService bpmnServiceDelegateValidationService @Bean public BpmnProcessStateChangeService bpmnProcessStateChangeService() { - return new BpmnProcessStateChangeServiceImpl(processEngine.getRepositoryService(), processPluginProvider); + return new BpmnProcessStateChangeServiceImpl(processEngine.getRepositoryService(), daoConfig.processStateDao(), + processPluginProvider, ProcessKeyAndVersion.fromStrings(excluded), + ProcessKeyAndVersion.fromStrings(retired)); + } + + @Bean + public FhirResourceHandler fhirResourceHandler() + { + return new FhirResourceHandlerImpl(fhirConfig.clientProvider().getLocalWebserviceClient(), + daoConfig.processPluginResourcesDao(), fhirConfig.fhirContext(), + processPluginProvider.getResouceProvidersByDpendencyJarName()); } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.changelog.xml b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.changelog.xml index 2727006f7..67d9af4cd 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.changelog.xml +++ b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.changelog.xml @@ -13,4 +13,7 @@ <include file="db/db.camunda_engine.changelog-0.3.0.xml" /> + <include file="db/db.process_plugin_resources.changelog-0.4.0.xml" /> + <include file="db/db.process_states.changelog-0.4.0.xml" /> + </databaseChangeLog> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_plugin_resources.changelog-0.4.0.xml b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_plugin_resources.changelog-0.4.0.xml new file mode 100644 index 000000000..fbf6771d1 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_plugin_resources.changelog-0.4.0.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<databaseChangeLog + xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog + http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + + <changeSet author="hhund" id="db.process_plugin_resources.changelog-0.4.0"> + <createTable tableName="process_plugin_resources"> + <column name="process_key_and_version" type="TEXT"> + <constraints nullable="false"/> + </column> + <column name="resource_type" type="TEXT"> + <constraints nullable="false"/> + </column> + <column name="resource_id" type="UUID"/> + <column name="url" type="TEXT"/> + <column name="version" type="TEXT"/> + <column name="name" type="TEXT"/> + </createTable> + + <sql dbms="postgresql"> + ALTER TABLE process_plugin_resources ADD CONSTRAINT url_check CHECK ((resource_type = 'NamingSystem' and url IS NULL) OR (resource_type <> 'NamingSystem' AND url IS NOT NULL)); + ALTER TABLE process_plugin_resources ADD CONSTRAINT version_check CHECK ((resource_type = 'NamingSystem' and version IS NULL) OR (resource_type <> 'NamingSystem' AND version IS NOT NULL)); + ALTER TABLE process_plugin_resources ADD CONSTRAINT name_check CHECK ((resource_type = 'NamingSystem' and name IS NOT NULL) OR (resource_type <> 'NamingSystem' AND name IS NULL)); + CREATE UNIQUE INDEX process_plugin_resources_unique_not_naming_system ON process_plugin_resources (process_key_and_version, resource_type, url, version) WHERE resource_type <> 'NamingSystem'; + CREATE UNIQUE INDEX process_plugin_resources_unique_naming_system ON process_plugin_resources (process_key_and_version, resource_type, name) WHERE resource_type = 'NamingSystem'; + ALTER TABLE process_plugin_resources OWNER TO ${db.liquibase_user}; + GRANT ALL ON TABLE process_plugin_resources TO ${db.liquibase_user}; + GRANT SELECT, INSERT, UPDATE ON TABLE process_plugin_resources TO ${db.server_users_group}; + </sql> + </changeSet> + +</databaseChangeLog> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_states.changelog-0.4.0.xml b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_states.changelog-0.4.0.xml new file mode 100644 index 000000000..e2ec861be --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_states.changelog-0.4.0.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<databaseChangeLog + xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog + http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + + <changeSet author="hhund" id="db.process_states.changelog-0.4.0"> + <createTable tableName="process_states"> + <column name="process_key_and_version" type="TEXT"> + <constraints nullable="false"/> + </column> + <column name="state" type="TEXT"> + <constraints nullable="false"/> + </column> + </createTable> + + <addPrimaryKey tableName="process_states" columnNames="process_key_and_version"/> + + <sql dbms="postgresql"> + ALTER TABLE process_states OWNER TO ${db.liquibase_user}; + GRANT ALL ON TABLE process_states TO ${db.liquibase_user}; + GRANT SELECT, INSERT, UPDATE ON TABLE process_states TO ${db.server_users_group}; + </sql> + </changeSet> + +</databaseChangeLog> \ No newline at end of file From 71e27b104dd07036e911aa0e507e0abafe244d84 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Tue, 17 Nov 2020 19:26:13 +0100 Subject: [PATCH 14/75] rename functions to be more specific --- .../src/main/java/org/highmed/dsf/fhir/variables/Target.java | 4 ++-- .../org/highmed/dsf/bpe/service/SelectRequestTargets.java | 4 ++-- .../highmed/dsf/bpe/service/SelectResponseTargetMedic.java | 2 +- .../org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java | 2 +- .../org/highmed/dsf/bpe/service/StoreCorrelationKeys.java | 2 +- .../java/org/highmed/dsf/bpe/service/SelectPingTargets.java | 2 +- .../java/org/highmed/dsf/bpe/service/SelectPongTarget.java | 2 +- .../org/highmed/dsf/bpe/service/SelectResourceAndTargets.java | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Target.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Target.java index 3f5a9b628..89ede844f 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Target.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/variables/Target.java @@ -24,12 +24,12 @@ private Target( this.correlationKey = correlationKey; } - public static Target createSingleInstanceTarget(String targetOrganizationIdentifierValue) + public static Target createUniDirectionalTarget(String targetOrganizationIdentifierValue) { return new Target(targetOrganizationIdentifierValue, null); } - public static Target createMultiInstanceTarget(String targetOrganizationIdentifierValue, String correlationKey) + public static Target createBiDirectionalTarget(String targetOrganizationIdentifierValue, String correlationKey) { return new Target(targetOrganizationIdentifierValue, correlationKey); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java index 867e32572..0464eb148 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java @@ -90,7 +90,7 @@ private Targets getMedicTargets(ResearchStudy researchStudy) { List<Target> targets = researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI) .stream().filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> Target.createMultiInstanceTarget(r.getIdentifier().getValue(), UUID.randomUUID().toString())) + .map(r -> Target.createBiDirectionalTarget(r.getIdentifier().getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); return new Targets(targets); @@ -100,6 +100,6 @@ private Target getTtpTarget(ResearchStudy researchStudy) { return researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI).stream() .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> Target.createSingleInstanceTarget(r.getIdentifier().getValue())).findFirst().get(); + .map(r -> Target.createUniDirectionalTarget(r.getIdentifier().getValue())).findFirst().get(); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java index 918a2d4bd..87dffa638 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java @@ -38,7 +38,7 @@ protected void doExecute(DelegateExecution execution) throws Exception { Task task = getLeadingTaskFromExecutionVariables(); - Target medicTarget = Target.createSingleInstanceTarget(task.getRequester().getIdentifier().getValue()); + Target medicTarget = Target.createUniDirectionalTarget(task.getRequester().getIdentifier().getValue()); execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues.create(medicTarget)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java index 49ce2d921..2bfc4818a 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java @@ -37,7 +37,7 @@ protected void doExecute(DelegateExecution execution) throws Exception String ttpIdentifier = (String) execution.getVariable(ConstantsBase.VARIABLE_TTP_IDENTIFIER); String correlationKey = getCorrelationKey(execution); - Target ttpTarget = Target.createMultiInstanceTarget(ttpIdentifier, correlationKey); + Target ttpTarget = Target.createBiDirectionalTarget(ttpIdentifier, correlationKey); execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues.create(ttpTarget)); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java index 1b8fc52b2..d85f7d0fe 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java @@ -31,7 +31,7 @@ protected void doExecute(DelegateExecution execution) throws Exception List<Target> targets = getTaskHelper() .getInputParameterStringValues(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY) - .map(correlationKey -> Target.createMultiInstanceTarget("", correlationKey)) + .map(correlationKey -> Target.createBiDirectionalTarget("", correlationKey)) .collect(Collectors.toList()); execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java index ac898f3d2..d822ffa47 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java @@ -39,7 +39,7 @@ public void afterPropertiesSet() throws Exception public void doExecute(DelegateExecution execution) throws Exception { List<Target> targets = organizationProvider.getRemoteIdentifiers().stream().map(identifier -> Target - .createMultiInstanceTarget(identifier.getValue(), UUID.randomUUID().toString())) + .createBiDirectionalTarget(identifier.getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java index 6ad9d6486..317871241 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java @@ -29,6 +29,6 @@ public void doExecute(DelegateExecution execution) throws Exception Identifier targetOrganizationIdentifier = task.getRequester().getIdentifier(); execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues - .create(Target.createMultiInstanceTarget(targetOrganizationIdentifier.getValue(), correlationKey))); + .create(Target.createBiDirectionalTarget(targetOrganizationIdentifier.getValue(), correlationKey))); } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java index e7b535c3b..857b994ef 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java @@ -77,7 +77,7 @@ else if (!BUNDLE_ID_PATTERN.matcher(references.get(0).getReference()).matches()) List<Target> targets = targetIdentifierSearchParameters.stream() .flatMap(organizationProvider::searchRemoteOrganizationsIdentifiers) - .map(identifier -> Target.createSingleInstanceTarget(identifier.getValue())) + .map(identifier -> Target.createUniDirectionalTarget(identifier.getValue())) .collect(Collectors.toList()); execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); } From b958017ed5cb24c02cf98cf1ef18d723c5e84d56 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 17 Nov 2020 20:48:36 +0100 Subject: [PATCH 15/75] moved bpmn files for merge of branch develop --- .../src/main/resources/{bpe => }/computeSimpleFeasibility.bpmn | 0 .../src/main/resources/{bpe => }/requestSimpleFeasibility.bpmn | 0 .../dsf-bpe-process-ping/src/main/resources/{bpe => }/ping.bpmn | 0 .../src/main/resources/{bpe => }/requestUpdateResources.bpmn | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/{bpe => }/computeSimpleFeasibility.bpmn (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/{bpe => }/requestSimpleFeasibility.bpmn (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/{bpe => }/ping.bpmn (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/{bpe => }/requestUpdateResources.bpmn (100%) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn From e33938748d84345e240f87ac727d8ec7f69fc9c6 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 17 Nov 2020 20:49:46 +0100 Subject: [PATCH 16/75] moved bpmn files back after merge of branch develop --- .../src/main/resources/{ => bpe}/computeSimpleFeasibility.bpmn | 0 .../src/main/resources/{ => bpe}/requestSimpleFeasibility.bpmn | 0 .../dsf-bpe-process-ping/src/main/resources/{ => bpe}/ping.bpmn | 0 .../src/main/resources/{ => bpe}/requestUpdateResources.bpmn | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/{ => bpe}/computeSimpleFeasibility.bpmn (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/{ => bpe}/requestSimpleFeasibility.bpmn (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/{ => bpe}/ping.bpmn (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/{ => bpe}/requestUpdateResources.bpmn (100%) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/computeSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/requestSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/ping.bpmn rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/requestUpdateResources.bpmn rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn From 64ee8b76a68e66ddfab0ff43b4b4161a7bd1ee17 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 18 Nov 2020 01:27:14 +0100 Subject: [PATCH 17/75] moved profile validation tests to process modules, new validation module Process profile validation tests are now located in the process modules where they are defined. Added a new validation module with basic validation, snapshot generator and value-set expansion services. Moved all base fhir profiles, code-systems, value-sets, naming-systems and subscriptions (internal bundle) to new validation module, because they are needed for process plugin profile validation and we don't want to have the fhir-server module as a test dependency. Process profile based integration test commented out, we should add some kind of infrastructure to run process module based integration tests against a FHIR server and maybe even against a FHIR and BPE server to test process execution. --- .gitignore | 1 + dsf-bpe/dsf-bpe-process-feasibility/pom.xml | 5 + .../dsf/fhir/profile}/GroupProfileTest.java | 7 +- .../profile}/ResearchStudyProfileTest.java | 9 +- .../dsf/fhir/profile}/TaskProfileTest.java | 440 +----------- .../dsf-bpe-process-local-services/pom.xml | 5 + .../dsf/fhir/profile/TaskProfileTest.java | 87 +++ dsf-bpe/dsf-bpe-process-ping/pom.xml | 5 + .../dsf/fhir/profiles/TaskProfileTest.java | 177 +++++ .../dsf-bpe-process-update-allow-list/pom.xml | 5 + .../dsf/fhir/profile/TaskProfileTest.java | 152 +++++ .../dsf-bpe-process-update-resources/pom.xml | 5 + .../dsf/fhir/profile/TaskProfileTest.java | 139 ++++ dsf-bpe/pom.xml | 17 + dsf-fhir/dsf-fhir-server/pom.xml | 74 +- .../fhir/dao/command/BatchCommandList.java | 2 +- .../dao/command/CheckReferencesCommand.java | 2 +- .../highmed/dsf/fhir/dao/command/Command.java | 2 +- .../fhir/dao/command/CommandFactoryImpl.java | 2 +- .../dsf/fhir/dao/command/CreateCommand.java | 2 +- .../CreateStructureDefinitionCommand.java | 4 +- .../dsf/fhir/dao/command/DeleteCommand.java | 2 +- .../dsf/fhir/dao/command/ReadCommand.java | 2 +- .../dao/command/TransactionCommandList.java | 2 +- .../dao/command/TransactionResources.java | 2 +- .../dsf/fhir/dao/command/UpdateCommand.java | 2 +- .../UpdateStructureDefinitionCommand.java | 4 +- .../dao/command/ValidationHelperImpl.java | 2 +- .../search/parameters/BundleIdentifier.java | 2 +- .../dsf/fhir/spring/config/CommandConfig.java | 6 +- .../fhir/spring/config/SnapshotConfig.java | 4 +- .../fhir/spring/config/ValidationConfig.java | 4 +- .../impl/AbstractResourceServiceImpl.java | 2 +- .../impl/ActivityDefinitionServiceImpl.java | 2 +- .../webservice/impl/BinaryServiceImpl.java | 2 +- .../webservice/impl/BundleServiceImpl.java | 2 +- .../impl/CodeSystemServiceImpl.java | 2 +- .../webservice/impl/EndpointServiceImpl.java | 2 +- .../webservice/impl/GroupServiceImpl.java | 2 +- .../impl/HealthcareServiceServiceImpl.java | 2 +- .../webservice/impl/LocationServiceImpl.java | 2 +- .../impl/NamingSystemServiceImpl.java | 2 +- .../impl/OrganizationServiceImpl.java | 2 +- .../webservice/impl/PatientServiceImpl.java | 2 +- .../impl/PractitionerRoleServiceImpl.java | 2 +- .../impl/PractitionerServiceImpl.java | 2 +- .../impl/ProvenanceServiceImpl.java | 2 +- .../impl/ResearchStudyServiceImpl.java | 2 +- .../impl/StructureDefinitionServiceImpl.java | 6 +- .../impl/SubscriptionServiceImpl.java | 2 +- .../fhir/webservice/impl/TaskServiceImpl.java | 2 +- .../webservice/impl/ValueSetServiceImpl.java | 2 +- .../secure/AbstractResourceServiceSecure.java | 2 +- .../ActivityDefinitionServiceSecure.java | 2 +- .../secure/BinaryServiceSecure.java | 2 +- .../secure/BundleServiceSecure.java | 2 +- .../secure/CodeSystemServiceSecure.java | 2 +- .../secure/EndpointServiceSecure.java | 2 +- .../webservice/secure/GroupServiceSecure.java | 2 +- .../HealthcareServiceServiceSecure.java | 2 +- .../secure/LocationServiceSecure.java | 2 +- .../secure/NamingSystemServiceSecure.java | 2 +- .../secure/OrganizationServiceSecure.java | 2 +- .../secure/PatientServiceSecure.java | 2 +- .../secure/PractitionerRoleServiceSecure.java | 2 +- .../secure/PractitionerServiceSecure.java | 2 +- .../secure/ProvenanceServiceSecure.java | 2 +- .../secure/ResearchStudyServiceSecure.java | 2 +- .../StructureDefinitionServiceSecure.java | 2 +- .../secure/SubscriptionServiceSecure.java | 2 +- .../webservice/secure/TaskServiceSecure.java | 2 +- .../secure/ValueSetServiceSecure.java | 2 +- .../fhir/integration/TaskIntegrationTest.java | 646 +++++++++--------- dsf-fhir/dsf-fhir-validation/pom.xml | 121 ++++ .../fhir/validation}/ResourceValidator.java | 2 +- .../validation}/ResourceValidatorImpl.java | 2 +- .../fhir/validation}/SnapshotGenerator.java | 2 +- .../validation}/SnapshotGeneratorImpl.java | 2 +- .../StructureDefinitionReader.java | 29 +- .../validation}/ValidationSupportRule.java | 68 +- .../ValidationSupportWithCustomResources.java | 2 +- .../fhir/validation}/ValueSetExpander.java | 2 +- .../validation}/ValueSetExpanderImpl.java | 2 +- .../src/main/resources/fhir/.gitignore | 0 .../CodeSystem/authorization-role-0.3.0.xml | 0 .../authorization-role-0.3.0.xml.post | 0 .../fhir/CodeSystem/bpmn-message-0.3.0.xml | 0 .../CodeSystem/bpmn-message-0.3.0.xml.post | 0 .../CodeSystem/organization-type-0.3.0.xml | 0 .../organization-type-0.3.0.xml.post | 0 .../fhir/CodeSystem/urn_ietf_bcp_13.xml | 0 .../fhir/CodeSystem/urn_ietf_bcp_13.xml.post | 0 .../fhir/NamingSystem/highmed-endpoint.xml | 0 .../NamingSystem/highmed-endpoint.xml.post | 0 .../NamingSystem/highmed-organization.xml | 0 .../highmed-organization.xml.post | 0 .../highmed-endpoint-0.3.0.xml | 0 .../highmed-endpoint-0.3.0.xml.post | 0 ...extension-certificate-thumbprint-0.3.0.xml | 0 ...sion-certificate-thumbprint-0.3.0.xml.post | 0 ...-extension-process-authorization-0.3.0.xml | 0 ...nsion-process-authorization-0.3.0.xml.post | 0 .../highmed-organization-0.3.0.xml | 0 .../highmed-organization-0.3.0.xml.post | 0 .../highmed-task-base-0.3.0.xml | 0 .../highmed-task-base-0.3.0.xml.post | 0 .../Subscription/bpmn-task-subscription.xml | 0 .../bpmn-task-subscription.xml.post | 0 .../ValueSet/authorization-role-0.3.0.xml | 0 .../authorization-role-0.3.0.xml.post | 0 .../fhir/ValueSet/bpmn-message-0.3.0.xml | 0 .../fhir/ValueSet/bpmn-message-0.3.0.xml.post | 0 .../fhir/ValueSet/organization-type-0.3.0.xml | 0 .../ValueSet/organization-type-0.3.0.xml.post | 0 .../fhir/ValueSet/valueset-mimetypes.xml | 0 .../fhir/ValueSet/valueset-mimetypes.xml.post | 0 .../fhir/profiles/EndpointProfileTest.java | 5 +- .../profiles/OrganizationProfileTest.java | 5 +- .../validation}/ValueSetExpanderTest.java | 27 +- .../src/test/resources/log4j2.xml | 26 + dsf-fhir/pom.xml | 6 + 121 files changed, 1233 insertions(+), 972 deletions(-) rename {dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles => dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile}/GroupProfileTest.java (90%) rename {dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles => dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile}/ResearchStudyProfileTest.java (90%) rename {dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles => dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile}/TaskProfileTest.java (50%) create mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java create mode 100644 dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java create mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java create mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java create mode 100644 dsf-fhir/dsf-fhir-validation/pom.xml rename dsf-fhir/{dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service => dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation}/ResourceValidator.java (81%) rename dsf-fhir/{dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service => dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation}/ResourceValidatorImpl.java (96%) rename dsf-fhir/{dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service => dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation}/SnapshotGenerator.java (95%) rename dsf-fhir/{dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service => dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation}/SnapshotGeneratorImpl.java (98%) rename dsf-fhir/{dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service => dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation}/StructureDefinitionReader.java (58%) rename dsf-fhir/{dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles => dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation}/ValidationSupportRule.java (59%) rename dsf-fhir/{dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service => dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation}/ValidationSupportWithCustomResources.java (98%) rename dsf-fhir/{dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service => dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation}/ValueSetExpander.java (83%) rename dsf-fhir/{dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service => dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation}/ValueSetExpanderImpl.java (97%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/.gitignore (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/NamingSystem/highmed-organization.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/NamingSystem/highmed-organization.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml.post (100%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java (93%) rename dsf-fhir/{dsf-fhir-server => dsf-fhir-validation}/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java (96%) rename dsf-fhir/{dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/service => dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation}/ValueSetExpanderTest.java (71%) create mode 100644 dsf-fhir/dsf-fhir-validation/src/test/resources/log4j2.xml diff --git a/.gitignore b/.gitignore index 68b656ad5..7e137fdd6 100755 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ dsf-fhir/dsf-fhir-server-jetty/conf/bundle.xml dsf-fhir/dsf-fhir-server-jetty/conf/config.properties dsf-fhir/dsf-fhir-server-jetty/docker/dsf_fhir.jar dsf-fhir/dsf-fhir-server-jetty/docker/lib/*.jar +dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/bundle.xml ### # dsf-docker-test-setup ignores diff --git a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml index e36ea1108..c2e85266c 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml @@ -23,5 +23,10 @@ <artifactId>log4j2-utils</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-validation</artifactId> + <scope>test</scope> + </dependency> </dependencies> </project> \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/GroupProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java similarity index 90% rename from dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/GroupProfileTest.java rename to dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java index f44ca0b76..3f8716243 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/GroupProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java @@ -1,11 +1,12 @@ -package org.highmed.dsf.fhir.profiles; +package org.highmed.dsf.fhir.profile; import static org.junit.Assert.assertEquals; import java.util.Arrays; -import org.highmed.dsf.fhir.service.ResourceValidator; -import org.highmed.dsf.fhir.service.ResourceValidatorImpl; +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.CodeType; import org.hl7.fhir.r4.model.Expression; import org.hl7.fhir.r4.model.Group; diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/ResearchStudyProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java similarity index 90% rename from dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/ResearchStudyProfileTest.java rename to dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java index c5054746d..6d2bc31b3 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/ResearchStudyProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java @@ -1,12 +1,13 @@ -package org.highmed.dsf.fhir.profiles; +package org.highmed.dsf.fhir.profile; import static org.junit.Assert.assertEquals; import java.util.Arrays; import java.util.UUID; -import org.highmed.dsf.fhir.service.ResourceValidator; -import org.highmed.dsf.fhir.service.ResourceValidatorImpl; +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.Reference; import org.hl7.fhir.r4.model.ResearchStudy; import org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus; @@ -20,7 +21,7 @@ public class ResearchStudyProfileTest { - private static final Logger logger = LoggerFactory.getLogger(OrganizationProfileTest.class); + private static final Logger logger = LoggerFactory.getLogger(ResearchStudyProfileTest.class); @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java similarity index 50% rename from dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java rename to dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 359e16161..2e3cd4f23 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -1,30 +1,19 @@ -package org.highmed.dsf.fhir.profiles; +package org.highmed.dsf.fhir.profile; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import java.nio.charset.StandardCharsets; -import java.nio.file.Paths; import java.util.Arrays; -import java.util.Base64; -import java.util.Collections; import java.util.Date; import java.util.UUID; -import org.highmed.dsf.fhir.service.ResourceValidator; -import org.highmed.dsf.fhir.service.ResourceValidatorImpl; -import org.highmed.dsf.fhir.service.SnapshotGenerator.SnapshotWithValidationMessages; -import org.highmed.dsf.fhir.service.SnapshotGeneratorImpl; -import org.highmed.dsf.fhir.service.StructureDefinitionReader; -import org.highmed.dsf.fhir.service.ValidationSupportWithCustomResources; -import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; -import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; +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.Base64BinaryType; import org.hl7.fhir.r4.model.BooleanType; -import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.StructureDefinition; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.ParameterComponent; import org.hl7.fhir.r4.model.Task.TaskIntent; @@ -36,356 +25,29 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import ca.uhn.fhir.context.support.DefaultProfileValidationSupport; import ca.uhn.fhir.validation.ResultSeverityEnum; import ca.uhn.fhir.validation.ValidationResult; public class TaskProfileTest { - private static final Logger logger = LoggerFactory.getLogger(OrganizationProfileTest.class); + private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-task-start-ping-process-0.3.0.xml", - "highmed-task-ping-0.3.0.xml", "highmed-task-pong-0.3.0.xml", - "highmed-task-update-allow-list-0.3.0.xml", "highmed-task-request-update-resources-0.3.0.xml", - "highmed-task-execute-update-resources-0.3.0.xml", "highmed-group-0.3.0.xml", + Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-group-0.3.0.xml", "highmed-extension-group-id-0.3.0.xml", "highmed-research-study-feasibility-0.3.0.xml", "highmed-task-request-simple-feasibility-0.3.0.xml", "highmed-task-execute-simple-feasibility-0.3.0.xml", "highmed-task-single-medic-result-simple-feasibility-0.3.0.xml", "highmed-task-compute-simple-feasibility-0.3.0.xml", "highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml", - "highmed-task-error-simple-feasibility-0.3.0.xml", - "highmed-task-local-services-integration-0.3.0.xml", "highmed-task-download-allow-list-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-allow-list-0.3.0.xml", - "update-resources-0.3.0.xml", "feasibility-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-allow-list-0.3.0.xml", - "update-resources-0.3.0.xml", "feasibility-0.3.0.xml")); + "highmed-task-error-simple-feasibility-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "feasibility-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "feasibility-0.3.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); - @Test - public void testGenerateSnapshotNotWorkingWithoutBaseSnapshot() throws Exception - { - var reader = new StructureDefinitionReader(validationRule.getFhirContext()); - - StructureDefinition base = reader - .readXml(Paths.get("src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml")); - StructureDefinition differential = reader.readXml(Paths.get( - "src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml")); - - var validationSupport = new ValidationSupportChain( - new InMemoryTerminologyServerValidationSupport(validationRule.getFhirContext()), - new ValidationSupportWithCustomResources(validationRule.getFhirContext(), Arrays.asList(base), - Collections.emptyList(), Collections.emptyList()), - new DefaultProfileValidationSupport(validationRule.getFhirContext())); - var snapshotGenerator = new SnapshotGeneratorImpl(validationRule.getFhirContext(), validationSupport); - - SnapshotWithValidationMessages messages = snapshotGenerator.generateSnapshot(differential); - assertFalse(messages.getMessages().isEmpty()); - } - - @Test - public void testTaskStartPingProcessProfileValid() throws Exception - { - Task task = createValidTaskStartPingProcess(); - - 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 testTaskStartPingProcessProfileNotValid1() throws Exception - { - Task task = createValidTaskStartPingProcess(); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.1.0"); - - ValidationResult result = resourceValidator.validate(task); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(1, result.getMessages().stream() - .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL - .equals(m.getSeverity())).count()); - } - - @Test - public void testTaskStartPingProcessProfileNotValid2() throws Exception - { - Task task = createValidTaskStartPingProcess(); - task.setIntent(TaskIntent.FILLERORDER); - - ValidationResult result = resourceValidator.validate(task); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(1, result.getMessages().stream() - .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL - .equals(m.getSeverity())).count()); - } - - @Test - public void testTaskStartProcessProfileNotValid3() throws Exception - { - Task task = createValidTaskStartPingProcess(); - task.setAuthoredOn(null); - - ValidationResult result = resourceValidator.validate(task); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(1, result.getMessages().stream() - .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL - .equals(m.getSeverity())).count()); - } - - private Task createValidTaskStartPingProcess() - { - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - - task.addInput().setValue(new StringType("startPingProcessMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - - return task; - } - - @Test - public void testTaskPingValid() throws Exception - { - Task task = createValidTaskPing(); - - 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 createValidTaskPing() - { - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - - task.addInput().setValue(new StringType("pingMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("correlation-key"); - - return task; - } - - @Test - public void testTaskPongValid() throws Exception - { - Task task = createValidTaskPong(); - - 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 createValidTaskPong() - { - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-pong"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - - task.addInput().setValue(new StringType("pongMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("correlation-key"); - - return task; - } - - @Test - public void testTaskUpdateAllowListValid() throws Exception - { - Task task = createValidTaskUpdateAllowList(); - - 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 testTaskUpdateAllowlistValidWithOutput() throws Exception - { - Task task = createValidTaskUpdateAllowList(); - task.addOutput().setValue(new Reference(new IdType("Bundle", UUID.randomUUID().toString(), "1"))).getType() - .addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") - .setCode("highmed_allow_list"); - - 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 createValidTaskUpdateAllowList() - { - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - - task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - - return task; - } - - @Test - public void testTaskRequestUpdateResourcesAllowListValid() throws Exception - { - Task task = createValidTaskRequestUpdateAllowListResources(); - - 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 createValidTaskRequestUpdateAllowListResources() - { - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - - task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - - return task; - } - - @Test - public void testTaskRequestUpdateResourcesValid() throws Exception - { - Task task = createValidTaskRequestUpdateResources(); - - 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 createValidTaskRequestUpdateResources() - { - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestUpdateResources/0.3.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - - task.addInput().setValue(new StringType("requestUpdateResourcesMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/update-resources").setCode("bundle-reference"); - task.addInput().setValue(new StringType("http://highmed.org/fhir/NamingSystem/organization-identifier|")) - .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-resources") - .setCode("organization-identifier-search-parameter"); - - return task; - } - - @Test - public void testTaskExecuteUpdateResourcesValid() throws Exception - { - Task task = createValidTaskExecuteUpdateResources(); - - 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 createValidTaskExecuteUpdateResources() - { - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/executeUpdateResources/0.3.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - - task.addInput().setValue(new StringType("executeUpdateResourcesMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); - task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/update-resources").setCode("bundle-reference"); - - return task; - } - @Test public void testTaskRequestSimpleFeasibilityValid() throws Exception { @@ -755,88 +417,4 @@ private Task createValidTaskErrorSimpleFeasibility() return task; } - - @Test - public void testTaskLocalServiceIntegrationValid() throws Exception - { - Task task = createValidTaskLocalServiceIntegration(); - - 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 createValidTaskLocalServiceIntegration() - { - Task task = new Task(); - - task.getMeta() - .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/localServicesIntegration/0.3.0"); - task.setStatus(Task.TaskStatus.REQUESTED); - task.setIntent(Task.TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - - task.addInput().setValue(new StringType("localServicesIntegrationMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - - task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/query-type").setCode("application/x-aql-query"); - task.addInput().setValue(new BooleanType(true)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-consent-check"); - task.addInput().setValue(new BooleanType(true)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-record-linkage"); - - byte[] bloomFilterConfig = Base64.getDecoder() - .decode("CIw/x19d3Oj+GLOKgYAX5KrFAl11q6qMi0qkDiyUOCvMXuF2KffVvSnjUjkTvqh4z8Xs+MuQdK6FqTedM5FY9t4qm+k92A+P"); - - task.addInput().setValue(new Base64BinaryType(bloomFilterConfig)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("bloom-filter-configuration"); - - return task; - } - - @Test - public void testTaskDownloadAllowListValid() throws Exception - { - Task task = createValidTaskDownloadAllowList(); - - ValidationResult result = resourceValidator.validate(task); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - } - - private Task createValidTaskDownloadAllowList() - { - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.3.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - - task.addInput().setValue(new StringType("downloadAllowListMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - task.addInput() - .setValue( - new Reference(new IdType("https://foo.bar/fhir", "Bundle", UUID.randomUUID().toString(), "1"))) - .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") - .setCode("highmed_allow_list"); - - return task; - } } diff --git a/dsf-bpe/dsf-bpe-process-local-services/pom.xml b/dsf-bpe/dsf-bpe-process-local-services/pom.xml index b234aaeea..575fa6f51 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/pom.xml @@ -29,5 +29,10 @@ <artifactId>log4j2-utils</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-validation</artifactId> + <scope>test</scope> + </dependency> </dependencies> </project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java new file mode 100644 index 000000000..3e379e8f8 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -0,0 +1,87 @@ +package org.highmed.dsf.fhir.profile; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import java.util.Base64; +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.Base64BinaryType; +import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.StringType; +import org.hl7.fhir.r4.model.Task; +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( + Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-group-0.3.0.xml", + "highmed-extension-group-id-0.3.0.xml", "highmed-extension-query-0.3.0.xml", + "highmed-task-local-services-integration-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "feasibility-0.3.0.xml", + "query-type-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "feasibility-0.3.0.xml", + "query-type-0.3.0.xml")); + + private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + @Test + public void testTaskLocalServiceIntegrationValid() throws Exception + { + Task task = createValidTaskLocalServiceIntegration(); + + 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 createValidTaskLocalServiceIntegration() + { + Task task = new Task(); + + task.getMeta() + .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/localServicesIntegration/0.3.0"); + task.setStatus(Task.TaskStatus.REQUESTED); + task.setIntent(Task.TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + + task.getRequester().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRestriction().addRecipient().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + + task.addInput().setValue(new StringType("localServicesIntegrationMessage")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + + task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/query-type").setCode("application/x-aql-query"); + task.addInput().setValue(new BooleanType(true)).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-consent-check"); + task.addInput().setValue(new BooleanType(true)).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-record-linkage"); + + byte[] bloomFilterConfig = Base64.getDecoder().decode( + "CIw/x19d3Oj+GLOKgYAX5KrFAl11q6qMi0qkDiyUOCvMXuF2KffVvSnjUjkTvqh4z8Xs+MuQdK6FqTedM5FY9t4qm+k92A+P"); + + task.addInput().setValue(new Base64BinaryType(bloomFilterConfig)).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("bloom-filter-configuration"); + + return task; + } +} diff --git a/dsf-bpe/dsf-bpe-process-ping/pom.xml b/dsf-bpe/dsf-bpe-process-ping/pom.xml index d5b75a28c..44aabd131 100755 --- a/dsf-bpe/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe/dsf-bpe-process-ping/pom.xml @@ -22,5 +22,10 @@ <artifactId>log4j2-utils</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-validation</artifactId> + <scope>test</scope> + </dependency> </dependencies> </project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java new file mode 100644 index 000000000..434ec1a25 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java @@ -0,0 +1,177 @@ +package org.highmed.dsf.fhir.profiles; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import java.util.Date; +import java.util.UUID; + +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.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( + Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-task-start-ping-process-0.3.0.xml", + "highmed-task-ping-0.3.0.xml", "highmed-task-pong-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml")); + + private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + @Test + public void testTaskStartPingProcessProfileValid() throws Exception + { + Task task = createValidTaskStartPingProcess(); + + 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 testTaskStartPingProcessProfileNotValid1() throws Exception + { + Task task = createValidTaskStartPingProcess(); + task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.1.0"); + + ValidationResult result = resourceValidator.validate(task); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + } + + @Test + public void testTaskStartPingProcessProfileNotValid2() throws Exception + { + Task task = createValidTaskStartPingProcess(); + task.setIntent(TaskIntent.FILLERORDER); + + ValidationResult result = resourceValidator.validate(task); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + } + + @Test + public void testTaskStartPingProcessProfileNotValid3() throws Exception + { + Task task = createValidTaskStartPingProcess(); + task.setAuthoredOn(null); + + ValidationResult result = resourceValidator.validate(task); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + } + + private Task createValidTaskStartPingProcess() + { + Task task = new Task(); + task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRestriction().addRecipient().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + + task.addInput().setValue(new StringType("startPingProcessMessage")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + + return task; + } + + @Test + public void testTaskPingValid() throws Exception + { + Task task = createValidTaskPing(); + + 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 createValidTaskPing() + { + Task task = new Task(); + task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRestriction().addRecipient().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + + task.addInput().setValue(new StringType("pingMessage")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("correlation-key"); + + return task; + } + + @Test + public void testTaskPongValid() throws Exception + { + Task task = createValidTaskPong(); + + 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 createValidTaskPong() + { + Task task = new Task(); + task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-pong"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRestriction().addRecipient().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + + task.addInput().setValue(new StringType("pongMessage")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("correlation-key"); + + return task; + } +} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml index f5ba8bc77..a66234b30 100755 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml @@ -22,5 +22,10 @@ <artifactId>log4j2-utils</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-validation</artifactId> + <scope>test</scope> + </dependency> </dependencies> </project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java new file mode 100644 index 000000000..2a7e0457a --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -0,0 +1,152 @@ +package org.highmed.dsf.fhir.profile; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import java.util.Date; +import java.util.UUID; + +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.IdType; +import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.StringType; +import org.hl7.fhir.r4.model.Task; +import org.hl7.fhir.r4.model.Task.TaskIntent; +import org.hl7.fhir.r4.model.Task.TaskStatus; +import 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( + Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-task-update-allow-list-0.3.0.xml", + "highmed-task-download-allow-list-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-allow-list-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-allow-list-0.3.0.xml")); + + private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + @Test + public void testTaskUpdateAllowListValid() throws Exception + { + Task task = createValidTaskUpdateAllowList(); + + 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 testTaskUpdateAllowlistValidWithOutput() throws Exception + { + Task task = createValidTaskUpdateAllowList(); + task.addOutput().setValue(new Reference(new IdType("Bundle", UUID.randomUUID().toString(), "1"))).getType() + .addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") + .setCode("highmed_allow_list"); + + 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 createValidTaskUpdateAllowList() + { + Task task = new Task(); + task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0"); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRestriction().addRecipient().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + + task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + + return task; + } + + @Test + public void testTaskRequestUpdateResourcesAllowListValid() throws Exception + { + Task task = createValidTaskRequestUpdateAllowListResources(); + + 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 createValidTaskRequestUpdateAllowListResources() + { + Task task = new Task(); + task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0"); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRestriction().addRecipient().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + + task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + + return task; + } + + @Test + public void testTaskDownloadAllowListValid() throws Exception + { + Task task = createValidTaskDownloadAllowList(); + + ValidationResult result = resourceValidator.validate(task); + ValidationSupportRule.logValidationMessages(logger, result); + + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + } + + private Task createValidTaskDownloadAllowList() + { + Task task = new Task(); + task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.3.0"); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRestriction().addRecipient().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + + task.addInput().setValue(new StringType("downloadAllowListMessage")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput() + .setValue( + new Reference(new IdType("https://foo.bar/fhir", "Bundle", UUID.randomUUID().toString(), "1"))) + .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") + .setCode("highmed_allow_list"); + + return task; + } +} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml index 8cbc56e42..691baf256 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml @@ -22,5 +22,10 @@ <artifactId>log4j2-utils</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-validation</artifactId> + <scope>test</scope> + </dependency> </dependencies> </project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java new file mode 100644 index 000000000..3cdafc806 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -0,0 +1,139 @@ +package org.highmed.dsf.fhir.profile; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.UUID; + +import org.highmed.dsf.fhir.validation.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidatorImpl; +import org.highmed.dsf.fhir.validation.SnapshotGenerator.SnapshotWithValidationMessages; +import org.highmed.dsf.fhir.validation.SnapshotGeneratorImpl; +import org.highmed.dsf.fhir.validation.StructureDefinitionReader; +import org.highmed.dsf.fhir.validation.ValidationSupportRule; +import org.highmed.dsf.fhir.validation.ValidationSupportWithCustomResources; +import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; +import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; +import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.StringType; +import org.hl7.fhir.r4.model.StructureDefinition; +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.context.support.DefaultProfileValidationSupport; +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( + Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-task-request-update-resources-0.3.0.xml", + "highmed-task-execute-update-resources-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-resources-0.3.0.xml"), + Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-resources-0.3.0.xml")); + + private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), + validationRule.getValidationSupport()); + + @Test + public void testGenerateSnapshotNotWorkingWithoutBaseSnapshot() throws Exception + { + var reader = new StructureDefinitionReader(validationRule.getFhirContext()); + + StructureDefinition base = reader.readXml("/fhir/StructureDefinition/highmed-task-base-0.3.0.xml"); + StructureDefinition differential = reader + .readXml("/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml"); + + var validationSupport = new ValidationSupportChain( + new InMemoryTerminologyServerValidationSupport(validationRule.getFhirContext()), + new ValidationSupportWithCustomResources(validationRule.getFhirContext(), Arrays.asList(base), + Collections.emptyList(), Collections.emptyList()), + new DefaultProfileValidationSupport(validationRule.getFhirContext())); + var snapshotGenerator = new SnapshotGeneratorImpl(validationRule.getFhirContext(), validationSupport); + + SnapshotWithValidationMessages messages = snapshotGenerator.generateSnapshot(differential); + assertFalse(messages.getMessages().isEmpty()); + } + + @Test + public void testTaskRequestUpdateResourcesValid() throws Exception + { + Task task = createValidTaskRequestUpdateResources(); + + 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 createValidTaskRequestUpdateResources() + { + Task task = new Task(); + task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/requestUpdateResources/0.3.0"); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRestriction().addRecipient().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + + task.addInput().setValue(new StringType("requestUpdateResourcesMessage")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/update-resources").setCode("bundle-reference"); + task.addInput().setValue(new StringType("http://highmed.org/fhir/NamingSystem/organization-identifier|")) + .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-resources") + .setCode("organization-identifier-search-parameter"); + + return task; + } + + @Test + public void testTaskExecuteUpdateResourcesValid() throws Exception + { + Task task = createValidTaskExecuteUpdateResources(); + + 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 createValidTaskExecuteUpdateResources() + { + Task task = new Task(); + task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/executeUpdateResources/0.3.0"); + task.setStatus(TaskStatus.REQUESTED); + task.setIntent(TaskIntent.ORDER); + task.setAuthoredOn(new Date()); + task.getRequester().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRestriction().addRecipient().setType("Organization").getIdentifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + + task.addInput().setValue(new StringType("executeUpdateResourcesMessage")).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() + .setSystem("http://highmed.org/fhir/CodeSystem/update-resources").setCode("bundle-reference"); + + return task; + } +} diff --git a/dsf-bpe/pom.xml b/dsf-bpe/pom.xml index bd03879c5..daedfe86c 100755 --- a/dsf-bpe/pom.xml +++ b/dsf-bpe/pom.xml @@ -126,6 +126,23 @@ <artifactId>dsf-fhir-webservice-client</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-server</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-validation</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-validation</artifactId> + <classifier>tests</classifier> + <type>test-jar</type> + <version>${project.version}</version> + </dependency> <dependency> <groupId>org.highmed.dsf</groupId> diff --git a/dsf-fhir/dsf-fhir-server/pom.xml b/dsf-fhir/dsf-fhir-server/pom.xml index 050a6334b..c4841047c 100755 --- a/dsf-fhir/dsf-fhir-server/pom.xml +++ b/dsf-fhir/dsf-fhir-server/pom.xml @@ -23,6 +23,10 @@ <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-build-info-reader</artifactId> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-validation</artifactId> + </dependency> <dependency> <groupId>org.glassfish.jaxb</groupId> @@ -147,19 +151,6 @@ <scope>test</scope> </dependency> - <!-- Workaround for exec maven plugin issue --> - <!-- https://github.com/mojohaus/exec-maven-plugin/issues/76 --> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-tools-bundle-generator</artifactId> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>de.hs-heilbronn.mi</groupId> - <artifactId>log4j2-utils</artifactId> - <scope>runtime</scope> - </dependency> - <!-- For async logging with log4j2 --> <dependency> <groupId>com.lmax</groupId> @@ -265,34 +256,6 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>java</goal> - </goals> - <phase>generate-resources</phase> - </execution> - </executions> - <configuration> - <mainClass>org.highmed.dsf.tools.generator.BundleGenerator</mainClass> - <arguments> - <argument>${project.basedir}/src/main/resources/fhir</argument> - </arguments> - <workingDirectory>${project.basedir}</workingDirectory> - <cleanupDaemonThreads>false</cleanupDaemonThreads> - <!-- Workaround for exec maven plugin issue --> - <!-- https://github.com/mojohaus/exec-maven-plugin/issues/76 --> - <!-- <includePluginDependencies>true</includePluginDependencies> <includeProjectDependencies>false</includeProjectDependencies> --> - <!-- <executableDependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-bundle-generator</artifactId> </executableDependency> --> - </configuration> - <!-- Workaround for exec maven plugin issue --> - <!-- https://github.com/mojohaus/exec-maven-plugin/issues/76 --> - <!-- <dependencies> <dependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-bundle-generator</artifactId> <version>0.4.0-SNAPSHOT</version> </dependency> - </dependencies> --> - </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-clean-plugin</artifactId> @@ -309,34 +272,5 @@ </configuration> </plugin> </plugins> - <pluginManagement> - <plugins> - <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. --> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <version>1.0.0</version> - <configuration> - <lifecycleMappingMetadata> - <pluginExecutions> - <pluginExecution> - <pluginExecutionFilter> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <versionRange>[1.6.0,)</versionRange> - <goals> - <goal>java</goal> - </goals> - </pluginExecutionFilter> - <action> - <ignore></ignore> - </action> - </pluginExecution> - </pluginExecutions> - </lifecycleMappingMetadata> - </configuration> - </plugin> - </plugins> - </pluginManagement> </build> </project> \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/BatchCommandList.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/BatchCommandList.java index 3a70ca417..3e1bb4873 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/BatchCommandList.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/BatchCommandList.java @@ -17,7 +17,7 @@ import org.highmed.dsf.fhir.event.EventHandler; import org.highmed.dsf.fhir.help.ExceptionHandler; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Bundle.BundleType; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CheckReferencesCommand.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CheckReferencesCommand.java index 68495c207..c7089aefd 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CheckReferencesCommand.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CheckReferencesCommand.java @@ -14,7 +14,7 @@ import org.highmed.dsf.fhir.prefer.PreferReturnType; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.IdType; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/Command.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/Command.java index eea130294..e747e6175 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/Command.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/Command.java @@ -8,7 +8,7 @@ import javax.ws.rs.WebApplicationException; import org.highmed.dsf.fhir.event.EventHandler; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.IdType; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CommandFactoryImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CommandFactoryImpl.java index b2f070444..5e919cfe1 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CommandFactoryImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CommandFactoryImpl.java @@ -26,7 +26,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Resource; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CreateCommand.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CreateCommand.java index c22a2e56d..272a66cb2 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CreateCommand.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CreateCommand.java @@ -31,7 +31,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CreateStructureDefinitionCommand.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CreateStructureDefinitionCommand.java index 02aed5a5f..b279466c2 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CreateStructureDefinitionCommand.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CreateStructureDefinitionCommand.java @@ -17,8 +17,8 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.SnapshotGenerator; -import org.highmed.dsf.fhir.service.SnapshotGenerator.SnapshotWithValidationMessages; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator.SnapshotWithValidationMessages; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.IdType; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteCommand.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteCommand.java index 3389bacfa..638535f5d 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteCommand.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteCommand.java @@ -25,7 +25,7 @@ import org.highmed.dsf.fhir.search.PartialResult; import org.highmed.dsf.fhir.search.SearchQuery; import org.highmed.dsf.fhir.search.SearchQueryParameterError; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/ReadCommand.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/ReadCommand.java index f9234a77f..775d258de 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/ReadCommand.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/ReadCommand.java @@ -28,7 +28,7 @@ import org.highmed.dsf.fhir.search.SearchQuery; import org.highmed.dsf.fhir.search.SearchQueryParameterError; import org.highmed.dsf.fhir.service.ReferenceCleaner; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/TransactionCommandList.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/TransactionCommandList.java index aa27e5284..f0585f1e8 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/TransactionCommandList.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/TransactionCommandList.java @@ -17,7 +17,7 @@ import javax.ws.rs.core.Response.Status; import org.highmed.dsf.fhir.help.ExceptionHandler; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Bundle.BundleType; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/TransactionResources.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/TransactionResources.java index c69fef5aa..06ec28a8b 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/TransactionResources.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/TransactionResources.java @@ -1,6 +1,6 @@ package org.highmed.dsf.fhir.dao.command; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; public class TransactionResources { diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/UpdateCommand.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/UpdateCommand.java index 6a0974363..c9aef7fb2 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/UpdateCommand.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/UpdateCommand.java @@ -32,7 +32,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/UpdateStructureDefinitionCommand.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/UpdateStructureDefinitionCommand.java index b03b8f6c7..0de7f91b2 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/UpdateStructureDefinitionCommand.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/UpdateStructureDefinitionCommand.java @@ -19,8 +19,8 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.SnapshotGenerator; -import org.highmed.dsf.fhir.service.SnapshotGenerator.SnapshotWithValidationMessages; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator.SnapshotWithValidationMessages; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r4.model.IdType; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/ValidationHelperImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/ValidationHelperImpl.java index 520919ee7..df7a4af25 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/ValidationHelperImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/ValidationHelperImpl.java @@ -6,7 +6,7 @@ import org.highmed.dsf.fhir.authentication.User; import org.highmed.dsf.fhir.help.ResponseGenerator; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.hl7.fhir.r4.model.Resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BundleIdentifier.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BundleIdentifier.java index aea46994f..931309501 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BundleIdentifier.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/BundleIdentifier.java @@ -31,7 +31,7 @@ public String getFilterQuery() case CODE: case CODE_AND_SYSTEM: case SYSTEM: - return "bundle->'identifier' " + (valueAndType.negated ? "<>" : "=") + " ?"; + return "bundle->'identifier' " + (valueAndType.negated ? "<>" : "=") + " ?::jsonb"; case CODE_AND_NO_SYSTEM_PROPERTY: if (valueAndType.negated) return "bundle->'identifier'->>'value' <> ? OR (bundle->'identifier' ?? 'system')"; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/CommandConfig.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/CommandConfig.java index 0e32ad0cd..e15b55fe6 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/CommandConfig.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/CommandConfig.java @@ -9,9 +9,9 @@ import org.highmed.dsf.fhir.dao.command.ValidationHelper; import org.highmed.dsf.fhir.dao.command.ValidationHelperImpl; import org.highmed.dsf.fhir.event.EventHandler; -import org.highmed.dsf.fhir.service.ResourceValidatorImpl; -import org.highmed.dsf.fhir.service.SnapshotGenerator; -import org.highmed.dsf.fhir.service.SnapshotGeneratorImpl; +import org.highmed.dsf.fhir.validation.ResourceValidatorImpl; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGeneratorImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.config.ConfigurableBeanFactory; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/SnapshotConfig.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/SnapshotConfig.java index 064351431..2830c73cc 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/SnapshotConfig.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/SnapshotConfig.java @@ -1,7 +1,7 @@ package org.highmed.dsf.fhir.spring.config; -import org.highmed.dsf.fhir.service.SnapshotGenerator; -import org.highmed.dsf.fhir.service.SnapshotGeneratorImpl; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGeneratorImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/ValidationConfig.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/ValidationConfig.java index c882e3b5c..0f04c2f28 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/ValidationConfig.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/ValidationConfig.java @@ -4,11 +4,11 @@ import org.highmed.dsf.fhir.dao.command.ValidationHelper; import org.highmed.dsf.fhir.dao.command.ValidationHelperImpl; -import org.highmed.dsf.fhir.service.ResourceValidator; -import org.highmed.dsf.fhir.service.ResourceValidatorImpl; import org.highmed.dsf.fhir.service.ValidationSupportWithCache; import org.highmed.dsf.fhir.service.ValidationSupportWithFetchFromDb; import org.highmed.dsf.fhir.service.ValidationSupportWithFetchFromDbWithTransaction; +import org.highmed.dsf.fhir.validation.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidatorImpl; import org.hl7.fhir.common.hapi.validation.support.CommonCodeSystemsTerminologyService; import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/AbstractResourceServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/AbstractResourceServiceImpl.java index a5c46e6f6..b6ef3d0f6 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/AbstractResourceServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/AbstractResourceServiceImpl.java @@ -47,7 +47,7 @@ import org.highmed.dsf.fhir.service.ReferenceResolver; import org.highmed.dsf.fhir.service.ResourceReference; import org.highmed.dsf.fhir.service.ResourceReference.ReferenceType; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.base.AbstractBasicService; import org.highmed.dsf.fhir.webservice.specification.BasicResourceService; import org.hl7.fhir.r4.model.Bundle; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ActivityDefinitionServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ActivityDefinitionServiceImpl.java index b91fa8adb..ff2c427b0 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ActivityDefinitionServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ActivityDefinitionServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.ActivityDefinitionService; import org.hl7.fhir.r4.model.ActivityDefinition; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/BinaryServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/BinaryServiceImpl.java index 21f94268b..70b9d89bd 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/BinaryServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/BinaryServiceImpl.java @@ -19,7 +19,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.BinaryService; import org.hl7.fhir.r4.model.Binary; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/BundleServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/BundleServiceImpl.java index 76f993ee5..6ef9c02be 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/BundleServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/BundleServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.BundleService; import org.hl7.fhir.r4.model.Bundle; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/CodeSystemServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/CodeSystemServiceImpl.java index ab9e3bbb5..891c6615f 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/CodeSystemServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/CodeSystemServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.CodeSystemService; import org.hl7.fhir.r4.model.CodeSystem; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/EndpointServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/EndpointServiceImpl.java index ed6286509..9e01e714c 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/EndpointServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/EndpointServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.EndpointService; import org.hl7.fhir.r4.model.Endpoint; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/GroupServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/GroupServiceImpl.java index c28708524..0bd68a20b 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/GroupServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/GroupServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.GroupService; import org.hl7.fhir.r4.model.Group; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/HealthcareServiceServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/HealthcareServiceServiceImpl.java index cb5eb1b9f..349bd8a57 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/HealthcareServiceServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/HealthcareServiceServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.HealthcareServiceService; import org.hl7.fhir.r4.model.HealthcareService; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/LocationServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/LocationServiceImpl.java index 2fb2adb83..4ecd712cc 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/LocationServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/LocationServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.LocationService; import org.hl7.fhir.r4.model.Location; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/NamingSystemServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/NamingSystemServiceImpl.java index 37d522680..e24090acb 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/NamingSystemServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/NamingSystemServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.NamingSystemService; import org.hl7.fhir.r4.model.NamingSystem; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/OrganizationServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/OrganizationServiceImpl.java index aec3f6d40..7e771f5be 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/OrganizationServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/OrganizationServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.OrganizationService; import org.hl7.fhir.r4.model.Organization; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PatientServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PatientServiceImpl.java index 871d2c24b..9b9bd0773 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PatientServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PatientServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.PatientService; import org.hl7.fhir.r4.model.Patient; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PractitionerRoleServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PractitionerRoleServiceImpl.java index e337553f7..3edadb41c 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PractitionerRoleServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PractitionerRoleServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.PractitionerRoleService; import org.hl7.fhir.r4.model.PractitionerRole; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PractitionerServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PractitionerServiceImpl.java index f6d8f33ff..deb9c79cc 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PractitionerServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/PractitionerServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.PractitionerService; import org.hl7.fhir.r4.model.Practitioner; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ProvenanceServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ProvenanceServiceImpl.java index 0d659404a..0c746ee4e 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ProvenanceServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ProvenanceServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.ProvenanceService; import org.hl7.fhir.r4.model.Provenance; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ResearchStudyServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ResearchStudyServiceImpl.java index 6e1d38180..8cd038e9b 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ResearchStudyServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ResearchStudyServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.ResearchStudyService; import org.hl7.fhir.r4.model.ResearchStudy; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/StructureDefinitionServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/StructureDefinitionServiceImpl.java index 0f046acbb..71d389111 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/StructureDefinitionServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/StructureDefinitionServiceImpl.java @@ -30,9 +30,9 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; -import org.highmed.dsf.fhir.service.SnapshotGenerator; -import org.highmed.dsf.fhir.service.SnapshotGenerator.SnapshotWithValidationMessages; +import org.highmed.dsf.fhir.validation.ResourceValidator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator; +import org.highmed.dsf.fhir.validation.SnapshotGenerator.SnapshotWithValidationMessages; import org.highmed.dsf.fhir.webservice.specification.StructureDefinitionService; import org.hl7.fhir.r4.model.OperationOutcome; import org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/SubscriptionServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/SubscriptionServiceImpl.java index 6f144f632..10542b0a5 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/SubscriptionServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/SubscriptionServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.SubscriptionService; import org.hl7.fhir.r4.model.Subscription; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/TaskServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/TaskServiceImpl.java index 1d2388980..67da122a4 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/TaskServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/TaskServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.TaskService; import org.hl7.fhir.r4.model.Task; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ValueSetServiceImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ValueSetServiceImpl.java index eb5a7920d..52a6ccbc9 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ValueSetServiceImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/impl/ValueSetServiceImpl.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceExtractor; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.ValueSetService; import org.hl7.fhir.r4.model.ValueSet; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/AbstractResourceServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/AbstractResourceServiceSecure.java index fea8e49d5..78683a9d9 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/AbstractResourceServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/AbstractResourceServiceSecure.java @@ -26,7 +26,7 @@ import org.highmed.dsf.fhir.search.SearchQueryParameterError; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.BasicResourceService; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.OperationOutcome; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ActivityDefinitionServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ActivityDefinitionServiceSecure.java index 8d52042f5..33ffd707a 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ActivityDefinitionServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ActivityDefinitionServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.ActivityDefinitionService; import org.hl7.fhir.r4.model.ActivityDefinition; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/BinaryServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/BinaryServiceSecure.java index c59f8f244..5fdb253e1 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/BinaryServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/BinaryServiceSecure.java @@ -13,7 +13,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.BinaryService; import org.hl7.fhir.r4.model.Binary; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/BundleServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/BundleServiceSecure.java index 783c93f27..c35b79224 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/BundleServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/BundleServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.BundleService; import org.hl7.fhir.r4.model.Bundle; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/CodeSystemServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/CodeSystemServiceSecure.java index 4a4c34c93..1bd31c645 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/CodeSystemServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/CodeSystemServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.CodeSystemService; import org.hl7.fhir.r4.model.CodeSystem; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/EndpointServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/EndpointServiceSecure.java index 6bb9fed30..8b5b9a48d 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/EndpointServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/EndpointServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.EndpointService; import org.hl7.fhir.r4.model.Endpoint; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/GroupServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/GroupServiceSecure.java index 24ac60e13..3eefdab5d 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/GroupServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/GroupServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.GroupService; import org.hl7.fhir.r4.model.Group; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/HealthcareServiceServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/HealthcareServiceServiceSecure.java index 445615950..4fc5fb2a8 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/HealthcareServiceServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/HealthcareServiceServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.HealthcareServiceService; import org.hl7.fhir.r4.model.HealthcareService; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/LocationServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/LocationServiceSecure.java index 7467e5de2..88f9607d0 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/LocationServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/LocationServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.LocationService; import org.hl7.fhir.r4.model.Location; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/NamingSystemServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/NamingSystemServiceSecure.java index 6ffc0a2e9..6f85f0249 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/NamingSystemServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/NamingSystemServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.NamingSystemService; import org.hl7.fhir.r4.model.NamingSystem; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/OrganizationServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/OrganizationServiceSecure.java index 58965ea54..dc4640b80 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/OrganizationServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/OrganizationServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.OrganizationService; import org.hl7.fhir.r4.model.Organization; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PatientServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PatientServiceSecure.java index f1e1194c6..6c6514124 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PatientServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PatientServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.PatientService; import org.hl7.fhir.r4.model.Patient; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PractitionerRoleServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PractitionerRoleServiceSecure.java index 211606d08..7d05ae3d3 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PractitionerRoleServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PractitionerRoleServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.PractitionerRoleService; import org.hl7.fhir.r4.model.PractitionerRole; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PractitionerServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PractitionerServiceSecure.java index eee2a22e3..23041c9af 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PractitionerServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/PractitionerServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.PractitionerService; import org.hl7.fhir.r4.model.Practitioner; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ProvenanceServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ProvenanceServiceSecure.java index 2d46bb3b1..0e70bb6ac 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ProvenanceServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ProvenanceServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.ProvenanceService; import org.hl7.fhir.r4.model.Provenance; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ResearchStudyServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ResearchStudyServiceSecure.java index d0edb8c5a..830b02752 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ResearchStudyServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ResearchStudyServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.ResearchStudyService; import org.hl7.fhir.r4.model.ResearchStudy; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/StructureDefinitionServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/StructureDefinitionServiceSecure.java index e97c82fa1..296fa6b42 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/StructureDefinitionServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/StructureDefinitionServiceSecure.java @@ -11,7 +11,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.StructureDefinitionService; import org.hl7.fhir.r4.model.Parameters; import org.hl7.fhir.r4.model.StructureDefinition; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/SubscriptionServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/SubscriptionServiceSecure.java index 0412184bc..781a25a44 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/SubscriptionServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/SubscriptionServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.SubscriptionService; import org.hl7.fhir.r4.model.Subscription; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/TaskServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/TaskServiceSecure.java index c5eef9214..6f468ce86 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/TaskServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/TaskServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.TaskService; import org.hl7.fhir.r4.model.Task; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ValueSetServiceSecure.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ValueSetServiceSecure.java index 09db1b221..dd7dd4df1 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ValueSetServiceSecure.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/webservice/secure/ValueSetServiceSecure.java @@ -7,7 +7,7 @@ import org.highmed.dsf.fhir.help.ResponseGenerator; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceResolver; -import org.highmed.dsf.fhir.service.ResourceValidator; +import org.highmed.dsf.fhir.validation.ResourceValidator; import org.highmed.dsf.fhir.webservice.specification.ValueSetService; import org.hl7.fhir.r4.model.ValueSet; diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/TaskIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/TaskIntegrationTest.java index ca7250024..e8626b6ed 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/TaskIntegrationTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/TaskIntegrationTest.java @@ -3,31 +3,17 @@ import static junit.framework.TestCase.assertEquals; import static org.junit.Assert.*; -import java.nio.file.Paths; -import java.util.Collections; import java.util.Date; import java.util.EnumSet; -import java.util.List; -import java.util.Map; import java.util.UUID; -import java.util.concurrent.BlockingDeque; -import java.util.concurrent.LinkedBlockingDeque; -import java.util.concurrent.TimeUnit; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response.Status; import org.highmed.dsf.fhir.authentication.OrganizationProvider; -import org.highmed.dsf.fhir.dao.TaskDao; import org.highmed.fhir.client.FhirWebserviceClient; -import org.highmed.fhir.client.WebsocketClient; -import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Coding; -import org.hl7.fhir.r4.model.DomainResource; -import org.hl7.fhir.r4.model.Extension; -import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResearchStudy; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.ParameterComponent; @@ -35,124 +21,123 @@ import org.hl7.fhir.r4.model.Task.TaskRestrictionComponent; import org.hl7.fhir.r4.model.Task.TaskStatus; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import ca.uhn.fhir.context.FhirContext; public class TaskIntegrationTest extends AbstractIntegrationTest { - private static final Logger logger = LoggerFactory.getLogger(TaskIntegrationTest.class); - - private List<Bundle.BundleEntryComponent> createTaskBundle() - { - Bundle bundle = readBundle(Paths.get("src/test/resources/integration/task-bundle.json"), newJsonParser()); - Bundle resultBundle = getWebserviceClient().postBundle(bundle); - return resultBundle.getEntry(); - } - - @Test - public void testHandleBundleForRequestSimpleFeasibility() throws Exception - { - WebsocketClient websocketClient = getWebsocketClient(); - assertNotNull(websocketClient); - - BlockingDeque<DomainResource> events = new LinkedBlockingDeque<>(); - websocketClient.setDomainResourceHandler(events::add, AbstractIntegrationTest::newJsonParser); - websocketClient.connect(); - - try - { - List<Bundle.BundleEntryComponent> resultBundleEntries = createTaskBundle(); - assertEquals(4, resultBundleEntries.size()); - - String taskId = new IdType(resultBundleEntries.get(3).getFullUrl()).getIdPart(); - Task task = getWebserviceClient().read(Task.class, taskId); - - Task.ParameterComponent input = task.getInput().stream() - .filter(c -> c.getType().getCoding().get(0).getCode().equals("research-study-reference")) - .findFirst().orElse(new Task.ParameterComponent()); - - IdType taskInputResearchStudyId = new IdType(((Reference) input.getValue()).getReference()); - IdType researchStudyId = new IdType(resultBundleEntries.get(2).getFullUrl()); - - assertEquals(researchStudyId.getResourceType(), taskInputResearchStudyId.getResourceType()); - assertEquals(researchStudyId.getIdPart(), taskInputResearchStudyId.getIdPart()); - assertEquals(researchStudyId.getVersionIdPart(), taskInputResearchStudyId.getVersionIdPart()); - - DomainResource event = events.pollFirst(5, TimeUnit.SECONDS); - assertNotNull(event); - assertTrue(event instanceof Task); - - Task taskViaWebsocket = (Task) event; - Task.ParameterComponent inputViaWebsocket = taskViaWebsocket.getInput().stream() - .filter(c -> c.getType().getCoding().get(0).getCode().equals("research-study-reference")) - .findFirst().orElse(new Task.ParameterComponent()); - - IdType taskInputResearchStudyIdViaWebsocket = new IdType( - ((Reference) inputViaWebsocket.getValue()).getReference()); - assertEquals(researchStudyId.getResourceType(), taskInputResearchStudyIdViaWebsocket.getResourceType()); - assertEquals(researchStudyId.getIdPart(), taskInputResearchStudyIdViaWebsocket.getIdPart()); - assertEquals(researchStudyId.getVersionIdPart(), taskInputResearchStudyIdViaWebsocket.getVersionIdPart()); - - ResearchStudy researchStudy = getWebserviceClient().read(ResearchStudy.class, researchStudyId.getIdPart()); - logger.debug("ResearchStudy: {}", - FhirContext.forR4().newXmlParser().setPrettyPrint(true).encodeResourceToString(researchStudy)); - - List<Extension> medics = researchStudy - .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/participating-medic"); - assertNotNull(medics); - assertEquals(1, medics.size()); - Extension medicExt = medics.get(0); - assertTrue(medicExt.hasValue()); - assertTrue(medicExt.getValue() instanceof Reference); - Reference medicRef = (Reference) medicExt.getValue(); - assertTrue(medicRef.hasIdentifier()); - assertFalse(medicRef.hasReference()); - - List<Extension> ttps = researchStudy - .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/participating-ttp"); - assertNotNull(ttps); - assertEquals(1, ttps.size()); - Extension ttpExt = medics.get(0); - assertTrue(ttpExt.hasValue()); - assertTrue(ttpExt.getValue() instanceof Reference); - Reference ttpRef = (Reference) ttpExt.getValue(); - assertTrue(ttpRef.hasIdentifier()); - assertFalse(ttpRef.hasReference()); - } - finally - { - if (websocketClient != null) - websocketClient.disconnect(); - } - } - - @Test - public void testCreateTaskStartPingProcess() throws Exception - { - OrganizationProvider organizationProvider = getSpringWebApplicationContext() - .getBean(OrganizationProvider.class); - assertNotNull(organizationProvider); - - Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); - t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); - t.setStatus(TaskStatus.REQUESTED); - t.setIntent(TaskIntent.ORDER); - t.setAuthoredOn(new Date()); - Reference localOrg = new Reference(); - localOrg.setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_Organization"); - t.setRequester(localOrg); - t.getRestriction().addRecipient(localOrg); - t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("message-name"); - t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); - - getWebserviceClient().create(t); - } +// private static final Logger logger = LoggerFactory.getLogger(TaskIntegrationTest.class); + +// TODO create test setup for testing against process profiles +// private List<Bundle.BundleEntryComponent> createTaskBundle() +// { +// Bundle bundle = readBundle(Paths.get("src/test/resources/integration/task-bundle.json"), newJsonParser()); +// Bundle resultBundle = getWebserviceClient().postBundle(bundle); +// return resultBundle.getEntry(); +// } + +// TODO create test setup for testing against process profiles +// @Test +// public void testHandleBundleForRequestSimpleFeasibility() throws Exception +// { +// WebsocketClient websocketClient = getWebsocketClient(); +// assertNotNull(websocketClient); +// +// BlockingDeque<DomainResource> events = new LinkedBlockingDeque<>(); +// websocketClient.setDomainResourceHandler(events::add, AbstractIntegrationTest::newJsonParser); +// websocketClient.connect(); +// +// try +// { +// List<Bundle.BundleEntryComponent> resultBundleEntries = createTaskBundle(); +// assertEquals(4, resultBundleEntries.size()); +// +// String taskId = new IdType(resultBundleEntries.get(3).getFullUrl()).getIdPart(); +// Task task = getWebserviceClient().read(Task.class, taskId); +// +// Task.ParameterComponent input = task.getInput().stream() +// .filter(c -> c.getType().getCoding().get(0).getCode().equals("research-study-reference")) +// .findFirst().orElse(new Task.ParameterComponent()); +// +// IdType taskInputResearchStudyId = new IdType(((Reference) input.getValue()).getReference()); +// IdType researchStudyId = new IdType(resultBundleEntries.get(2).getFullUrl()); +// +// assertEquals(researchStudyId.getResourceType(), taskInputResearchStudyId.getResourceType()); +// assertEquals(researchStudyId.getIdPart(), taskInputResearchStudyId.getIdPart()); +// assertEquals(researchStudyId.getVersionIdPart(), taskInputResearchStudyId.getVersionIdPart()); +// +// DomainResource event = events.pollFirst(5, TimeUnit.SECONDS); +// assertNotNull(event); +// assertTrue(event instanceof Task); +// +// Task taskViaWebsocket = (Task) event; +// Task.ParameterComponent inputViaWebsocket = taskViaWebsocket.getInput().stream() +// .filter(c -> c.getType().getCoding().get(0).getCode().equals("research-study-reference")) +// .findFirst().orElse(new Task.ParameterComponent()); +// +// IdType taskInputResearchStudyIdViaWebsocket = new IdType( +// ((Reference) inputViaWebsocket.getValue()).getReference()); +// assertEquals(researchStudyId.getResourceType(), taskInputResearchStudyIdViaWebsocket.getResourceType()); +// assertEquals(researchStudyId.getIdPart(), taskInputResearchStudyIdViaWebsocket.getIdPart()); +// assertEquals(researchStudyId.getVersionIdPart(), taskInputResearchStudyIdViaWebsocket.getVersionIdPart()); +// +// ResearchStudy researchStudy = getWebserviceClient().read(ResearchStudy.class, researchStudyId.getIdPart()); +// logger.debug("ResearchStudy: {}", +// FhirContext.forR4().newXmlParser().setPrettyPrint(true).encodeResourceToString(researchStudy)); +// +// List<Extension> medics = researchStudy +// .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/participating-medic"); +// assertNotNull(medics); +// assertEquals(1, medics.size()); +// Extension medicExt = medics.get(0); +// assertTrue(medicExt.hasValue()); +// assertTrue(medicExt.getValue() instanceof Reference); +// Reference medicRef = (Reference) medicExt.getValue(); +// assertTrue(medicRef.hasIdentifier()); +// assertFalse(medicRef.hasReference()); +// +// List<Extension> ttps = researchStudy +// .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/participating-ttp"); +// assertNotNull(ttps); +// assertEquals(1, ttps.size()); +// Extension ttpExt = medics.get(0); +// assertTrue(ttpExt.hasValue()); +// assertTrue(ttpExt.getValue() instanceof Reference); +// Reference ttpRef = (Reference) ttpExt.getValue(); +// assertTrue(ttpRef.hasIdentifier()); +// assertFalse(ttpRef.hasReference()); +// } +// finally +// { +// if (websocketClient != null) +// websocketClient.disconnect(); +// } +// } + +// TODO create test setup for testing against process profiles +// @Test +// public void testCreateTaskStartPingProcess() throws Exception +// { +// OrganizationProvider organizationProvider = getSpringWebApplicationContext() +// .getBean(OrganizationProvider.class); +// assertNotNull(organizationProvider); +// +// Task t = new Task(); +// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); +// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); +// t.setStatus(TaskStatus.REQUESTED); +// t.setIntent(TaskIntent.ORDER); +// t.setAuthoredOn(new Date()); +// Reference localOrg = new Reference(); +// localOrg.setType("Organization").getIdentifier() +// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") +// .setValue("Test_Organization"); +// t.setRequester(localOrg); +// t.getRestriction().addRecipient(localOrg); +// t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("message-name"); +// t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); +// +// getWebserviceClient().create(t); +// } @Test(expected = WebApplicationException.class) public void testCreateTaskStartPingProcessNotAllowedForRemoteUser() throws Exception @@ -189,155 +174,159 @@ public void testCreateTaskStartPingProcessNotAllowedForRemoteUser() throws Excep } } - @Test - public void testCreateTaskStartPongProcessAllowedForRemoteUser() throws Exception - { - OrganizationProvider organizationProvider = getSpringWebApplicationContext() - .getBean(OrganizationProvider.class); - assertNotNull(organizationProvider); - - Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); - t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); - t.setStatus(TaskStatus.REQUESTED); - t.setIntent(TaskIntent.ORDER); - t.setAuthoredOn(new Date()); - - Reference requester = new Reference().setType("Organization"); - requester.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("External_Test_Organization"); - t.setRequester(requester); - - Reference localOrg = new Reference(); - localOrg.setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_Organization"); - t.getRestriction().addRecipient(localOrg); - - ParameterComponent in1 = t.addInput(); - in1.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("message-name"); - in1.setValue(new StringType("pingMessage")); - - ParameterComponent in2 = t.addInput(); - in2.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("business-key"); - in2.setValue(new StringType(UUID.randomUUID().toString())); - - ParameterComponent in3 = t.addInput(); - in3.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("correlation-key"); - in3.setValue(new StringType(UUID.randomUUID().toString())); - - getExternalWebserviceClient().create(t); - } - - @Test - public void testCreateTaskContinuePingProcessAllowedForRemoteUser() throws Exception - { - OrganizationProvider organizationProvider = getSpringWebApplicationContext() - .getBean(OrganizationProvider.class); - assertNotNull(organizationProvider); - - Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-pong"); - t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); - t.setStatus(TaskStatus.REQUESTED); - t.setIntent(TaskIntent.ORDER); - t.setAuthoredOn(new Date()); - - Reference requester = new Reference().setType("Organization"); - requester.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("External_Test_Organization"); - t.setRequester(requester); - - Reference localOrg = new Reference(); - localOrg.setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_Organization"); - t.getRestriction().addRecipient(localOrg); - - ParameterComponent in1 = t.addInput(); - in1.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("message-name"); - in1.setValue(new StringType("pongMessage")); - - ParameterComponent in2 = t.addInput(); - in2.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("business-key"); - in2.setValue(new StringType(UUID.randomUUID().toString())); - - ParameterComponent in3 = t.addInput(); - in3.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("correlation-key"); - in3.setValue(new StringType(UUID.randomUUID().toString())); - - getExternalWebserviceClient().create(t); - } - - @Test - public void testUpdateTaskStartPingProcessStatusRequestedToInProgress() throws Exception - { - OrganizationProvider organizationProvider = getSpringWebApplicationContext() - .getBean(OrganizationProvider.class); - assertNotNull(organizationProvider); - - Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); - t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); - t.setStatus(TaskStatus.REQUESTED); - t.setIntent(TaskIntent.ORDER); - t.setAuthoredOn(new Date()); - Reference localOrg = new Reference(); - localOrg.setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_Organization"); - t.setRequester(localOrg); - t.getRestriction().addRecipient(localOrg); - t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("message-name"); - t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); - - TaskDao dao = getSpringWebApplicationContext().getBean(TaskDao.class); - Task created = dao.create(t); - - created.setStatus(TaskStatus.INPROGRESS); - - getWebserviceClient().update(created); - } - - @Test - public void testUpdateTaskStartPingProcessStatusInProgressToCompleted() throws Exception - { - OrganizationProvider organizationProvider = getSpringWebApplicationContext() - .getBean(OrganizationProvider.class); - assertNotNull(organizationProvider); - - Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); - t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); - t.setStatus(TaskStatus.INPROGRESS); - t.setIntent(TaskIntent.ORDER); - t.setAuthoredOn(new Date()); - - Reference localOrg = new Reference(); - localOrg.setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_Organization"); - t.setRequester(localOrg); - t.getRestriction().addRecipient(localOrg); - - t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("message-name"); - t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); - - TaskDao dao = getSpringWebApplicationContext().getBean(TaskDao.class); - Task created = dao.create(t); - - created.setStatus(TaskStatus.COMPLETED); - - getWebserviceClient().update(created); - } +// TODO create test setup for testing against process profiles +// @Test +// public void testCreateTaskStartPongProcessAllowedForRemoteUser() throws Exception +// { +// OrganizationProvider organizationProvider = getSpringWebApplicationContext() +// .getBean(OrganizationProvider.class); +// assertNotNull(organizationProvider); +// +// Task t = new Task(); +// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); +// t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); +// t.setStatus(TaskStatus.REQUESTED); +// t.setIntent(TaskIntent.ORDER); +// t.setAuthoredOn(new Date()); +// +// Reference requester = new Reference().setType("Organization"); +// requester.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") +// .setValue("External_Test_Organization"); +// t.setRequester(requester); +// +// Reference localOrg = new Reference(); +// localOrg.setType("Organization").getIdentifier() +// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") +// .setValue("Test_Organization"); +// t.getRestriction().addRecipient(localOrg); +// +// ParameterComponent in1 = t.addInput(); +// in1.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("message-name"); +// in1.setValue(new StringType("pingMessage")); +// +// ParameterComponent in2 = t.addInput(); +// in2.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("business-key"); +// in2.setValue(new StringType(UUID.randomUUID().toString())); +// +// ParameterComponent in3 = t.addInput(); +// in3.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("correlation-key"); +// in3.setValue(new StringType(UUID.randomUUID().toString())); +// +// getExternalWebserviceClient().create(t); +// } + +// TODO create test setup for testing against process profiles +// @Test +// public void testCreateTaskContinuePingProcessAllowedForRemoteUser() throws Exception +// { +// OrganizationProvider organizationProvider = getSpringWebApplicationContext() +// .getBean(OrganizationProvider.class); +// assertNotNull(organizationProvider); +// +// Task t = new Task(); +// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-pong"); +// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); +// t.setStatus(TaskStatus.REQUESTED); +// t.setIntent(TaskIntent.ORDER); +// t.setAuthoredOn(new Date()); +// +// Reference requester = new Reference().setType("Organization"); +// requester.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") +// .setValue("External_Test_Organization"); +// t.setRequester(requester); +// +// Reference localOrg = new Reference(); +// localOrg.setType("Organization").getIdentifier() +// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") +// .setValue("Test_Organization"); +// t.getRestriction().addRecipient(localOrg); +// +// ParameterComponent in1 = t.addInput(); +// in1.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("message-name"); +// in1.setValue(new StringType("pongMessage")); +// +// ParameterComponent in2 = t.addInput(); +// in2.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("business-key"); +// in2.setValue(new StringType(UUID.randomUUID().toString())); +// +// ParameterComponent in3 = t.addInput(); +// in3.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("correlation-key"); +// in3.setValue(new StringType(UUID.randomUUID().toString())); +// +// getExternalWebserviceClient().create(t); +// } + +// TODO create test setup for testing against process profiles +// @Test +// public void testUpdateTaskStartPingProcessStatusRequestedToInProgress() throws Exception +// { +// OrganizationProvider organizationProvider = getSpringWebApplicationContext() +// .getBean(OrganizationProvider.class); +// assertNotNull(organizationProvider); +// +// Task t = new Task(); +// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); +// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); +// t.setStatus(TaskStatus.REQUESTED); +// t.setIntent(TaskIntent.ORDER); +// t.setAuthoredOn(new Date()); +// Reference localOrg = new Reference(); +// localOrg.setType("Organization").getIdentifier() +// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") +// .setValue("Test_Organization"); +// t.setRequester(localOrg); +// t.getRestriction().addRecipient(localOrg); +// t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("message-name"); +// t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); +// +// TaskDao dao = getSpringWebApplicationContext().getBean(TaskDao.class); +// Task created = dao.create(t); +// +// created.setStatus(TaskStatus.INPROGRESS); +// +// getWebserviceClient().update(created); +// } + +// TODO create test setup for testing against process profiles +// @Test +// public void testUpdateTaskStartPingProcessStatusInProgressToCompleted() throws Exception +// { +// OrganizationProvider organizationProvider = getSpringWebApplicationContext() +// .getBean(OrganizationProvider.class); +// assertNotNull(organizationProvider); +// +// Task t = new Task(); +// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); +// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); +// t.setStatus(TaskStatus.INPROGRESS); +// t.setIntent(TaskIntent.ORDER); +// t.setAuthoredOn(new Date()); +// +// Reference localOrg = new Reference(); +// localOrg.setType("Organization").getIdentifier() +// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") +// .setValue("Test_Organization"); +// t.setRequester(localOrg); +// t.getRestriction().addRecipient(localOrg); +// +// t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("message-name"); +// t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); +// +// TaskDao dao = getSpringWebApplicationContext().getBean(TaskDao.class); +// Task created = dao.create(t); +// +// created.setStatus(TaskStatus.COMPLETED); +// +// getWebserviceClient().update(created); +// } @Test public void testCreateForbiddenLocalUserIllegalStatus() throws Exception @@ -839,54 +828,55 @@ public void testCreateForbiddenOutputNotValidByExternalUser() throws Exception testCreateExpectForbidden(getExternalWebserviceClient(), t); } - @Test - public void testSearchByStatusRequested() throws Exception - { - Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); - t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); - t.setStatus(TaskStatus.REQUESTED); - t.setIntent(TaskIntent.ORDER); - t.setAuthoredOn(new Date()); - Reference localOrg = new Reference(); - localOrg.setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_Organization"); - t.setRequester(localOrg); - t.getRestriction().addRecipient(localOrg); - t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") - .setCode("message-name"); - t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); - - getWebserviceClient().create(t); - - Bundle searchResult = getWebserviceClient().searchWithStrictHandling(Task.class, Map.of("status", - Collections.singletonList("requested"), "_sort", Collections.singletonList("_lastUpdated"))); - assertNotNull(searchResult); - assertEquals(1, searchResult.getTotal()); - assertTrue(searchResult.hasEntry()); - assertNotNull(searchResult.getEntry()); - assertEquals(1, searchResult.getEntry().size()); - assertTrue(searchResult.getEntryFirstRep().hasResource()); - assertNotNull(searchResult.getEntryFirstRep().getResource()); - assertTrue(searchResult.getEntryFirstRep().getResource() instanceof Task); - - Task result = (Task) searchResult.getEntryFirstRep().getResource(); - assertTrue(result.hasRequester()); - assertTrue(result.hasRestriction()); - assertTrue(result.getRestriction().hasRecipient()); - assertNotNull(result.getRestriction().getRecipient()); - assertEquals(1, result.getRestriction().getRecipient().size()); - assertNotNull(result.getRestriction().getRecipientFirstRep()); - - Reference ref = result.getRestriction().getRecipientFirstRep(); - assertFalse(ref.hasReference()); - assertNull(ref.getReference()); - assertTrue(ref.hasIdentifier()); - assertNotNull(ref.getIdentifier()); - assertTrue(ref.getIdentifier().hasSystem()); - assertNotNull(ref.getIdentifier().getSystem()); - assertTrue(ref.getIdentifier().hasValue()); - assertNotNull(ref.getIdentifier().getValue()); - } +// TODO create test setup for testing against process profiles +// @Test +// public void testSearchByStatusRequested() throws Exception +// { +// Task t = new Task(); +// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); +// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); +// t.setStatus(TaskStatus.REQUESTED); +// t.setIntent(TaskIntent.ORDER); +// t.setAuthoredOn(new Date()); +// Reference localOrg = new Reference(); +// localOrg.setType("Organization").getIdentifier() +// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") +// .setValue("Test_Organization"); +// t.setRequester(localOrg); +// t.getRestriction().addRecipient(localOrg); +// t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") +// .setCode("message-name"); +// t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); +// +// getWebserviceClient().create(t); +// +// Bundle searchResult = getWebserviceClient().searchWithStrictHandling(Task.class, Map.of("status", +// Collections.singletonList("requested"), "_sort", Collections.singletonList("_lastUpdated"))); +// assertNotNull(searchResult); +// assertEquals(1, searchResult.getTotal()); +// assertTrue(searchResult.hasEntry()); +// assertNotNull(searchResult.getEntry()); +// assertEquals(1, searchResult.getEntry().size()); +// assertTrue(searchResult.getEntryFirstRep().hasResource()); +// assertNotNull(searchResult.getEntryFirstRep().getResource()); +// assertTrue(searchResult.getEntryFirstRep().getResource() instanceof Task); +// +// Task result = (Task) searchResult.getEntryFirstRep().getResource(); +// assertTrue(result.hasRequester()); +// assertTrue(result.hasRestriction()); +// assertTrue(result.getRestriction().hasRecipient()); +// assertNotNull(result.getRestriction().getRecipient()); +// assertEquals(1, result.getRestriction().getRecipient().size()); +// assertNotNull(result.getRestriction().getRecipientFirstRep()); +// +// Reference ref = result.getRestriction().getRecipientFirstRep(); +// assertFalse(ref.hasReference()); +// assertNull(ref.getReference()); +// assertTrue(ref.hasIdentifier()); +// assertNotNull(ref.getIdentifier()); +// assertTrue(ref.getIdentifier().hasSystem()); +// assertNotNull(ref.getIdentifier().getSystem()); +// assertTrue(ref.getIdentifier().hasValue()); +// assertNotNull(ref.getIdentifier().getValue()); +// } } diff --git a/dsf-fhir/dsf-fhir-validation/pom.xml b/dsf-fhir/dsf-fhir-validation/pom.xml new file mode 100644 index 000000000..5066ba02c --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/pom.xml @@ -0,0 +1,121 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <artifactId>dsf-fhir-validation</artifactId> + + <parent> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-pom</artifactId> + <version>0.4.0-SNAPSHOT</version> + </parent> + + <dependencies> + <dependency> + <groupId>ca.uhn.hapi.fhir</groupId> + <artifactId>hapi-fhir-structures-r4</artifactId> + </dependency> + <dependency> + <groupId>ca.uhn.hapi.fhir</groupId> + <artifactId>hapi-fhir-structures-r5</artifactId> + </dependency> + <dependency> + <groupId>ca.uhn.hapi.fhir</groupId> + <artifactId>hapi-fhir-validation</artifactId> + </dependency> + <dependency> + <groupId>ca.uhn.hapi.fhir</groupId> + <artifactId>hapi-fhir-validation-resources-r4</artifactId> + </dependency> + <dependency> + <groupId>ca.uhn.hapi.fhir</groupId> + <artifactId>hapi-fhir-validation-resources-r5</artifactId> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <optional>true</optional> + </dependency> + + <!-- Workaround for exec maven plugin issue --> + <!-- https://github.com/mojohaus/exec-maven-plugin/issues/76 --> + <!-- <dependency> + <groupId>de.hs-heilbronn.mi</groupId> + <artifactId>log4j2-utils</artifactId> + <scope>test</scope> + </dependency>--> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-tools-bundle-generator</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>de.hs-heilbronn.mi</groupId> + <artifactId>log4j2-utils</artifactId> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>java</goal> + </goals> + <phase>generate-resources</phase> + </execution> + </executions> + <configuration> + <mainClass>org.highmed.dsf.tools.generator.BundleGenerator</mainClass> + <arguments> + <argument>${project.basedir}/src/main/resources/fhir</argument> + </arguments> + <workingDirectory>${project.basedir}</workingDirectory> + <cleanupDaemonThreads>false</cleanupDaemonThreads> + <!-- Workaround for exec maven plugin issue --> + <!-- https://github.com/mojohaus/exec-maven-plugin/issues/76 --> + <!-- <includePluginDependencies>true</includePluginDependencies> <includeProjectDependencies>false</includeProjectDependencies> --> + <!-- <executableDependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-bundle-generator</artifactId> </executableDependency> --> + </configuration> + <!-- Workaround for exec maven plugin issue --> + <!-- https://github.com/mojohaus/exec-maven-plugin/issues/76 --> + <!-- <dependencies> <dependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-bundle-generator</artifactId> <version>0.4.0-SNAPSHOT</version> </dependency> + </dependencies> --> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. --> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <versionRange>[1.6.0,)</versionRange> + <goals> + <goal>java</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore></ignore> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ResourceValidator.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ResourceValidator.java similarity index 81% rename from dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ResourceValidator.java rename to dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ResourceValidator.java index 03379bf45..abe9139af 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ResourceValidator.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ResourceValidator.java @@ -1,4 +1,4 @@ -package org.highmed.dsf.fhir.service; +package org.highmed.dsf.fhir.validation; import org.hl7.fhir.r4.model.Resource; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ResourceValidatorImpl.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ResourceValidatorImpl.java similarity index 96% rename from dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ResourceValidatorImpl.java rename to dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ResourceValidatorImpl.java index 4075cbc57..26210291c 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ResourceValidatorImpl.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ResourceValidatorImpl.java @@ -1,4 +1,4 @@ -package org.highmed.dsf.fhir.service; +package org.highmed.dsf.fhir.validation; import org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator; import org.hl7.fhir.r4.model.Resource; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/SnapshotGenerator.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/SnapshotGenerator.java similarity index 95% rename from dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/SnapshotGenerator.java rename to dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/SnapshotGenerator.java index d8afa6387..f2ffe050b 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/SnapshotGenerator.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/SnapshotGenerator.java @@ -1,4 +1,4 @@ -package org.highmed.dsf.fhir.service; +package org.highmed.dsf.fhir.validation; import java.util.List; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/SnapshotGeneratorImpl.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/SnapshotGeneratorImpl.java similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/SnapshotGeneratorImpl.java rename to dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/SnapshotGeneratorImpl.java index c2eb107d0..733501854 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/SnapshotGeneratorImpl.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/SnapshotGeneratorImpl.java @@ -1,4 +1,4 @@ -package org.highmed.dsf.fhir.service; +package org.highmed.dsf.fhir.validation; import java.util.ArrayList; import java.util.List; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/StructureDefinitionReader.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/StructureDefinitionReader.java similarity index 58% rename from dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/StructureDefinitionReader.java rename to dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/StructureDefinitionReader.java index 34b64f29f..6719d53de 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/StructureDefinitionReader.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/StructureDefinitionReader.java @@ -1,4 +1,4 @@ -package org.highmed.dsf.fhir.service; +package org.highmed.dsf.fhir.validation; import java.io.IOException; import java.io.InputStream; @@ -28,16 +28,31 @@ public List<StructureDefinition> readXml(Path... xmlPaths) return readXml(Arrays.asList(xmlPaths)); } + public List<StructureDefinition> readXml(String... xmlOnClassPaths) + { + return readXmlFromClassPath(Arrays.asList(xmlOnClassPaths)); + } + public List<StructureDefinition> readXml(List<Path> xmlPaths) { return readXml(xmlPaths.stream()).collect(Collectors.toList()); } + public List<StructureDefinition> readXmlFromClassPath(List<String> xmlOnClassPaths) + { + return readXmlFromClassPath(xmlOnClassPaths.stream()).collect(Collectors.toList()); + } + public Stream<StructureDefinition> readXml(Stream<Path> xmlPaths) { return xmlPaths.map(this::readXml); } + public Stream<StructureDefinition> readXmlFromClassPath(Stream<String> xmlOnClassPaths) + { + return xmlOnClassPaths.map(this::readXml); + } + public StructureDefinition readXml(Path xmlPath) { try (InputStream in = Files.newInputStream(xmlPath)) @@ -49,4 +64,16 @@ public StructureDefinition readXml(Path xmlPath) throw new RuntimeException(e); } } + + public StructureDefinition readXml(String xmlOnClassPath) + { + try (InputStream in = StructureDefinitionReader.class.getResourceAsStream(xmlOnClassPath)) + { + return context.newXmlParser().parseResource(StructureDefinition.class, in); + } + catch (DataFormatException | IOException e) + { + throw new RuntimeException(e); + } + } } diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/ValidationSupportRule.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java similarity index 59% rename from dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/ValidationSupportRule.java rename to dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java index 00fe869b0..e7f9bd397 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/ValidationSupportRule.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java @@ -1,22 +1,15 @@ -package org.highmed.dsf.fhir.profiles; +package org.highmed.dsf.fhir.validation; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.IOException; import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.List; import java.util.Locale; import java.util.stream.Stream; -import org.highmed.dsf.fhir.service.ValidationSupportWithCustomResources; -import org.highmed.dsf.fhir.service.SnapshotGenerator; -import org.highmed.dsf.fhir.service.SnapshotGenerator.SnapshotWithValidationMessages; -import org.highmed.dsf.fhir.service.SnapshotGeneratorImpl; -import org.highmed.dsf.fhir.service.StructureDefinitionReader; +import org.highmed.dsf.fhir.validation.SnapshotGenerator.SnapshotWithValidationMessages; import org.hl7.fhir.common.hapi.validation.support.CommonCodeSystemsTerminologyService; import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; @@ -33,11 +26,6 @@ public class ValidationSupportRule extends ExternalResource { - private static final String BASE_FOLDER = "src/main/resources/fhir/"; - private static final String STUCTURE_DEFINITIONS_FOLDER = BASE_FOLDER + "StructureDefinition"; - private static final String CODE_SYSTEMS_FOLDER = BASE_FOLDER + "CodeSystem"; - private static final String VALUE_SETS_FOLDER = BASE_FOLDER + "ValueSet"; - private final FhirContext context; private final IValidationSupport validationSupport; @@ -61,46 +49,42 @@ customValidationSupport, new DefaultProfileValidationSupport(context), new CommonCodeSystemsTerminologyService(context)); readProfilesAndGenerateSnapshots(context, customValidationSupport, - new SnapshotGeneratorImpl(context, validationSupport), - toPaths(STUCTURE_DEFINITIONS_FOLDER, structureDefinitions)); - - readCodeSystems(context, customValidationSupport, toPaths(CODE_SYSTEMS_FOLDER, codeSystems)); - readValueSets(context, customValidationSupport, toPaths(VALUE_SETS_FOLDER, valueSets)); - } + new SnapshotGeneratorImpl(context, validationSupport), structureDefinitions.stream()); - private static Stream<Path> toPaths(String folder, List<String> files) - { - return files.stream().map(file -> Paths.get(folder, file)); + readCodeSystems(context, customValidationSupport, codeSystems.stream()); + readValueSets(context, customValidationSupport, valueSets.stream()); } private static void readProfilesAndGenerateSnapshots(FhirContext context, ValidationSupportWithCustomResources vSupport, SnapshotGenerator snapshotGenerator, - Stream<Path> structureDefinitions) + Stream<String> structureDefinitions) { StructureDefinitionReader reader = new StructureDefinitionReader(context); - reader.readXml(structureDefinitions).forEach(diff -> - { - SnapshotWithValidationMessages snapshotWithValidationMessages = snapshotGenerator.generateSnapshot(diff); - assertTrue(snapshotWithValidationMessages.getMessages().isEmpty()); - assertNotNull(snapshotWithValidationMessages.getSnapshot()); - - vSupport.addOrReplace(snapshotWithValidationMessages.getSnapshot()); - }); + reader.readXmlFromClassPath(structureDefinitions.map(file -> "/fhir/StructureDefinition/" + file)) + .forEach(diff -> + { + SnapshotWithValidationMessages snapshotWithValidationMessages = snapshotGenerator + .generateSnapshot(diff); + assertTrue(snapshotWithValidationMessages.getMessages().isEmpty()); + assertNotNull(snapshotWithValidationMessages.getSnapshot()); + + vSupport.addOrReplace(snapshotWithValidationMessages.getSnapshot()); + }); } private static void readCodeSystems(FhirContext context, ValidationSupportWithCustomResources vSupport, - Stream<Path> codeSystems) + Stream<String> codeSystems) { - codeSystems.forEach(path -> + codeSystems.map(file -> "/fhir/CodeSystem/" + file).forEach(file -> { - var cS = readCodeSystem(context, path); + var cS = readCodeSystem(context, file); vSupport.addOrReplace(cS); }); } - private static CodeSystem readCodeSystem(FhirContext context, Path path) + private static CodeSystem readCodeSystem(FhirContext context, String file) { - try (InputStream in = Files.newInputStream(path)) + try (InputStream in = ValidationSupportRule.class.getResourceAsStream(file)) { return context.newXmlParser().parseResource(CodeSystem.class, in); } @@ -111,18 +95,18 @@ private static CodeSystem readCodeSystem(FhirContext context, Path path) } private static void readValueSets(FhirContext context, ValidationSupportWithCustomResources vSupport, - Stream<Path> valueSets) + Stream<String> valueSets) { - valueSets.forEach(p -> + valueSets.map(file -> "/fhir/ValueSet/" + file).forEach(file -> { - var vS = readValueSet(context, p); + var vS = readValueSet(context, file); vSupport.addOrReplace(vS); }); } - private static ValueSet readValueSet(FhirContext context, Path path) + private static ValueSet readValueSet(FhirContext context, String file) { - try (InputStream in = Files.newInputStream(path)) + try (InputStream in = ValidationSupportRule.class.getResourceAsStream(file)) { return context.newXmlParser().parseResource(ValueSet.class, in); } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValidationSupportWithCustomResources.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportWithCustomResources.java similarity index 98% rename from dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValidationSupportWithCustomResources.java rename to dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportWithCustomResources.java index 23245a6cb..29a831173 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValidationSupportWithCustomResources.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportWithCustomResources.java @@ -1,4 +1,4 @@ -package org.highmed.dsf.fhir.service; +package org.highmed.dsf.fhir.validation; import java.util.ArrayList; import java.util.Collection; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValueSetExpander.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValueSetExpander.java similarity index 83% rename from dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValueSetExpander.java rename to dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValueSetExpander.java index b34d929d6..76ee521c6 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValueSetExpander.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValueSetExpander.java @@ -1,4 +1,4 @@ -package org.highmed.dsf.fhir.service; +package org.highmed.dsf.fhir.validation; import org.hl7.fhir.r4.model.ValueSet; import org.hl7.fhir.r4.terminologies.ValueSetExpander.ValueSetExpansionOutcome; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValueSetExpanderImpl.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValueSetExpanderImpl.java similarity index 97% rename from dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValueSetExpanderImpl.java rename to dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValueSetExpanderImpl.java index b4e3731fd..bcc295640 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValueSetExpanderImpl.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValueSetExpanderImpl.java @@ -1,4 +1,4 @@ -package org.highmed.dsf.fhir.service; +package org.highmed.dsf.fhir.validation; import java.util.Objects; diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/.gitignore b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/.gitignore similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/.gitignore rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/.gitignore diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/urn_ietf_bcp_13.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-organization.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-organization.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-organization.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/NamingSystem/highmed-organization.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml diff --git a/dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-server/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/valueset-mimetypes.xml.post diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java similarity index 93% rename from dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java rename to dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java index 846eadfdf..34d7be968 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java @@ -5,8 +5,9 @@ import java.util.Arrays; import java.util.UUID; -import org.highmed.dsf.fhir.service.ResourceValidator; -import org.highmed.dsf.fhir.service.ResourceValidatorImpl; +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.Endpoint; import org.hl7.fhir.r4.model.Endpoint.EndpointStatus; import org.junit.ClassRule; diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java similarity index 96% rename from dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java rename to dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java index 291acafcb..88a24203a 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java @@ -5,8 +5,9 @@ import java.util.Arrays; import java.util.UUID; -import org.highmed.dsf.fhir.service.ResourceValidator; -import org.highmed.dsf.fhir.service.ResourceValidatorImpl; +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.Organization; import org.hl7.fhir.r4.model.StringType; import org.junit.ClassRule; diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/service/ValueSetExpanderTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java similarity index 71% rename from dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/service/ValueSetExpanderTest.java rename to dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java index 4cf1d997c..0107df506 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/service/ValueSetExpanderTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java @@ -1,4 +1,4 @@ -package org.highmed.dsf.fhir.service; +package org.highmed.dsf.fhir.validation; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -6,9 +6,6 @@ import java.io.IOException; import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.Collections; import java.util.List; import java.util.Locale; @@ -29,9 +26,6 @@ public class ValueSetExpanderTest { - private static final String CODE_SYSTEM_FOLDER = "src/main/resources/fhir/CodeSystem"; - private static final String VALUE_SET_FOLDER = "src/main/resources/fhir/ValueSet"; - private FhirContext fhirContext; private ValueSetExpander valueSetExpander; @@ -50,22 +44,21 @@ public Locale getLocale() var validationSupport = new ValidationSupportChain(new InMemoryTerminologyServerValidationSupport(fhirContext), new ValidationSupportWithCustomResources(fhirContext, Collections.emptyList(), readCodeSystems(), - Collections.emptyList()), new DefaultProfileValidationSupport(fhirContext)); + Collections.emptyList()), + new DefaultProfileValidationSupport(fhirContext)); valueSetExpander = new ValueSetExpanderImpl(fhirContext, validationSupport); } private List<CodeSystem> readCodeSystems() { - return Stream.of("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "feasibility-0.3.0.xml", - "organization-type-0.3.0.xml", "query-type-0.3.0.xml", "update-resources-0.3.0.xml", - "update-allow-list-0.3.0.xml").map(f -> Paths.get(CODE_SYSTEM_FOLDER, f)).map(this::readCodeSystem) - .collect(Collectors.toList()); + return Stream.of("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml") + .map(file -> "/fhir/CodeSystem/" + file).map(this::readCodeSystem).collect(Collectors.toList()); } - private CodeSystem readCodeSystem(Path file) + private CodeSystem readCodeSystem(String file) { - try (InputStream in = Files.newInputStream(file)) + try (InputStream in = ValueSetExpanderTest.class.getResourceAsStream(file)) { return fhirContext.newXmlParser().parseResource(CodeSystem.class, in); } @@ -79,7 +72,7 @@ private CodeSystem readCodeSystem(Path file) public void testExpandFeasibility() throws Exception { ValueSetExpansionOutcome out = valueSetExpander - .expand(readValueSet(Paths.get(VALUE_SET_FOLDER, "authorization-role-0.3.0.xml"))); + .expand(readValueSet("/fhir/ValueSet/authorization-role-0.3.0.xml")); assertNotNull(out); assertNull(out.getError()); @@ -91,9 +84,9 @@ public void testExpandFeasibility() throws Exception assertEquals(2, out.getValueset().getExpansion().getContains().size()); } - private ValueSet readValueSet(Path file) + private ValueSet readValueSet(String file) { - try (InputStream in = Files.newInputStream(file)) + try (InputStream in = ValueSetExpanderTest.class.getResourceAsStream(file)) { return fhirContext.newXmlParser().parseResource(ValueSet.class, in); } diff --git a/dsf-fhir/dsf-fhir-validation/src/test/resources/log4j2.xml b/dsf-fhir/dsf-fhir-validation/src/test/resources/log4j2.xml new file mode 100644 index 000000000..3813017db --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/test/resources/log4j2.xml @@ -0,0 +1,26 @@ +<?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> + <Console name="AUDIT" target="SYSTEM_ERR"> + <PatternLayout pattern="%p\t%t - %C{1}.%M(%L) | %m%n"/> + </Console> + </Appenders> + + <Loggers> + <Logger name="dsf-audit-logger" level="INFO" additivity="false"> + <AppenderRef ref="AUDIT"/> + </Logger> + + <Logger name="de.rwh" level="INFO"/> + <Logger name="org.highmed" level="TRACE"/> + <Logger name="org.eclipse.jetty" level="INFO"/> + + <Root level="WARN"> + <AppenderRef ref="CONSOLE"/> + </Root> + </Loggers> +</Configuration> \ No newline at end of file diff --git a/dsf-fhir/pom.xml b/dsf-fhir/pom.xml index e1fe7fb19..c476ed371 100755 --- a/dsf-fhir/pom.xml +++ b/dsf-fhir/pom.xml @@ -17,6 +17,7 @@ <module>dsf-fhir-server-jetty</module> <module>dsf-fhir-webservice-client</module> <module>dsf-fhir-websocket-client</module> + <module>dsf-fhir-validation</module> </modules> <dependencies> @@ -66,6 +67,11 @@ <artifactId>dsf-fhir-websocket-client</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-fhir-validation</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>org.highmed.dsf</groupId> From be14064d05a25707501005acdb4a822304acbfc0 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 18 Nov 2020 20:52:39 +0100 Subject: [PATCH 18/75] changes for consistent ActivityDefinition.name the ActivityDefinition.name property value should be the same as the url part after http://highmed.org/bpe/Process/ --- .../fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml | 2 +- .../fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml | 2 +- .../src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml | 2 +- .../src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml | 2 +- .../fhir/ActivityDefinition/downloadAllowList-0.3.0.xml | 2 +- .../resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml | 2 +- .../fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml | 2 +- .../fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml index 85eec099f..beab60edc 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml @@ -45,7 +45,7 @@ </extension> <url value="http://highmed.org/bpe/Process/executeSimpleFeasibility" /> <version value="0.3.0" /> - <name value="ExecuteSimpleFeasibility" /> + <name value="executeSimpleFeasibility" /> <title value="Execute a Simple Feasibility" /> <subtitle value="Process to execute a simple feasibility query" /> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml index 842b0f5ad..97fc7f17a 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml @@ -103,7 +103,7 @@ </extension> <url value="http://highmed.org/bpe/Process/requestSimpleFeasibility" /> <version value="0.3.0" /> - <name value="RequestSimpleFeasibility" /> + <name value="requestSimpleFeasibility" /> <title value="Request simple feasibility" /> <subtitle value="Feasibility Request Process" /> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml index 695cfe834..21d292957 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml @@ -95,7 +95,7 @@ </extension> <url value="http://highmed.org/bpe/Process/ping" /> <version value="0.3.0" /> - <name value="PingProcess" /> + <name value="ping" /> <title value="PING process" /> <subtitle value="Communication Testing Process" /> <status value="active" /> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml index 2fbb004f2..c38c98531 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml @@ -51,7 +51,7 @@ </extension> <url value="http://highmed.org/bpe/Process/pong" /> <version value="0.3.0" /> - <name value="PongProcess" /> + <name value="pong" /> <title value="PONG process" /> <subtitle value="Communication Testing Process" /> <status value="active" /> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml index 3df2e8871..dcb04b197 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml @@ -51,7 +51,7 @@ </extension> <url value="http://highmed.org/bpe/Process/downloadAllowList" /> <version value="0.3.0" /> - <name value="DownloadAllowList" /> + <name value="downloadAllowList" /> <title value="Download Allow List" /> <subtitle value="Download Allow List Bundle Process" /> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml index d2c3180a8..9b6ee4421 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml @@ -39,7 +39,7 @@ </extension> <url value="http://highmed.org/bpe/Process/updateAllowList" /> <version value="0.3.0" /> - <name value="UpdateAllowList" /> + <name value="updateAllowList" /> <title value="Update Allow List" /> <subtitle value="Update Allow List Bundle Process" /> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml index d54f34476..4bd105655 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml @@ -45,7 +45,7 @@ </extension> <url value="http://highmed.org/bpe/Process/executeUpdateResources" /> <version value="0.3.0" /> - <name value="ExecuteUpdateResources" /> + <name value="executeUpdateResources" /> <title value="Execute Update of Resources" /> <subtitle value="Process to Download and Execute FHIR Bundle" /> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml index ac74a115c..7aa411744 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml @@ -39,7 +39,7 @@ </extension> <url value="http://highmed.org/bpe/Process/requestUpdateResources" /> <version value="0.3.0" /> - <name value="RequestUpdateResources" /> + <name value="requestUpdateResources" /> <title value="Request Update of Resources" /> <subtitle value="Process to Request a Bundle Download" /> <!-- status managed by bpe --> From 24dacc28586b4df32ce60810a6e0925fb93fcafb Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 18 Nov 2020 20:54:18 +0100 Subject: [PATCH 19/75] new empty process folders in docker test setups --- .../medic1/bpe/app/process/README.md | 1 + .../medic1/bpe/docker-compose.yml | 4 ++++ .../medic2/bpe/app/process/README.md | 1 + .../medic2/bpe/docker-compose.yml | 4 ++++ .../medic3/bpe/app/process/README.md | 1 + .../medic3/bpe/docker-compose.yml | 4 ++++ .../ttp/bpe/app/process/README.md | 1 + dsf-docker-test-setup-3medic-ttp/ttp/bpe/docker-compose.yml | 4 ++++ dsf-docker-test-setup/bpe/app/process/README.md | 1 + dsf-docker-test-setup/bpe/docker-compose.yml | 4 ++++ 10 files changed, 25 insertions(+) create mode 100644 dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process/README.md create mode 100644 dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process/README.md create mode 100644 dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process/README.md create mode 100644 dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process/README.md create mode 100644 dsf-docker-test-setup/bpe/app/process/README.md diff --git a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process/README.md b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process/README.md new file mode 100644 index 000000000..47c7890cc --- /dev/null +++ b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process/README.md @@ -0,0 +1 @@ +Empty folder for process jars \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/docker-compose.yml b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/docker-compose.yml index eb8f437eb..f7ea4458b 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/docker-compose.yml +++ b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/docker-compose.yml @@ -32,6 +32,10 @@ services: source: ./app/plugin target: /opt/bpe/plugin read_only: true + - type: bind + source: ./app/process + target: /opt/bpe/process + read_only: true - type: bind source: ./app/log target: /opt/bpe/log diff --git a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process/README.md b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process/README.md new file mode 100644 index 000000000..47c7890cc --- /dev/null +++ b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process/README.md @@ -0,0 +1 @@ +Empty folder for process jars \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/docker-compose.yml b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/docker-compose.yml index 216dafde2..f5857fc11 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/docker-compose.yml +++ b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/docker-compose.yml @@ -32,6 +32,10 @@ services: source: ./app/plugin target: /opt/bpe/plugin read_only: true + - type: bind + source: ./app/process + target: /opt/bpe/process + read_only: true - type: bind source: ./app/log target: /opt/bpe/log diff --git a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process/README.md b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process/README.md new file mode 100644 index 000000000..47c7890cc --- /dev/null +++ b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process/README.md @@ -0,0 +1 @@ +Empty folder for process jars \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/docker-compose.yml b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/docker-compose.yml index 4bb29a563..05f9c5cda 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/docker-compose.yml +++ b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/docker-compose.yml @@ -32,6 +32,10 @@ services: source: ./app/plugin target: /opt/bpe/plugin read_only: true + - type: bind + source: ./app/process + target: /opt/bpe/process + read_only: true - type: bind source: ./app/log target: /opt/bpe/log diff --git a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process/README.md b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process/README.md new file mode 100644 index 000000000..47c7890cc --- /dev/null +++ b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process/README.md @@ -0,0 +1 @@ +Empty folder for process jars \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/docker-compose.yml b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/docker-compose.yml index fc57168fd..9721ad934 100755 --- a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/docker-compose.yml +++ b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/docker-compose.yml @@ -32,6 +32,10 @@ services: source: ./app/plugin target: /opt/bpe/plugin read_only: true + - type: bind + source: ./app/process + target: /opt/bpe/process + read_only: true - type: bind source: ./app/log target: /opt/bpe/log diff --git a/dsf-docker-test-setup/bpe/app/process/README.md b/dsf-docker-test-setup/bpe/app/process/README.md new file mode 100644 index 000000000..47c7890cc --- /dev/null +++ b/dsf-docker-test-setup/bpe/app/process/README.md @@ -0,0 +1 @@ +Empty folder for process jars \ No newline at end of file diff --git a/dsf-docker-test-setup/bpe/docker-compose.yml b/dsf-docker-test-setup/bpe/docker-compose.yml index 14d20db99..aaaf73a28 100755 --- a/dsf-docker-test-setup/bpe/docker-compose.yml +++ b/dsf-docker-test-setup/bpe/docker-compose.yml @@ -34,6 +34,10 @@ services: source: ./app/plugin target: /opt/bpe/plugin read_only: true + - type: bind + source: ./app/process + target: /opt/bpe/process + read_only: true - type: bind source: ./app/log target: /opt/bpe/log From 9190538510ea30c90d220d9c6eedbd6d94bd4236 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 18 Nov 2020 20:56:39 +0100 Subject: [PATCH 20/75] process-excluded, process-retired and cors-origins params now optional added empty default values for org.highmed.dsf.bpe.cors.origins, org.highmed.dsf.bpe.process.excluded, org.highmed.dsf.bpe.process.retired --- dsf-bpe/dsf-bpe-server-jetty/conf/config.properties | 6 ++---- .../dsf/bpe/spring/config/PostProcessDeployConfig.java | 4 ++-- .../java/org/highmed/dsf/fhir/spring/config/CorsConfig.java | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties b/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties index 8dc10446d..22dbfccaa 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties +++ b/dsf-bpe/dsf-bpe-server-jetty/conf/config.properties @@ -57,8 +57,6 @@ org.highmed.dsf.bpe.db.camunda_user_password=arpJ2FgJuYvUJhbxeuh7 #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.cors.origins= - -org.highmed.dsf.bpe.process.excluded= -org.highmed.dsf.bpe.process.retired= +#org.highmed.dsf.bpe.process.excluded= +#org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java index 0045add85..ce19a5821 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java @@ -40,10 +40,10 @@ public class PostProcessDeployConfig @Autowired private DaoConfig daoConfig; - @Value("#{'${org.highmed.dsf.bpe.process.excluded}'.split(',')}") + @Value("#{'${org.highmed.dsf.bpe.process.excluded:}'.split(',')}") private List<String> excluded; - @Value("#{'${org.highmed.dsf.bpe.process.retired}'.split(',')}") + @Value("#{'${org.highmed.dsf.bpe.process.retired:}'.split(',')}") private List<String> retired; @EventListener({ ContextRefreshedEvent.class }) diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/CorsConfig.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/CorsConfig.java index 3a808301d..4f44d737f 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/CorsConfig.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/spring/config/CorsConfig.java @@ -11,7 +11,7 @@ @Configuration public class CorsConfig { - @Value("#{'${org.highmed.dsf.fhir.cors.origins}'.split(',')}") + @Value("#{'${org.highmed.dsf.fhir.cors.origins:}'.split(',')}") private List<String> allowedOrigins; @Bean From 114981121c49f295ac1167299084ba8f1caa2a98 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 18 Nov 2020 20:57:10 +0100 Subject: [PATCH 21/75] ignore config for new empty process folders in docker test setups --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7e137fdd6..139948e7a 100755 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ dsf-docker-test-setup/bpe/app/last_event/time.file dsf-docker-test-setup/bpe/app/log/*.log dsf-docker-test-setup/bpe/app/log/*.log.gz dsf-docker-test-setup/bpe/app/plugin/*.jar +dsf-docker-test-setup/bpe/app/process/*.jar dsf-docker-test-setup/bpe/db/postgres-data/ dsf-docker-test-setup/bpe/proxy/ssl/*.pem @@ -51,6 +52,7 @@ dsf-docker-test-setup/fhir/proxy/ssl/*.pem dsf-docker-test-setup-3medic-ttp/**/bpe/app/conf/*.p12 dsf-docker-test-setup-3medic-ttp/**/bpe/app/conf/config.properties dsf-docker-test-setup-3medic-ttp/**/bpe/app/plugin/*.jar +dsf-docker-test-setup-3medic-ttp/**/bpe/app/process/*.jar dsf-docker-test-setup-3medic-ttp/**/bpe/proxy/ssl/*.pem dsf-docker-test-setup-3medic-ttp/**/fhir/app/conf/*.p12 From 7f9c4574aaf034feb14c8a5747ea779732ab54f1 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 18 Nov 2020 20:59:25 +0100 Subject: [PATCH 22/75] consistent timeout configs, added process params, remove cors.origins Param org.highmed.dsf.bpe.cors.origins currently not used in bpe server MeDIC or TTP only processes now excluded in 3MeDIC/TTP test setup config. --- .../medic1/bpe/app/conf/config.properties | 10 ++++++---- .../medic2/bpe/app/conf/config.properties | 12 +++++++----- .../medic3/bpe/app/conf/config.properties | 10 ++++++---- .../ttp/bpe/app/conf/config.properties | 12 ++++++++---- dsf-docker-test-setup/bpe/app/conf/config.properties | 12 +++++++----- 5 files changed, 34 insertions(+), 22 deletions(-) diff --git a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties index 2e3145b8e..a06203a15 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties @@ -16,10 +16,10 @@ org.highmed.dsf.bpe.fhir.organization.identifier.localValue=Test_MeDIC_1 org.highmed.dsf.bpe.fhir.local.webservice.baseUrl=https://medic1/fhir org.highmed.dsf.bpe.fhir.local.webservice.keystore.p12file=conf/medic1-client_certificate.p12 org.highmed.dsf.bpe.fhir.local.webservice.keystore.password=password -org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=10000 -org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=500 +org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=20000 +org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=2000 -org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=10000 +org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=20000 org.highmed.dsf.bpe.fhir.remote.webservice.connectTimeout=2000 #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.password= #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.username= @@ -57,4 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.cors.origins= \ No newline at end of file +org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.3.0,requestUpdateResources/0.3.0,updateAllowList/0.3.0 +#org.highmed.dsf.bpe.process.retired= +#org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties index 3d5854e3e..6f25b8897 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties @@ -16,10 +16,10 @@ org.highmed.dsf.bpe.fhir.organization.identifier.localValue=Test_MeDIC_2 org.highmed.dsf.bpe.fhir.local.webservice.baseUrl=https://medic2/fhir org.highmed.dsf.bpe.fhir.local.webservice.keystore.p12file=conf/medic2-client_certificate.p12 org.highmed.dsf.bpe.fhir.local.webservice.keystore.password=password -org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=10000 -org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=500 +org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=20000 +org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=2000 -org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=10000 +org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=20000 org.highmed.dsf.bpe.fhir.remote.webservice.connectTimeout=2000 #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.password= #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.username= @@ -38,9 +38,9 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.openehr.webservice.factory.class=org.highmed.openehr.client.impl.OpenEhrClientJerseyFactory #org.highmed.dsf.bpe.openehr.jersey.webservice.baseUrl= -#org.highmed.dsf.bpe.openehr.jersey..webservice.basicAuthUsername= #org.highmed.dsf.bpe.openehr.jersey.webservice.basicauth.username= #org.highmed.dsf.bpe.openehr.jersey.webservice.basicauth.password= +#org.highmed.dsf.bpe.openehr.jersey.webservice.connectionTimeout= #org.highmed.dsf.bpe.openehr.jersey.webservice.readTimeout= #org.highmed.dsf.bpe.openehr.jersey.webservice.truststore.path= #org.highmed.dsf.bpe.openehr.jersey.webservice.truststore.password= @@ -57,4 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.cors.origins= \ No newline at end of file +org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.3.0,requestUpdateResources/0.3.0,updateAllowList/0.3.0 +#org.highmed.dsf.bpe.process.retired= +#org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties index 6327a1e83..8037bb5db 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties @@ -16,10 +16,10 @@ org.highmed.dsf.bpe.fhir.organization.identifier.localValue=Test_MeDIC_3 org.highmed.dsf.bpe.fhir.local.webservice.baseUrl=https://medic3/fhir org.highmed.dsf.bpe.fhir.local.webservice.keystore.p12file=conf/medic3-client_certificate.p12 org.highmed.dsf.bpe.fhir.local.webservice.keystore.password=password -org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=10000 -org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=500 +org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=20000 +org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=2000 -org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=10000 +org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=20000 org.highmed.dsf.bpe.fhir.remote.webservice.connectTimeout=2000 #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.password= #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.username= @@ -57,4 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.cors.origins= \ No newline at end of file +org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.3.0,requestUpdateResources/0.3.0,updateAllowList/0.3.0 +#org.highmed.dsf.bpe.process.retired= +#org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties index ee01d0585..3d605a0be 100755 --- a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties @@ -16,10 +16,10 @@ org.highmed.dsf.bpe.fhir.organization.identifier.localValue=Test_TTP org.highmed.dsf.bpe.fhir.local.webservice.baseUrl=https://ttp/fhir org.highmed.dsf.bpe.fhir.local.webservice.keystore.p12file=conf/ttp-client_certificate.p12 org.highmed.dsf.bpe.fhir.local.webservice.keystore.password=password -org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=10000 -org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=500 +org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=20000 +org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=2000 -org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=10000 +org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=20000 org.highmed.dsf.bpe.fhir.remote.webservice.connectTimeout=2000 #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.password= #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.username= @@ -34,6 +34,8 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.fhir.task.subscription.retrySleepMillis=5000 #org.highmed.dsf.bpe.fhir.task.subscription.maxRetries=-1 +#org.highmed.dsf.bpe.openehr.subject_external_id.path=/ehr_status/subject/external_ref/id/value + #org.highmed.dsf.bpe.openehr.webservice.factory.class=org.highmed.openehr.client.impl.OpenEhrClientJerseyFactory #org.highmed.dsf.bpe.openehr.jersey.webservice.baseUrl= #org.highmed.dsf.bpe.openehr.jersey.webservice.basicauth.username= @@ -55,4 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.cors.origins= \ No newline at end of file +org.highmed.dsf.bpe.process.excluded=localServicesIntegration/0.3.0,requestSimpleFeasibility/0.3.0,executeSimpleFeasibility/0.3.0 +#org.highmed.dsf.bpe.process.retired= +#org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup/bpe/app/conf/config.properties b/dsf-docker-test-setup/bpe/app/conf/config.properties index c8e604034..ba0c44512 100755 --- a/dsf-docker-test-setup/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup/bpe/app/conf/config.properties @@ -16,11 +16,11 @@ org.highmed.dsf.bpe.fhir.organization.identifier.localValue=Test_Organization org.highmed.dsf.bpe.fhir.local.webservice.baseUrl=https://fhir/fhir org.highmed.dsf.bpe.fhir.local.webservice.keystore.p12file=conf/test-client_certificate.p12 org.highmed.dsf.bpe.fhir.local.webservice.keystore.password=password -org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=1500 -org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=500 +org.highmed.dsf.bpe.fhir.local.webservice.readTimeout=20000 +org.highmed.dsf.bpe.fhir.local.webservice.connectTimeout=2000 -org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=2500 -org.highmed.dsf.bpe.fhir.remote.webservice.connectTimeout=1500 +org.highmed.dsf.bpe.fhir.remote.webservice.readTimeout=20000 +org.highmed.dsf.bpe.fhir.remote.webservice.connectTimeout=2000 #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.password= #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.username= #org.highmed.dsf.bpe.fhir.remote.webservice.proxy.schemeHostPort= @@ -57,4 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.cors.origins= +#org.highmed.dsf.bpe.process.excluded= +#org.highmed.dsf.bpe.process.retired= +#org.highmed.dsf.bpe.process_plugin_directroy=process From d8738a87f4d75c3d6a64b3cdd6a80ae34576447b Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 18 Nov 2020 21:00:19 +0100 Subject: [PATCH 23/75] maven dependency plugin config to copy process plugins to docker tests --- dsf-bpe/dsf-bpe-process-feasibility/pom.xml | 139 ++++++++++++++++++ .../dsf-bpe-process-local-services/pom.xml | 139 ++++++++++++++++++ dsf-bpe/dsf-bpe-process-ping/pom.xml | 139 ++++++++++++++++++ .../dsf-bpe-process-update-allow-list/pom.xml | 139 ++++++++++++++++++ .../dsf-bpe-process-update-resources/pom.xml | 139 ++++++++++++++++++ 5 files changed, 695 insertions(+) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml index c2e85266c..e94e4b254 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml @@ -29,4 +29,143 @@ <scope>test</scope> </dependency> </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-process-plugin-to-docker-test-setup</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <configuration> + <filesets> + <fileset> + <directory>../../dsf-docker-test-setup/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + </filesets> + </configuration> + </plugin> + </plugins> + </build> </project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-local-services/pom.xml b/dsf-bpe/dsf-bpe-process-local-services/pom.xml index 575fa6f51..2e6c8523d 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/pom.xml @@ -35,4 +35,143 @@ <scope>test</scope> </dependency> </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-process-plugin-to-docker-test-setup</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <configuration> + <filesets> + <fileset> + <directory>../../dsf-docker-test-setup/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + </filesets> + </configuration> + </plugin> + </plugins> + </build> </project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/pom.xml b/dsf-bpe/dsf-bpe-process-ping/pom.xml index 44aabd131..54c1025e0 100755 --- a/dsf-bpe/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe/dsf-bpe-process-ping/pom.xml @@ -28,4 +28,143 @@ <scope>test</scope> </dependency> </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-process-plugin-to-docker-test-setup</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <configuration> + <filesets> + <fileset> + <directory>../../dsf-docker-test-setup/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + </filesets> + </configuration> + </plugin> + </plugins> + </build> </project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml index a66234b30..663a114c5 100755 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml @@ -28,4 +28,143 @@ <scope>test</scope> </dependency> </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-process-plugin-to-docker-test-setup</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <configuration> + <filesets> + <fileset> + <directory>../../dsf-docker-test-setup/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + </filesets> + </configuration> + </plugin> + </plugins> + </build> </project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml index 691baf256..e2a483009 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml @@ -28,4 +28,143 @@ <scope>test</scope> </dependency> </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-process-plugin-to-docker-test-setup</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> + </configuration> + </execution> + <execution> + <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <configuration> + <filesets> + <fileset> + <directory>../../dsf-docker-test-setup/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + <fileset> + <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> + <includes> + <include>${project.artifactId}-${project.version}.jar</include> + </includes> + <followSymlinks>false</followSymlinks> + </fileset> + </filesets> + </configuration> + </plugin> + </plugins> + </build> </project> \ No newline at end of file From 98f232bb74742a9a201d4f8fcec337f34463e09b Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Thu, 19 Nov 2020 01:11:22 +0100 Subject: [PATCH 24/75] StructureDefinition delete test case and fix for cache and bundle cmd ValidationSupportWithCache no correctly handles ResourceDeletedEvents. Added missing DeleteStructureDefinitionCommand to handle StructureDefinition special case, aka deleting entry in the snapshot table. --- .../fhir/dao/command/CommandFactoryImpl.java | 11 +- .../dsf/fhir/dao/command/DeleteCommand.java | 11 +- .../DeleteStructureDefinitionCommand.java | 57 ++++++++++ .../service/ValidationSupportWithCache.java | 45 +++++++- .../integration/BundleIntegrationTest.java | 101 ++++++++++++++++++ 5 files changed, 219 insertions(+), 6 deletions(-) create mode 100644 dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteStructureDefinitionCommand.java diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CommandFactoryImpl.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CommandFactoryImpl.java index 5e919cfe1..a57ba00c4 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CommandFactoryImpl.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/CommandFactoryImpl.java @@ -165,8 +165,15 @@ private <R extends Resource> Command put(int index, User user, PreferReturnType private Command delete(int index, User user, PreferReturnType returnType, Bundle bundle, BundleEntryComponent entry) { if (entry.getRequest().getUrl() != null && !entry.getRequest().getUrl().isBlank()) - return new DeleteCommand(index, user, returnType, bundle, entry, serverBase, authorizationHelper, - responseGenerator, daoProvider, exceptionHandler, parameterConverter, eventGenerator); + { + if (entry.getRequest().getUrl().startsWith("StructureDefinition")) + return new DeleteStructureDefinitionCommand(index, user, returnType, bundle, entry, serverBase, + authorizationHelper, responseGenerator, daoProvider, exceptionHandler, parameterConverter, + eventGenerator); + else + return new DeleteCommand(index, user, returnType, bundle, entry, serverBase, authorizationHelper, + responseGenerator, daoProvider, exceptionHandler, parameterConverter, eventGenerator); + } else throw new BadBundleException( "Request url " + entry.getRequest().getUrl() + " for method DELETE not supported"); diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteCommand.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteCommand.java index 638535f5d..40204cc1d 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteCommand.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteCommand.java @@ -15,6 +15,7 @@ import org.highmed.dsf.fhir.authentication.User; import org.highmed.dsf.fhir.dao.ResourceDao; +import org.highmed.dsf.fhir.dao.exception.ResourceNotFoundException; import org.highmed.dsf.fhir.dao.provider.DaoProvider; import org.highmed.dsf.fhir.event.EventGenerator; import org.highmed.dsf.fhir.event.EventHandler; @@ -109,7 +110,7 @@ private void deleteById(Connection connection, String resourceTypeName, String i dbResource.ifPresent(oldResource -> authorizationHelper.checkDeleteAllowed(connection, user, oldResource)); deleted = exceptionHandler.handleSqlAndResourceNotFoundException(resourceTypeName, - () -> dao.deleteWithTransaction(connection, uuid)); + () -> deleteWithTransaction(dao, connection, uuid)); this.resourceType = dao.getResourceType(); this.id = id; @@ -133,7 +134,7 @@ private void deleteByCondition(Connection connection, String resourceTypeName, authorizationHelper.checkDeleteAllowed(connection, user, resourceToDelete.get()); deleted = exceptionHandler.handleSqlAndResourceNotFoundException(resourceTypeName, - () -> dao.get().deleteWithTransaction(connection, parameterConverter.toUuid(resourceTypeName, + () -> deleteWithTransaction(dao.get(), connection, parameterConverter.toUuid(resourceTypeName, resourceToDelete.get().getIdElement().getIdPart()))); this.resourceType = dao.get().getResourceType(); @@ -142,6 +143,12 @@ private void deleteByCondition(Connection connection, String resourceTypeName, } } + protected boolean deleteWithTransaction(ResourceDao<?> dao, Connection connection, UUID uuid) + throws SQLException, ResourceNotFoundException + { + return dao.deleteWithTransaction(connection, uuid); + } + private Optional<Resource> search(Connection connection, ResourceDao<?> dao, Map<String, List<String>> queryParameters) { diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteStructureDefinitionCommand.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteStructureDefinitionCommand.java new file mode 100644 index 000000000..601df0dc5 --- /dev/null +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/command/DeleteStructureDefinitionCommand.java @@ -0,0 +1,57 @@ +package org.highmed.dsf.fhir.dao.command; + +import java.sql.Connection; +import java.sql.SQLException; +import java.util.UUID; + +import org.highmed.dsf.fhir.authentication.User; +import org.highmed.dsf.fhir.dao.ResourceDao; +import org.highmed.dsf.fhir.dao.StructureDefinitionDao; +import org.highmed.dsf.fhir.dao.exception.ResourceNotFoundException; +import org.highmed.dsf.fhir.dao.provider.DaoProvider; +import org.highmed.dsf.fhir.event.EventGenerator; +import org.highmed.dsf.fhir.help.ExceptionHandler; +import org.highmed.dsf.fhir.help.ParameterConverter; +import org.highmed.dsf.fhir.help.ResponseGenerator; +import org.highmed.dsf.fhir.prefer.PreferReturnType; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DeleteStructureDefinitionCommand extends DeleteCommand +{ + private static final Logger logger = LoggerFactory.getLogger(DeleteStructureDefinitionCommand.class); + + private StructureDefinitionDao snapshotDao; + + public DeleteStructureDefinitionCommand(int index, User user, PreferReturnType returnType, Bundle bundle, + BundleEntryComponent entry, String serverBase, AuthorizationHelper authorizationHelper, + ResponseGenerator responseGenerator, DaoProvider daoProvider, ExceptionHandler exceptionHandler, + ParameterConverter parameterConverter, EventGenerator eventGenerator) + { + super(index, user, returnType, bundle, entry, serverBase, authorizationHelper, responseGenerator, daoProvider, + exceptionHandler, parameterConverter, eventGenerator); + + snapshotDao = daoProvider.getStructureDefinitionSnapshotDao(); + } + + @Override + protected boolean deleteWithTransaction(ResourceDao<?> dao, Connection connection, UUID uuid) + throws SQLException, ResourceNotFoundException + { + boolean deleted = super.deleteWithTransaction(dao, connection, uuid); + + try + { + snapshotDao.deleteWithTransaction(connection, uuid); + } + catch (SQLException | ResourceNotFoundException e) + { + logger.warn("Error while deleting StructureDefinition snaphost for id " + uuid.toString() + + ", exception will be ignored", e); + } + + return deleted; + } +} diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValidationSupportWithCache.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValidationSupportWithCache.java index d9ce680f8..e7bb037ba 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValidationSupportWithCache.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/service/ValidationSupportWithCache.java @@ -7,6 +7,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Function; import java.util.function.Supplier; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -60,6 +61,9 @@ public R get() } } + private static final Pattern UUID_PATTERN = Pattern + .compile("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"); + private final FhirContext context; private final IValidationSupport delegate; @@ -70,6 +74,8 @@ public R get() private final ConcurrentMap<String, CacheEntry<CodeSystem>> codeSystems = new ConcurrentHashMap<>(); private final ConcurrentMap<String, CacheEntry<ValueSet>> valueSets = new ConcurrentHashMap<>(); + private final ConcurrentMap<String, String> urlAndVersionsById = new ConcurrentHashMap<>(); + public ValidationSupportWithCache(FhirContext context, IValidationSupport delegate) { this.context = context; @@ -104,8 +110,8 @@ public void handleEvent(Event event) if (event instanceof ResourceCreatedEvent && resourceSupported(event.getResource())) add(event.getResource()); - else if (event instanceof ResourceDeletedEvent && resourceSupported(event.getResource())) - remove(event.getResource()); + else if (event instanceof ResourceDeletedEvent && resourceSupported(event.getResourceType(), event.getId())) + remove(event.getResourceType(), event.getId()); else if (event instanceof ResourceUpdatedEvent && resourceSupported(event.getResource())) update(event.getResource()); } @@ -116,6 +122,12 @@ private boolean resourceSupported(Resource resource) || resource instanceof ValueSet); } + private boolean resourceSupported(Class<? extends Resource> type, String resourceId) + { + return urlAndVersionsById.containsKey(resourceId) && (CodeSystem.class.equals(type) + || StructureDefinition.class.equals(type) || ValueSet.class.equals(type)); + } + private void add(Resource resource) { if (resource instanceof CodeSystem) @@ -143,6 +155,10 @@ private <R extends Resource> void doAdd(R resource, ConcurrentMap<String, CacheE String urlAndVersion = url + "|" + version; cache.put(urlAndVersion, new CacheEntry<>(resource, () -> fetch.apply(urlAndVersion))); } + + if (resource.hasIdElement() && resource.getIdElement().hasIdPart() + && UUID_PATTERN.matcher(resource.getIdElement().getIdPart()).matches()) + urlAndVersionsById.put(resource.getIdElement().getIdPart(), url + "|" + version); } private void update(Resource resource) @@ -172,6 +188,31 @@ private <R extends Resource> void doRemove(R resource, ConcurrentMap<String, Cac cache.remove(url + "|" + version); } + private void remove(Class<? extends Resource> type, String id) + { + if (CodeSystem.class.equals(type)) + doRemove(id, codeSystems); + else if (StructureDefinition.class.equals(type)) + doRemove(id, structureDefinitions); + else if (ValueSet.class.equals(type)) + doRemove(id, valueSets); + } + + private <R extends Resource> void doRemove(String id, ConcurrentMap<String, CacheEntry<R>> cache) + { + String urlAndVersion = urlAndVersionsById.get(id); + + if (urlAndVersion != null) + { + String[] split = urlAndVersion.split("\\|"); + String url = split.length > 0 ? split[0] : ""; + String version = split.length > 1 ? split[1] : ""; + + cache.remove(url); + cache.remove(url + "|" + version); + } + } + public List<IBaseResource> fetchAllConformanceResources() { if (!fetchAllConformanceResourcesDone.get()) diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java index 9a5cbeb37..a62ec0be2 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java @@ -1,18 +1,41 @@ package org.highmed.dsf.fhir.integration; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import java.nio.file.Paths; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.Optional; +import org.highmed.dsf.fhir.dao.StructureDefinitionDao; import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent; +import org.hl7.fhir.r4.model.Bundle.BundleType; +import org.hl7.fhir.r4.model.Bundle.HTTPVerb; +import org.hl7.fhir.r4.model.CanonicalType; +import org.hl7.fhir.r4.model.CapabilityStatement; +import org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent; +import org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent; +import org.hl7.fhir.r4.model.ElementDefinition; +import org.hl7.fhir.r4.model.Enumerations.FHIRVersion; +import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.OperationOutcome; +import org.hl7.fhir.r4.model.StructureDefinition; +import org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind; +import org.hl7.fhir.r4.model.StructureDefinition.TypeDerivationRule; +import org.hl7.fhir.r4.model.UriType; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.base.Objects; + public class BundleIntegrationTest extends AbstractIntegrationTest { private static final Logger logger = LoggerFactory.getLogger(BundleIntegrationTest.class); @@ -59,4 +82,82 @@ public void testCreateBundleReturnOperationOutcome() throws Exception assertNotNull(outcome); } + + @Test + public void testDeleteTaskProfileViaBundleTestSupportedProfilesInConformanceStatement() throws Exception + { + final String taskProfileUrl = "http://highmed.org/fhir/StructureDefinition/highmed-task-test"; + final String taskProfileVersion = "1.2.3"; + + StructureDefinition newS = new StructureDefinition(); + newS.getMeta().addTag().setSystem("http://highmed.org/fhir/CodeSystem/authorization-role").setCode("REMOTE"); + newS.setUrl(taskProfileUrl); + newS.setVersion(taskProfileVersion); + newS.setName("TaskTest"); + newS.setStatus(PublicationStatus.ACTIVE); + newS.setFhirVersion(FHIRVersion._4_0_1); + newS.setKind(StructureDefinitionKind.RESOURCE); + newS.setAbstract(false); + newS.setType("Task"); + newS.setBaseDefinition("http://highmed.org/fhir/StructureDefinition/highmed-task-base"); + newS.setDerivation(TypeDerivationRule.CONSTRAINT); + ElementDefinition diff = newS.getDifferential().addElement(); + diff.setId("Task.instantiatesUri"); + diff.setPath("Task.instantiatesUri"); + diff.setFixed(new UriType("http://highmed.org/bpe/Process/taskTest/1.2.3")); + + assertFalse(testProfileSupported(taskProfileUrl)); + + IdType newSid = getWebserviceClient().withMinimalReturn().create(newS); + assertNotNull(newSid); + + assertTrue(testProfileSupported(taskProfileUrl)); + + Bundle deleteBundle = new Bundle(); + deleteBundle.setType(BundleType.TRANSACTION); + BundleEntryComponent deleteEntry = deleteBundle.addEntry(); + deleteEntry.setFullUrl(newSid.withServerBase(getWebserviceClient().getBaseUrl(), "Task").toString()); + + BundleEntryRequestComponent request = deleteEntry.getRequest(); + request.setMethod(HTTPVerb.DELETE); + request.setUrl("StructureDefinition/" + newSid.getIdPart()); + + getWebserviceClient().withMinimalReturn().postBundle(deleteBundle); + + assertFalse(testProfileSupported(taskProfileUrl)); + StructureDefinitionDao sDdao = getSpringWebApplicationContext().getBean("structureDefinitionDao", + StructureDefinitionDao.class); + StructureDefinitionDao sDsDao = getSpringWebApplicationContext().getBean("structureDefinitionSnapshotDao", + StructureDefinitionDao.class); + + assertTrue(sDdao.readByUrlAndVersion(taskProfileUrl, taskProfileVersion).isEmpty()); + assertTrue(sDsDao.readByUrlAndVersion(taskProfileUrl, taskProfileVersion).isEmpty()); + } + + private boolean testProfileSupported(String taskProfileUrl) + { + CapabilityStatement conformance = getWebserviceClient().getConformance(); + assertNotNull(conformance); + assertTrue(conformance.hasRest()); + assertEquals(1, conformance.getRest().size()); + CapabilityStatementRestComponent rest = conformance.getRest().get(0); + assertNotNull(rest); + assertTrue(rest.hasResource()); + assertTrue(rest.getResource().size() > 0); + + Optional<CapabilityStatementRestResourceComponent> taskResourceOpt = rest.getResource().stream() + .filter(r -> "Task".equals(r.getType())).findFirst(); + assertTrue(taskResourceOpt.isPresent()); + + CapabilityStatementRestResourceComponent taskResource = taskResourceOpt.get(); + if (taskResource.hasSupportedProfile()) + { + assertTrue(taskResource.getSupportedProfile().size() > 0); + List<CanonicalType> profiles = taskResource.getSupportedProfile(); + + return profiles.stream().filter(t -> Objects.equal(t.getValue(), taskProfileUrl)).count() == 1; + } + else + return false; + } } From 035048e9109aedfe2642c321eeb2380dde1b83c3 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 23 Nov 2020 16:25:30 +0100 Subject: [PATCH 25/75] reverting change used for testing --- .../dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index 8bc574911..4f5c6c83c 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -35,7 +35,7 @@ public static void main(String[] args) FhirContext context = FhirContext.forR4(); ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey("https://localhost:8001/fhir/", trustStore, keyStore, + FhirWebserviceClient client = new FhirWebserviceClientJersey("https://ttp/fhir/", trustStore, keyStore, keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); Task task = new Task(); @@ -45,9 +45,9 @@ public static void main(String[] args) task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_Organization"); + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_Organization"); + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); task.addInput().setValue(new StringType("startPingProcessMessage")).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); From fbeba2a0eea354f28fd34153e076c40a507b1d83 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 23 Nov 2020 21:42:16 +0100 Subject: [PATCH 26/75] removing version from fhir resource file names --- ...teSimpleFeasibility-0.3.0.xml => computeSimpleFeasibility.xml} | 0 ...teSimpleFeasibility-0.3.0.xml => executeSimpleFeasibility.xml} | 0 ...stSimpleFeasibility-0.3.0.xml => requestSimpleFeasibility.xml} | 0 .../fhir/CodeSystem/{feasibility-0.3.0.xml => feasibility.xml} | 0 .../fhir/CodeSystem/{query-type-0.3.0.xml => query-type.xml} | 0 ...xtension-group-id-0.3.0.xml => highmed-extension-group-id.xml} | 0 ...-medic-0.3.0.xml => highmed-extension-participating-medic.xml} | 0 ...ting-ttp-0.3.0.xml => highmed-extension-participating-ttp.xml} | 0 ...hmed-extension-query-0.3.0.xml => highmed-extension-query.xml} | 0 .../{highmed-group-0.3.0.xml => highmed-group.xml} | 0 ...asibility-0.3.0.xml => highmed-research-study-feasibility.xml} | 0 ...lity-0.3.0.xml => highmed-task-compute-simple-feasibility.xml} | 0 ...bility-0.3.0.xml => highmed-task-error-simple-feasibility.xml} | 0 ...lity-0.3.0.xml => highmed-task-execute-simple-feasibility.xml} | 0 ...xml => highmed-task-multi-medic-result-simple-feasibility.xml} | 0 ...lity-0.3.0.xml => highmed-task-request-simple-feasibility.xml} | 0 ...ml => highmed-task-single-medic-result-simple-feasibility.xml} | 0 ...ServicesIntegration-0.3.0.xml => localServicesIntegration.xml} | 0 ...tion-0.3.0.xml => highmed-task-local-services-integration.xml} | 0 .../fhir/ActivityDefinition/{ping-0.3.0.xml => ping.xml} | 0 .../fhir/ActivityDefinition/{pong-0.3.0.xml => pong.xml} | 0 .../{highmed-task-ping-0.3.0.xml => highmed-task-ping.xml} | 0 .../{highmed-task-pong-0.3.0.xml => highmed-task-pong.xml} | 0 ...ping-process-0.3.0.xml => highmed-task-start-ping-process.xml} | 0 ...ask-parent-plugin-0.3.0.xml => highmed-task-parent-plugin.xml} | 0 .../{downloadAllowList-0.3.0.xml => downloadAllowList.xml} | 0 .../{updateAllowList-0.3.0.xml => updateAllowList.xml} | 0 .../{update-allow-list-0.3.0.xml => update-allow-list.xml} | 0 ...-allow-list-0.3.0.xml => highmed-task-download-allow-list.xml} | 0 ...te-allow-list-0.3.0.xml => highmed-task-update-allow-list.xml} | 0 .../{update-allow-list-0.3.0.xml => update-allow-list.xml} | 0 ...xecuteUpdateResources-0.3.0.xml => executeUpdateResources.xml} | 0 ...equestUpdateResources-0.3.0.xml => requestUpdateResources.xml} | 0 .../{update-resources-0.3.0.xml => update-resources.xml} | 0 ...ources-0.3.0.xml => highmed-task-execute-update-resources.xml} | 0 ...ources-0.3.0.xml => highmed-task-request-update-resources.xml} | 0 .../ValueSet/{update-resources-0.3.0.xml => update-resources.xml} | 0 37 files changed, 0 insertions(+), 0 deletions(-) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/{computeSimpleFeasibility-0.3.0.xml => computeSimpleFeasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/{executeSimpleFeasibility-0.3.0.xml => executeSimpleFeasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/{requestSimpleFeasibility-0.3.0.xml => requestSimpleFeasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/{feasibility-0.3.0.xml => feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/{query-type-0.3.0.xml => query-type.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-extension-group-id-0.3.0.xml => highmed-extension-group-id.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-extension-participating-medic-0.3.0.xml => highmed-extension-participating-medic.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-extension-participating-ttp-0.3.0.xml => highmed-extension-participating-ttp.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-extension-query-0.3.0.xml => highmed-extension-query.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-group-0.3.0.xml => highmed-group.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-research-study-feasibility-0.3.0.xml => highmed-research-study-feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-compute-simple-feasibility-0.3.0.xml => highmed-task-compute-simple-feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-error-simple-feasibility-0.3.0.xml => highmed-task-error-simple-feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-execute-simple-feasibility-0.3.0.xml => highmed-task-execute-simple-feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml => highmed-task-multi-medic-result-simple-feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-request-simple-feasibility-0.3.0.xml => highmed-task-request-simple-feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-single-medic-result-simple-feasibility-0.3.0.xml => highmed-task-single-medic-result-simple-feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/{localServicesIntegration-0.3.0.xml => localServicesIntegration.xml} (100%) rename dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/{highmed-task-local-services-integration-0.3.0.xml => highmed-task-local-services-integration.xml} (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/{ping-0.3.0.xml => ping.xml} (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/{pong-0.3.0.xml => pong.xml} (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/{highmed-task-ping-0.3.0.xml => highmed-task-ping.xml} (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/{highmed-task-pong-0.3.0.xml => highmed-task-pong.xml} (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/{highmed-task-start-ping-process-0.3.0.xml => highmed-task-start-ping-process.xml} (100%) rename dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/{highmed-task-parent-plugin-0.3.0.xml => highmed-task-parent-plugin.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/{downloadAllowList-0.3.0.xml => downloadAllowList.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/{updateAllowList-0.3.0.xml => updateAllowList.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/{update-allow-list-0.3.0.xml => update-allow-list.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/{highmed-task-download-allow-list-0.3.0.xml => highmed-task-download-allow-list.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/{highmed-task-update-allow-list-0.3.0.xml => highmed-task-update-allow-list.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/{update-allow-list-0.3.0.xml => update-allow-list.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/{executeUpdateResources-0.3.0.xml => executeUpdateResources.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/{requestUpdateResources-0.3.0.xml => requestUpdateResources.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/{update-resources-0.3.0.xml => update-resources.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/{highmed-task-execute-update-resources-0.3.0.xml => highmed-task-execute-update-resources.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/{highmed-task-request-update-resources-0.3.0.xml => highmed-task-request-update-resources.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/{update-resources-0.3.0.xml => update-resources.xml} (100%) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration.xml diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping.xml diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong.xml diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList.xml diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList.xml diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list.xml diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list.xml diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources.xml diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources.xml diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources.xml diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources.xml From 0ba4507338cf261983a8fd7969569cc878637aa0 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 23 Nov 2020 23:20:31 +0100 Subject: [PATCH 27/75] version 0.3.0 -> 0.4.0 change --- ...{authorization-role-0.3.0.xml => authorization-role-0.4.0.xml} | 0 ...tion-role-0.3.0.xml.post => authorization-role-0.4.0.xml.post} | 0 .../CodeSystem/{bpmn-message-0.3.0.xml => bpmn-message-0.4.0.xml} | 0 .../{bpmn-message-0.3.0.xml.post => bpmn-message-0.4.0.xml.post} | 0 .../{organization-type-0.3.0.xml => organization-type-0.4.0.xml} | 0 ...ation-type-0.3.0.xml.post => organization-type-0.4.0.xml.post} | 0 .../{highmed-endpoint-0.3.0.xml => highmed-endpoint-0.4.0.xml} | 0 ...ed-endpoint-0.3.0.xml.post => highmed-endpoint-0.4.0.xml.post} | 0 ...3.0.xml => highmed-extension-certificate-thumbprint-0.4.0.xml} | 0 ...st => highmed-extension-certificate-thumbprint-0.4.0.xml.post} | 0 ....3.0.xml => highmed-extension-process-authorization-0.4.0.xml} | 0 ...ost => highmed-extension-process-authorization-0.4.0.xml.post} | 0 ...hmed-organization-0.3.0.xml => highmed-organization-0.4.0.xml} | 0 ...ization-0.3.0.xml.post => highmed-organization-0.4.0.xml.post} | 0 .../{highmed-task-base-0.3.0.xml => highmed-task-base-0.4.0.xml} | 0 ...-task-base-0.3.0.xml.post => highmed-task-base-0.4.0.xml.post} | 0 ...{authorization-role-0.3.0.xml => authorization-role-0.4.0.xml} | 0 ...tion-role-0.3.0.xml.post => authorization-role-0.4.0.xml.post} | 0 .../ValueSet/{bpmn-message-0.3.0.xml => bpmn-message-0.4.0.xml} | 0 .../{bpmn-message-0.3.0.xml.post => bpmn-message-0.4.0.xml.post} | 0 .../{organization-type-0.3.0.xml => organization-type-0.4.0.xml} | 0 ...ation-type-0.3.0.xml.post => organization-type-0.4.0.xml.post} | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{authorization-role-0.3.0.xml => authorization-role-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{authorization-role-0.3.0.xml.post => authorization-role-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{bpmn-message-0.3.0.xml => bpmn-message-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{bpmn-message-0.3.0.xml.post => bpmn-message-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{organization-type-0.3.0.xml => organization-type-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{organization-type-0.3.0.xml.post => organization-type-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-endpoint-0.3.0.xml => highmed-endpoint-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-endpoint-0.3.0.xml.post => highmed-endpoint-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-extension-certificate-thumbprint-0.3.0.xml => highmed-extension-certificate-thumbprint-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-extension-certificate-thumbprint-0.3.0.xml.post => highmed-extension-certificate-thumbprint-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-extension-process-authorization-0.3.0.xml => highmed-extension-process-authorization-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-extension-process-authorization-0.3.0.xml.post => highmed-extension-process-authorization-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-organization-0.3.0.xml => highmed-organization-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-organization-0.3.0.xml.post => highmed-organization-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-task-base-0.3.0.xml => highmed-task-base-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/{highmed-task-base-0.3.0.xml.post => highmed-task-base-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{authorization-role-0.3.0.xml => authorization-role-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{authorization-role-0.3.0.xml.post => authorization-role-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{bpmn-message-0.3.0.xml => bpmn-message-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{bpmn-message-0.3.0.xml.post => bpmn-message-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{organization-type-0.3.0.xml => organization-type-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{organization-type-0.3.0.xml.post => organization-type-0.4.0.xml.post} (100%) diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.3.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml.post From e7958ffd2f0e2af96f0c8e5992b0e12321a004a3 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 23 Nov 2020 23:20:49 +0100 Subject: [PATCH 28/75] removing version from fhir resource file names --- .../fhir/ValueSet/{feasibility-0.3.0.xml => feasibility.xml} | 0 .../fhir/ValueSet/{query-type-0.3.0.xml => query-type.xml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/{feasibility-0.3.0.xml => feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/{query-type-0.3.0.xml => query-type.xml} (100%) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type-0.3.0.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type.xml From f7b602fe014913432a32fd703119e960851d197e Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 23 Nov 2020 23:22:25 +0100 Subject: [PATCH 29/75] added helpful error message --- .../org/highmed/dsf/fhir/validation/ValidationSupportRule.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java index e7f9bd397..ecc145ea9 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java @@ -108,6 +108,9 @@ private static ValueSet readValueSet(FhirContext context, String file) { try (InputStream in = ValidationSupportRule.class.getResourceAsStream(file)) { + if (in == null) + throw new IOException("File " + file + " not found"); + return context.newXmlParser().parseResource(ValueSet.class, in); } catch (IOException e) From 5e31963eb6901bd5dd5a7b9b333dadca32b12b33 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 23 Nov 2020 23:46:54 +0100 Subject: [PATCH 30/75] version 0.3.0 -> 0.4.0 change --- .../fhir/CodeSystem/authorization-role-0.4.0.xml | 4 ++-- .../fhir/CodeSystem/authorization-role-0.4.0.xml.post | 2 +- .../main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml | 4 ++-- .../resources/fhir/CodeSystem/bpmn-message-0.4.0.xml.post | 2 +- .../resources/fhir/CodeSystem/organization-type-0.4.0.xml | 4 ++-- .../fhir/CodeSystem/organization-type-0.4.0.xml.post | 2 +- .../main/resources/fhir/NamingSystem/highmed-endpoint.xml | 2 +- .../resources/fhir/NamingSystem/highmed-organization.xml | 2 +- .../fhir/StructureDefinition/highmed-endpoint-0.4.0.xml | 4 ++-- .../StructureDefinition/highmed-endpoint-0.4.0.xml.post | 2 +- .../highmed-extension-certificate-thumbprint-0.4.0.xml | 4 ++-- ...ighmed-extension-certificate-thumbprint-0.4.0.xml.post | 2 +- .../highmed-extension-process-authorization-0.4.0.xml | 4 ++-- ...highmed-extension-process-authorization-0.4.0.xml.post | 2 +- .../StructureDefinition/highmed-organization-0.4.0.xml | 4 ++-- .../highmed-organization-0.4.0.xml.post | 2 +- .../fhir/StructureDefinition/highmed-task-base-0.4.0.xml | 4 ++-- .../StructureDefinition/highmed-task-base-0.4.0.xml.post | 2 +- .../resources/fhir/ValueSet/authorization-role-0.4.0.xml | 4 ++-- .../fhir/ValueSet/authorization-role-0.4.0.xml.post | 2 +- .../main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml | 4 ++-- .../resources/fhir/ValueSet/bpmn-message-0.4.0.xml.post | 2 +- .../resources/fhir/ValueSet/organization-type-0.4.0.xml | 4 ++-- .../fhir/ValueSet/organization-type-0.4.0.xml.post | 2 +- .../highmed/dsf/fhir/profiles/EndpointProfileTest.java | 8 ++++---- .../dsf/fhir/profiles/OrganizationProfileTest.java | 8 ++++---- .../highmed/dsf/fhir/validation/ValueSetExpanderTest.java | 4 ++-- 27 files changed, 45 insertions(+), 45 deletions(-) diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml index 8b9174fe2..7b8038110 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml @@ -6,12 +6,12 @@ </tag> </meta> <url value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <version value="0.3.0"/> + <version value="0.4.0"/> <name value="HiGHmed_Authorization_Role"/> <title value="HiGHmed Authorization Role"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="CodeSystem with authorization roles"/> <caseSensitive value="true"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml.post index 5d29be7fe..2bf76ddd2 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/CodeSystem/authorization-role&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/CodeSystem/authorization-role&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml index 6619be807..ba804b054 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml @@ -6,12 +6,12 @@ </tag> </meta> <url value="http://highmed.org/fhir/CodeSystem/bpmn-message"/> - <version value="0.3.0"/> + <version value="0.4.0"/> <name value="HiGHmed_Bpmn_Message_Values"/> <title value="HiGHmed BPMN message values"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="CodeSystem with standard BPMN message values for Task resources"/> <caseSensitive value="true"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml.post index c74c46000..5cb5abce3 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/CodeSystem/bpmn-message&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/CodeSystem/bpmn-message&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml index 6132def74..334507d18 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml @@ -6,12 +6,12 @@ </tag> </meta> <url value="http://highmed.org/fhir/CodeSystem/organization-type"/> - <version value="0.3.0"/> + <version value="0.4.0"/> <name value="HiGHmed_Organization_Type"/> <title value="HiGHmed Organization Type"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="CodeSystem with HiGHmed organization roles used in Organization resources"/> <caseSensitive value="true"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml.post index 01a3b3dc4..a7f8e2af6 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/CodeSystem/organization-type&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/CodeSystem/organization-type&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml index 2671ab1a4..04989ed7b 100755 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml @@ -8,7 +8,7 @@ <name value="HiGHmed_Endpoint_Identifier"/> <status value="active"/> <kind value="identifier"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <responsible value="HiGHmed, TTP Heilbronn"/> <description value="Shortest DNS that resolves the endpoint typically the DNS used in endpoint.address"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml index f2b74ba1d..31eb60997 100755 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml @@ -8,7 +8,7 @@ <name value="HiGHmed_Organization_Identifier"/> <status value="active"/> <kind value="identifier"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <responsible value="HiGHmed, TPP Heilbronn"/> <description diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml index 58447470f..4bc178191 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml @@ -6,11 +6,11 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint" /> - <version value="0.3.0" /> + <version value="0.4.0" /> <name value="Endpoint" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post index df2ac720f..bb1fa39c9 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-endpoint&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/highmed-endpoint&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml index 6233d4b52..1d90b2e0b 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml @@ -6,11 +6,11 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint" /> - <version value="0.3.0" /> + <version value="0.4.0" /> <name value="CertificateThumbprint" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post index 5653feff1..edbc79985 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/certificate-thumbprint&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/certificate-thumbprint&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml index 322de7a06..476fe4928 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml @@ -6,11 +6,11 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/process-authorization" /> - <version value="0.3.0" /> + <version value="0.4.0" /> <name value="ProcessAuthorization" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.0" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post index 3ec88dce3..197c68b47 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/process-authorization&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/process-authorization&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml index f081896b1..aacddebc5 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml @@ -6,11 +6,11 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-organization" /> - <version value="0.3.0" /> + <version value="0.4.0" /> <name value="Organization" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post index 5f8c47ec8..717820181 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-organization&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/highmed-organization&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml index e85bd27db..9f020332f 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml @@ -6,11 +6,11 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> - <version value="0.3.0" /> + <version value="0.4.0" /> <name value="TaskBase" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="true" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post index d3c0d6180..2d98cb30e 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-base&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/highmed-task-base&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml index ccb916525..307e3529a 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml @@ -6,12 +6,12 @@ </tag> </meta> <url value="http://highmed.org/fhir/ValueSet/authorization-role"/> - <version value="0.3.0"/> + <version value="0.4.0"/> <name value="HiGHmed_Authorization_Role"/> <title value="HiGHmed Authorization Role"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="ValueSet with authorization roles"/> <immutable value="true"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml.post index 32b071348..211e3a219 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/ValueSet/authorization-role&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/ValueSet/authorization-role&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml index 0c2f266a8..42febdcb1 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml @@ -6,12 +6,12 @@ </tag> </meta> <url value="http://highmed.org/fhir/ValueSet/bpmn-message"/> - <version value="0.3.0"/> + <version value="0.4.0"/> <name value="HiGHmed_Bpmn_Message_Values"/> <title value="HiGHmed BPMN message values"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="ValueSet with standard BPMN message values for Task resources"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml.post index aeea11518..4e800f2e2 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/ValueSet/bpmn-message&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/ValueSet/bpmn-message&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml index 3a25f47fb..b6f8c0d1a 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml @@ -6,12 +6,12 @@ </tag> </meta> <url value="http://highmed.org/fhir/ValueSet/organization-type"/> - <version value="0.3.0"/> + <version value="0.4.0"/> <name value="HiGHmed_Organization_Type"/> <title value="HiGHmed Organization Type"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="ValueSet with HiGHmed organization types used in Organization resources"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml.post index aee931ef0..ec73dc6de 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/ValueSet/organization-type&version=0.3.0 \ No newline at end of file +url=http://highmed.org/fhir/ValueSet/organization-type&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java index 34d7be968..a5f5b36ad 100644 --- a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java @@ -25,15 +25,15 @@ public class EndpointProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-endpoint-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "urn_ietf_bcp_13.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "valueset-mimetypes.xml")); + Arrays.asList("highmed-endpoint-0.4.0.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "urn_ietf_bcp_13.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "valueset-mimetypes.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @Test - public void testOrganizationProfileValid() throws Exception + public void testEndpointProfileValid() throws Exception { Endpoint endpoint = new Endpoint(); endpoint.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-endpoint"); diff --git a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java index 88a24203a..c9441d05f 100755 --- a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java @@ -24,10 +24,10 @@ public class OrganizationProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-organization-0.3.0.xml", "highmed-extension-certificate-thumbprint-0.3.0.xml", - "highmed-endpoint-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "organization-type-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "organization-type-0.3.0.xml")); + Arrays.asList("highmed-organization-0.4.0.xml", "highmed-extension-certificate-thumbprint-0.4.0.xml", + "highmed-endpoint-0.4.0.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "organization-type-0.4.0.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "organization-type-0.4.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); diff --git a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java index 0107df506..da9816a2b 100755 --- a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java @@ -52,7 +52,7 @@ public Locale getLocale() private List<CodeSystem> readCodeSystems() { - return Stream.of("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml") + return Stream.of("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml") .map(file -> "/fhir/CodeSystem/" + file).map(this::readCodeSystem).collect(Collectors.toList()); } @@ -72,7 +72,7 @@ private CodeSystem readCodeSystem(String file) public void testExpandFeasibility() throws Exception { ValueSetExpansionOutcome out = valueSetExpander - .expand(readValueSet("/fhir/ValueSet/authorization-role-0.3.0.xml")); + .expand(readValueSet("/fhir/ValueSet/authorization-role-0.4.0.xml")); assertNotNull(out); assertNull(out.getError()); From c30a9da9bb5484cdc5641c38dda15d7e81fa1303 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 23 Nov 2020 23:50:21 +0100 Subject: [PATCH 31/75] version management, error if bpmn process version tag not plugin version Better process plugin version management. BPMN model reader now throws exception if bpmn version tag is not same as provess plugin version. --- .../highmed/dsf/ProcessPluginDefinition.java | 24 +++++++++++--- .../dsf/fhir/resources/AbstractResource.java | 12 +++---- .../fhir/resources/CodeSystemResource.java | 21 +++++++------ .../fhir/resources/NamingSystemResource.java | 17 +++++----- .../dsf/fhir/resources/ResourceProvider.java | 5 +-- .../fhir/resources/ResourceProviderImpl.java | 31 ++++++++++++------- .../StructureDefinitionResource.java | 21 +++++++------ .../dsf/fhir/resources/ValueSetResource.java | 21 +++++++------ ...ProcessPluginDefinitionAndClassLoader.java | 13 ++++++++ .../dsf/bpe/plugin/ProcessPluginProvider.java | 2 +- .../bpe/plugin/ProcessPluginProviderImpl.java | 10 +++--- .../bpe/service/FhirResourceHandlerImpl.java | 20 ++++++------ .../config/PostProcessDeployConfig.java | 2 +- 13 files changed, 122 insertions(+), 77 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java index defb744c9..71d9fc6c6 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java @@ -23,9 +23,25 @@ public interface ProcessPluginDefinition { /** - * @return jar name used by other processes when defining dependencies + * @return process plugin name, same as jar name excluding suffix <code>-<version>.jar</code> used by other + * processes when defining dependencies, e.g. <code>foo-1.2.3</code> for a jar called + * <code>foo-1.2.3.jar</code> or <code>foo-1.2.3-SNAPSHOT.jar</code> with processPluginName <code>foo</code> + * and version <code>1.2.3</code> */ - String getJarName(); + String getName(); + + /** + * @return version of the process plugin, processes and fhir resources, e.g. <code>1.2.3</code> + */ + String getVersion(); + + /** + * @return <code>name-version</code> + */ + default String getNameAndVersion() + { + return getName() + "-" + getVersion(); + } /** * Return <code>Stream.of("foo.bpmn");</code> for a foo.bpmn file located in the root folder of the process plugin @@ -56,9 +72,9 @@ default ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoade /** * @return dependencies to other processes by jar name (excluding '.jar'). The system will add ".jar" and - * "-SNAPSHOT.jar" while searching for jars + * "-SNAPSHOT.jar" while searching for jars, e.g. "bar-1.2.3" */ - default List<String> getDependencyJarNames() + default List<String> getDependencyNamesAndVersions() { return Collections.emptyList(); } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/AbstractResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/AbstractResource.java index 69290e948..6ecd779b8 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/AbstractResource.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/AbstractResource.java @@ -6,18 +6,18 @@ public abstract class AbstractResource { private final Class<? extends MetadataResource> type; - private final String dependecyJarName; + private final String dependencyNameAndVersion; private final String url; private final String version; private final String name; private final String fileName; - AbstractResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, String version, + AbstractResource(Class<? extends MetadataResource> type, String dependencyNameAndVersion, String url, String version, String name, String fileName) { this.type = type; - this.dependecyJarName = dependecyJarName; + this.dependencyNameAndVersion = dependencyNameAndVersion; this.url = url; this.version = version; this.name = name; @@ -29,9 +29,9 @@ public Class<? extends MetadataResource> getType() return type; } - public String getDependecyJarName() + public String getDependencyNameAndVersion() { - return dependecyJarName; + return dependencyNameAndVersion; } public String getUrl() @@ -56,6 +56,6 @@ public String getFileName() public boolean isDependencyResource() { - return dependecyJarName != null; + return dependencyNameAndVersion != null; } } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/CodeSystemResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/CodeSystemResource.java index 0d1d30508..ae8404677 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/CodeSystemResource.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/CodeSystemResource.java @@ -7,21 +7,24 @@ public class CodeSystemResource extends AbstractResource { - private CodeSystemResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, - String version, String name, String fileName) + private CodeSystemResource(Class<? extends MetadataResource> type, String dependencyNameAndVersion, + String codeSystemUrl, String codeSystemVersion, String codeSystemFileName) { - super(type, dependecyJarName, url, version, name, fileName); + super(type, dependencyNameAndVersion, codeSystemUrl, codeSystemVersion, null, codeSystemFileName); } - public static CodeSystemResource file(String fileName) + public static CodeSystemResource file(String codeSystemFileName) { - return new CodeSystemResource(CodeSystem.class, null, null, null, null, - Objects.requireNonNull(fileName, "fileName")); + return new CodeSystemResource(CodeSystem.class, null, null, null, + Objects.requireNonNull(codeSystemFileName, "codeSystemFileName")); } - public static CodeSystemResource dependency(String dependecyJarName, String url, String version) + public static CodeSystemResource dependency(String dependencyNameAndVersion, String codeSystemUrl, + String codeSystemVersion) { - return new CodeSystemResource(CodeSystem.class, Objects.requireNonNull(dependecyJarName, "dependecyJarName"), - Objects.requireNonNull(url, "url"), Objects.requireNonNull(version, "version"), null, null); + return new CodeSystemResource(CodeSystem.class, + Objects.requireNonNull(dependencyNameAndVersion, "dependencyNameAndVersion"), + Objects.requireNonNull(codeSystemUrl, "codeSystemUrl"), + Objects.requireNonNull(codeSystemVersion, "codeSystemVersion"), null); } } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/NamingSystemResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/NamingSystemResource.java index 92a32b4df..4c77f52fb 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/NamingSystemResource.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/NamingSystemResource.java @@ -7,22 +7,21 @@ public class NamingSystemResource extends AbstractResource { - private NamingSystemResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, - String version, String name, String fileName) + private NamingSystemResource(Class<? extends MetadataResource> type, String dependencyNameAndVersion, + String namingSystemName, String namingSystemFileName) { - super(type, dependecyJarName, url, version, name, fileName); + super(type, dependencyNameAndVersion, null, null, namingSystemName, namingSystemFileName); } - public static NamingSystemResource file(String fileName) + public static NamingSystemResource file(String namingSystemFileName) { - return new NamingSystemResource(NamingSystem.class, null, null, null, null, - Objects.requireNonNull(fileName, "fileName")); + return new NamingSystemResource(NamingSystem.class, null, null, Objects.requireNonNull(namingSystemFileName, "namingSystemFileName")); } - public static NamingSystemResource dependency(String dependecyJarName, String name) + public static NamingSystemResource dependency(String dependencyNameAndVersion, String namingSystemName) { return new NamingSystemResource(NamingSystem.class, - Objects.requireNonNull(dependecyJarName, "dependecyJarName"), null, null, - Objects.requireNonNull(name, "name"), null); + Objects.requireNonNull(dependencyNameAndVersion, "dependencyNameAndVersion"), + Objects.requireNonNull(namingSystemName, "namingSystemName"), null); } } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProvider.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProvider.java index 5a811b842..9d05f8c10 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProvider.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProvider.java @@ -101,9 +101,10 @@ static ResourceProvider of(Map<String, List<MetadataResource>> resourcesByProces return ResourceProviderImpl.of(resourcesByProcessKeyAndVersion, dependencyResourcesByProcessKeyAndVersion); } - static ResourceProvider read(Supplier<IParser> parserSupplier, ClassLoader classLoader, + static ResourceProvider read(String processPluginVersion, Supplier<IParser> parserSupplier, ClassLoader classLoader, Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion) { - return ResourceProviderImpl.read(parserSupplier, classLoader, resourcesByProcessKeyAndVersion); + return ResourceProviderImpl.read(processPluginVersion, parserSupplier, classLoader, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java index 8411d612a..e74e0fcda 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java @@ -119,10 +119,10 @@ public Optional<MetadataResource> getMetadataResouce(AbstractResource resource) { if (NamingSystem.class.equals(resource.getType())) logger.debug("Get {} resource dependency {}, file {}, name {}", resource.getType().getSimpleName(), - resource.getDependecyJarName(), resource.getFileName(), resource.getName()); + resource.getDependencyNameAndVersion(), resource.getFileName(), resource.getName()); else logger.debug("Get {} resource dependency {}, file {}, url {}, version {}", - resource.getType().getSimpleName(), resource.getDependecyJarName(), resource.getFileName(), + resource.getType().getSimpleName(), resource.getDependencyNameAndVersion(), resource.getFileName(), resource.getUrl(), resource.getVersion()); if (ActivityDefinition.class.equals(resource.getType())) @@ -144,13 +144,13 @@ else if (ValueSet.class.equals(resource.getType())) @Override public Stream<MetadataResource> getResources(String processKeyAndVersion, - Function<String, ResourceProvider> providerByJarName) + Function<String, ResourceProvider> providerByNameAndVersion) { List<AbstractResource> list = dependencyResourcesByProcessKeyAndVersion.getOrDefault(processKeyAndVersion, Collections.emptyList()); Stream<MetadataResource> dependencyResources = list.stream() - .map(r -> providerByJarName.apply(r.getDependecyJarName()).getMetadataResouce(r)) + .map(r -> providerByNameAndVersion.apply(r.getDependencyNameAndVersion()).getMetadataResouce(r)) .filter(Optional::isPresent).map(Optional::get); Stream<MetadataResource> resources = Arrays @@ -226,7 +226,7 @@ private static <T extends MetadataResource> void addOrInsert(Map<String, List<T> } } - static ResourceProvider read(Supplier<IParser> parserSupplier, ClassLoader classLoader, + static ResourceProvider read(String processPluginVersion, Supplier<IParser> parserSupplier, ClassLoader classLoader, Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion) { Map<String, List<AbstractResource>> dependencyResourcesByProcessKeyAndVersion = new HashMap<>(); @@ -242,15 +242,15 @@ static ResourceProvider read(Supplier<IParser> parserSupplier, ClassLoader class { resources.put(entry.getKey(), entry.getValue().stream().filter(Predicate.not(AbstractResource::isDependencyResource)) - .map(r -> read(parserSupplier, classLoader, resourcesByFileName, r)) + .map(r -> read(processPluginVersion, parserSupplier, classLoader, resourcesByFileName, r)) .collect(Collectors.toList())); } return of(resources, dependencyResourcesByProcessKeyAndVersion); } - private static MetadataResource read(Supplier<IParser> parserSupplier, ClassLoader classLoader, - Map<String, MetadataResource> resourcesByFileName, AbstractResource resources) + private static MetadataResource read(String processPluginVersion, Supplier<IParser> parserSupplier, + ClassLoader classLoader, Map<String, MetadataResource> resourcesByFileName, AbstractResource resources) { final String fileName = resources.getFileName(); final Class<? extends MetadataResource> type = resources.getType(); @@ -266,21 +266,28 @@ private static MetadataResource read(Supplier<IParser> parserSupplier, ClassLoad } else { - MetadataResource m = parseResource(parserSupplier, classLoader, fileName, type); + MetadataResource m = parseResourceAndSetVersion(processPluginVersion, parserSupplier, classLoader, fileName, + type); + resourcesByFileName.put(fileName, m); return m; } } - private static <T extends MetadataResource> T parseResource(Supplier<IParser> parserSupplier, - ClassLoader classLoader, String fileName, Class<T> type) + private static <T extends MetadataResource> T parseResourceAndSetVersion(String processPluginVersion, + Supplier<IParser> parserSupplier, ClassLoader classLoader, String fileName, Class<T> type) { logger.debug("Reading {} from {}", type.getSimpleName(), fileName); try (InputStream in = classLoader.getResourceAsStream(fileName)) { - return parserSupplier.get().parseResource(type, in); + T r = parserSupplier.get().parseResource(type, in); + + if (!(r instanceof NamingSystem)) + r.setVersion(processPluginVersion); + + return r; } catch (IOException e) { diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/StructureDefinitionResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/StructureDefinitionResource.java index 8b36daf84..c9479e11a 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/StructureDefinitionResource.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/StructureDefinitionResource.java @@ -7,22 +7,25 @@ public class StructureDefinitionResource extends AbstractResource { - private StructureDefinitionResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, - String version, String name, String fileName) + private StructureDefinitionResource(Class<? extends MetadataResource> type, String dependecyNameAndVersion, + String structureDefinitionUrl, String structureDefinitionVersion, String structureDefinitionFileName) { - super(type, dependecyJarName, url, version, name, fileName); + super(type, dependecyNameAndVersion, structureDefinitionUrl, structureDefinitionVersion, null, + structureDefinitionFileName); } - public static StructureDefinitionResource file(String fileName) + public static StructureDefinitionResource file(String structureDefinitionFileName) { - return new StructureDefinitionResource(StructureDefinition.class, null, null, null, null, - Objects.requireNonNull(fileName, "fileName")); + return new StructureDefinitionResource(StructureDefinition.class, null, null, null, + Objects.requireNonNull(structureDefinitionFileName, "structureDefinitionFileName")); } - public static StructureDefinitionResource dependency(String dependecyJarName, String url, String version) + public static StructureDefinitionResource dependency(String dependencyNameAndVersion, String structureDefinitionUrl, + String structureDefinitionVersion) { return new StructureDefinitionResource(StructureDefinition.class, - Objects.requireNonNull(dependecyJarName, "dependecyJarName"), Objects.requireNonNull(url, "url"), - Objects.requireNonNull(version, "version"), null, null); + Objects.requireNonNull(dependencyNameAndVersion, "dependencyNameAndVersion"), + Objects.requireNonNull(structureDefinitionUrl, "structureDefinitionUrl"), + Objects.requireNonNull(structureDefinitionVersion, "structureDefinitionVersion"), null); } } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ValueSetResource.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ValueSetResource.java index bdfc3f05f..2fe8d6c1c 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ValueSetResource.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ValueSetResource.java @@ -7,21 +7,24 @@ public class ValueSetResource extends AbstractResource { - private ValueSetResource(Class<? extends MetadataResource> type, String dependecyJarName, String url, - String version, String name, String fileName) + private ValueSetResource(Class<? extends MetadataResource> type, String dependencyNameAndVersion, + String valueSetUrl, String valueSetVersion, String valueSetFileName) { - super(type, dependecyJarName, url, version, name, fileName); + super(type, dependencyNameAndVersion, valueSetUrl, valueSetVersion, null, valueSetFileName); } - public static ValueSetResource file(String fileName) + public static ValueSetResource file(String valueSetFileName) { - return new ValueSetResource(ValueSet.class, null, null, null, null, - Objects.requireNonNull(fileName, "fileName")); + return new ValueSetResource(ValueSet.class, null, null, null, + Objects.requireNonNull(valueSetFileName, "valueSetFileName")); } - public static ValueSetResource dependency(String dependecyJarName, String url, String version) + public static ValueSetResource dependency(String dependencyNameAndVersion, String valueSetUrl, + String valueSetVersion) { - return new ValueSetResource(ValueSet.class, Objects.requireNonNull(dependecyJarName, "dependecyJarName"), - Objects.requireNonNull(url, "url"), Objects.requireNonNull(version, "version"), null, null); + return new ValueSetResource(ValueSet.class, + Objects.requireNonNull(dependencyNameAndVersion, "dependencyNameAndVersion"), + Objects.requireNonNull(valueSetUrl, "valueSetUrl"), + Objects.requireNonNull(valueSetVersion, "valueSetVersion"), null); } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java index 8badff1ca..cdbbc9c96 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java @@ -96,9 +96,22 @@ private BpmnFileAndModel loadAndValidateModel(String bpmnFile, ClassLoader class { BpmnModelInstance model = Bpmn.readModelFromStream(classLoader.getResourceAsStream(bpmnFile)); Bpmn.validateModel(model); + validateModelVersionTags(model); return new BpmnFileAndModel(bpmnFile, model, jars); } + private void validateModelVersionTags(BpmnModelInstance model) + { + Collection<Process> processes = model.getModelElementsByType(Process.class); + processes.forEach(p -> + { + if (!definition.getVersion().equals(p.getCamundaVersionTag())) + throw new RuntimeException("Camunda version tag in process '" + p.getId() + + "' does not match process plugin version (tag: " + p.getCamundaVersionTag() + " vs. plugin:" + + definition.getVersion() + ")"); + }); + } + public ResourceProvider getResourceProvider() { if (resourceProvider == null) diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java index fc9f77fd7..e6b755d1f 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProvider.java @@ -48,7 +48,7 @@ public interface ProcessPluginProvider */ Map<ProcessKeyAndVersion, ApplicationContext> getApplicationContextsByProcessDefinitionKeyAndVersion(); - Map<String, ResourceProvider> getResouceProvidersByDpendencyJarName(); + Map<String, ResourceProvider> getResouceProvidersByDpendencyNameAndVersion(); List<ProcessKeyAndVersion> getProcessKeyAndVersions(); diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java index c37fb0e63..03985cd80 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java @@ -207,7 +207,7 @@ private List<ProcessPluginDefinitionAndClassLoader> handleDependencies( private ProcessPluginDefinitionAndClassLoader withDependencies(ProcessPluginDefinitionAndClassLoader definition, Map<String, ProcessPluginDefinitionAndClassLoader> definitionsByJar) { - if (definition.getDefinition().getDependencyJarNames().isEmpty()) + if (definition.getDefinition().getDependencyNamesAndVersions().isEmpty()) return definition; else { @@ -225,7 +225,7 @@ private ProcessPluginDefinitionAndClassLoader withDependencies(ProcessPluginDefi } String definitionClassName = definition.getDefinition().getClass().getName(); - List<Path> dependencyJars = definition.getDefinition().getDependencyJarNames().stream() + List<Path> dependencyJars = definition.getDefinition().getDependencyNamesAndVersions().stream() .flatMap(dependency -> findDefinition(definitionsByJar, dependency)).collect(Collectors.toList()); if (definition.getJars().size() == 1) @@ -322,10 +322,10 @@ public Map<ProcessKeyAndVersion, ProcessPluginDefinitionAndClassLoader> getDefin } @Override - public Map<String, ResourceProvider> getResouceProvidersByDpendencyJarName() + public Map<String, ResourceProvider> getResouceProvidersByDpendencyNameAndVersion() { - return getDefinitions().stream() - .collect(Collectors.toMap(def -> def.getDefinition().getJarName(), def -> def.getResourceProvider())); + return getDefinitions().stream().collect( + Collectors.toMap(def -> def.getDefinition().getNameAndVersion(), def -> def.getResourceProvider())); } @Override diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java index 33f216346..5ecc8b507 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java @@ -44,17 +44,17 @@ public class FhirResourceHandlerImpl implements FhirResourceHandler, Initializin private final ProcessPluginResourcesDao dao; private final FhirContext fhirContext; - private final Map<String, ResourceProvider> resouceProvidersByDpendencyJarName = new HashMap<>(); + private final Map<String, ResourceProvider> resouceProvidersByDpendencyNameAndVersion = new HashMap<>(); public FhirResourceHandlerImpl(FhirWebserviceClient localWebserviceClient, ProcessPluginResourcesDao dao, - FhirContext fhirContext, Map<String, ResourceProvider> resouceProvidersByDpendencyJarName) + FhirContext fhirContext, Map<String, ResourceProvider> resouceProvidersByDpendencyNameAndVersion) { this.localWebserviceClient = localWebserviceClient; this.dao = dao; this.fhirContext = fhirContext; - if (resouceProvidersByDpendencyJarName != null) - this.resouceProvidersByDpendencyJarName.putAll(resouceProvidersByDpendencyJarName); + if (resouceProvidersByDpendencyNameAndVersion != null) + this.resouceProvidersByDpendencyNameAndVersion.putAll(resouceProvidersByDpendencyNameAndVersion); } @Override @@ -213,21 +213,21 @@ private Stream<ProcessesResource> getResources( private Stream<MetadataResource> getResources(ProcessKeyAndVersion process, ProcessPluginDefinitionAndClassLoader definition) { - Function<String, ResourceProvider> providerByJarName = name -> + Function<String, ResourceProvider> providerByNameAndVersion = nameAndVersion -> { - if (resouceProvidersByDpendencyJarName.containsKey(name)) + if (resouceProvidersByDpendencyNameAndVersion.containsKey(nameAndVersion)) { - logger.trace("Resource provider for dependency {} found", name); - return resouceProvidersByDpendencyJarName.get(name); + logger.trace("Resource provider for dependency {} found", nameAndVersion); + return resouceProvidersByDpendencyNameAndVersion.get(nameAndVersion); } else { - logger.warn("Resource provider for dependency {} not found", name); + logger.warn("Resource provider for dependency {} not found", nameAndVersion); return ResourceProvider.empty(); } }; - return definition.getResourceProvider().getResources(process.toString(), providerByJarName); + return definition.getResourceProvider().getResources(process.toString(), providerByNameAndVersion); } private Optional<UUID> getResourceId(Map<ProcessKeyAndVersion, List<ResourceInfo>> dbResourcesByProcess, diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java index ce19a5821..db1a2f0ef 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/PostProcessDeployConfig.java @@ -80,6 +80,6 @@ public FhirResourceHandler fhirResourceHandler() { return new FhirResourceHandlerImpl(fhirConfig.clientProvider().getLocalWebserviceClient(), daoConfig.processPluginResourcesDao(), fhirConfig.fhirContext(), - processPluginProvider.getResouceProvidersByDpendencyJarName()); + processPluginProvider.getResouceProvidersByDpendencyNameAndVersion()); } } From 04012a95b33e0576e6ecfc273b14900273eebd42 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 23 Nov 2020 23:50:56 +0100 Subject: [PATCH 32/75] version 0.3.0 -> 0.4.0 change, better version management --- .../FeasibilityProcessPluginDefinition.java | 65 +++++---- .../bpe/computeSimpleFeasibility.bpmn | 6 +- .../bpe/executeSimpleFeasibility.bpmn | 4 +- .../bpe/requestSimpleFeasibility.bpmn | 6 +- .../computeSimpleFeasibility.xml | 6 +- .../executeSimpleFeasibility.xml | 6 +- .../requestSimpleFeasibility.xml | 6 +- .../resources/fhir/CodeSystem/feasibility.xml | 6 +- .../resources/fhir/CodeSystem/query-type.xml | 6 +- .../NamingSystem/highmed-research-study.xml | 3 +- .../highmed-extension-group-id.xml | 6 +- .../highmed-extension-participating-medic.xml | 6 +- .../highmed-extension-participating-ttp.xml | 6 +- .../highmed-extension-query.xml | 6 +- .../StructureDefinition/highmed-group.xml | 6 +- .../highmed-research-study-feasibility.xml | 6 +- ...ighmed-task-compute-simple-feasibility.xml | 8 +- .../highmed-task-error-simple-feasibility.xml | 8 +- ...ighmed-task-execute-simple-feasibility.xml | 8 +- ...-multi-medic-result-simple-feasibility.xml | 8 +- ...ighmed-task-request-simple-feasibility.xml | 8 +- ...single-medic-result-simple-feasibility.xml | 8 +- .../resources/fhir/ValueSet/feasibility.xml | 6 +- .../resources/fhir/ValueSet/query-type.xml | 6 +- ...lityFromMedicsViaMedic1ExampleStarter.java | 2 +- .../dsf/fhir/profile/GroupProfileTest.java | 6 +- .../profile/ResearchStudyProfileTest.java | 8 +- .../dsf/fhir/profile/TaskProfileTest.java | 124 ++++++++---------- .../LocalServicesProcessPluginDefinition.java | 52 +++++--- .../bpe/localServicesIntegration.bpmn | 4 +- .../localServicesIntegration.xml | 8 +- ...ighmed-task-local-services-integration.xml | 8 +- ...ServicesIntegrationTestExampleStarter.java | 2 +- .../dsf/fhir/profile/TaskProfileTest.java | 15 +-- .../dsf/bpe/PingProcessPluginDefinition.java | 28 ++-- .../src/main/resources/bpe/ping.bpmn | 4 +- .../src/main/resources/bpe/pong.bpmn | 4 +- .../fhir/ActivityDefinition/ping.xml | 8 +- .../fhir/ActivityDefinition/pong.xml | 8 +- .../StructureDefinition/highmed-task-ping.xml | 10 +- .../StructureDefinition/highmed-task-pong.xml | 10 +- .../highmed-task-start-ping-process.xml | 10 +- .../Ping3MedicFromTtpExampleStarter.java | 2 +- .../dsf/fhir/profiles/TaskProfileTest.java | 16 +-- .../dsf/bpe/ChildProcessPluginDefinition.java | 8 +- .../src/main/resources/child.bpmn | 2 +- .../bpe/ParentProcessPluginDefinition.java | 20 ++- .../src/main/resources/bpe/parent.bpmn | 4 +- .../highmed-task-parent-plugin.xml | 10 +- .../bpe/UpdateAllowListPluginDefinition.java | 35 +++-- .../main/resources/bpe/downloadAllowList.bpmn | 2 +- .../main/resources/bpe/updateAllowList.bpmn | 2 +- .../ActivityDefinition/downloadAllowList.xml | 6 +- .../ActivityDefinition/updateAllowList.xml | 6 +- .../fhir/CodeSystem/update-allow-list.xml | 6 +- .../highmed-task-download-allow-list.xml | 8 +- .../highmed-task-update-allow-list.xml | 8 +- .../fhir/ValueSet/update-allow-list.xml | 6 +- ...lowListFromTtpViaMedic1ExampleStarter.java | 2 +- ...pdateAllowList3MedicTtpExampleStarter.java | 2 +- .../dsf/fhir/profile/TaskProfileTest.java | 14 +- .../bpe/UpdateResourcesPluginDefinition.java | 31 +++-- .../executeUpdateResources.xml | 6 +- .../requestUpdateResources.xml | 6 +- .../fhir/CodeSystem/update-resources.xml | 6 +- .../highmed-task-execute-update-resources.xml | 8 +- .../highmed-task-request-update-resources.xml | 8 +- .../fhir/ValueSet/update-resources.xml | 6 +- ...UpdateResource3MedicTtpExampleStarter.java | 2 +- .../dsf/fhir/profile/TaskProfileTest.java | 16 +-- 70 files changed, 447 insertions(+), 322 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index c4fae8796..ba71549df 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -20,12 +20,20 @@ public class FeasibilityProcessPluginDefinition implements ProcessPluginDefinition { + public static final String VERSION = "0.4.0"; + + @Override + public String getName() + { + return "dsf-bpe-process-feasibility"; + } + @Override - public String getJarName() + public String getVersion() { - return "dsf-bpe-process-feasibility-0.4.0"; + return VERSION; } - + @Override public Stream<String> getBpmnFiles() { @@ -42,47 +50,48 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aCom = ActivityDefinitionResource.file("fhir/ActivityDefinition/computeSimpleFeasibility-0.3.0.xml"); - var aExe = ActivityDefinitionResource.file("fhir/ActivityDefinition/executeSimpleFeasibility-0.3.0.xml"); - var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/requestSimpleFeasibility-0.3.0.xml"); + var aCom = ActivityDefinitionResource.file("fhir/ActivityDefinition/computeSimpleFeasibility.xml"); + var aExe = ActivityDefinitionResource.file("fhir/ActivityDefinition/executeSimpleFeasibility.xml"); + var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/requestSimpleFeasibility.xml"); - var cF = CodeSystemResource.file("fhir/CodeSystem/feasibility-0.3.0.xml"); - var cQT = CodeSystemResource.file("fhir/CodeSystem/query-type-0.3.0.xml"); + var cF = CodeSystemResource.file("fhir/CodeSystem/feasibility.xml"); + var cQT = CodeSystemResource.file("fhir/CodeSystem/query-type.xml"); var n = NamingSystemResource.file("fhir/NamingSystem/highmed-research-study.xml"); - var sExtG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-group-id-0.3.0.xml"); + var sExtG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-group-id.xml"); var sExtPartMeDic = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-extension-participating-medic-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-extension-participating-medic.xml"); var sExtPartTtp = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-extension-participating-ttp-0.3.0.xml"); - var sExtQ = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-query-0.3.0.xml"); - var sG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-group-0.3.0.xml"); - var sR = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-research-study-feasibility-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-extension-participating-ttp.xml"); + var sExtQ = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-query.xml"); + var sG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-group.xml"); + var sR = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-research-study-feasibility.xml"); var sTCom = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-compute-simple-feasibility-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml"); var sTErr = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-error-simple-feasibility-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml"); var sTExe = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-execute-simple-feasibility-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml"); var sTResM = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml"); var sTReq = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-request-simple-feasibility-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml"); var sTResS = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml"); - var vF = ValueSetResource.file("fhir/ValueSet/feasibility-0.3.0.xml"); - var vQT = ValueSetResource.file("fhir/ValueSet/query-type-0.3.0.xml"); + var vF = ValueSetResource.file("fhir/ValueSet/feasibility.xml"); + var vQT = ValueSetResource.file("fhir/ValueSet/query-type.xml"); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("computeSimpleFeasibility/0.3.0", - Arrays.asList(aCom, sTCom, vF, cF, sTResS, sExtG, sG), "executeSimpleFeasibility/0.3.0", + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of( + "computeSimpleFeasibility/" + VERSION, Arrays.asList(aCom, sTCom, vF, cF, sTResS, sExtG, sG), + "executeSimpleFeasibility/" + VERSION, Arrays.asList(aExe, sTExe, vF, cF, sR, sExtPartTtp, sExtPartMeDic, n, sG, sExtQ, vQT, cQT), - "requestSimpleFeasibility/0.3.0", Arrays.asList(aReq, sTReq, vF, cF, sR, sExtPartTtp, sExtPartMeDic, n, - sG, sExtQ, vQT, cQT, sTResM, sExtG, sTErr)); + "requestSimpleFeasibility/" + VERSION, Arrays.asList(aReq, sTReq, vF, cF, sR, sExtPartTtp, + sExtPartMeDic, n, sG, sExtQ, vQT, cQT, sTResM, sExtG, sTErr)); - return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + return ResourceProvider.read(VERSION, + () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn index e8e6a23e6..452c3cfcd 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1yff9tp" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="computeSimpleFeasibility" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="computeSimpleFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:subProcess id="SubProcess_1gopxt4"> <bpmn:incoming>SequenceFlow_1lfe4wr</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0xxpamp</bpmn:outgoing> @@ -47,7 +47,7 @@ <camunda:inputOutput> <camunda:inputParameter name="processDefinitionKey">requestSimpleFeasibility</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.3.0</camunda:inputParameter> + <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="messageName">resultMultiMedicSimpleFeasibilityMessage</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> @@ -99,7 +99,7 @@ <camunda:inputOutput> <camunda:inputParameter name="processDefinitionKey">requestSimpleFeasibility</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-error-simple-feasibility</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.3.0</camunda:inputParameter> + <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="messageName">errorMultiMedicSimpleFeasibilityMessage</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeSimpleFeasibility.bpmn index 9e4ce24e7..97bd4aa10 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeSimpleFeasibility.bpmn +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeSimpleFeasibility.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0drkcb5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="executeSimpleFeasibility" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="executeSimpleFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:serviceTask id="checkResults" name="check results" camunda:class="org.highmed.dsf.bpe.service.CheckSingleMedicResults"> <bpmn:incoming>SequenceFlow_0q803rh</bpmn:incoming> <bpmn:outgoing>SequenceFlow_04ouilq</bpmn:outgoing> @@ -25,7 +25,7 @@ <bpmn:extensionElements> <camunda:inputOutput> <camunda:inputParameter name="messageName">resultSingleMedicSimpleFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.3.0</camunda:inputParameter> + <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="processDefinitionKey">computeSimpleFeasibility</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility</camunda:inputParameter> </camunda:inputOutput> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn index c94787741..62e87ff10 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0inb4ax" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="requestSimpleFeasibility" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="requestSimpleFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:startEvent id="StartEvent" name="start"> <bpmn:outgoing>SequenceFlow_11k77gx</bpmn:outgoing> <bpmn:messageEventDefinition id="MessageEventDefinition_10c2suu" messageRef="Message_1pq9qxp" /> @@ -13,7 +13,7 @@ <bpmn:extensionElements> <camunda:inputOutput> <camunda:inputParameter name="processDefinitionKey">executeSimpleFeasibility</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.3.0</camunda:inputParameter> + <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="messageName">executeSimpleFeasibilityMessage</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility</camunda:inputParameter> </camunda:inputOutput> @@ -34,7 +34,7 @@ <bpmn:extensionElements> <camunda:inputOutput> <camunda:inputParameter name="processDefinitionKey">computeSimpleFeasibility</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.3.0</camunda:inputParameter> + <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="messageName">computeSimpleFeasibilityMessage</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility</camunda:inputParameter> </camunda:inputOutput> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility.xml index 3aba9912a..dc0617ea5 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility.xml @@ -70,13 +70,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/computeSimpleFeasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="computeSimpleFeasibility" /> <title value="Compute Simple Feasibility" /> <subtitle value="Process to compute simple feasibility result" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility.xml index beab60edc..420986256 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility.xml @@ -44,13 +44,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/executeSimpleFeasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="executeSimpleFeasibility" /> <title value="Execute a Simple Feasibility" /> <subtitle value="Process to execute a simple feasibility query" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml index 97fc7f17a..95a1cadec 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml @@ -102,13 +102,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/requestSimpleFeasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="requestSimpleFeasibility" /> <title value="Request simple feasibility" /> <subtitle value="Feasibility Request Process" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility.xml index bf62c1894..c95bd4517 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility.xml @@ -6,12 +6,14 @@ </tag> </meta> <url value="http://highmed.org/fhir/CodeSystem/feasibility"/> - <version value="0.3.0"/> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="HiGHmed_Feasibility"/> <title value="HiGHmed Feasibility"/> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="CodeSystem with standard values for feasibility processes"/> <caseSensitive value="true"/> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type.xml index 9a1b7d038..5904bf429 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type.xml @@ -6,12 +6,14 @@ </tag> </meta> <url value="http://highmed.org/fhir/CodeSystem/query-type"/> - <version value="0.3.0"/> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="HiGHmed_Query_Type"/> <title value="HiGHmed Query Type"/> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="CodeSystem with HiGHmed query types for medical data stored in the data lake repositories"/> <caseSensitive value="true"/> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study.xml index 0fbf15032..124008831 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study.xml @@ -7,8 +7,9 @@ </meta> <name value="HiGHmed_ResearchStudy_Identifier"/> <!-- status managed by bpe --> + <status value="unknown" /> <kind value="identifier"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <responsible value="HiGHmed"/> <description diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml index a82e548fc..1c8a818ce 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/group-id" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="GroupId" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <mapping> <identity value="rim" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml index ae64235e6..f6831a3d1 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/participating-medic" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="ParticipatingMedic" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml index 8fdbd05ff..8fa6fe351 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/participating-ttp" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="ParticipatingTtp" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml index 979dffc9a..1f00a8565 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/query" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="Query" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml index cbaa4bd0b..9a3e93ca2 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-group" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="Group" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml index 094a8c092..79fc47dbd 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="ResearchStudyFeasibility" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml index 58d63f7c1..1861cb45f 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskComputeSimpleFeasibility" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeSimpleFeasibility/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/computeSimpleFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml index 5a2360e85..2dbd89d46 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml @@ -7,11 +7,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-error-simple-feasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskErrorSimpleFeasibility" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -21,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestSimpleFeasibility/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml index f32898878..70fba860e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskExecuteSimpleFeasibility" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeSimpleFeasibility/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/executeSimpleFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml index 81c9cb9a1..304b1b10e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskMultiMedicResultSimpleFeasibility" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestSimpleFeasibility/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml index 57343fc89..ed98353f2 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskRequestSimpleFeasibility" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestSimpleFeasibility/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml index 4a265d667..428ef339e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskSingleMedicResultSimpleFeasibility" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeSimpleFeasibility/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/computeSimpleFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility.xml index 521b08a2e..960e57e5c 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility.xml @@ -6,12 +6,14 @@ </tag> </meta> <url value="http://highmed.org/fhir/ValueSet/feasibility"/> - <version value="0.3.0"/> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="HiGHmed_Feasibility"/> <title value="HiGHmed Feasibility"/> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="ValueSet with standard values for feasibility processes"/> <immutable value="true"/> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type.xml index 3ac00d49f..6cde8914e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type.xml @@ -6,12 +6,14 @@ </tag> </meta> <url value="http://highmed.org/fhir/ValueSet/query-type"/> - <version value="0.3.0"/> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="HiGHmed_Query_Type"/> <title value="HiGHmed Query Type"/> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="ValueSet with HiGHmed query types used in Group resources query extension of the expression datatype"/> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java index 056028b78..8d65a5577 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -149,7 +149,7 @@ private static Task createTask(ResearchStudy researchStudy) task.getMeta() .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java index 3f8716243..96d7db24a 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java @@ -25,9 +25,9 @@ public class GroupProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-extension-query-0.3.0.xml", "highmed-group-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "query-type-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "query-type-0.3.0.xml")); + Arrays.asList("highmed-extension-query.xml", "highmed-group.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "query-type.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "query-type.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java index 6d2bc31b3..9e3d342c6 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java @@ -25,10 +25,10 @@ public class ResearchStudyProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-extension-participating-medic-0.3.0.xml", - "highmed-extension-participating-ttp-0.3.0.xml", "highmed-research-study-feasibility-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "organization-type-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "organization-type-0.3.0.xml")); + Arrays.asList("highmed-extension-participating-medic.xml", "highmed-extension-participating-ttp.xml", + "highmed-research-study-feasibility.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "organization-type-0.4.0.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "organization-type-0.4.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 2e3cd4f23..b2fbc98d2 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -33,17 +33,14 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-group-0.3.0.xml", - "highmed-extension-group-id-0.3.0.xml", "highmed-research-study-feasibility-0.3.0.xml", - "highmed-task-request-simple-feasibility-0.3.0.xml", - "highmed-task-execute-simple-feasibility-0.3.0.xml", - "highmed-task-single-medic-result-simple-feasibility-0.3.0.xml", - "highmed-task-compute-simple-feasibility-0.3.0.xml", - "highmed-task-multi-medic-result-simple-feasibility-0.3.0.xml", - "highmed-task-error-simple-feasibility-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "feasibility-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "feasibility-0.3.0.xml")); + public static final ValidationSupportRule validationRule = new ValidationSupportRule(Arrays.asList( + "highmed-task-base-0.4.0.xml", "highmed-group.xml", "highmed-extension-group-id.xml", + "highmed-research-study-feasibility.xml", "highmed-task-request-simple-feasibility.xml", + "highmed-task-execute-simple-feasibility.xml", "highmed-task-single-medic-result-simple-feasibility.xml", + "highmed-task-compute-simple-feasibility.xml", "highmed-task-multi-medic-result-simple-feasibility.xml", + "highmed-task-error-simple-feasibility.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -56,9 +53,8 @@ public void testTaskRequestSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -72,31 +68,30 @@ public void testTaskRequestSimpleFeasibilityValidWithOutput() throws Exception TaskOutputComponent outParticipatingMedics1 = task.addOutput(); outParticipatingMedics1.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("participating-medics"); - outParticipatingMedics1 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId1)); + outParticipatingMedics1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId1)); TaskOutputComponent outMultiMedicResult1 = task.addOutput(); outMultiMedicResult1.setValue(new UnsignedIntType(25)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("multi-medic-result"); - outMultiMedicResult1 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId1)); + outMultiMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId1)); TaskOutputComponent outParticipatingMedics2 = task.addOutput(); outParticipatingMedics2.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("participating-medics"); - outParticipatingMedics2 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId2)); + outParticipatingMedics2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId2)); TaskOutputComponent outMultiMedicResult2 = task.addOutput(); outMultiMedicResult2.setValue(new UnsignedIntType(25)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("multi-medic-result"); - outMultiMedicResult2 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId2)); + outMultiMedicResult2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId2)); 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskRequestSimpleFeasibility() @@ -104,7 +99,7 @@ private Task createValidTaskRequestSimpleFeasibility() Task task = new Task(); task.getMeta() .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -133,9 +128,8 @@ public void testTaskExecuteSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -148,9 +142,8 @@ public void testTaskExecuteSimpleFeasibilityValidWithBloomFilterConfig() throws 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskExecuteSimpleFeasibility() @@ -158,7 +151,7 @@ private Task createValidTaskExecuteSimpleFeasibility() Task task = new Task(); task.getMeta() .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/executeSimpleFeasibility/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/executeSimpleFeasibility/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -192,9 +185,8 @@ public void testTaskSingleMedicResultSimpleFeasibilityUnsignedIntResultValid() t 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -205,9 +197,8 @@ public void testTaskSingleMedicResultSimpleFeasibilityReferenceResultValid() thr 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskSingleMedicResultSimpleFeasibility() @@ -215,7 +206,7 @@ private Task createValidTaskSingleMedicResultSimpleFeasibility() Task task = new Task(); task.getMeta().addProfile( "http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/computeSimpleFeasibility/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/computeSimpleFeasibility/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -244,13 +235,13 @@ private Task createValidTaskSingleMedicResultSimpleFeasibilityUnsignedIntResult( ParameterComponent inSingleMedicResult1 = task.addInput(); inSingleMedicResult1.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("single-medic-result"); - inSingleMedicResult1 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId1)); + inSingleMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId1)); ParameterComponent inSingleMedicResult2 = task.addInput(); inSingleMedicResult2.setValue(new UnsignedIntType(10)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("single-medic-result"); - inSingleMedicResult2 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId2)); + inSingleMedicResult2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId2)); return task; } @@ -265,13 +256,13 @@ private Task createValidTaskSingleMedicResultSimpleFeasibilityReferenceResult() ParameterComponent inSingleMedicResult1 = task.addInput(); inSingleMedicResult1.setValue(new Reference("Binary/" + UUID.randomUUID().toString())).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("single-medic-result-reference"); - inSingleMedicResult1 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId1)); + inSingleMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId1)); ParameterComponent inSingleMedicResult2 = task.addInput(); inSingleMedicResult2.setValue(new Reference("Binary/" + UUID.randomUUID().toString())).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("single-medic-result-reference"); - inSingleMedicResult2 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId2)); + inSingleMedicResult2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId2)); return task; } @@ -284,9 +275,8 @@ public void testTaskComputeSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskComputeSimpleFeasibility() @@ -294,7 +284,7 @@ private Task createValidTaskComputeSimpleFeasibility() Task task = new Task(); task.getMeta() .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/computeSimpleFeasibility/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/computeSimpleFeasibility/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -327,9 +317,8 @@ public void testTaskMultiMedicResultSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskMultiMedicResultSimpleFeasibility() @@ -337,7 +326,7 @@ private Task createValidTaskMultiMedicResultSimpleFeasibility() Task task = new Task(); task.getMeta().addProfile( "http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -357,24 +346,24 @@ private Task createValidTaskMultiMedicResultSimpleFeasibility() ParameterComponent inParticipatingMedics1 = task.addInput(); inParticipatingMedics1.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("participating-medics"); - inParticipatingMedics1 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId1)); + inParticipatingMedics1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId1)); ParameterComponent inMultiMedicResult1 = task.addInput(); inMultiMedicResult1.setValue(new UnsignedIntType(25)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("multi-medic-result"); - inMultiMedicResult1 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId1)); + inMultiMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId1)); ParameterComponent inParticipatingMedics2 = task.addInput(); inParticipatingMedics2.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("participating-medics"); - inParticipatingMedics2 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId2)); + inParticipatingMedics2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId2)); ParameterComponent inMultiMedicResult2 = task.addInput(); inMultiMedicResult2.setValue(new UnsignedIntType(25)).getType().addCoding() .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("multi-medic-result"); - inMultiMedicResult2 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId2)); + inMultiMedicResult2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", + new Reference(groupId2)); return task; } @@ -387,16 +376,15 @@ public void testTaskErrorSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskErrorSimpleFeasibility() { Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-error-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index a15553ee0..c2803cf70 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -18,12 +18,21 @@ public class LocalServicesProcessPluginDefinition implements ProcessPluginDefinition { - private static final String DEP_FEASIBILITY = "dsf-bpe-process-feasibility-0.4.0"; + public static final String VERSION = "0.4.0"; + + private static final String DEPENDENCY_FEASIBILITY_VERSION = "0.4.0"; + private static final String DEPENDENCY_FEASIBILITY_NAME_AND_VERSION = "dsf-bpe-process-feasibility-0.4.0"; + + @Override + public String getName() + { + return "dsf-bpe-process-local-services"; + } @Override - public String getJarName() + public String getVersion() { - return "dsf-bpe-process-local-services-0.4.0"; + return VERSION; } @Override @@ -39,33 +48,36 @@ public Stream<Class<?>> getSpringConfigClasses() } @Override - public List<String> getDependencyJarNames() + public List<String> getDependencyNamesAndVersions() { - return Arrays.asList(DEP_FEASIBILITY); + return Arrays.asList(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION); } @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aL = ActivityDefinitionResource.file("fhir/ActivityDefinition/localServicesIntegration-0.3.0.xml"); + var aL = ActivityDefinitionResource.file("fhir/ActivityDefinition/localServicesIntegration.xml"); var sTL = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-local-services-integration-0.3.0.xml"); - var sExtG = StructureDefinitionResource.dependency(DEP_FEASIBILITY, - "http://highmed.org/fhir/StructureDefinition/group-id", "0.3.0"); - var sExtQ = StructureDefinitionResource.dependency(DEP_FEASIBILITY, - "http://highmed.org/fhir/StructureDefinition/query", "0.3.0"); + .file("fhir/StructureDefinition/highmed-task-local-services-integration.xml"); + var sExtG = StructureDefinitionResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, + "http://highmed.org/fhir/StructureDefinition/group-id", DEPENDENCY_FEASIBILITY_VERSION); + var sExtQ = StructureDefinitionResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, + "http://highmed.org/fhir/StructureDefinition/query", DEPENDENCY_FEASIBILITY_VERSION); - var vF = ValueSetResource.dependency(DEP_FEASIBILITY, "http://highmed.org/fhir/ValueSet/feasibility", "0.3.0"); - var vQt = ValueSetResource.dependency(DEP_FEASIBILITY, "http://highmed.org/fhir/ValueSet/query-type", "0.3.0"); - var cF = CodeSystemResource.dependency(DEP_FEASIBILITY, "http://highmed.org/fhir/CodeSystem/feasibility", - "0.3.0"); - var cQt = CodeSystemResource.dependency(DEP_FEASIBILITY, "http://highmed.org/fhir/CodeSystem/query-type", - "0.3.0"); + var vF = ValueSetResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, + "http://highmed.org/fhir/ValueSet/feasibility", DEPENDENCY_FEASIBILITY_VERSION); + var vQt = ValueSetResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, + "http://highmed.org/fhir/ValueSet/query-type", DEPENDENCY_FEASIBILITY_VERSION); + var cF = CodeSystemResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, + "http://highmed.org/fhir/CodeSystem/feasibility", DEPENDENCY_FEASIBILITY_VERSION); + var cQt = CodeSystemResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, + "http://highmed.org/fhir/CodeSystem/query-type", DEPENDENCY_FEASIBILITY_VERSION); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("localServicesIntegration/0.3.0", - Arrays.asList(aL, sTL, vF, cF, vQt, cQt, sExtG, sExtQ)); + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map + .of("localServicesIntegration/" + VERSION, Arrays.asList(aL, sTL, vF, cF, vQt, cQt, sExtG, sExtQ)); - return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + return ResourceProvider.read(VERSION, + () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn index 295ff00f8..12d02cbc5 100755 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0drkcb5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="localServicesIntegration" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="localServicesIntegration" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:serviceTask id="checkResults" name="check results" camunda:class="org.highmed.dsf.bpe.service.CheckSingleMedicResults"> <bpmn:incoming>SequenceFlow_0q803rh</bpmn:incoming> <bpmn:outgoing>SequenceFlow_04ouilq</bpmn:outgoing> @@ -95,7 +95,7 @@ <bpmn:extensionElements> <camunda:inputOutput> <camunda:inputParameter name="messageName">resultSingleMedicSimpleFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.3.0</camunda:inputParameter> + <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="processDefinitionKey">computeSimpleFeasibility</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility</camunda:inputParameter> </camunda:inputOutput> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration.xml index 9d327b4b3..3f446ce70 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration.xml @@ -39,13 +39,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/localServicesIntegration"/> - <version value="0.3.0"/> - <name value="LocalServicesIntegration"/> + <!-- version managed by bpe --> + <version value="bpe-managed" /> + <name value="localServicesIntegration"/> <title value="Local services integration"/> <subtitle value="Service integration process"/> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <contact> <name value="HiGHmed"/> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml index bbf062265..d3553023f 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml @@ -7,11 +7,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskLocalServicesIntegration" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -21,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/localServicesIntegration/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/localServicesIntegration/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/RequestLocalServicesIntegrationTestExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/RequestLocalServicesIntegrationTestExampleStarter.java index 3c6498a09..3961d4180 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/RequestLocalServicesIntegrationTestExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/RequestLocalServicesIntegrationTestExampleStarter.java @@ -71,7 +71,7 @@ private static Task createTask(boolean needsConsentCheck, boolean needsRecordLin task.getMeta() .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/localServicesIntegration/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/localServicesIntegration/0.4.0"); task.setStatus(Task.TaskStatus.REQUESTED); task.setIntent(Task.TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 3e379e8f8..3633df889 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -27,13 +27,12 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-group-0.3.0.xml", - "highmed-extension-group-id-0.3.0.xml", "highmed-extension-query-0.3.0.xml", - "highmed-task-local-services-integration-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "feasibility-0.3.0.xml", - "query-type-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "feasibility-0.3.0.xml", - "query-type-0.3.0.xml")); + Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group.xml", "highmed-extension-group-id.xml", + "highmed-extension-query.xml", "highmed-task-local-services-integration.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml", + "query-type.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml", + "query-type.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -56,7 +55,7 @@ private Task createValidTaskLocalServiceIntegration() task.getMeta() .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/localServicesIntegration/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/localServicesIntegration/0.4.0"); task.setStatus(Task.TaskStatus.REQUESTED); task.setIntent(Task.TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java index 213ce9ef0..b5defe07c 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java @@ -16,10 +16,18 @@ public class PingProcessPluginDefinition implements ProcessPluginDefinition { + public static final String VERSION = "0.4.0"; + + @Override + public String getName() + { + return "dsf-bpe-process-ping"; + } + @Override - public String getJarName() + public String getVersion() { - return "dsf-bpe-process-ping-0.4.0"; + return VERSION; } @Override @@ -37,17 +45,17 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aPing = ActivityDefinitionResource.file("fhir/ActivityDefinition/ping-0.3.0.xml"); - var aPong = ActivityDefinitionResource.file("fhir/ActivityDefinition/pong-0.3.0.xml"); - var tPing = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-pong-0.3.0.xml"); + var aPing = ActivityDefinitionResource.file("fhir/ActivityDefinition/ping.xml"); + var aPong = ActivityDefinitionResource.file("fhir/ActivityDefinition/pong.xml"); + var tPing = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-pong.xml"); var tStartPing = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-start-ping-process-0.3.0.xml"); - var tPong = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-ping-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-task-start-ping-process.xml"); + var tPong = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-ping.xml"); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("ping/0.3.0", - Arrays.asList(aPing, tPong, tStartPing), "pong/0.3.0", Arrays.asList(aPong, tPing)); + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("ping/" + VERSION, + Arrays.asList(aPing, tPong, tStartPing), "pong/" + VERSION, Arrays.asList(aPong, tPing)); - return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn index d1221c89c..fbfd887f4 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0azvmx1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="ping" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="ping" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:sequenceFlow id="SequenceFlow_0k1j79c" sourceRef="StartEvent_1" targetRef="selectTargets" /> <bpmn:sequenceFlow id="SequenceFlow_05ia6lz" sourceRef="selectTargets" targetRef="sendPing" /> <bpmn:serviceTask id="selectTargets" name="selectTargets" camunda:class="org.highmed.dsf.bpe.service.SelectPingTargets"> @@ -11,7 +11,7 @@ <bpmn:extensionElements> <camunda:inputOutput> <camunda:inputParameter name="processDefinitionKey">pong</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.3.0</camunda:inputParameter> + <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="messageName">pingMessage</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-ping</camunda:inputParameter> </camunda:inputOutput> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn index 12c7360a0..bd0ac6d19 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_15v05m6" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0"> - <bpmn:process id="pong" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="pong" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_07w11cw</bpmn:outgoing> <bpmn:messageEventDefinition messageRef="Message_0u91abp" /> @@ -10,7 +10,7 @@ <bpmn:extensionElements> <camunda:inputOutput> <camunda:inputParameter name="messageName">pongMessage</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.3.0</camunda:inputParameter> + <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="processDefinitionKey">ping</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-pong</camunda:inputParameter> </camunda:inputOutput> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping.xml index 21d292957..cd6b3c34a 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping.xml @@ -94,13 +94,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/ping" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="ping" /> <title value="PING process" /> <subtitle value="Communication Testing Process" /> - <status value="active" /> + <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong.xml index c38c98531..4b186ddf3 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong.xml @@ -50,13 +50,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/pong" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="pong" /> <title value="PONG process" /> <subtitle value="Communication Testing Process" /> - <status value="active" /> + <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml index eeb8a9ed9..bb60fd8c2 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-ping" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskPing" /> - <status value="active" /> + <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/pong/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/pong/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml index eef564b7c..ed98ab8f4 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-pong" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskPong" /> - <status value="active" /> + <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/ping/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/ping/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml index e49a28c49..6e6f71f2d 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskStartProcess" /> - <status value="active" /> + <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/ping/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/ping/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index 4f5c6c83c..b276e2db9 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -40,7 +40,7 @@ public static void main(String[] args) Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java index 434ec1a25..314a0bf62 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java @@ -27,10 +27,10 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-task-start-ping-process-0.3.0.xml", - "highmed-task-ping-0.3.0.xml", "highmed-task-pong-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml")); + Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-start-ping-process.xml", "highmed-task-ping.xml", + "highmed-task-pong.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -51,7 +51,7 @@ public void testTaskStartPingProcessProfileValid() throws Exception public void testTaskStartPingProcessProfileNotValid1() throws Exception { Task task = createValidTaskStartPingProcess(); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.1.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.1.0"); // not valid ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -90,7 +90,7 @@ private Task createValidTaskStartPingProcess() { Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -121,7 +121,7 @@ private Task createValidTaskPing() { Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -156,7 +156,7 @@ private Task createValidTaskPong() { Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-pong"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java index 790e5ccb6..73dcf2bd4 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java @@ -8,7 +8,13 @@ public class ChildProcessPluginDefinition implements ProcessPluginDefinition { @Override - public String getJarName() + public String getVersion() + { + return "0.4.0"; + } + + @Override + public String getName() { return "dsf-bpe-process-child-0.4.0"; } diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/child.bpmn b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/child.bpmn index 95cef8960..1c9f095d9 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/child.bpmn +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/child.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0btlyt4" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> - <bpmn:process id="childPlugin" isExecutable="true" camunda:versionTag="1.0.0"> + <bpmn:process id="childPlugin" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:startEvent id="StartEvent"> <bpmn:outgoing>SequenceFlow_1u0czdh</bpmn:outgoing> </bpmn:startEvent> diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java index c174ba611..ce41ccba9 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java @@ -15,16 +15,24 @@ public class ParentProcessPluginDefinition implements ProcessPluginDefinition { + public static final String VERSION = "0.4.0"; + + @Override + public String getVersion() + { + return VERSION; + } + @Override - public String getJarName() + public String getName() { - return "bpe/dsf-bpe-process-parent-0.4.0"; + return "dsf-bpe-process-parent"; } @Override public Stream<String> getBpmnFiles() { - return Stream.of("parent.bpmn"); + return Stream.of("bpe/parent.bpmn"); } @Override @@ -36,12 +44,12 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var sT = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-parent-plugin-0.3.0.xml"); + var sT = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-parent-plugin.xml"); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("parentPlugin/1.0.0", + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("parentPlugin/" + VERSION, Arrays.asList(sT)); - return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn index 3ae8c08e5..3b1eb3451 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1ij9ts4" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> - <bpmn:process id="parentPlugin" isExecutable="true" camunda:versionTag="1.0.0"> + <bpmn:process id="parentPlugin" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:sequenceFlow id="SequenceFlow_1ogejv7" sourceRef="StartEvent" targetRef="beforePlugin" /> <bpmn:endEvent id="EndEvent" name="success"> <bpmn:incoming>SequenceFlow_1uvl6af</bpmn:incoming> @@ -20,7 +20,7 @@ <bpmn:outgoing>SequenceFlow_1uvl6af</bpmn:outgoing> </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_00k7wb9" sourceRef="executeSubprocess" targetRef="afterPlugin" /> - <bpmn:callActivity id="executeSubprocess" name="execute subprocess" calledElement="childPlugin" camunda:calledElementBinding="versionTag" camunda:calledElementVersionTag="1.0.0"> + <bpmn:callActivity id="executeSubprocess" name="execute subprocess" calledElement="childPlugin" camunda:calledElementBinding="versionTag" camunda:calledElementVersionTag="0.4.0"> <bpmn:extensionElements> <camunda:in variables="all" /> <camunda:out variables="all" /> diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml index 31d5eefa4..9eedeea15 100644 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml +++ b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-parent-plugin" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="ParentPlugin" /> - <status value="active" /> + <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/parentPlugin/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/parentPlugin/0.4.0" /> </element> <element id="Task.input:message-name"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java index cc3f075c2..89f45d63c 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java @@ -18,10 +18,18 @@ public class UpdateAllowListPluginDefinition implements ProcessPluginDefinition { + public static final String VERSION = "0.4.0"; + @Override - public String getJarName() + public String getName() { - return "dsf-bpe-process-update-allow-list-0.4.0"; + return "dsf-bpe-process-update-allow-list"; + } + + @Override + public String getVersion() + { + return VERSION; } @Override @@ -39,18 +47,17 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aDown = ActivityDefinitionResource.file("fhir/ActivityDefinition/downloadAllowList-0.3.0.xml"); - var aUp = ActivityDefinitionResource.file("fhir/ActivityDefinition/updateAllowList-0.3.0.xml"); - var c = CodeSystemResource.file("fhir/CodeSystem/update-allow-list-0.3.0.xml"); - var sDown = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-download-allow-list-0.3.0.xml"); - var sUp = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-update-allow-list-0.3.0.xml"); - var v = ValueSetResource.file("fhir/ValueSet/update-allow-list-0.3.0.xml"); - - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("downloadAllowList/0.3.0", - Arrays.asList(aDown, c, sDown, v), "updateAllowList/0.3.0", Arrays.asList(aUp, c, sUp, v)); - - return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + var aDown = ActivityDefinitionResource.file("fhir/ActivityDefinition/downloadAllowList.xml"); + var aUp = ActivityDefinitionResource.file("fhir/ActivityDefinition/updateAllowList.xml"); + var c = CodeSystemResource.file("fhir/CodeSystem/update-allow-list.xml"); + var sDown = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-download-allow-list.xml"); + var sUp = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-update-allow-list.xml"); + var v = ValueSetResource.file("fhir/ValueSet/update-allow-list.xml"); + + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("downloadAllowList/" + VERSION, + Arrays.asList(aDown, c, sDown, v), "updateAllowList/" + VERSION, Arrays.asList(aUp, c, sUp, v)); + + return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn index 1ddce4d90..d3b32105f 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1yb5vw3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.2.0"> - <bpmn:process id="downloadAllowList" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="downloadAllowList" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="downloadAllowListTask" /> <bpmn:endEvent id="EndEvent_0xd0x8k"> <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn index ed675abd9..a4f877446 100755 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1yb5vw3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0"> - <bpmn:process id="updateAllowList" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="updateAllowList" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="updateAllowListTask" /> <bpmn:endEvent id="EndEvent_0xd0x8k"> <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList.xml index dcb04b197..124247884 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList.xml @@ -50,13 +50,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/downloadAllowList" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="downloadAllowList" /> <title value="Download Allow List" /> <subtitle value="Download Allow List Bundle Process" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList.xml index 9b6ee4421..73f48690f 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList.xml @@ -38,13 +38,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/updateAllowList" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="updateAllowList" /> <title value="Update Allow List" /> <subtitle value="Update Allow List Bundle Process" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list.xml index 1a0e25176..11b3fe979 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list.xml @@ -6,12 +6,14 @@ </tag> </meta> <url value="http://highmed.org/fhir/CodeSystem/update-allow-list"/> - <version value="0.3.0"/> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="HiGHmed_Update_Allow_List"/> <title value="HiGHmed Update Allow List"/> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="CodeSystem with standard values for the processes update and download allow list"/> <caseSensitive value="true"/> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml index 0cb093246..a3efdd039 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml @@ -7,11 +7,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskDownloadAllowList" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -21,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/downloadAllowList/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/downloadAllowList/0.4.0" /> </element> <element id="Task.input"> <path value="Task.input" /> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml index db494a3f7..7e49a5e73 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskUpdateAllowList" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/updateAllowList/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/updateAllowList/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list.xml index 80ce22bb5..5dd19abf7 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list.xml @@ -6,12 +6,14 @@ </tag> </meta> <url value="http://highmed.org/fhir/ValueSet/update-allow-list"/> - <version value="0.3.0"/> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="HiGHmed_Update_Allow_List"/> <title value="HiGHmed Update Allow List"/> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="ValueSet with standard values for the process update allow list"/> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index 0e4919ce9..7c9466881 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -57,7 +57,7 @@ public static void main(String[] args) Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index e47fed907..cf57bcf09 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -41,7 +41,7 @@ public static void main(String[] args) Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 2a7e0457a..cc36f4c4c 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -29,10 +29,10 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-task-update-allow-list-0.3.0.xml", - "highmed-task-download-allow-list-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-allow-list-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-allow-list-0.3.0.xml")); + Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-update-allow-list.xml", + "highmed-task-download-allow-list.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "update-allow-list.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "update-allow-list.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -68,7 +68,7 @@ private Task createValidTaskUpdateAllowList() { Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -99,7 +99,7 @@ private Task createValidTaskRequestUpdateAllowListResources() { Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -130,7 +130,7 @@ private Task createValidTaskDownloadAllowList() { Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java index eab1947b9..375bec410 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java @@ -18,10 +18,18 @@ public class UpdateResourcesPluginDefinition implements ProcessPluginDefinition { + public static final String VERSION = "0.4.0"; + + @Override + public String getName() + { + return "dsf-bpe-process-update-resources"; + } + @Override - public String getJarName() + public String getVersion() { - return "dsf-bpe-process-update-resources-0.4.0"; + return VERSION; } @Override @@ -39,19 +47,20 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aExec = ActivityDefinitionResource.file("fhir/ActivityDefinition/executeUpdateResources-0.3.0.xml"); - var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/requestUpdateResources-0.3.0.xml"); - var c = CodeSystemResource.file("fhir/CodeSystem/update-resources-0.3.0.xml"); + var aExec = ActivityDefinitionResource.file("fhir/ActivityDefinition/executeUpdateResources.xml"); + var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/requestUpdateResources.xml"); + var c = CodeSystemResource.file("fhir/CodeSystem/update-resources.xml"); var sExec = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-task-execute-update-resources.xml"); var sReq = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-request-update-resources-0.3.0.xml"); - var v = ValueSetResource.file("fhir/ValueSet/update-resources-0.3.0.xml"); + .file("fhir/StructureDefinition/highmed-task-request-update-resources.xml"); + var v = ValueSetResource.file("fhir/ValueSet/update-resources.xml"); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("executeUpdateResources/0.3.0", - Arrays.asList(aExec, c, sExec, v), "requestUpdateResources/0.3.0", Arrays.asList(aReq, c, sReq, v)); + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of( + "executeUpdateResources/" + VERSION, Arrays.asList(aExec, c, sExec, v), + "requestUpdateResources/" + VERSION, Arrays.asList(aReq, c, sReq, v)); - return ResourceProvider.read(() -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), + return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources.xml index 4bd105655..c8b580604 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources.xml @@ -44,13 +44,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/executeUpdateResources" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="executeUpdateResources" /> <title value="Execute Update of Resources" /> <subtitle value="Process to Download and Execute FHIR Bundle" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources.xml index 7aa411744..5a2f7ba50 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources.xml @@ -38,13 +38,15 @@ </extension> </extension> <url value="http://highmed.org/bpe/Process/requestUpdateResources" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="requestUpdateResources" /> <title value="Request Update of Resources" /> <subtitle value="Process to Request a Bundle Download" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <publisher value="HiGHmed" /> <contact> <name value="HiGHmed" /> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources.xml index 43e75136a..84fb949a0 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources.xml @@ -6,12 +6,14 @@ </tag> </meta> <url value="http://highmed.org/fhir/CodeSystem/update-resources"/> - <version value="0.3.0"/> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="HiGHmed_Update_Resources"/> <title value="HiGHmed Update Resources"/> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="CodeSystem with standard values for the process update resources"/> <caseSensitive value="true"/> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml index b93a83c46..5017f1fd7 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskExecuteUpdateResources" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeUpdateResources/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/executeUpdateResources/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml index e7c1c468f..fd191d10d 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml @@ -6,11 +6,13 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources" /> - <version value="0.3.0" /> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="TaskRequestUpdateResources" /> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false" /> - <date value="2020-11-03" /> + <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> @@ -20,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestUpdateResources/0.3.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestUpdateResources/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources.xml index e9367ef9b..e5381bc19 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources.xml @@ -6,12 +6,14 @@ </tag> </meta> <url value="http://highmed.org/fhir/ValueSet/update-resources"/> - <version value="0.3.0"/> + <!-- version managed by bpe --> + <version value="bpe-managed" /> <name value="HiGHmed_Update_Resources"/> <title value="HiGHmed Update Resources"/> <!-- status managed by bpe --> + <status value="unknown" /> <experimental value="false"/> - <date value="2020-11-03"/> + <date value="2020-11-23"/> <publisher value="HiGHmed"/> <description value="ValueSet with standard values for the process update resources"/> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index d56c1c294..ded78a77a 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -53,7 +53,7 @@ public static void main(String[] args) Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestUpdateResources/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/requestUpdateResources/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 3cdafc806..243698988 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -38,10 +38,10 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-task-base-0.3.0.xml", "highmed-task-request-update-resources-0.3.0.xml", - "highmed-task-execute-update-resources-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-resources-0.3.0.xml"), - Arrays.asList("authorization-role-0.3.0.xml", "bpmn-message-0.3.0.xml", "update-resources-0.3.0.xml")); + Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-request-update-resources.xml", + "highmed-task-execute-update-resources.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "update-resources.xml"), + Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "update-resources.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -51,9 +51,9 @@ public void testGenerateSnapshotNotWorkingWithoutBaseSnapshot() throws Exception { var reader = new StructureDefinitionReader(validationRule.getFhirContext()); - StructureDefinition base = reader.readXml("/fhir/StructureDefinition/highmed-task-base-0.3.0.xml"); + StructureDefinition base = reader.readXml("/fhir/StructureDefinition/highmed-task-base-0.4.0.xml"); StructureDefinition differential = reader - .readXml("/fhir/StructureDefinition/highmed-task-execute-update-resources-0.3.0.xml"); + .readXml("/fhir/StructureDefinition/highmed-task-execute-update-resources.xml"); var validationSupport = new ValidationSupportChain( new InMemoryTerminologyServerValidationSupport(validationRule.getFhirContext()), @@ -82,7 +82,7 @@ private Task createValidTaskRequestUpdateResources() { Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestUpdateResources/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/requestUpdateResources/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); @@ -118,7 +118,7 @@ private Task createValidTaskExecuteUpdateResources() { Task task = new Task(); task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/executeUpdateResources/0.3.0"); + task.setInstantiatesUri("http://highmed.org/bpe/Process/executeUpdateResources/0.4.0"); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); From ed0df99bf9d05a482a2795e37bd0e13f2871cd94 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 24 Nov 2020 00:17:45 +0100 Subject: [PATCH 33/75] version 0.3.0 -> 0.4.0 change --- .../src/main/resources/bpe/executeUpdateResources.bpmn | 2 +- .../src/main/resources/bpe/requestUpdateResources.bpmn | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn index 63c1fe0ff..389057631 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0k0v4i2" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0"> - <bpmn:process id="executeUpdateResources" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="executeUpdateResources" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:startEvent id="StartEvent_1"> <bpmn:outgoing>SequenceFlow_0djh0eg</bpmn:outgoing> <bpmn:messageEventDefinition messageRef="Message_1r6vnvn" /> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn index 68222fc84..d2221b808 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0os0n0z" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="requestUpdateResources" isExecutable="true" camunda:versionTag="0.3.0"> + <bpmn:process id="requestUpdateResources" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:sequenceFlow id="SequenceFlow_1ryplwc" sourceRef="StartEvent_1" targetRef="selectResourceAndTargets" /> <bpmn:sequenceFlow id="SequenceFlow_1u4zxix" sourceRef="selectResourceAndTargets" targetRef="sendRequest" /> <bpmn:endEvent id="EndEvent_1f9cjs7"> @@ -11,7 +11,7 @@ <bpmn:extensionElements> <camunda:inputOutput> <camunda:inputParameter name="processDefinitionKey">executeUpdateResources</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.3.0</camunda:inputParameter> + <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="messageName">executeUpdateResourcesMessage</camunda:inputParameter> <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources</camunda:inputParameter> </camunda:inputOutput> From 9d604d4b62f8a034fad5b113cb28a8fa76b093c3 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 24 Nov 2020 00:30:28 +0100 Subject: [PATCH 34/75] added missing space in exception message --- .../dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java index cdbbc9c96..ad2a67f7e 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java @@ -107,7 +107,7 @@ private void validateModelVersionTags(BpmnModelInstance model) { if (!definition.getVersion().equals(p.getCamundaVersionTag())) throw new RuntimeException("Camunda version tag in process '" + p.getId() - + "' does not match process plugin version (tag: " + p.getCamundaVersionTag() + " vs. plugin:" + + "' does not match process plugin version (tag: " + p.getCamundaVersionTag() + " vs. plugin: " + definition.getVersion() + ")"); }); } From 133ef461a815bea162c560dc48ba7fd154cb99f1 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 24 Nov 2020 01:34:19 +0100 Subject: [PATCH 35/75] added missing empty process folder --- dsf-bpe/dsf-bpe-server-jetty/docker/.dockerignore | 3 ++- dsf-bpe/dsf-bpe-server-jetty/docker/Dockerfile | 2 +- dsf-bpe/dsf-bpe-server-jetty/docker/process/README.md | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-server-jetty/docker/process/README.md diff --git a/dsf-bpe/dsf-bpe-server-jetty/docker/.dockerignore b/dsf-bpe/dsf-bpe-server-jetty/docker/.dockerignore index 141d11a7e..1a3e68475 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/docker/.dockerignore +++ b/dsf-bpe/dsf-bpe-server-jetty/docker/.dockerignore @@ -4,4 +4,5 @@ conf/README.md last_event/README.md lib/README.md log/README.md -plugin/README.md \ No newline at end of file +plugin/README.md +process/README.md \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server-jetty/docker/Dockerfile b/dsf-bpe/dsf-bpe-server-jetty/docker/Dockerfile index 6f9c238f7..678724b99 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/docker/Dockerfile +++ b/dsf-bpe/dsf-bpe-server-jetty/docker/Dockerfile @@ -3,7 +3,7 @@ RUN adduser --system --no-create-home --group --uid 2202 java WORKDIR /opt/bpe COPY --chown=root:java ./ ./ RUN chown root:java ./ && \ - chmod 750 ./ ./lib ./plugin ./dsf_bpe_start.sh && \ + chmod 750 ./ ./lib ./plugin ./process ./dsf_bpe_start.sh && \ chmod 640 ./dsf_bpe.jar ./lib/*.jar && \ chmod 1775 ./log ./last_event diff --git a/dsf-bpe/dsf-bpe-server-jetty/docker/process/README.md b/dsf-bpe/dsf-bpe-server-jetty/docker/process/README.md new file mode 100644 index 000000000..5402f557a --- /dev/null +++ b/dsf-bpe/dsf-bpe-server-jetty/docker/process/README.md @@ -0,0 +1 @@ +empty process directory for docker build \ No newline at end of file From b017b3bb146e60be43b49da0892d524043bb7304 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Tue, 24 Nov 2020 09:25:57 +0100 Subject: [PATCH 36/75] differentiate between pull_request SNAPSHOT and release publishing --- .github/workflows/maven-publish.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index e3e77d439..7a482c844 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -6,14 +6,16 @@ name: Java CI Publish with Maven on: pull_request: types: [closed] - branches: [master, develop] + branches: [develop] + release: + types: [published] jobs: publish: - # Only run if pull requests are merged, + # Only run if releases are published or pull requests are merged, # omit running if pull requests are closed without merging - if: github.event.pull_request.merged + if: github.event.pull_request.merged || github.event.action == 'published' runs-on: ubuntu-latest From 7a950598e8da9efe8b515a27610a189538dcd158 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 25 Nov 2020 01:58:12 +0100 Subject: [PATCH 37/75] updating process versions in exclude config --- .../medic1/bpe/app/conf/config.properties | 2 +- .../medic2/bpe/app/conf/config.properties | 2 +- .../medic3/bpe/app/conf/config.properties | 2 +- .../ttp/bpe/app/conf/config.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties index a06203a15..0884db1d4 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties @@ -57,6 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.3.0,requestUpdateResources/0.3.0,updateAllowList/0.3.0 +org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.4.0,requestUpdateResources/0.4.0,updateAllowList/0.4.0 #org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties index 6f25b8897..93c84cc1d 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties @@ -57,6 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.3.0,requestUpdateResources/0.3.0,updateAllowList/0.3.0 +org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.4.0,requestUpdateResources/0.4.0,updateAllowList/0.4.0 #org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties index 8037bb5db..2606a0e47 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties @@ -57,6 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.3.0,requestUpdateResources/0.3.0,updateAllowList/0.3.0 +org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.4.0,requestUpdateResources/0.4.0,updateAllowList/0.4.0 #org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties index 3d605a0be..b6b2afa23 100755 --- a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties @@ -57,6 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.process.excluded=localServicesIntegration/0.3.0,requestSimpleFeasibility/0.3.0,executeSimpleFeasibility/0.3.0 +org.highmed.dsf.bpe.process.excluded=localServicesIntegration/0.4.0,requestSimpleFeasibility/0.4.0,executeSimpleFeasibility/0.4.0 #org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file From 60fce06ed52ac7b97cd507d03f91eb4fe1d11132 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Wed, 25 Nov 2020 02:05:13 +0100 Subject: [PATCH 38/75] reworking authorization rules for metadata resources Authorization rules (create allowed, update allowed) for ActivityDefinition, CodeSystem, NamingSystem, StructureDefinition and ValueSet now consistent. --- .../ActivityDefinitionAuthorizationRule.java | 62 ++++------ .../CodeSystemAuthorizationRule.java | 113 +++++++++++++----- .../NamingSystemAuthorizationRule.java | 104 +++++++++++----- .../StructureDefinitionAuthorizationRule.java | 24 +--- .../ValueSetAuthorizationRule.java | 112 ++++++++++++----- 5 files changed, 269 insertions(+), 146 deletions(-) diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ActivityDefinitionAuthorizationRule.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ActivityDefinitionAuthorizationRule.java index a2c9a3314..cbf9be843 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ActivityDefinitionAuthorizationRule.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ActivityDefinitionAuthorizationRule.java @@ -3,9 +3,9 @@ import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; +import java.util.EnumSet; import java.util.List; import java.util.Optional; -import java.util.regex.Pattern; import java.util.stream.Collectors; import org.highmed.dsf.fhir.authentication.OrganizationProvider; @@ -14,6 +14,7 @@ import org.highmed.dsf.fhir.dao.provider.DaoProvider; import org.highmed.dsf.fhir.service.ReferenceResolver; import org.hl7.fhir.r4.model.ActivityDefinition; +import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -22,11 +23,6 @@ public class ActivityDefinitionAuthorizationRule { private static final Logger logger = LoggerFactory.getLogger(ActivityDefinitionAuthorizationRule.class); - private static final String VERSION_PATTERN_STRING = "\\d+\\.\\d+\\.\\d+"; - private static final Pattern VERSION_PATTERN = Pattern.compile(VERSION_PATTERN_STRING); - private static final String URL_PATTERN_STRING = "http://highmed.org/bpe/Process/[-\\w]+"; - private static final Pattern URL_PATTERN = Pattern.compile(URL_PATTERN_STRING); - public ActivityDefinitionAuthorizationRule(DaoProvider daoProvider, String serverBase, ReferenceResolver referenceResolver, OrganizationProvider organizationProvider) { @@ -51,7 +47,7 @@ public Optional<String> reasonCreateAllowed(Connection connection, User user, Ac else { logger.warn( - "Create of ActivityDefinition unauthorized, ActivityDefinition with version and url already exists"); + "Create of ActivityDefinition unauthorized, ActivityDefinition with url and version already exists"); return Optional.empty(); } } @@ -72,37 +68,35 @@ private Optional<String> newResourceOk(ActivityDefinition newResource) { List<String> errors = new ArrayList<String>(); - if (newResource.hasUrl()) - { - if (!URL_PATTERN.matcher(newResource.getUrl()).matches()) - { - errors.add("activitydefinition.url not matching " + URL_PATTERN_STRING + " pattern"); - } - } - else + ActivityDefinitionProcessAuthorizationExtensions extensions = new ActivityDefinitionProcessAuthorizationExtensions( + newResource); + if (!extensions.isValid()) { - errors.add("activitydefinition.url missing"); + errors.add("ActivityDefinition.extension with url " + + ActivityDefinitionProcessAuthorizationExtensions.PROCESS_AUTHORIZATION_EXTENSION_URL + + " not valid or missing, at least one expected"); } - if (newResource.hasVersion()) + if (newResource.hasStatus()) { - if (!VERSION_PATTERN.matcher(newResource.getVersion()).matches()) + if (!EnumSet.of(PublicationStatus.DRAFT, PublicationStatus.ACTIVE, PublicationStatus.RETIRED) + .contains(newResource.getStatus())) { - errors.add("activitydefinition.version not matching " + VERSION_PATTERN_STRING + " pattern"); + errors.add("ActivityDefinition.status not one of DRAFT, ACTIVE or RETIRED"); } } else { - errors.add("activitydefinition.version missing"); + errors.add("ActivityDefinition.status not defined"); } - ActivityDefinitionProcessAuthorizationExtensions extensions = new ActivityDefinitionProcessAuthorizationExtensions( - newResource); - if (!extensions.isValid()) + if (!newResource.hasUrl()) { - errors.add("activitydefinition.extension with url " - + ActivityDefinitionProcessAuthorizationExtensions.PROCESS_AUTHORIZATION_EXTENSION_URL - + " not valid or missing, at least one expected"); + errors.add("ActivityDefinition.url not defined"); + } + if (!newResource.hasVersion()) + { + errors.add("ActivityDefinition.version not defined"); } if (!hasLocalOrRemoteAuthorizationRole(newResource)) @@ -126,9 +120,7 @@ private boolean resourceExists(Connection connection, ActivityDefinition newReso } catch (SQLException e) { - logger.warn( - "Create of ActivityDefinition unauthorized, error while checking for existing ActivityDefinition with version and url", - e); + logger.warn("Error while searching for ActivityDefinition", e); return false; } } @@ -173,19 +165,13 @@ public Optional<String> reasonUpdateAllowed(Connection connection, User user, Ac "Update of ActivityDefinition authorized for local user '{}', url and version same as existing ActivityDefinition", user.getName()); return Optional.of("local user; url and version same as existing ActivityDefinition"); - - } - else if (!resourceExists(connection, newResource)) - { - logger.info( - "Update of ActivityDefinition authorized for local user '{}', other ActivityDefinition with url and version does not exist", - user.getName()); - return Optional.of("local user; other ActivityDefinition with url and version does not exist yet"); } else { logger.warn( - "Update of ActivityDefinition unauthorized, other ActivityDefinition with url and version already exists"); + "Update of ActivityDefinition unauthorized, url or version changed ({} -> {}, {} -> {})", + oldResource.getUrl(), newResource.getUrl(), oldResource.getVersion(), + newResource.getVersion()); return Optional.empty(); } } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/CodeSystemAuthorizationRule.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/CodeSystemAuthorizationRule.java index 73267f41d..7802ec4d1 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/CodeSystemAuthorizationRule.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/CodeSystemAuthorizationRule.java @@ -2,7 +2,11 @@ import java.sql.Connection; import java.sql.SQLException; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; import java.util.Optional; +import java.util.stream.Collectors; import org.highmed.dsf.fhir.authentication.OrganizationProvider; import org.highmed.dsf.fhir.authentication.User; @@ -10,6 +14,7 @@ import org.highmed.dsf.fhir.dao.provider.DaoProvider; import org.highmed.dsf.fhir.service.ReferenceResolver; import org.hl7.fhir.r4.model.CodeSystem; +import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,38 +33,25 @@ public Optional<String> reasonCreateAllowed(Connection connection, User user, Co { if (isLocalUser(user)) { - // TODO move check for url, version and authorization tag to validation layer - if (newResource.hasUrl() && newResource.hasVersion() && hasLocalOrRemoteAuthorizationRole(newResource)) + Optional<String> errors = newResourceOk(newResource); + if (errors.isEmpty()) { - try + if (!resourceExists(connection, newResource)) { - Optional<CodeSystem> existing = getDao().readByUrlAndVersionWithTransaction(connection, - newResource.getUrl(), newResource.getVersion()); - if (existing.isEmpty()) - { - logger.info( - "Create of CodeSystem authorized for local user '{}', CodeSystem with version and url does not exist", - user.getName()); - return Optional.of("local user, CodeSystem with version and url does not exist yet"); - } - else - { - logger.warn( - "Create of CodeSystem unauthorized, CodeSystem with url and version already exists"); - return Optional.empty(); - } + logger.info( + "Create of CodeSystem authorized for local user '{}', CodeSystem with version and url does not exist", + user.getName()); + return Optional.of("local user, CodeSystem with version and url does not exist yet"); } - catch (SQLException e) + else { - logger.warn( - "Create of CodeSystem unauthorized, error while checking for existing CodeSystem with version and url", - e); + logger.warn("Create of CodeSystem unauthorized, CodeSystem with url and version already exists"); return Optional.empty(); } } else { - logger.warn("Create of CodeSystem unauthorized, missing url or version or authorization tag"); + logger.warn("Create of CodeSystem unauthorized, " + errors.get()); return Optional.empty(); } } @@ -70,6 +62,58 @@ public Optional<String> reasonCreateAllowed(Connection connection, User user, Co } } + private Optional<String> newResourceOk(CodeSystem newResource) + { + List<String> errors = new ArrayList<String>(); + + if (newResource.hasStatus()) + { + if (!EnumSet.of(PublicationStatus.DRAFT, PublicationStatus.ACTIVE, PublicationStatus.RETIRED) + .contains(newResource.getStatus())) + { + errors.add("CodeSystem.status not one of DRAFT, ACTIVE or RETIRED"); + } + } + else + { + errors.add("CodeSystem.status not defined"); + } + + if (!newResource.hasUrl()) + { + errors.add("CodeSystem.url not defined"); + } + if (!newResource.hasVersion()) + { + errors.add("CodeSystem.version not defined"); + } + + if (!hasLocalOrRemoteAuthorizationRole(newResource)) + { + errors.add("missing authorization tag"); + } + + if (errors.isEmpty()) + return Optional.empty(); + else + return Optional.of(errors.stream().collect(Collectors.joining(", "))); + } + + private boolean resourceExists(Connection connection, CodeSystem newResource) + { + try + { + return getDao() + .readByUrlAndVersionWithTransaction(connection, newResource.getUrl(), newResource.getVersion()) + .isPresent(); + } + catch (SQLException e) + { + logger.warn("Error while searching for CodeSystem", e); + return false; + } + } + @Override public Optional<String> reasonReadAllowed(Connection connection, User user, CodeSystem existingResource) { @@ -99,26 +143,27 @@ public Optional<String> reasonUpdateAllowed(Connection connection, User user, Co { if (isLocalUser(user)) { - // TODO move check for url, version and authorization tag to validation layer - if (newResource.hasUrl() && newResource.hasVersion() && hasLocalOrRemoteAuthorizationRole(newResource)) + Optional<String> errors = newResourceOk(newResource); + if (errors.isEmpty()) { - if (oldResource.getUrl().equals(newResource.getUrl()) - && oldResource.getVersion().equals(newResource.getVersion())) + if (isSame(oldResource, newResource)) { logger.info( - "Update of CodeSystem authorized for local user '{}', CodeSystem with version and url exists", + "Update of CodeSystem authorized for local user '{}', url and version same as existing CodeSystem", user.getName()); - return Optional.of("local user, CodeSystem with version and url exists"); + return Optional.of("local user; url and version same as existing CodeSystem"); } else { - logger.warn("Update of CodeSystem unauthorized, new url or version not equal to existing resource"); + logger.warn("Update of CodeSystem unauthorized, url or version changed ({} -> {}, {} -> {})", + oldResource.getUrl(), newResource.getUrl(), oldResource.getVersion(), + newResource.getVersion()); return Optional.empty(); } } else { - logger.warn("Update of CodeSystem unauthorized, missing url or version or authorization tag"); + logger.warn("Update of CodeSystem unauthorized, " + errors.get()); return Optional.empty(); } } @@ -129,6 +174,12 @@ public Optional<String> reasonUpdateAllowed(Connection connection, User user, Co } } + private boolean isSame(CodeSystem oldResource, CodeSystem newResource) + { + return oldResource.getUrl().equals(newResource.getUrl()) + && oldResource.getVersion().equals(newResource.getVersion()); + } + @Override public Optional<String> reasonDeleteAllowed(Connection connection, User user, CodeSystem oldResource) { diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/NamingSystemAuthorizationRule.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/NamingSystemAuthorizationRule.java index d363c5580..05c190198 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/NamingSystemAuthorizationRule.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/NamingSystemAuthorizationRule.java @@ -2,13 +2,18 @@ import java.sql.Connection; import java.sql.SQLException; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; import java.util.Optional; +import java.util.stream.Collectors; import org.highmed.dsf.fhir.authentication.OrganizationProvider; import org.highmed.dsf.fhir.authentication.User; import org.highmed.dsf.fhir.dao.NamingSystemDao; import org.highmed.dsf.fhir.dao.provider.DaoProvider; import org.highmed.dsf.fhir.service.ReferenceResolver; +import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; import org.hl7.fhir.r4.model.NamingSystem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,37 +33,25 @@ public Optional<String> reasonCreateAllowed(Connection connection, User user, Na { if (isLocalUser(user)) { - // TODO move check for name and authorization tag to validation layer - if (newResource.hasName() && hasLocalOrRemoteAuthorizationRole(newResource)) + Optional<String> errors = newResourceOk(newResource); + if (errors.isEmpty()) { - try + if (!resourceExists(connection, newResource)) { - Optional<NamingSystem> existing = getDao().readByNameWithTransaction(connection, - newResource.getName()); - if (existing.isEmpty()) - { - logger.info( - "Create of NamingSystem authorized for local user '{}', NamingSystem with name does not exist", - user.getName()); - return Optional.of("local user, NamingSystem with name does not exist yet"); - } - else - { - logger.warn("Create of NamingSystem unauthorized, NamingSystem with name already exists"); - return Optional.empty(); - } + logger.info( + "Create of NamingSystem authorized for local user '{}', NamingSystem with name does not exist", + user.getName()); + return Optional.of("local user, NamingSystem with name does not exist yet"); } - catch (SQLException e) + else { - logger.warn( - "Create of NamingSystem unauthorized, error while checking for existing NamingSystem with name", - e); + logger.warn("Create of NamingSystem unauthorized, NamingSystem with name already exists"); return Optional.empty(); } } else { - logger.warn("Create of NamingSystem unauthorized, missing name or authorization tag"); + logger.warn("Create of NamingSystem unauthorized, " + errors.get()); return Optional.empty(); } } @@ -69,6 +62,52 @@ public Optional<String> reasonCreateAllowed(Connection connection, User user, Na } } + private Optional<String> newResourceOk(NamingSystem newResource) + { + List<String> errors = new ArrayList<String>(); + + if (newResource.hasStatus()) + { + if (!EnumSet.of(PublicationStatus.DRAFT, PublicationStatus.ACTIVE, PublicationStatus.RETIRED) + .contains(newResource.getStatus())) + { + errors.add("NamingSystem.status not one of DRAFT, ACTIVE or RETIRED"); + } + } + else + { + errors.add("NamingSystem.status not defined"); + } + + if (!newResource.hasName()) + { + errors.add("NamingSystem.name not defined"); + } + + if (!hasLocalOrRemoteAuthorizationRole(newResource)) + { + errors.add("missing authorization tag"); + } + + if (errors.isEmpty()) + return Optional.empty(); + else + return Optional.of(errors.stream().collect(Collectors.joining(", "))); + } + + private boolean resourceExists(Connection connection, NamingSystem newResource) + { + try + { + return getDao().readByNameWithTransaction(connection, newResource.getName()).isPresent(); + } + catch (SQLException e) + { + logger.warn("Error while searching for NamingSystem", e); + return false; + } + } + @Override public Optional<String> reasonReadAllowed(Connection connection, User user, NamingSystem existingResource) { @@ -99,24 +138,26 @@ public Optional<String> reasonUpdateAllowed(Connection connection, User user, Na { if (isLocalUser(user)) { - // TODO move check for name and authorization tag to validation layer - if (newResource.hasName() && hasLocalOrRemoteAuthorizationRole(newResource)) + Optional<String> errors = newResourceOk(newResource); + if (errors.isEmpty()) { - if (oldResource.getName().equals(newResource.getName())) + if (isSame(oldResource, newResource)) { - logger.info("Update of NamingSystem authorized for local user '{}', NamingSystem with name exist", + logger.info( + "Update of NamingSystem authorized for local user '{}', name same as existing NamingSystem", user.getName()); - return Optional.of("local user, NamingSystem with name exist"); + return Optional.of("local user; name same as existing NamingSystem"); } else { - logger.warn("Update of NamingSystem unauthorized, new name not equal to existing resource"); + logger.warn("Update of NamingSystem unauthorized, name changed ({} -> {})", oldResource.getName(), + newResource.getName()); return Optional.empty(); } } else { - logger.warn("Update of NamingSystem unauthorized, missing name or authorization tag"); + logger.warn("Update of NamingSystem unauthorized, " + errors.get()); return Optional.empty(); } } @@ -127,6 +168,11 @@ public Optional<String> reasonUpdateAllowed(Connection connection, User user, Na } } + private boolean isSame(NamingSystem oldResource, NamingSystem newResource) + { + return oldResource.getName().equals(newResource.getName()); + } + @Override public Optional<String> reasonDeleteAllowed(Connection connection, User user, NamingSystem oldResource) { diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/StructureDefinitionAuthorizationRule.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/StructureDefinitionAuthorizationRule.java index cbcbf7097..433529ca0 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/StructureDefinitionAuthorizationRule.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/StructureDefinitionAuthorizationRule.java @@ -150,18 +150,19 @@ public Optional<String> reasonUpdateAllowed(Connection connection, User user, St Optional<String> errors = newResourceOk(newResource); if (errors.isEmpty()) { - if (isSame(oldResource, newResource) && statusOk(oldResource, newResource)) + if (isSame(oldResource, newResource)) { logger.info( - "Update of StructureDefinition authorized for local user '{}', url and version same as existing StructureDefinition, status change {} -> {} ok", - user.getName(), oldResource.getStatus(), newResource.getStatus()); + "Update of StructureDefinition authorized for local user '{}', url and version same as existing StructureDefinition", + user.getName()); return Optional.of("local user; url and version same as existing StructureDefinition"); } else { logger.warn( - "Update of StructureDefinition unauthorized, other StructureDefinition with same url and version exists, illegal status change {} -> {}", - oldResource.getStatus(), newResource.getStatus()); + "Update of StructureDefinition unauthorized, url or version changed ({} -> {}, {} -> {})", + oldResource.getUrl(), newResource.getUrl(), oldResource.getVersion(), + newResource.getVersion()); return Optional.empty(); } } @@ -184,19 +185,6 @@ private boolean isSame(StructureDefinition oldResource, StructureDefinition newR && oldResource.getVersion().equals(newResource.getVersion()); } - private boolean statusOk(StructureDefinition oldResource, StructureDefinition newResource) - { - // draft -> draft/active/retired OK - if (PublicationStatus.DRAFT.equals(oldResource.getStatus())) - return true; - // active -> retired OK - else if (PublicationStatus.ACTIVE.equals(oldResource.getStatus()) - && PublicationStatus.RETIRED.equals(newResource.getStatus())) - return true; - else - return false; - } - @Override public Optional<String> reasonDeleteAllowed(Connection connection, User user, StructureDefinition oldResource) { diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ValueSetAuthorizationRule.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ValueSetAuthorizationRule.java index 436aa8e73..e60ae605b 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ValueSetAuthorizationRule.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ValueSetAuthorizationRule.java @@ -2,13 +2,18 @@ import java.sql.Connection; import java.sql.SQLException; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; import java.util.Optional; +import java.util.stream.Collectors; import org.highmed.dsf.fhir.authentication.OrganizationProvider; import org.highmed.dsf.fhir.authentication.User; import org.highmed.dsf.fhir.dao.ValueSetDao; import org.highmed.dsf.fhir.dao.provider.DaoProvider; import org.highmed.dsf.fhir.service.ReferenceResolver; +import org.hl7.fhir.r4.model.Enumerations.PublicationStatus; import org.hl7.fhir.r4.model.ValueSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,37 +33,25 @@ public Optional<String> reasonCreateAllowed(Connection connection, User user, Va { if (isLocalUser(user)) { - // TODO move check for url, version and authorization tag to validation layer - if (newResource.hasUrl() && newResource.hasVersion() && hasLocalOrRemoteAuthorizationRole(newResource)) + Optional<String> errors = newResourceOk(newResource); + if (errors.isEmpty()) { - try + if (!resourceExists(connection, newResource)) { - Optional<ValueSet> existing = getDao().readByUrlAndVersionWithTransaction(connection, - newResource.getUrl(), newResource.getVersion()); - if (existing.isEmpty()) - { - logger.info( - "Create of ValueSet authorized for local user '{}', ValueSet with version and url does not exist", - user.getName()); - return Optional.of("local user, ValueSet with version and url does not exist yet"); - } - else - { - logger.warn("Create of ValueSet unauthorized, ValueSet with url and version already exists"); - return Optional.empty(); - } + logger.info( + "Create of ValueSet authorized for local user '{}', ValueSet with version and url does not exist", + user.getName()); + return Optional.of("local user, ValueSet with version and url does not exist yet"); } - catch (SQLException e) + else { - logger.warn( - "Create of ValueSet unauthorized, error while checking for existing ValueSet with version and url", - e); + logger.warn("Create of ValueSet unauthorized, ValueSet with url and version already exists"); return Optional.empty(); } } else { - logger.warn("Create of ValueSet unauthorized, missing url or version or authorization tag"); + logger.warn("Create of ValueSet unauthorized, " + errors.get()); return Optional.empty(); } } @@ -69,6 +62,58 @@ public Optional<String> reasonCreateAllowed(Connection connection, User user, Va } } + private Optional<String> newResourceOk(ValueSet newResource) + { + List<String> errors = new ArrayList<String>(); + + if (newResource.hasStatus()) + { + if (!EnumSet.of(PublicationStatus.DRAFT, PublicationStatus.ACTIVE, PublicationStatus.RETIRED) + .contains(newResource.getStatus())) + { + errors.add("ValueSet.status not one of DRAFT, ACTIVE or RETIRED"); + } + } + else + { + errors.add("ValueSet.status not defined"); + } + + if (!newResource.hasUrl()) + { + errors.add("ValueSet.url not defined"); + } + if (!newResource.hasVersion()) + { + errors.add("ValueSet.version not defined"); + } + + if (!hasLocalOrRemoteAuthorizationRole(newResource)) + { + errors.add("missing authorization tag"); + } + + if (errors.isEmpty()) + return Optional.empty(); + else + return Optional.of(errors.stream().collect(Collectors.joining(", "))); + } + + private boolean resourceExists(Connection connection, ValueSet newResource) + { + try + { + return getDao() + .readByUrlAndVersionWithTransaction(connection, newResource.getUrl(), newResource.getVersion()) + .isPresent(); + } + catch (SQLException e) + { + logger.warn("Error while searching for ValueSet", e); + return false; + } + } + @Override public Optional<String> reasonReadAllowed(Connection connection, User user, ValueSet existingResource) { @@ -98,26 +143,27 @@ public Optional<String> reasonUpdateAllowed(Connection connection, User user, Va { if (isLocalUser(user)) { - // TODO move check for url, version and authorization tag to validation layer - if (newResource.hasUrl() && newResource.hasVersion() && hasLocalOrRemoteAuthorizationRole(newResource)) + Optional<String> errors = newResourceOk(newResource); + if (errors.isEmpty()) { - if (oldResource.getUrl().equals(newResource.getUrl()) - && oldResource.getVersion().equals(newResource.getVersion())) + if (isSame(oldResource, newResource)) { logger.info( - "Update of ValueSet authorized for local user '{}', ValueSet with version and url exists", + "Update of ValueSet authorized for local user '{}', url and version same as existing ValueSet", user.getName()); - return Optional.of("local user, ValueSet with version and url exists"); + return Optional.of("local user; url and version same as existing ValueSet"); } else { - logger.warn("Update of ValueSet unauthorized, new url or version not equal to existing resource"); + logger.warn("Update of ValueSet unauthorized, url or version changed ({} -> {}, {} -> {})", + oldResource.getUrl(), newResource.getUrl(), oldResource.getVersion(), + newResource.getVersion()); return Optional.empty(); } } else { - logger.warn("Update of ValueSet unauthorized, missing url or version or authorization tag"); + logger.warn("Update of ValueSet unauthorized, " + errors.get()); return Optional.empty(); } } @@ -128,6 +174,12 @@ public Optional<String> reasonUpdateAllowed(Connection connection, User user, Va } } + private boolean isSame(ValueSet oldResource, ValueSet newResource) + { + return oldResource.getUrl().equals(newResource.getUrl()) + && oldResource.getVersion().equals(newResource.getVersion()); + } + @Override public Optional<String> reasonDeleteAllowed(Connection connection, User user, ValueSet oldResource) { From b7010245a4191d29ede75568dd9f3141217a0d1a Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Sun, 29 Nov 2020 16:11:20 +0100 Subject: [PATCH 39/75] removing redundant snapshotRepository tag "The repository elements will be used for snapshot distribution if the snapshotRepository is not defined." See https://maven.apache.org/pom.html#repository --- pom.xml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index cc7d242e2..a7fd7938b 100755 --- a/pom.xml +++ b/pom.xml @@ -468,17 +468,13 @@ <distributionManagement> <!-- for deployment to GitHub Packages the id must be 'github', - if not the deployment fails with a 401 error --> + if not the deployment fails with a 401 error; + repository also used for snapshots if no snapshotRepository defined --> <repository> <id>github</id> <name>GitHub Packages</name> <url>https://maven.pkg.github.com/highmed/highmed-dsf</url> </repository> - <snapshotRepository> - <id>github</id> - <name>GitHub Packages</name> - <url>https://maven.pkg.github.com/highmed/highmed-dsf</url> - </snapshotRepository> </distributionManagement> <repositories> From ae26670bb5c17622b1cf52c13be3923f9c69b73b Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Sun, 29 Nov 2020 18:46:25 +0100 Subject: [PATCH 40/75] missing `app/process/README.md` entries in .rsync-filter files --- dsf-docker-test-setup-3medic-ttp/medic1/bpe/.rsync-filter | 1 + dsf-docker-test-setup-3medic-ttp/medic2/bpe/.rsync-filter | 1 + dsf-docker-test-setup-3medic-ttp/medic3/bpe/.rsync-filter | 1 + dsf-docker-test-setup-3medic-ttp/ttp/bpe/.rsync-filter | 1 + 4 files changed, 4 insertions(+) diff --git a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/.rsync-filter b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/.rsync-filter index fcd2e2e92..28d73bb1c 100644 --- a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/.rsync-filter +++ b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/.rsync-filter @@ -2,4 +2,5 @@ - app/last_event/README.md - app/log/README.md - app/plugin/README.md +- app/process/README.md - proxy/ssl/README.md \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/.rsync-filter b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/.rsync-filter index fcd2e2e92..28d73bb1c 100644 --- a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/.rsync-filter +++ b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/.rsync-filter @@ -2,4 +2,5 @@ - app/last_event/README.md - app/log/README.md - app/plugin/README.md +- app/process/README.md - proxy/ssl/README.md \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/.rsync-filter b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/.rsync-filter index fcd2e2e92..28d73bb1c 100644 --- a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/.rsync-filter +++ b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/.rsync-filter @@ -2,4 +2,5 @@ - app/last_event/README.md - app/log/README.md - app/plugin/README.md +- app/process/README.md - proxy/ssl/README.md \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/.rsync-filter b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/.rsync-filter index fcd2e2e92..28d73bb1c 100644 --- a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/.rsync-filter +++ b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/.rsync-filter @@ -2,4 +2,5 @@ - app/last_event/README.md - app/log/README.md - app/plugin/README.md +- app/process/README.md - proxy/ssl/README.md \ No newline at end of file From 0b6bc762b1931863b30256e0149fad0cfeff6664 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Sun, 29 Nov 2020 18:48:26 +0100 Subject: [PATCH 41/75] spring app context per plugin not per process, distinct serializers --- .../dsf/bpe/delegate/DelegateProviderImpl.java | 3 ++- .../ProcessPluginDefinitionAndClassLoader.java | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java index dfddc9303..fe68e98c3 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java @@ -60,6 +60,7 @@ public ApplicationContext getApplicationContext(ProcessKeyAndVersion processKeyA public Stream<TypedValueSerializer> getAdditionalTypedValueSerializers() { return applicationContextByProcessDefinitionKeyAndVersion.values().stream() - .map(ctx -> ctx.getBeansOfType(TypedValueSerializer.class)).flatMap(m -> m.values().stream()); + .map(ctx -> ctx.getBeansOfType(TypedValueSerializer.class)).distinct() + .flatMap(m -> m.values().stream()); } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java index ad2a67f7e..fdd58fa45 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java @@ -29,6 +29,7 @@ public class ProcessPluginDefinitionAndClassLoader private final boolean draft; private List<BpmnFileAndModel> models; + private AnnotationConfigApplicationContext context; private ResourceProvider resourceProvider; public ProcessPluginDefinitionAndClassLoader(FhirContext fhirContext, List<Path> jars, @@ -61,11 +62,15 @@ public ClassLoader getClassLoader() public ApplicationContext createPluginApplicationContext(ApplicationContext mainContext) { - AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); - context.setParent(mainContext); - context.setClassLoader(getClassLoader()); - context.register(getDefinition().getSpringConfigClasses().toArray(Class<?>[]::new)); - context.refresh(); + if (context == null) + { + context = new AnnotationConfigApplicationContext(); + context.setParent(mainContext); + context.setClassLoader(getClassLoader()); + context.register(getDefinition().getSpringConfigClasses().toArray(Class<?>[]::new)); + context.refresh(); + } + return context; } From d85fa1172867a783105549014df0dae2b8913ab4 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Sun, 29 Nov 2020 18:49:12 +0100 Subject: [PATCH 42/75] added missing feasibility serializers to local services plugin --- .../highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index c2803cf70..6e616b439 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -6,6 +6,7 @@ import java.util.stream.Stream; import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.spring.config.FeasibilitySerializerConfig; import org.highmed.dsf.bpe.spring.config.LocalServicesConfig; import org.highmed.dsf.fhir.resources.AbstractResource; import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; @@ -44,7 +45,7 @@ public Stream<String> getBpmnFiles() @Override public Stream<Class<?>> getSpringConfigClasses() { - return Stream.of(LocalServicesConfig.class); + return Stream.of(LocalServicesConfig.class, FeasibilitySerializerConfig.class); } @Override From 7532f04bbb1ced83a9ae6336fa986d72b13836bf Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 30 Nov 2020 00:27:03 +0100 Subject: [PATCH 43/75] support for same name serializers from multiple process plugins --- .../camunda/FallbackSerializerFactory.java | 149 ++++++++++++++++++ .../dsf/bpe/delegate/DelegateProvider.java | 4 +- .../bpe/delegate/DelegateProviderImpl.java | 9 +- .../dsf/bpe/spring/config/CamundaConfig.java | 26 ++- 4 files changed, 166 insertions(+), 22 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/FallbackSerializerFactory.java diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/FallbackSerializerFactory.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/FallbackSerializerFactory.java new file mode 100644 index 000000000..0af1b86b2 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/camunda/FallbackSerializerFactory.java @@ -0,0 +1,149 @@ +package org.highmed.dsf.bpe.camunda; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.camunda.bpm.engine.impl.variable.serializer.AbstractTypedValueSerializer; +import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; +import org.camunda.bpm.engine.impl.variable.serializer.ValueFields; +import org.camunda.bpm.engine.impl.variable.serializer.VariableSerializerFactory; +import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl; +import org.camunda.bpm.engine.variable.value.PrimitiveValue; +import org.camunda.bpm.engine.variable.value.TypedValue; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.InitializingBean; + +public class FallbackSerializerFactory implements VariableSerializerFactory, InitializingBean +{ + public static final class TypedValueSerializerWrapper<T extends TypedValue> extends AbstractTypedValueSerializer<T> + { + final TypedValueSerializer<T> delegate; + + TypedValueSerializerWrapper(TypedValueSerializer<T> delegate) + { + super(delegate.getType()); + + this.delegate = delegate; + } + + ClassLoader getClassLoader() + { + return delegate.getClass().getClassLoader(); + } + + @Override + public String getName() + { + return getClassLoader().getName() + "/" + delegate.getName(); + } + + @Override + public void writeValue(T value, ValueFields valueFields) + { + delegate.writeValue(value, valueFields); + } + + @Override + public T readValue(ValueFields valueFields, boolean deserializeValue, boolean isTransient) + { + return delegate.readValue(valueFields, deserializeValue, isTransient); + } + + @Override + public T convertToTypedValue(UntypedValueImpl untypedValue) + { + return delegate.convertToTypedValue(untypedValue); + } + + @Override + public boolean canHandle(TypedValue value) + { + return delegate.canHandle(value); + } + + @Override + protected boolean canWriteValue(TypedValue value) + { + throw new UnsupportedOperationException("canWriteValue method not supported"); + } + } + + private static final Logger logger = LoggerFactory.getLogger(FallbackSerializerFactory.class); + + @SuppressWarnings("rawtypes") + private final Map<ClassLoader, List<TypedValueSerializer>> serializersByClassLoader; + @SuppressWarnings("rawtypes") + private final Map<String, TypedValueSerializer> serializersByName; + + @SuppressWarnings("unchecked") + public FallbackSerializerFactory(@SuppressWarnings("rawtypes") List<TypedValueSerializer> serializers) + { + if (serializers != null) + { + serializers = serializers.stream().map(TypedValueSerializerWrapper::new).collect(Collectors.toList()); + + serializersByClassLoader = serializers.stream() + .collect(Collectors.groupingBy(s -> s.getType().getClass().getClassLoader(), + Collectors.mapping(Function.identity(), Collectors.toList()))); + serializersByName = serializers.stream() + .collect(Collectors.toMap(TypedValueSerializer::getName, Function.identity())); + } + else + { + serializersByClassLoader = new HashMap<>(); + serializersByName = new HashMap<>(); + } + } + + @Override + public void afterPropertiesSet() throws Exception + { + int serializersCount = serializersByClassLoader.values().stream().mapToInt(List::size).sum(); + String serializers = serializersByClassLoader + .entrySet().stream().map(e -> e.getKey().getName() + ": " + e.getValue().stream() + .map(s -> s.getClass().getName()).collect(Collectors.joining(", ", "[", "]"))) + .collect(Collectors.joining(", ")); + + logger.info("{} variable process plugin serializer{} configured", serializersCount, + serializersCount != 1 ? "s" : ""); + logger.debug("Variable serializer{}: {}", serializersCount != 1 ? "s" : "", serializers); + } + + @Override + public TypedValueSerializer<?> getSerializer(String serializerName) + { + if (serializerName == null) + return null; + + logger.debug("Getting serializer for {}", serializerName); + return serializersByName.getOrDefault(serializerName, null); + } + + @Override + public TypedValueSerializer<?> getSerializer(TypedValue value) + { + if (value == null) + return null; + + logger.debug("Getting serializer for {} from class loader {}", getName(value), + value.getType().getClass().getClassLoader().getName()); + + ClassLoader classLoader = value.getType().getClass().getClassLoader(); + return serializersByClassLoader.getOrDefault(classLoader, Collections.emptyList()).stream() + .filter(s -> s.getType().equals(value.getType())).findFirst().orElse(null); + } + + @SuppressWarnings("rawtypes") + private String getName(TypedValue value) + { + if (value instanceof PrimitiveValue) + return ((PrimitiveValue) value).getType().getJavaType().getName(); + else + return value.getType().getName(); + } +} diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java index 35ac2b2e5..8485e267a 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProvider.java @@ -1,6 +1,6 @@ package org.highmed.dsf.bpe.delegate; -import java.util.stream.Stream; +import java.util.List; import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; @@ -28,5 +28,5 @@ public interface DelegateProvider * @return additional {@link TypedValueSerializer}s from the plugin to deploy into the process engine */ @SuppressWarnings("rawtypes") - Stream<TypedValueSerializer> getAdditionalTypedValueSerializers(); + List<TypedValueSerializer> getTypedValueSerializers(); } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java index fe68e98c3..8a30cc156 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/delegate/DelegateProviderImpl.java @@ -1,8 +1,9 @@ package org.highmed.dsf.bpe.delegate; +import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Stream; +import java.util.stream.Collectors; import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; @@ -57,10 +58,10 @@ public ApplicationContext getApplicationContext(ProcessKeyAndVersion processKeyA @SuppressWarnings("rawtypes") @Override - public Stream<TypedValueSerializer> getAdditionalTypedValueSerializers() + public List<TypedValueSerializer> getTypedValueSerializers() { return applicationContextByProcessDefinitionKeyAndVersion.values().stream() - .map(ctx -> ctx.getBeansOfType(TypedValueSerializer.class)).distinct() - .flatMap(m -> m.values().stream()); + .map(ctx -> ctx.getBeansOfType(TypedValueSerializer.class)).distinct().flatMap(m -> m.values().stream()) + .collect(Collectors.toList()); } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java index a4ed05e75..932604420 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/CamundaConfig.java @@ -5,13 +5,13 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; import org.apache.commons.dbcp2.BasicDataSource; import org.camunda.bpm.engine.impl.variable.serializer.TypedValueSerializer; +import org.camunda.bpm.engine.impl.variable.serializer.VariableSerializerFactory; import org.camunda.bpm.engine.spring.ProcessEngineFactoryBean; import org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration; +import org.highmed.dsf.bpe.camunda.FallbackSerializerFactory; import org.highmed.dsf.bpe.camunda.MultiVersionSpringProcessEngineConfiguration; import org.highmed.dsf.bpe.delegate.DelegateProvider; import org.highmed.dsf.bpe.delegate.DelegateProviderImpl; @@ -23,8 +23,6 @@ import org.highmed.dsf.bpe.plugin.ProcessPluginProviderImpl; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.postgresql.Driver; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationContext; @@ -37,8 +35,6 @@ @Configuration public class CamundaConfig { - private static final Logger logger = LoggerFactory.getLogger(CamundaConfig.class); - @Value("${org.highmed.dsf.bpe.db.url}") private String dbUrl; @@ -114,11 +110,6 @@ public DefaultBpmnParseListener defaultBpmnParseListener() public SpringProcessEngineConfiguration processEngineConfiguration( @SuppressWarnings("rawtypes") List<TypedValueSerializer> baseSerializers) throws IOException { - @SuppressWarnings("rawtypes") - List<TypedValueSerializer> serializers = Stream - .concat(baseSerializers.stream(), delegateProvider().getAdditionalTypedValueSerializers()) - .collect(Collectors.toList()); - var c = new MultiVersionSpringProcessEngineConfiguration(delegateProvider()); c.setProcessEngineName("highmed"); c.setDataSource(transactionAwareDataSource()); @@ -126,15 +117,18 @@ public SpringProcessEngineConfiguration processEngineConfiguration( c.setDatabaseSchemaUpdate("false"); c.setJobExecutorActivate(true); c.setCustomPreBPMNParseListeners(List.of(defaultBpmnParseListener())); - - logger.info("{} variable serializer{} configured", serializers.size(), serializers.size() != 1 ? "s" : ""); - logger.debug("Variable serializer{}: {}", serializers.size() != 1 ? "s" : "", - serializers.stream().map(p -> p.getClass().getName()).collect(Collectors.joining(", ", "[", "]"))); - c.setCustomPreVariableSerializers(serializers); + c.setCustomPreVariableSerializers(baseSerializers); + c.setFallbackSerializerFactory(getFallbackSerializerFactory()); return c; } + @Bean + public VariableSerializerFactory getFallbackSerializerFactory() + { + return new FallbackSerializerFactory(delegateProvider().getTypedValueSerializers()); + } + @Bean public DelegateProvider delegateProvider() { From 7cff583dbb11a5c24f4ed1ecacdf56737dcbfe14 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 30 Nov 2020 00:27:31 +0100 Subject: [PATCH 44/75] shell script to start all ansible upload playbooks --- .../ansible-upload-all.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 dsf-docker-test-setup-3medic-ttp/ansible-upload-all.sh diff --git a/dsf-docker-test-setup-3medic-ttp/ansible-upload-all.sh b/dsf-docker-test-setup-3medic-ttp/ansible-upload-all.sh new file mode 100644 index 000000000..b936e218c --- /dev/null +++ b/dsf-docker-test-setup-3medic-ttp/ansible-upload-all.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +cd ttp +ansible-playbook upload.yml +cd ../medic1 +ansible-playbook upload.yml +cd ../medic2 +ansible-playbook upload.yml +cd ../medic3 +ansible-playbook upload.yml +cd .. From 5895dc4b323005a8069e8453c03f3f1462ae603d Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Tue, 8 Dec 2020 21:06:14 +0100 Subject: [PATCH 45/75] add reference type to extension, make ansible-upload-all.sh executable --- .../dsf/bpe/service/DownloadResearchStudyResource.java | 9 +++++---- dsf-docker-test-setup-3medic-ttp/ansible-upload-all.sh | 0 2 files changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 dsf-docker-test-setup-3medic-ttp/ansible-upload-all.sh diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java index 73ef9874d..55c81a09a 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java @@ -12,6 +12,7 @@ import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.fhir.client.FhirWebserviceClient; import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.Identifier; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResearchStudy; import org.hl7.fhir.r4.model.Task; @@ -101,11 +102,11 @@ private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirW if (!identifiers.isEmpty()) { - identifiers.forEach(identifier -> researchStudy - .addExtension(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI, - new Reference().getIdentifier() + identifiers.forEach(identifier -> researchStudy.addExtension() + .setUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI).setValue( + new Reference().setType("Organization").setIdentifier(new Identifier() .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue(identifier))); + .setValue(identifier)))); return update(researchStudy, client); } diff --git a/dsf-docker-test-setup-3medic-ttp/ansible-upload-all.sh b/dsf-docker-test-setup-3medic-ttp/ansible-upload-all.sh old mode 100644 new mode 100755 From 0ca3882ad1f2d9b1e15d4f6360e6dfc6b17fe610 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Wed, 9 Dec 2020 07:50:53 +0100 Subject: [PATCH 46/75] adds log if organization is missingin research study --- .../service/DownloadResearchStudyResource.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java index 55c81a09a..6015007c2 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java @@ -102,11 +102,17 @@ private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirW if (!identifiers.isEmpty()) { - identifiers.forEach(identifier -> researchStudy.addExtension() - .setUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI).setValue( - new Reference().setType("Organization").setIdentifier(new Identifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue(identifier)))); + identifiers.forEach(identifier -> { + logger.warn( + "Adding missing organization with identifier='{}' to feasibility research study with id='{}'", + identifier, researchStudy.getId()); + + researchStudy.addExtension().setUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI).setValue( + new Reference().setType("Organization").setIdentifier(new Identifier() + .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + .setValue(identifier))); + + }); return update(researchStudy, client); } From d7066c614cda3e35f6bc4a631e19348fd2dacee2 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Wed, 9 Dec 2020 07:54:08 +0100 Subject: [PATCH 47/75] use constants in update resource process --- dsf-bpe/dsf-bpe-process-base/pom.xml | 20 ++++++- .../bpe/start/ConstantsExampleStarters.java | 19 ++++++ .../dsf-bpe-process-update-resources/pom.xml | 9 ++- .../variables/ConstantsUpdateResources.java | 5 ++ ...UpdateResource3MedicTtpExampleStarter.java | 58 ++++++++++++------- dsf-bpe/pom.xml | 8 +++ 6 files changed, 95 insertions(+), 24 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java diff --git a/dsf-bpe/dsf-bpe-process-base/pom.xml b/dsf-bpe/dsf-bpe-process-base/pom.xml index c13242436..d355632b5 100755 --- a/dsf-bpe/dsf-bpe-process-base/pom.xml +++ b/dsf-bpe/dsf-bpe-process-base/pom.xml @@ -1,5 +1,5 @@ <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>dsf-bpe-process-base</artifactId> @@ -15,7 +15,7 @@ <groupId>org.highmed.dsf</groupId> <artifactId>dsf-fhir-webservice-client</artifactId> </dependency> - + <dependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-pseudonymization-medic</artifactId> @@ -54,4 +54,20 @@ <scope>test</scope> </dependency> </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java new file mode 100644 index 000000000..6a3ccccc6 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java @@ -0,0 +1,19 @@ +package org.highmed.dsf.bpe.start; + +public interface ConstantsExampleStarters +{ + String CERTIFICATE_PATH = "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"; + char[] CERTIFICATE_PASSWORD = "password".toCharArray(); + + String TTP_FHIR_BASE_URL = "https://ttp/fhir/"; + String ORGANIZATION_IDENTIFIER_VALUE_TTP = "Test_TTP"; + + String MEDIC_1_FHIR_BASE_URL = "https://medic1/fhir/"; + String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1 = "Test_MeDIC_1"; + + String MEDIC_2_FHIR_BASE_URL = "https://medic2/fhir/"; + String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2 = "Test_MeDIC_2"; + + String MEDIC_3_FHIR_BASE_URL = "https://medic3/fhir/"; + String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3 = "Test_MeDIC_3"; +} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml index e2a483009..c0036c02d 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml @@ -16,7 +16,8 @@ <artifactId>dsf-bpe-process-base</artifactId> <scope>provided</scope> </dependency> - + + <dependency> <groupId>de.hs-heilbronn.mi</groupId> <artifactId>log4j2-utils</artifactId> @@ -27,6 +28,12 @@ <artifactId>dsf-fhir-validation</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-base</artifactId> + <scope>test</scope> + <type>test-jar</type> + </dependency> </dependencies> <build> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java index 6036c2e9d..3a16583a7 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java @@ -5,4 +5,9 @@ public interface ConstantsUpdateResources String CODESYSTEM_HIGHMED_UPDATE_RESOURCE = "http://highmed.org/fhir/CodeSystem/update-resources"; String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE = "bundle-reference"; String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER = "organization-identifier-search-parameter"; + + String REQUEST_UPDATE_RESOURCES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"; + String REQUEST_UPDATE_RESOURCES_PROCESS_URI = "http://highmed.org/bpe/Process/requestUpdateResources"; + String REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION = "0.4.0"; + String REQUEST_UPDATE_RESOURCES_MESSAGE_NAME = "requestUpdateResourcesMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index ded78a77a..6e363303f 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -1,5 +1,20 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; + import java.io.IOException; import java.nio.file.Paths; import java.security.KeyStore; @@ -18,12 +33,14 @@ import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; import org.hl7.fhir.r4.model.Task.TaskStatus; import ca.uhn.fhir.context.FhirContext; + import de.rwh.utils.crypto.CertificateHelper; import de.rwh.utils.crypto.io.CertificateReader; @@ -32,19 +49,17 @@ public class UpdateResource3MedicTtpExampleStarter public static void main(String[] args) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { - char[] keyStorePassword = "password".toCharArray(); - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get( - "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"), - keyStorePassword); + KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); KeyStore trustStore = CertificateHelper.extractTrust(keyStore); FhirContext context = FhirContext.forR4(); ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey("https://ttp/fhir/", trustStore, keyStore, - keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); + FhirWebserviceClient client = new FhirWebserviceClientJersey(TTP_FHIR_BASE_URL, trustStore, keyStore, + CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); + if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) throw new IllegalStateException("Expected a single allow list Bundle"); Bundle allowList = (Bundle) searchResult.getEntryFirstRep().getResource(); @@ -52,28 +67,29 @@ public static void main(String[] args) System.out.println(context.newXmlParser().encodeResourceToString(allowList)); Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestUpdateResources/0.4.0"); + task.getMeta().addProfile(REQUEST_UPDATE_RESOURCES_TASK_PROFILE); + task.setInstantiatesUri( + REQUEST_UPDATE_RESOURCES_PROCESS_URI + "/" + REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.addInput().setValue(new StringType("requestUpdateResourcesMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(REQUEST_UPDATE_RESOURCES_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput() - .setValue(new Reference(new IdType("Bundle", allowList.getIdElement().getIdPart(), - allowList.getIdElement().getVersionIdPart()))) - .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-resources") - .setCode("bundle-reference"); + task.addInput().setValue(new Reference( + new IdType(ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), + allowList.getIdElement().getVersionIdPart()))).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) + .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); task.addInput().setValue(new StringType("http://highmed.org/fhir/NamingSystem/organization-identifier|")) - .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-resources") - .setCode("organization-identifier-search-parameter"); + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) + .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER); client.withMinimalReturn().create(task); } diff --git a/dsf-bpe/pom.xml b/dsf-bpe/pom.xml index daedfe86c..146c82148 100755 --- a/dsf-bpe/pom.xml +++ b/dsf-bpe/pom.xml @@ -200,6 +200,14 @@ <scope>import</scope> <type>pom</type> </dependency> + + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-base</artifactId> + <version>${project.version}</version> + <scope>test</scope> + <type>test-jar</type> + </dependency> </dependencies> </dependencyManagement> </project> \ No newline at end of file From 72b0d893241a5ebbd4713145d9c5b1d68913046a Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Thu, 10 Dec 2020 14:02:47 +0100 Subject: [PATCH 48/75] remove not anymore needed plugin example processes --- .../dsf-bpe-process-child/pom.xml | 21 ------ .../dsf/bpe/ChildProcessPluginDefinition.java | 33 --------- .../dsf/bpe/service/ExecutePlugin.java | 24 ------- .../dsf/bpe/spring/config/ChildConfig.java | 24 ------- .../org.highmed.dsf.ProcessPluginDefinition | 1 - .../src/main/resources/child.bpmn | 41 ----------- .../dsf-bpe-process-parent/pom.xml | 21 ------ .../bpe/ParentProcessPluginDefinition.java | 55 -------------- .../highmed/dsf/bpe/service/AfterPlugin.java | 24 ------- .../highmed/dsf/bpe/service/BeforePlugin.java | 24 ------- .../dsf/bpe/spring/config/ParentConfig.java | 31 -------- .../org.highmed.dsf.ProcessPluginDefinition | 1 - .../src/main/resources/bpe/parent.bpmn | 71 ------------------- .../highmed-task-parent-plugin.xml | 55 -------------- .../start/PluginSubprocessExampleStarter.java | 58 --------------- .../dsf-bpe-process-service-overwrite/pom.xml | 20 ------ .../service/SelectPingTargetsOverwrite.java | 28 -------- .../spring/config/ServiceOverwriteConfig.java | 31 -------- .../dsf-bpe-process-plugin-example/pom.xml | 28 -------- 19 files changed, 591 deletions(-) delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/service/ExecutePlugin.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/spring/config/ChildConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/child.bpmn delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/service/AfterPlugin.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/service/BeforePlugin.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/spring/config/ParentConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/test/java/org/highmed/dsf/bpe/start/PluginSubprocessExampleStarter.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/pom.xml delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargetsOverwrite.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/src/main/java/org/highmed/dsf/bpe/spring/config/ServiceOverwriteConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-plugin-example/pom.xml diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml deleted file mode 100644 index 2a668c40c..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <artifactId>dsf-bpe-process-child</artifactId> - - <parent> - <artifactId>dsf-bpe-process-plugin-example</artifactId> - <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> - </parent> - - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> -</project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java deleted file mode 100644 index 73dcf2bd4..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/ChildProcessPluginDefinition.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.highmed.dsf.bpe; - -import java.util.stream.Stream; - -import org.highmed.dsf.ProcessPluginDefinition; -import org.highmed.dsf.bpe.spring.config.ChildConfig; - -public class ChildProcessPluginDefinition implements ProcessPluginDefinition -{ - @Override - public String getVersion() - { - return "0.4.0"; - } - - @Override - public String getName() - { - return "dsf-bpe-process-child-0.4.0"; - } - - @Override - public Stream<String> getBpmnFiles() - { - return Stream.of("child.bpmn"); - } - - @Override - public Stream<Class<?>> getSpringConfigClasses() - { - return Stream.of(ChildConfig.class); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/service/ExecutePlugin.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/service/ExecutePlugin.java deleted file mode 100644 index 38138f6d4..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/service/ExecutePlugin.java +++ /dev/null @@ -1,24 +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.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ExecutePlugin extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(ExecutePlugin.class); - - public ExecutePlugin(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - logger.info("Execute plugin was called"); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/spring/config/ChildConfig.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/spring/config/ChildConfig.java deleted file mode 100644 index 5c1ec6d71..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/java/org/highmed/dsf/bpe/spring/config/ChildConfig.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.highmed.dsf.bpe.service.ExecutePlugin; -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; - -@Configuration -public class ChildConfig -{ - @Autowired - private FhirWebserviceClientProvider clientProvider; - - @Autowired - private TaskHelper taskHelper; - - @Bean - public ExecutePlugin executePlugin() - { - return new ExecutePlugin(clientProvider, taskHelper); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition deleted file mode 100644 index a74d5aa92..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition +++ /dev/null @@ -1 +0,0 @@ -org.highmed.dsf.bpe.PingProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/child.bpmn b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/child.bpmn deleted file mode 100644 index 1c9f095d9..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-child/src/main/resources/child.bpmn +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0btlyt4" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> - <bpmn:process id="childPlugin" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:startEvent id="StartEvent"> - <bpmn:outgoing>SequenceFlow_1u0czdh</bpmn:outgoing> - </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_1u0czdh" sourceRef="StartEvent" targetRef="executePlugin" /> - <bpmn:endEvent id="EndEvent" name="success"> - <bpmn:incoming>SequenceFlow_1f0v7zb</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_1f0v7zb" sourceRef="executePlugin" targetRef="EndEvent" /> - <bpmn:serviceTask id="executePlugin" name="execute plugin" camunda:class="org.highmed.dsf.bpe.service.ExecutePlugin"> - <bpmn:incoming>SequenceFlow_1u0czdh</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1f0v7zb</bpmn:outgoing> - </bpmn:serviceTask> - </bpmn:process> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="childPlugin"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent"> - <dc:Bounds x="173" y="102" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1u0czdh_di" bpmnElement="SequenceFlow_1u0czdh"> - <di:waypoint x="209" y="120" /> - <di:waypoint x="281" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_06n7rng_di" bpmnElement="EndEvent"> - <dc:Bounds x="457" y="102" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="456" y="145" width="40" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1f0v7zb_di" bpmnElement="SequenceFlow_1f0v7zb"> - <di:waypoint x="381" y="120" /> - <di:waypoint x="457" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0eyi6x9_di" bpmnElement="executePlugin"> - <dc:Bounds x="281" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml deleted file mode 100644 index 5bd65ad42..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <artifactId>dsf-bpe-process-parent</artifactId> - - <parent> - <artifactId>dsf-bpe-process-plugin-example</artifactId> - <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> - </parent> - - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> -</project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java deleted file mode 100644 index ce41ccba9..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/ParentProcessPluginDefinition.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.highmed.dsf.bpe; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -import org.highmed.dsf.ProcessPluginDefinition; -import org.highmed.dsf.bpe.spring.config.ParentConfig; -import org.highmed.dsf.fhir.resources.AbstractResource; -import org.highmed.dsf.fhir.resources.ResourceProvider; -import org.highmed.dsf.fhir.resources.StructureDefinitionResource; - -import ca.uhn.fhir.context.FhirContext; - -public class ParentProcessPluginDefinition implements ProcessPluginDefinition -{ - public static final String VERSION = "0.4.0"; - - @Override - public String getVersion() - { - return VERSION; - } - - @Override - public String getName() - { - return "dsf-bpe-process-parent"; - } - - @Override - public Stream<String> getBpmnFiles() - { - return Stream.of("bpe/parent.bpmn"); - } - - @Override - public Stream<Class<?>> getSpringConfigClasses() - { - return Stream.of(ParentConfig.class); - } - - @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) - { - var sT = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-parent-plugin.xml"); - - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("parentPlugin/" + VERSION, - Arrays.asList(sT)); - - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/service/AfterPlugin.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/service/AfterPlugin.java deleted file mode 100644 index 6e446d60a..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/service/AfterPlugin.java +++ /dev/null @@ -1,24 +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.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AfterPlugin extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(AfterPlugin.class); - - public AfterPlugin(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - logger.info("After plugin was called"); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/service/BeforePlugin.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/service/BeforePlugin.java deleted file mode 100644 index db6ac1b0b..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/service/BeforePlugin.java +++ /dev/null @@ -1,24 +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.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class BeforePlugin extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(BeforePlugin.class); - - public BeforePlugin(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - logger.info("Before plugin was called"); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/spring/config/ParentConfig.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/spring/config/ParentConfig.java deleted file mode 100644 index f0b9bf9b5..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/java/org/highmed/dsf/bpe/spring/config/ParentConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.highmed.dsf.bpe.service.AfterPlugin; -import org.highmed.dsf.bpe.service.BeforePlugin; -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; - -@Configuration -public class ParentConfig -{ - @Autowired - private FhirWebserviceClientProvider clientProvider; - - @Autowired - private TaskHelper taskHelper; - - @Bean - public BeforePlugin beforePlugin() - { - return new BeforePlugin(clientProvider, taskHelper); - } - - @Bean - public AfterPlugin afterPlugin() - { - return new AfterPlugin(clientProvider, taskHelper); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition deleted file mode 100644 index 58b6f2b66..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition +++ /dev/null @@ -1 +0,0 @@ -org.highmed.dsf.bpe.ParentProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn deleted file mode 100644 index 3b1eb3451..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/bpe/parent.bpmn +++ /dev/null @@ -1,71 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1ij9ts4" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4"> - <bpmn:process id="parentPlugin" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:sequenceFlow id="SequenceFlow_1ogejv7" sourceRef="StartEvent" targetRef="beforePlugin" /> - <bpmn:endEvent id="EndEvent" name="success"> - <bpmn:incoming>SequenceFlow_1uvl6af</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_10h1j1a" sourceRef="beforePlugin" targetRef="executeSubprocess" /> - <bpmn:startEvent id="StartEvent"> - <bpmn:outgoing>SequenceFlow_1ogejv7</bpmn:outgoing> - <bpmn:messageEventDefinition messageRef="Message_0p71dqr" /> - </bpmn:startEvent> - <bpmn:serviceTask id="beforePlugin" name="before plugin" camunda:class="org.highmed.dsf.bpe.service.BeforePlugin"> - <bpmn:incoming>SequenceFlow_1ogejv7</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_10h1j1a</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_1uvl6af" sourceRef="afterPlugin" targetRef="EndEvent" /> - <bpmn:serviceTask id="afterPlugin" name="after plugin" camunda:class="org.highmed.dsf.bpe.service.AfterPlugin"> - <bpmn:incoming>SequenceFlow_00k7wb9</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1uvl6af</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_00k7wb9" sourceRef="executeSubprocess" targetRef="afterPlugin" /> - <bpmn:callActivity id="executeSubprocess" name="execute subprocess" calledElement="childPlugin" camunda:calledElementBinding="versionTag" camunda:calledElementVersionTag="0.4.0"> - <bpmn:extensionElements> - <camunda:in variables="all" /> - <camunda:out variables="all" /> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_10h1j1a</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_00k7wb9</bpmn:outgoing> - </bpmn:callActivity> - </bpmn:process> - <bpmn:message id="Message_0p71dqr" name="parentPluginMessage" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="parentPlugin"> - <bpmndi:BPMNEdge id="SequenceFlow_1ogejv7_di" bpmnElement="SequenceFlow_1ogejv7"> - <di:waypoint x="94" y="120" /> - <di:waypoint x="177" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_1upzsnu_di" bpmnElement="EndEvent"> - <dc:Bounds x="913" y="102" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="911" y="145" width="40" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_10h1j1a_di" bpmnElement="SequenceFlow_10h1j1a"> - <di:waypoint x="277" y="120" /> - <di:waypoint x="430" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="StartEvent_17ylrhd_di" bpmnElement="StartEvent"> - <dc:Bounds x="58" y="102" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_07qx0pg_di" bpmnElement="beforePlugin"> - <dc:Bounds x="177" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1uvl6af_di" bpmnElement="SequenceFlow_1uvl6af"> - <di:waypoint x="800" y="120" /> - <di:waypoint x="913" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1nvp20x_di" bpmnElement="afterPlugin"> - <dc:Bounds x="700" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_00k7wb9_di" bpmnElement="SequenceFlow_00k7wb9"> - <di:waypoint x="530" y="120" /> - <di:waypoint x="700" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="CallActivity_0tnso7q_di" bpmnElement="executeSubprocess"> - <dc:Bounds x="430" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml deleted file mode 100644 index 9eedeea15..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/main/resources/fhir/StructureDefinition/highmed-task-parent-plugin.xml +++ /dev/null @@ -1,55 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-parent-plugin" /> - <!-- version managed by bpe --> - <version value="bpe-managed" /> - <name value="ParentPlugin" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/parentPlugin/0.4.0" /> - </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="parentPluginMessage" /> - </element> - <element id="Task.input:business-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="business-key" /> - <max value="0" /> - </element> - <element id="Task.input:correlation-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="correlation-key" /> - <max value="0" /> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/test/java/org/highmed/dsf/bpe/start/PluginSubprocessExampleStarter.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/test/java/org/highmed/dsf/bpe/start/PluginSubprocessExampleStarter.java deleted file mode 100644 index f08145d7d..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-parent/src/test/java/org/highmed/dsf/bpe/start/PluginSubprocessExampleStarter.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.highmed.dsf.bpe.start; - -import java.io.IOException; -import java.nio.file.Paths; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.util.Date; - -import org.highmed.dsf.fhir.service.ReferenceCleaner; -import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; -import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.highmed.fhir.client.FhirWebserviceClientJersey; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.TaskIntent; -import org.hl7.fhir.r4.model.Task.TaskStatus; - -import ca.uhn.fhir.context.FhirContext; - -import de.rwh.utils.crypto.CertificateHelper; -import de.rwh.utils.crypto.io.CertificateReader; - -public class PluginSubprocessExampleStarter -{ - public static void main(String[] args) - throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException - { - char[] keyStorePassword = "password".toCharArray(); - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get( - "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"), - keyStorePassword); - KeyStore trustStore = CertificateHelper.extractTrust(keyStore); - - FhirContext context = FhirContext.forR4(); - ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey("https://medic1/fhir/", trustStore, keyStore, - keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); - - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-parent-plugin"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/parentPlugin/0.3.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - - task.addInput().setValue(new StringType("parentPluginMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - - client.create(task); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/pom.xml deleted file mode 100644 index 057b22971..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <artifactId>dsf-bpe-process-service-overwrite</artifactId> - - <parent> - <artifactId>dsf-bpe-process-plugin-example</artifactId> - <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> - </parent> - - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-ping</artifactId> - </dependency> - </dependencies> -</project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargetsOverwrite.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargetsOverwrite.java deleted file mode 100644 index 7b99f5af0..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargetsOverwrite.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SelectPingTargetsOverwrite extends SelectPingTargets -{ - private static final Logger logger = LoggerFactory.getLogger(SelectPingTargetsOverwrite.class); - - public SelectPingTargetsOverwrite(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) - { - super(clientProvider, taskHelper, organizationProvider); - } - - @Override - public void doExecute(DelegateExecution execution) throws Exception - { - logger.info("--- THIS OVERWRITES SelectPingTargets AND STOPS THE PROCESS EXECUTION ---"); - - execution.getProcessEngine().getRuntimeService().deleteProcessInstance(execution.getProcessInstanceId(), - "Only for demonstration of SelectPingTargets overwrite with plugin"); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/src/main/java/org/highmed/dsf/bpe/spring/config/ServiceOverwriteConfig.java b/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/src/main/java/org/highmed/dsf/bpe/spring/config/ServiceOverwriteConfig.java deleted file mode 100644 index de4bb57e4..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/dsf-bpe-process-service-overwrite/src/main/java/org/highmed/dsf/bpe/spring/config/ServiceOverwriteConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.highmed.dsf.bpe.service.SelectPingTargets; -import org.highmed.dsf.bpe.service.SelectPingTargetsOverwrite; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; - -@Configuration -public class ServiceOverwriteConfig -{ - @Autowired - private FhirWebserviceClientProvider clientProvider; - - @Autowired - private OrganizationProvider organizationProvider; - - @Autowired - private TaskHelper taskHelper; - - @Bean - @Primary - public SelectPingTargets selectPingTargetsOverwrite() - { - return new SelectPingTargetsOverwrite(clientProvider, taskHelper, organizationProvider); - } -} diff --git a/dsf-bpe/dsf-bpe-process-plugin-example/pom.xml b/dsf-bpe/dsf-bpe-process-plugin-example/pom.xml deleted file mode 100644 index b84a4a17f..000000000 --- a/dsf-bpe/dsf-bpe-process-plugin-example/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <artifactId>dsf-bpe-pom</artifactId> - <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> - </parent> - - <artifactId>dsf-bpe-process-plugin-example</artifactId> - <packaging>pom</packaging> - - <modules> - <module>dsf-bpe-process-child</module> - <module>dsf-bpe-process-parent</module> - <module>dsf-bpe-process-service-overwrite</module> - </modules> - - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - </dependency> - </dependencies> -</project> \ No newline at end of file From 0f388e3f24d54a8696b1b66dfbb56cc7e51546b9 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Thu, 10 Dec 2020 14:33:20 +0100 Subject: [PATCH 49/75] remove plugin example modules as well from pom --- ....java => LocalServicesMedic1ExampleStarter.java} | 0 ... => UpdateAllowListProcessPluginDefinition.java} | 0 ... => UpdateResourcesProcessPluginDefinition.java} | 0 dsf-bpe/pom.xml | 13 ------------- 4 files changed, 13 deletions(-) rename dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/{RequestLocalServicesIntegrationTestExampleStarter.java => LocalServicesMedic1ExampleStarter.java} (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/{UpdateAllowListPluginDefinition.java => UpdateAllowListProcessPluginDefinition.java} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/{UpdateResourcesPluginDefinition.java => UpdateResourcesProcessPluginDefinition.java} (100%) diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/RequestLocalServicesIntegrationTestExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java similarity index 100% rename from dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/RequestLocalServicesIntegrationTestExampleStarter.java rename to dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListPluginDefinition.java rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesPluginDefinition.java rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java diff --git a/dsf-bpe/pom.xml b/dsf-bpe/pom.xml index 146c82148..c886be649 100755 --- a/dsf-bpe/pom.xml +++ b/dsf-bpe/pom.xml @@ -15,7 +15,6 @@ <module>dsf-bpe-process-base</module> <module>dsf-bpe-process-feasibility</module> <module>dsf-bpe-process-ping</module> - <module>dsf-bpe-process-plugin-example</module> <module>dsf-bpe-process-update-resources</module> <module>dsf-bpe-process-update-allow-list</module> <module>dsf-bpe-server</module> @@ -84,18 +83,6 @@ <artifactId>dsf-bpe-process-local-services</artifactId> <version>${project.version}</version> </dependency> - <!-- provided as jar and injected on startup as plugin - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-parent</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-child</artifactId> - <version>${project.version}</version> - </dependency> - --> <dependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-process-ping</artifactId> From d7e302cc508fd5f93f5d4ed5d5dd38c6139901d6 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Thu, 10 Dec 2020 16:26:55 +0100 Subject: [PATCH 50/75] use contstant in all test starters --- .../bpe/start/ConstantsExampleStarters.java | 4 - dsf-bpe/dsf-bpe-process-feasibility/pom.xml | 6 + .../dsf/bpe/service/GenerateBloomFilters.java | 2 +- .../bpe/variables/ConstantsFeasibility.java | 13 +- ...lityFromMedicsViaMedic1ExampleStarter.java | 118 ++++++++++-------- .../dsf-bpe-process-local-services/pom.xml | 6 + .../bpe/variables/ConstantsLocalServices.java | 13 ++ .../LocalServicesMedic1ExampleStarter.java | 61 +++++---- dsf-bpe/dsf-bpe-process-ping/pom.xml | 6 + .../dsf/bpe/variables/ConstantsPing.java | 12 ++ .../Ping3MedicFromTtpExampleStarter.java | 38 +++--- .../dsf-bpe-process-update-allow-list/pom.xml | 6 + ...pdateAllowListProcessPluginDefinition.java | 2 +- .../variables/ConstantsUpdateAllowList.java | 16 +++ .../org.highmed.dsf.ProcessPluginDefinition | 2 +- ...lowListFromTtpViaMedic1ExampleStarter.java | 57 +++++---- ...pdateAllowList3MedicTtpExampleStarter.java | 37 +++--- ...pdateResourcesProcessPluginDefinition.java | 2 +- .../variables/ConstantsUpdateResources.java | 3 + .../org.highmed.dsf.ProcessPluginDefinition | 2 +- ...UpdateResource3MedicTtpExampleStarter.java | 6 +- 21 files changed, 277 insertions(+), 135 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java create mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java index 6a3ccccc6..8f1994275 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java @@ -10,10 +10,6 @@ public interface ConstantsExampleStarters String MEDIC_1_FHIR_BASE_URL = "https://medic1/fhir/"; String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1 = "Test_MeDIC_1"; - - String MEDIC_2_FHIR_BASE_URL = "https://medic2/fhir/"; String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2 = "Test_MeDIC_2"; - - String MEDIC_3_FHIR_BASE_URL = "https://medic3/fhir/"; String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3 = "Test_MeDIC_3"; } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml index e94e4b254..6f93b7a6b 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml @@ -28,6 +28,12 @@ <artifactId>dsf-fhir-validation</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-base</artifactId> + <scope>test</scope> + <type>test-jar</type> + </dependency> </dependencies> <build> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java index cc84e62b7..380a4ed7e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java @@ -99,7 +99,7 @@ private String getSecurityIdentifier(DelegateExecution execution) { Task task = getCurrentTaskFromExecutionVariables(); - if (task.getInstantiatesUri().startsWith(ConstantsFeasibility.LOCAL_SERVICES_INTEGRATION_PROCESS_URI)) + if (task.getInstantiatesUri().startsWith(ConstantsFeasibility.LOCAL_SERVICES_PROCESS_URI)) return task.getRequester().getIdentifier().getValue(); else return (String) execution.getVariable(ConstantsBase.VARIABLE_TTP_IDENTIFIER); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java index fdd9d693a..13170641c 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java @@ -36,5 +36,16 @@ public interface ConstantsFeasibility String EXTENSION_PARTICIPATING_TTP_URI = "http://highmed.org/fhir/StructureDefinition/participating-ttp"; String EXTENSION_GROUP_ID_URI = "http://highmed.org/fhir/StructureDefinition/group-id"; - String LOCAL_SERVICES_INTEGRATION_PROCESS_URI = "http://highmed.org/bpe/Process/localServicesIntegration"; + String FEASIBILITY_RESEARCH_STUDY_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility"; + String GROUP_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-group"; + String RESEARCH_STUDY_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/research-study-identifier"; + + String REQUEST_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility"; + String LOCAL_SERVICES_PROCESS_URI = "http://highmed.org/bpe/Process/localServicesIntegration"; + String REQUEST_FEASIBILITY_PROCESS_URI = "http://highmed.org/bpe/Process/requestSimpleFeasibility"; + String REQUEST_FEASIBILITY_PROCESS_LATEST_VERSION = "0.4.0"; + String REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = + REQUEST_FEASIBILITY_PROCESS_URI + "/" + REQUEST_FEASIBILITY_PROCESS_LATEST_VERSION; + + String REQUEST_FEASIBILITY_MESSAGE_NAME = "requestSimpleFeasibilityMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java index 8d65a5577..b1de319f9 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -1,5 +1,29 @@ 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.EXTENSION_QUERY_URI; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.FEASIBILITY_RESEARCH_STUDY_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.GROUP_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.RESEARCH_STUDY_IDENTIFIER_SYSTEM; + import java.io.IOException; import java.nio.file.Paths; import java.security.KeyStore; @@ -31,6 +55,7 @@ import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResearchStudy; import org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; @@ -46,16 +71,13 @@ public class RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter public static void main(String[] args) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { - char[] keyStorePassword = "password".toCharArray(); - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get( - "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"), - keyStorePassword); + KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); KeyStore trustStore = CertificateHelper.extractTrust(keyStore); FhirContext context = FhirContext.forR4(); ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey("https://medic1/fhir/", trustStore, keyStore, - keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); + FhirWebserviceClient client = new FhirWebserviceClientJersey(MEDIC_1_FHIR_BASE_URL, trustStore, keyStore, + CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); try { @@ -67,13 +89,13 @@ public static void main(String[] args) Bundle bundle = new Bundle(); bundle.setType(BundleType.TRANSACTION); bundle.addEntry().setResource(group1).setFullUrl(group1.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl("Group"); + .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); bundle.addEntry().setResource(group2).setFullUrl(group2.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl("Group"); + .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); bundle.addEntry().setResource(researchStudy).setFullUrl(researchStudy.getIdElement().getIdPart()) - .getRequest().setMethod(HTTPVerb.POST).setUrl("ResearchStudy"); + .getRequest().setMethod(HTTPVerb.POST).setUrl(ResourceType.ResearchStudy.name()); bundle.addEntry().setResource(task).setFullUrl(task.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl("Task"); + .setMethod(HTTPVerb.POST).setUrl(ResourceType.Task.name()); client.withMinimalReturn().postBundle(bundle); } @@ -95,13 +117,13 @@ private static Group createGroup(String name) Group group = new Group(); group.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - group.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-group"); + group.getMeta().addProfile(GROUP_PROFILE); group.getText().getDiv().addText("This is the description"); group.getText().setStatus(Narrative.NarrativeStatus.ADDITIONAL); group.setType(GroupType.PERSON); group.setActual(false); group.setActive(true); - group.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/query").setValue( + group.addExtension().setUrl(EXTENSION_QUERY_URI).setValue( new Expression().setLanguageElement(ConstantsBase.AQL_QUERY_TYPE) .setExpression("SELECT COUNT(e) FROM EHR e")); group.setName(name); @@ -114,30 +136,29 @@ private static ResearchStudy createResearchStudy(Group group1, Group group2) ResearchStudy researchStudy = new ResearchStudy(); researchStudy.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - researchStudy.getMeta() - .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility"); - researchStudy.addIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/research-study-identifier") + researchStudy.getMeta().addProfile(FEASIBILITY_RESEARCH_STUDY_PROFILE); + researchStudy.addIdentifier().setSystem(RESEARCH_STUDY_IDENTIFIER_SYSTEM) .setValue(UUID.randomUUID().toString()); researchStudy.setStatus(ResearchStudyStatus.ACTIVE); researchStudy.addEnrollment().setReference(group1.getIdElement().getIdPart()); researchStudy.addEnrollment().setReference(group2.getIdElement().getIdPart()); - researchStudy.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-medic").setValue( - new Reference().setType("Organization").setIdentifier( - new Identifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_MeDIC_1"))); - researchStudy.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-medic").setValue( - new Reference().setType("Organization").setIdentifier( - new Identifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_MeDIC_2"))); - researchStudy.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-medic").setValue( - new Reference().setType("Organization").setIdentifier( - new Identifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_MeDIC_3"))); - researchStudy.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-ttp").setValue( - new Reference().setType("Organization").setIdentifier( - new Identifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") - .setValue("Test_TTP"))); + researchStudy.addExtension().setUrl(EXTENSION_PARTICIPATING_MEDIC_URI).setValue( + new Reference().setType(ResourceType.Organization.name()).setIdentifier( + new Identifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) + .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1))); + researchStudy.addExtension().setUrl(EXTENSION_PARTICIPATING_MEDIC_URI).setValue( + new Reference().setType(ResourceType.Organization.name()).setIdentifier( + new Identifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) + .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2))); + researchStudy.addExtension().setUrl(EXTENSION_PARTICIPATING_MEDIC_URI).setValue( + new Reference().setType(ResourceType.Organization.name()).setIdentifier( + new Identifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) + .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3))); + researchStudy.addExtension().setUrl(EXTENSION_PARTICIPATING_TTP_URI).setValue( + new Reference().setType(ResourceType.Organization.name()).setIdentifier( + new Identifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) + .setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP))); return researchStudy; } @@ -147,27 +168,26 @@ private static Task createTask(ResearchStudy researchStudy) Task task = new Task(); task.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - task.getMeta() - .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0"); + task.getMeta().addProfile(REQUEST_FEASIBILITY_TASK_PROFILE); + task.setInstantiatesUri(REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - - task.addInput().setValue(new StringType("requestSimpleFeasibilityMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - task.addInput().setValue( - new Reference().setReference(researchStudy.getIdElement().getIdPart()).setType("ResearchStudy")) - .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/feasibility") - .setCode("research-study-reference"); - task.addInput().setValue(new BooleanType(true)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-record-linkage"); - task.addInput().setValue(new BooleanType(true)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-consent-check"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + + task.addInput().setValue(new StringType(REQUEST_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new Reference().setReference(researchStudy.getIdElement().getIdPart()) + .setType(ResourceType.ResearchStudy.name())).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); + task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); + task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); return task; } diff --git a/dsf-bpe/dsf-bpe-process-local-services/pom.xml b/dsf-bpe/dsf-bpe-process-local-services/pom.xml index 2e6c8523d..07744ae1e 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/pom.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/pom.xml @@ -34,6 +34,12 @@ <artifactId>dsf-fhir-validation</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-base</artifactId> + <scope>test</scope> + <type>test-jar</type> + </dependency> </dependencies> <build> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java new file mode 100644 index 000000000..cf940b2c3 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java @@ -0,0 +1,13 @@ +package org.highmed.dsf.bpe.variables; + +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.LOCAL_SERVICES_PROCESS_URI; + +public interface ConstantsLocalServices +{ + String LOCAL_SERVICES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"; + String LOCAL_SERVICES_PROCESS_LATEST_VERSION = "0.4.0"; + String LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION = + LOCAL_SERVICES_PROCESS_URI + "/" + LOCAL_SERVICES_PROCESS_LATEST_VERSION; + + String LOCAL_SERVICES_MESSAGE_NAME = "localServicesIntegrationMessage"; +} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java index 3961d4180..4018f4479 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java @@ -1,5 +1,22 @@ package org.highmed.dsf.bpe.start; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_TASK_PROFILE; + import java.io.IOException; import java.nio.file.Paths; import java.security.KeyStore; @@ -13,15 +30,16 @@ import javax.ws.rs.WebApplicationException; import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; -import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.fhir.client.FhirWebserviceClient; import org.highmed.fhir.client.FhirWebserviceClientJersey; import org.hl7.fhir.r4.model.Base64BinaryType; import org.hl7.fhir.r4.model.BooleanType; import org.hl7.fhir.r4.model.OperationOutcome; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; @@ -30,21 +48,18 @@ import de.rwh.utils.crypto.CertificateHelper; import de.rwh.utils.crypto.io.CertificateReader; -public class RequestLocalServicesIntegrationTestExampleStarter +public class LocalServicesMedic1ExampleStarter { public static void main(String[] args) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { - char[] keyStorePassword = "password".toCharArray(); - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get( - "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"), - keyStorePassword); + KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); KeyStore trustStore = CertificateHelper.extractTrust(keyStore); FhirContext context = FhirContext.forR4(); ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey("https://medic1/fhir/", trustStore, keyStore, - keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); + FhirWebserviceClient client = new FhirWebserviceClientJersey(MEDIC_1_FHIR_BASE_URL, trustStore, keyStore, + CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); try { @@ -69,28 +84,28 @@ private static Task createTask(boolean needsConsentCheck, boolean needsRecordLin { Task task = new Task(); - task.getMeta() - .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/localServicesIntegration/0.4.0"); + task.getMeta().addProfile(LOCAL_SERVICES_TASK_PROFILE); + task.setInstantiatesUri(LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(Task.TaskStatus.REQUESTED); task.setIntent(Task.TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.addInput().setValue(new StringType("localServicesIntegrationMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/query-type") - .setCode("application/x-aql-query"); + .setSystem(CODESYSTEM_QUERY_TYPE).setCode(CODESYSTEM_QUERY_TYPE_AQL); task.addInput().setValue(new BooleanType(needsConsentCheck)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-consent-check"); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); task.addInput().setValue(new BooleanType(needsRecordLinkage)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-record-linkage"); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); if (needsRecordLinkage) { @@ -100,8 +115,8 @@ private static Task createTask(boolean needsConsentCheck, boolean needsRecordLin KeyGenerator.getInstance("HmacSHA3-256", bouncyCastleProvider).generateKey()); task.addInput().setValue(new Base64BinaryType(bloomFilterConfig.toBytes())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility") - .setCode("bloom-filter-configuration"); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); } return task; diff --git a/dsf-bpe/dsf-bpe-process-ping/pom.xml b/dsf-bpe/dsf-bpe-process-ping/pom.xml index 54c1025e0..84b576124 100755 --- a/dsf-bpe/dsf-bpe-process-ping/pom.xml +++ b/dsf-bpe/dsf-bpe-process-ping/pom.xml @@ -27,6 +27,12 @@ <artifactId>dsf-fhir-validation</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-base</artifactId> + <scope>test</scope> + <type>test-jar</type> + </dependency> </dependencies> <build> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java new file mode 100644 index 000000000..863dff40e --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java @@ -0,0 +1,12 @@ +package org.highmed.dsf.bpe.variables; + +public interface ConstantsPing +{ + String START_PING_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"; + String START_PING_PROCESS_URI = "http://highmed.org/bpe/Process/ping"; + String START_PING_PROCESS_LATEST_VERSION = "0.4.0"; + String START_PING_PROCESS_URI_AND_LATEST_VERSION = + START_PING_PROCESS_URI + "/" + START_PING_PROCESS_LATEST_VERSION; + + String START_PING_MESSAGE_NAME = "startPingProcessMessage"; +} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index b276e2db9..a5c94e4d4 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -1,5 +1,16 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; +import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_TASK_PROFILE; + import java.io.IOException; import java.nio.file.Paths; import java.security.KeyStore; @@ -13,12 +24,14 @@ import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; import org.highmed.fhir.client.FhirWebserviceClient; import org.highmed.fhir.client.FhirWebserviceClientJersey; +import org.hl7.fhir.r4.model.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 ca.uhn.fhir.context.FhirContext; + import de.rwh.utils.crypto.CertificateHelper; import de.rwh.utils.crypto.io.CertificateReader; @@ -27,30 +40,27 @@ public class Ping3MedicFromTtpExampleStarter public static void main(String[] args) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { - char[] keyStorePassword = "password".toCharArray(); - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get( - "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"), - keyStorePassword); + KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); KeyStore trustStore = CertificateHelper.extractTrust(keyStore); FhirContext context = FhirContext.forR4(); ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey("https://ttp/fhir/", trustStore, keyStore, - keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); + FhirWebserviceClient client = new FhirWebserviceClientJersey(TTP_FHIR_BASE_URL, trustStore, keyStore, + CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.4.0"); + task.getMeta().addProfile(START_PING_TASK_PROFILE); + task.setInstantiatesUri(START_PING_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.addInput().setValue(new StringType("startPingProcessMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(START_PING_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); client.withMinimalReturn().create(task); } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml index 663a114c5..72d268256 100755 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml @@ -27,6 +27,12 @@ <artifactId>dsf-fhir-validation</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-base</artifactId> + <scope>test</scope> + <type>test-jar</type> + </dependency> </dependencies> <build> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java index 89f45d63c..a6c0d5f9f 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java @@ -16,7 +16,7 @@ import ca.uhn.fhir.context.FhirContext; -public class UpdateAllowListPluginDefinition implements ProcessPluginDefinition +public class UpdateAllowListProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "0.4.0"; diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java index dc6816a43..3dd781af9 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java @@ -4,4 +4,20 @@ public interface ConstantsUpdateAllowList { String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST = "http://highmed.org/fhir/CodeSystem/update-allow-list"; String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST = "highmed_allow_list"; + + String DOWNLOAD_ALLOW_LIST_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"; + String DOWNLOAD_ALLOW_LIST_PROCESS_URI = "http://highmed.org/bpe/Process/downloadAllowList"; + String DOWNLOAD_ALLOW_LIST_PROCESS_LATEST_VERSION = "0.4.0"; + String DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = + DOWNLOAD_ALLOW_LIST_PROCESS_URI + "/" + DOWNLOAD_ALLOW_LIST_PROCESS_LATEST_VERSION; + + String DOWNLOAD_ALLOW_LIST_MESSAGE_NAME = "downloadAllowListMessage"; + + String UPDATE_ALLOW_LIST_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"; + String UPDATE_ALLOW_LIST_PROCESS_URI = "http://highmed.org/bpe/Process/updateAllowList"; + String UPDATE_ALLOW_LIST_PROCESS_LATEST_VERSION = "0.4.0"; + String UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = + UPDATE_ALLOW_LIST_PROCESS_URI + "/" + UPDATE_ALLOW_LIST_PROCESS_LATEST_VERSION; + + String UPDATE_ALLOW_LIST_MESSAGE_NAME = "updateAllowListMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition index 446f88a30..cd27d36b4 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition @@ -1 +1 @@ -org.highmed.dsf.bpe.UpdateAllowListPluginDefinition \ No newline at end of file +org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index 7c9466881..ec1068610 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -1,5 +1,19 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_TASK_PROFILE; + import java.io.IOException; import java.nio.file.Paths; import java.security.KeyStore; @@ -18,12 +32,14 @@ import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; import org.hl7.fhir.r4.model.Task.TaskStatus; import ca.uhn.fhir.context.FhirContext; + import de.rwh.utils.crypto.CertificateHelper; import de.rwh.utils.crypto.io.CertificateReader; @@ -32,47 +48,46 @@ public class DownloadAllowListFromTtpViaMedic1ExampleStarter public static void main(String[] args) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { - char[] keyStorePassword = "password".toCharArray(); - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get( - "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"), - keyStorePassword); + KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); KeyStore trustStore = CertificateHelper.extractTrust(keyStore); FhirContext context = FhirContext.forR4(); ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient ttpClient = new FhirWebserviceClientJersey("https://ttp/fhir/", trustStore, keyStore, - keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); + FhirWebserviceClient ttpClient = new FhirWebserviceClientJersey(TTP_FHIR_BASE_URL, trustStore, keyStore, + CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); Bundle searchResult = ttpClient.searchWithStrictHandling(Bundle.class, Map.of("identifier", Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); + if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) throw new IllegalStateException("Expected a single allow list Bundle"); Bundle allowList = (Bundle) searchResult.getEntryFirstRep().getResource(); System.out.println(context.newXmlParser().encodeResourceToString(allowList)); - FhirWebserviceClient client = new FhirWebserviceClientJersey("https://medic1/fhir/", trustStore, keyStore, - keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); + FhirWebserviceClient client = new FhirWebserviceClientJersey(MEDIC_1_FHIR_BASE_URL, trustStore, keyStore, + CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.4.0"); + task.getMeta().addProfile(DOWNLOAD_ALLOW_LIST_TASK_PROFILE); + task.setInstantiatesUri(DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) + .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) + .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.addInput().setValue(new StringType("downloadAllowListMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - task.addInput() - .setValue(new Reference(new IdType("https://ttp/fhir", "Bundle", allowList.getIdElement().getIdPart(), - allowList.getIdElement().getVersionIdPart()))) - .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") - .setCode("highmed_allow_list"); + task.addInput().setValue(new StringType(DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new Reference( + new IdType(TTP_FHIR_BASE_URL, ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), + allowList.getIdElement().getVersionIdPart()))).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST).setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); client.withMinimalReturn().create(task); } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index cf57bcf09..029df8738 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -1,5 +1,16 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_TASK_PROFILE; + import java.io.IOException; import java.nio.file.Paths; import java.security.KeyStore; @@ -13,6 +24,7 @@ import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; import org.highmed.fhir.client.FhirWebserviceClient; import org.highmed.fhir.client.FhirWebserviceClientJersey; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; @@ -28,30 +40,27 @@ public class UpdateAllowList3MedicTtpExampleStarter public static void main(String[] args) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { - char[] keyStorePassword = "password".toCharArray(); - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get( - "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"), - keyStorePassword); + KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); KeyStore trustStore = CertificateHelper.extractTrust(keyStore); FhirContext context = FhirContext.forR4(); ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey("https://ttp/fhir/", trustStore, keyStore, - keyStorePassword, null, null, null, 0, 0, null, context, referenceCleaner); + FhirWebserviceClient client = new FhirWebserviceClientJersey(TTP_FHIR_BASE_URL, trustStore, keyStore, + CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.4.0"); + task.getMeta().addProfile(UPDATE_ALLOW_LIST_TASK_PROFILE); + task.setInstantiatesUri(UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); client.withMinimalReturn().create(task); } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java index 375bec410..8480efcee 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java @@ -16,7 +16,7 @@ import ca.uhn.fhir.context.FhirContext; -public class UpdateResourcesPluginDefinition implements ProcessPluginDefinition +public class UpdateResourcesProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "0.4.0"; diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java index 3a16583a7..b213efc30 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java @@ -9,5 +9,8 @@ public interface ConstantsUpdateResources String REQUEST_UPDATE_RESOURCES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"; String REQUEST_UPDATE_RESOURCES_PROCESS_URI = "http://highmed.org/bpe/Process/requestUpdateResources"; String REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION = "0.4.0"; + String REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = + REQUEST_UPDATE_RESOURCES_PROCESS_URI + "/" + REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION; + String REQUEST_UPDATE_RESOURCES_MESSAGE_NAME = "requestUpdateResourcesMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition index 775c8c6fa..b6dca76c2 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition @@ -1 +1 @@ -org.highmed.dsf.bpe.UpdateResourcesPluginDefinition \ No newline at end of file +org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index 6e363303f..f1e360b95 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -11,8 +11,7 @@ import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; import java.io.IOException; @@ -68,8 +67,7 @@ public static void main(String[] args) Task task = new Task(); task.getMeta().addProfile(REQUEST_UPDATE_RESOURCES_TASK_PROFILE); - task.setInstantiatesUri( - REQUEST_UPDATE_RESOURCES_PROCESS_URI + "/" + REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION); + task.setInstantiatesUri(REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); From 54c0ec60bc93d5149d9560b5e75b46c0f9b72706 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Thu, 10 Dec 2020 17:10:16 +0100 Subject: [PATCH 51/75] use constants as well in processes --- .../main/java/org/highmed/dsf/bpe/ConstantsBase.java | 1 + .../dsf/bpe/service/CheckFeasibilityResources.java | 4 +++- .../bpe/service/DownloadFeasibilityResources.java | 5 +++-- .../bpe/service/DownloadResearchStudyResource.java | 12 ++++++++---- .../dsf/bpe/service/GenerateBloomFilters.java | 9 ++++++--- .../highmed/dsf/bpe/service/ExtractInputValues.java | 4 +++- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java index 2981c3ef3..8d9ca0b11 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java @@ -34,6 +34,7 @@ public interface ConstantsBase String ORGANIZATION_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/organization-identifier"; String ORGANIZATION_TYPE_SYSTEM = "http://highmed.org/fhir/CodeSystem/organization-type"; String ORGANIZATION_TYPE_TTP = "TTP"; + String ORGANIZATION_TYPE_MEDIC = "MeDIC"; String ENDPOINT_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/endpoint-identifier"; String EXTENSION_QUERY_URI = "http://highmed.org/fhir/StructureDefinition/query"; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java index dfe142642..da934ab2e 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java @@ -1,5 +1,7 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; + import java.util.List; import org.camunda.bpm.engine.delegate.DelegateExecution; @@ -38,7 +40,7 @@ private void checkNumberOfParticipatingMedics(ResearchStudy researchStudy) long medics = researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI).stream() .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) .map(r -> r.getIdentifier()) - .filter(i -> "http://highmed.org/fhir/NamingSystem/organization-identifier".equals(i.getSystem())) + .filter(i -> ORGANIZATION_IDENTIFIER_SYSTEM.equals(i.getSystem())) .map(i -> i.getValue()).distinct().count(); if (medics < ConstantsFeasibility.MIN_PARTICIPATING_MEDICS) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java index 79dbe9fa9..4829474e0 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java @@ -1,5 +1,7 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; + import java.util.Collections; import java.util.List; import java.util.Map; @@ -150,8 +152,7 @@ private List<Group> getCohortDefinitions(Bundle bundle, String baseUrl) private String getTtpIdentifier(ResearchStudy researchStudy, FhirWebserviceClient client) { - Extension ext = researchStudy - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/participating-ttp"); + Extension ext = researchStudy.getExtensionByUrl(EXTENSION_PARTICIPATING_TTP_URI); Reference ref = (Reference) ext.getValue(); return ref.getIdentifier().getValue(); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java index 6015007c2..9841b0107 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java @@ -1,5 +1,8 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_TYPE_MEDIC; + import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -15,6 +18,7 @@ import org.hl7.fhir.r4.model.Identifier; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResearchStudy; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.Task; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -88,9 +92,9 @@ private ResearchStudy getResearchStudy(IdType researchStudyid, FhirWebserviceCli private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirWebserviceClient client) { - List<String> identifiers = organizationProvider.getOrganizationsByType("MeDIC") + List<String> identifiers = organizationProvider.getOrganizationsByType(ORGANIZATION_TYPE_MEDIC) .flatMap(o -> o.getIdentifier().stream()) - .filter(i -> "http://highmed.org/fhir/NamingSystem/organization-identifier".equals(i.getSystem())) + .filter(i -> ORGANIZATION_IDENTIFIER_SYSTEM.equals(i.getSystem())) .map(i -> i.getValue()).collect(Collectors.toList()); List<String> existingIdentifiers = researchStudy @@ -108,8 +112,8 @@ private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirW identifier, researchStudy.getId()); researchStudy.addExtension().setUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI).setValue( - new Reference().setType("Organization").setIdentifier(new Identifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + new Reference().setType(ResourceType.Organization.name()).setIdentifier(new Identifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) .setValue(identifier))); }); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java index 380a4ed7e..ce8d913da 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java @@ -1,5 +1,7 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; + import java.security.Key; import java.util.List; import java.util.Objects; @@ -28,6 +30,7 @@ import org.hl7.fhir.r4.model.Binary; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.Task; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -147,13 +150,13 @@ protected String saveResultSetAsBinaryForTtp(ResultSet resultSet, String securit { byte[] content = serializeResultSet(resultSet); Reference securityContext = new Reference(); - securityContext.setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue(securityIdentifier); + securityContext.setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(securityIdentifier); Binary binary = new Binary().setContentType(ConstantsBase.OPENEHR_MIMETYPE_JSON) .setSecurityContext(securityContext).setData(content); IdType created = createBinaryResource(binary); - return new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl(), "Binary", created.getIdPart(), + return new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl(), ResourceType.Binary.name(), created.getIdPart(), created.getVersionIdPart()).getValue(); } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java index 153050401..1e892a489 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java @@ -1,5 +1,7 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_QUERY_URI; + import java.util.List; import java.util.UUID; import java.util.stream.Collectors; @@ -61,7 +63,7 @@ private List<Group> getCohortDefinitions(Stream<String> queries) return queries.map(q -> { Group group = new Group(); group.setIdElement(new IdType(UUID.randomUUID().toString())); - group.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/query").setValue( + group.addExtension().setUrl(EXTENSION_QUERY_URI).setValue( new Expression().setLanguageElement(ConstantsBase.AQL_QUERY_TYPE).setExpression(q)); return group; }).collect(Collectors.toList()); From 4de79ab6680e0af357994b975cef5b1c9640a18c Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Fri, 11 Dec 2020 09:34:07 +0100 Subject: [PATCH 52/75] more updates in constants, use constants as well in tests --- .../org/highmed/dsf/bpe/ConstantsBase.java | 18 +- .../bpe/delegate/AbstractServiceDelegate.java | 2 +- .../fhir/task/AbstractTaskMessageSend.java | 2 +- .../dsf/bpe/message/SendMultiMedicErrors.java | 4 +- .../bpe/message/SendMultiMedicResults.java | 6 +- .../bpe/service/CheckMultiMedicResults.java | 4 +- .../highmed/dsf/bpe/service/CheckQueries.java | 2 +- .../bpe/service/CheckSingleMedicResults.java | 2 +- .../CheckTtpComputedMultiMedicResults.java | 6 +- .../dsf/bpe/service/DownloadResultSets.java | 9 +- .../dsf/bpe/service/GenerateBloomFilters.java | 9 +- .../service/HandleErrorMultiMedicResults.java | 4 +- .../bpe/variables/ConstantsFeasibility.java | 50 ++- .../bpe/computeSimpleFeasibility.bpmn | 2 +- .../requestSimpleFeasibility.xml | 2 +- .../highmed-task-error-simple-feasibility.xml | 2 +- ...lityFromMedicsViaMedic1ExampleStarter.java | 5 +- .../dsf/fhir/profile/GroupProfileTest.java | 24 +- .../profile/ResearchStudyProfileTest.java | 28 +- .../dsf/fhir/profile/TaskProfileTest.java | 316 ++++++++++-------- .../bpe/variables/ConstantsLocalServices.java | 2 +- .../dsf/fhir/profile/TaskProfileTest.java | 52 +-- .../dsf/bpe/variables/ConstantsPing.java | 19 +- .../Ping3MedicFromTtpExampleStarter.java | 4 +- .../dsf/fhir/profiles/TaskProfileTest.java | 103 +++--- .../variables/ConstantsUpdateAllowList.java | 12 +- .../dsf/fhir/profile/TaskProfileTest.java | 83 ++--- .../variables/ConstantsUpdateResources.java | 14 +- .../dsf/fhir/profile/TaskProfileTest.java | 57 ++-- .../dsf/fhir/group/GroupHelperImpl.java | 12 +- .../highmed/dsf/fhir/task/TaskHandler.java | 2 +- 31 files changed, 493 insertions(+), 364 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java index 8d9ca0b11..bbbd64c7f 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java @@ -19,15 +19,22 @@ public interface ConstantsBase String VARIABLE_TTP_IDENTIFIER = "ttp"; /** - * Used to distinguish if I am at the moment in a process called by another process by a CallActivity or not + * Used to distinguish if I am at the moment in a process called + * by another process by a CallActivity or not */ String VARIABLE_IN_CALLED_PROCESS = "inCalledProcess"; + String EXTENSION_QUERY_URI = "http://highmed.org/fhir/StructureDefinition/query"; + String CODESYSTEM_QUERY_TYPE = "http://highmed.org/fhir/CodeSystem/query-type"; + String CODESYSTEM_QUERY_TYPE_AQL = "application/x-aql-query"; + CodeType AQL_QUERY_TYPE = new CodeType(CODESYSTEM_QUERY_TYPE_AQL).setSystem(CODESYSTEM_QUERY_TYPE); + String OPENEHR_MIMETYPE_JSON = "application/json"; + String CODESYSTEM_HIGHMED_BPMN = "http://highmed.org/fhir/CodeSystem/bpmn-message"; String CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME = "message-name"; String CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY = "business-key"; String CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY = "correlation-key"; - String CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE = "error"; + String CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR = "error"; String PROCESS_URI_BASE = "http://highmed.org/bpe/Process/"; @@ -36,11 +43,4 @@ public interface ConstantsBase String ORGANIZATION_TYPE_TTP = "TTP"; String ORGANIZATION_TYPE_MEDIC = "MeDIC"; String ENDPOINT_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/endpoint-identifier"; - - String EXTENSION_QUERY_URI = "http://highmed.org/fhir/StructureDefinition/query"; - String CODESYSTEM_QUERY_TYPE = "http://highmed.org/fhir/CodeSystem/query-type"; - String CODESYSTEM_QUERY_TYPE_AQL = "application/x-aql-query"; - CodeType AQL_QUERY_TYPE = new CodeType(CODESYSTEM_QUERY_TYPE_AQL).setSystem(CODESYSTEM_QUERY_TYPE); - - String OPENEHR_MIMETYPE_JSON = "application/json"; } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java index 9b84d1322..70021a5cc 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java @@ -73,7 +73,7 @@ public final void execute(DelegateExecution execution) throws Exception + execution.getActivityInstanceId() + ", reason: " + exception.getMessage(); task.addOutput(taskHelper.createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, errorMessage)); + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); task.setStatus(Task.TaskStatus.FAILED); clientProvider.getLocalWebserviceClient().withMinimalReturn().update(task); diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java index 25c94ffe4..115a035c4 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java @@ -88,7 +88,7 @@ public void doExecute(DelegateExecution execution) throws Exception Task task = getLeadingTaskFromExecutionVariables(); task.addOutput(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, errorMessage)); + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java index fc92e19b8..999e44dca 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java @@ -1,7 +1,7 @@ package org.highmed.dsf.bpe.message; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; import java.util.stream.Stream; @@ -34,7 +34,7 @@ protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecut .getReference(); Task.ParameterComponent input = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, + .createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, "An error occurred while calculating the multi medic feasibility result for " + "all defined cohorts, see task with url='" + taskUrl + "'"); return Stream.of(input); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java index 34c3c2908..ec77f9da8 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java @@ -1,7 +1,7 @@ package org.highmed.dsf.bpe.message; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; import java.util.List; import java.util.stream.Stream; @@ -76,7 +76,7 @@ private Stream<ParameterComponent> getErrorInput(DelegateExecution execution) task.getIdElement().getIdPart())).getReference(); Task.ParameterComponent input = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, + .createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, "Errors occurred for missing cohorts while calculating their multi medic feasibility " + "result, see task with url='" + taskUrl + "'"); return Stream.of(input); @@ -89,6 +89,6 @@ private boolean hasErrorOutput(List<Task.TaskOutputComponent> outputs) { return outputs.stream().anyMatch(output -> output.getType().getCoding().stream().anyMatch( coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_BPMN) && coding.getCode() - .equals(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE))); + .equals(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR))); } } \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java index 7c2b1fbe0..d3d55bb1b 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java @@ -49,10 +49,10 @@ private void addFinalFeasibilityQueryErrorsToLeadingTask(Task toRead, Task toWri toRead.getInput().stream() .filter(in -> in.hasType() && in.getType().hasCoding() && ConstantsBase.CODESYSTEM_HIGHMED_BPMN .equals(in.getType().getCodingFirstRep().getSystem()) - && ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE + && ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR .equals(in.getType().getCodingFirstRep().getCode())).forEach(in -> toWrite.getOutput() .add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, in.getValue().primitiveValue()))); + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, in.getValue().primitiveValue()))); } private FinalFeasibilityQueryResults readFinalFeasibilityQueryResultsFromCurrentTask(Task task) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java index c07f090b8..92e4659b3 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java @@ -61,7 +61,7 @@ protected void doExecute(DelegateExecution execution) throws Exception logger.info(errorMessage); leadingTask.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, errorMessage)); + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); } else { diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java index 018a56fdc..b784ad438 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java @@ -71,6 +71,6 @@ private void addError(Task task, String cohortId, String error) logger.info(errorMessage); task.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, errorMessage)); + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java index 64fe40293..91e1423ac 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java @@ -1,7 +1,7 @@ package org.highmed.dsf.bpe.service; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.ERROR_CODE_MULTI_MEDIC_RESULT; import java.util.List; @@ -67,7 +67,7 @@ private List<FinalFeasibilityQueryResult> filterResultsByParticipatingMedics(Tas result.getCohortId(), taskId, businessKey, correlationKey); leadingTask.getOutput().add(getTaskHelper() - .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, + .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, "Removed result with cohort id='" + result.getCohortId() + "' from feasibility request because of not enough participating MeDICs")); @@ -93,7 +93,7 @@ private boolean checkIfAtLeastOneResultExists(Task leadingTask, List<FinalFeasib businessKey, correlationKey); leadingTask.getOutput().add(getTaskHelper() - .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, + .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, "Did not receive enough results from participating MeDICs for any cohort definition")); return false; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java index ad286c6f5..8ec330cb3 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java @@ -1,5 +1,7 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.OPENEHR_MIMETYPE_JSON; + import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -9,14 +11,13 @@ import javax.ws.rs.core.MediaType; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.ConstantsFeasibility; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.fhir.client.FhirWebserviceClient; import org.highmed.openehr.model.structure.ResultSet; import org.hl7.fhir.r4.model.IdType; @@ -80,7 +81,7 @@ private InputStream readBinaryResource(FhirWebserviceClient client, String id) try { logger.info("Reading binary from {} with id {}", client.getBaseUrl(), id); - return client.readBinary(id, MediaType.valueOf(ConstantsBase.OPENEHR_MIMETYPE_JSON)); + return client.readBinary(id, MediaType.valueOf(OPENEHR_MIMETYPE_JSON)); } catch (Exception e) { diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java index ce8d913da..bed50e0cd 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.OPENEHR_MIMETYPE_JSON; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; import java.security.Key; @@ -152,12 +153,12 @@ protected String saveResultSetAsBinaryForTtp(ResultSet resultSet, String securit Reference securityContext = new Reference(); securityContext.setType(ResourceType.Organization.name()).getIdentifier() .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(securityIdentifier); - Binary binary = new Binary().setContentType(ConstantsBase.OPENEHR_MIMETYPE_JSON) - .setSecurityContext(securityContext).setData(content); + Binary binary = new Binary().setContentType(OPENEHR_MIMETYPE_JSON).setSecurityContext(securityContext) + .setData(content); IdType created = createBinaryResource(binary); - return new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl(), ResourceType.Binary.name(), created.getIdPart(), - created.getVersionIdPart()).getValue(); + return new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl(), ResourceType.Binary.name(), + created.getIdPart(), created.getVersionIdPart()).getValue(); } private byte[] serializeResultSet(ResultSet resultSet) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java index e831b3f20..c00384c4f 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java @@ -23,12 +23,12 @@ protected void doExecute(DelegateExecution execution) throws Exception currentTask.getInput().forEach(input -> { boolean isErrorInput = input.getType().getCoding().stream().anyMatch( code -> code.getSystem().equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN) && code.getCode() - .equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE)); + .equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR)); if (isErrorInput) { leadingTask.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, input.getValue().primitiveValue())); + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, input.getValue().primitiveValue())); } }); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java index 13170641c..1f1bde750 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java @@ -1,5 +1,9 @@ package org.highmed.dsf.bpe.variables; +import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; + +import org.hl7.fhir.r4.model.CodeType; + public interface ConstantsFeasibility { String VARIABLE_BLOOM_FILTER_CONFIG = "bloomFilterConfig"; @@ -13,6 +17,12 @@ public interface ConstantsFeasibility String ERROR_CODE_MULTI_MEDIC_RESULT = "errorMultiMedicSimpleFeasibilityResult"; + // Must be 3 or larger, as otherwise it is possible to draw conclusions about the individual MeDICs + // (if I already know the cohort size in my MeDIC) + int MIN_PARTICIPATING_MEDICS = 3; + int MIN_COHORT_DEFINITIONS = 1; + String SIMPLE_FEASIBILITY_QUERY_PREFIX = "select count"; + String CODESYSTEM_HIGHMED_FEASIBILITY = "http://highmed.org/fhir/CodeSystem/feasibility"; String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY = "medic-correlation-key"; String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK = "needs-consent-check"; @@ -25,27 +35,43 @@ public interface ConstantsFeasibility String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT = "multi-medic-result"; String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE = "research-study-reference"; - // Must be 3 or larger, as otherwise it is possible to draw conclusions about the individual MeDICs - // (if I already know the cohort size in my MeDIC) - int MIN_PARTICIPATING_MEDICS = 3; - int MIN_COHORT_DEFINITIONS = 1; - - String SIMPLE_FEASIBILITY_QUERY_PREFIX = "select count"; - String EXTENSION_PARTICIPATING_MEDIC_URI = "http://highmed.org/fhir/StructureDefinition/participating-medic"; String EXTENSION_PARTICIPATING_TTP_URI = "http://highmed.org/fhir/StructureDefinition/participating-ttp"; String EXTENSION_GROUP_ID_URI = "http://highmed.org/fhir/StructureDefinition/group-id"; - String FEASIBILITY_RESEARCH_STUDY_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility"; String GROUP_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-group"; + String FEASIBILITY_RESEARCH_STUDY_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility"; String RESEARCH_STUDY_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/research-study-identifier"; String REQUEST_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility"; - String LOCAL_SERVICES_PROCESS_URI = "http://highmed.org/bpe/Process/localServicesIntegration"; - String REQUEST_FEASIBILITY_PROCESS_URI = "http://highmed.org/bpe/Process/requestSimpleFeasibility"; + String REQUEST_FEASIBILITY_PROCESS_URI = PROCESS_URI_BASE + "requestSimpleFeasibility/"; String REQUEST_FEASIBILITY_PROCESS_LATEST_VERSION = "0.4.0"; String REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - REQUEST_FEASIBILITY_PROCESS_URI + "/" + REQUEST_FEASIBILITY_PROCESS_LATEST_VERSION; - + REQUEST_FEASIBILITY_PROCESS_URI + REQUEST_FEASIBILITY_PROCESS_LATEST_VERSION; String REQUEST_FEASIBILITY_MESSAGE_NAME = "requestSimpleFeasibilityMessage"; + + String EXECUTE_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility"; + String EXECUTE_FEASIBILITY_PROCESS_URI = PROCESS_URI_BASE + "executeSimpleFeasibility/"; + String EXECUTE_FEASIBILITY_PROCESS_LATEST_VERSION = "0.4.0"; + String EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = + EXECUTE_FEASIBILITY_PROCESS_URI + EXECUTE_FEASIBILITY_PROCESS_LATEST_VERSION; + String EXECUTE_FEASIBILITY_MESSAGE_NAME = "executeSimpleFeasibilityMessage"; + + String COMPUTE_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility"; + String COMPUTE_FEASIBILITY_PROCESS_URI = PROCESS_URI_BASE + "computeSimpleFeasibility/"; + String COMPUTE_FEASIBILITY_PROCESS_LATEST_VERSION = "0.4.0"; + String COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = + COMPUTE_FEASIBILITY_PROCESS_URI + COMPUTE_FEASIBILITY_PROCESS_LATEST_VERSION; + String COMPUTE_FEASIBILITY_MESSAGE_NAME = "computeSimpleFeasibilityMessage"; + + String SINGLE_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility"; + String SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultSingleMedicSimpleFeasibilityMessage"; + + String MULTI_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility"; + String MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultMultiMedicSimpleFeasibilityMessage"; + + String ERROR_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-error-simple-feasibility"; + String ERROR_FEASIBILITY_MESSAGE_NAME = "errorMultiMedicSimpleFeasibilityMessage"; + + String LOCAL_SERVICES_PROCESS_URI = PROCESS_URI_BASE + "localServicesIntegration/"; } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn index 452c3cfcd..6d87f67c1 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn @@ -98,7 +98,7 @@ <bpmn:extensionElements> <camunda:inputOutput> <camunda:inputParameter name="processDefinitionKey">requestSimpleFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-error-simple-feasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-error-simple-feasibility</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="messageName">errorMultiMedicSimpleFeasibilityMessage</camunda:inputParameter> </camunda:inputOutput> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml index 95a1cadec..9bd320ae2 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml @@ -98,7 +98,7 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-error-simple-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-error-simple-feasibility" /> </extension> </extension> <url value="http://highmed.org/bpe/Process/requestSimpleFeasibility" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml index 2dbd89d46..deed9ce7e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml @@ -6,7 +6,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-error-simple-feasibility" /> + <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-error-simple-feasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="TaskErrorSimpleFeasibility" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java index b1de319f9..5650b6124 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -1,5 +1,6 @@ package org.highmed.dsf.bpe.start; +import static org.highmed.dsf.bpe.ConstantsBase.AQL_QUERY_TYPE; 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.EXTENSION_QUERY_URI; @@ -35,7 +36,6 @@ import javax.ws.rs.WebApplicationException; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.fhir.service.ReferenceCleaner; import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; @@ -124,8 +124,7 @@ private static Group createGroup(String name) group.setActual(false); group.setActive(true); group.addExtension().setUrl(EXTENSION_QUERY_URI).setValue( - new Expression().setLanguageElement(ConstantsBase.AQL_QUERY_TYPE) - .setExpression("SELECT COUNT(e) FROM EHR e")); + new Expression().setLanguageElement(AQL_QUERY_TYPE).setExpression("SELECT COUNT(e) FROM EHR e")); group.setName(name); return group; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java index 96d7db24a..c578d10e0 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java @@ -1,5 +1,9 @@ package org.highmed.dsf.fhir.profile; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_QUERY_URI; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.GROUP_PROFILE; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -36,20 +40,20 @@ public class GroupProfileTest public void testGroupProfileValid() throws Exception { Group group = new Group(); - group.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-group"); + group.getMeta().addProfile(GROUP_PROFILE); group.setType(GroupType.PERSON); group.setActual(false); - group.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/query") - .setValue(new Expression() - .setLanguageElement(new CodeType("application/x-aql-query") - .setSystem("http://highmed.org/fhir/CodeSystem/query-type")) - .setExpression("SELECT COUNT(e) FROM EHR e")); + group.addExtension().setUrl(EXTENSION_QUERY_URI).setValue(new Expression() + .setLanguageElement(new CodeType(CODESYSTEM_QUERY_TYPE_AQL).setSystem(CODESYSTEM_QUERY_TYPE)) + .setExpression("SELECT COUNT(e) FROM EHR e")); ValidationResult result = resourceValidator.validate(group); - result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" - + m.getLocationCol() + " - " + m.getSeverity() + ": " + m.getMessage()).forEach(logger::info); + result.getMessages().stream() + .map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + m.getLocationCol() + " - " + m + .getSeverity() + ": " + m.getMessage()).forEach(logger::info); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java index 9e3d342c6..deb613cdb 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java @@ -1,5 +1,10 @@ package org.highmed.dsf.fhir.profile; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.FEASIBILITY_RESEARCH_STUDY_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.RESEARCH_STUDY_IDENTIFIER_SYSTEM; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -11,6 +16,7 @@ import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResearchStudy; import org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus; +import org.hl7.fhir.r4.model.ResourceType; import org.junit.ClassRule; import org.junit.Test; import org.slf4j.Logger; @@ -37,23 +43,23 @@ public class ResearchStudyProfileTest public void testResearchStudyProfileValid() throws Exception { ResearchStudy res = new ResearchStudy(); - res.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility"); - res.getIdentifierFirstRep().setSystem("http://highmed.org/fhir/NamingSystem/research-study-identifier") + res.getMeta().addProfile(FEASIBILITY_RESEARCH_STUDY_PROFILE); + res.getIdentifierFirstRep().setSystem(RESEARCH_STUDY_IDENTIFIER_SYSTEM ) .setValue(UUID.randomUUID().toString()); res.setStatus(ResearchStudyStatus.ACTIVE); res.addEnrollment().setReference("Group/" + UUID.randomUUID().toString()); - Reference medicRef1 = new Reference().setType("Organization"); - medicRef1.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + Reference medicRef1 = new Reference().setType(ResourceType.Organization.name()); + medicRef1.getIdentifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) .setValue("MeDIC 1"); - res.addExtension("http://highmed.org/fhir/StructureDefinition/participating-medic", medicRef1); - Reference medicRef2 = new Reference().setType("Organization"); - medicRef2.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + res.addExtension(EXTENSION_PARTICIPATING_MEDIC_URI, medicRef1); + Reference medicRef2 = new Reference().setType(ResourceType.Organization.name()); + medicRef2.getIdentifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) .setValue("MeDIC 2"); - res.addExtension("http://highmed.org/fhir/StructureDefinition/participating-medic", medicRef2); - Reference ttpRef = new Reference().setType("Organization"); - ttpRef.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + res.addExtension(EXTENSION_PARTICIPATING_MEDIC_URI, medicRef2); + Reference ttpRef = new Reference().setType(ResourceType.Organization.name()); + ttpRef.getIdentifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) .setValue("TTP"); - res.addExtension("http://highmed.org/fhir/StructureDefinition/participating-ttp", ttpRef); + res.addExtension(EXTENSION_PARTICIPATING_TTP_URI, ttpRef); ValidationResult result = resourceValidator.validate(res); result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index b2fbc98d2..24ca460da 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -1,5 +1,37 @@ 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_BUSINESS_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.COMPUTE_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.COMPUTE_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.ERROR_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.ERROR_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXECUTE_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXECUTE_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_GROUP_ID_URI; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.MULTI_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.SINGLE_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE; import static org.junit.Assert.assertEquals; import java.nio.charset.StandardCharsets; @@ -13,6 +45,7 @@ import org.hl7.fhir.r4.model.Base64BinaryType; import org.hl7.fhir.r4.model.BooleanType; 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.ParameterComponent; @@ -33,12 +66,14 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule(Arrays.asList( - "highmed-task-base-0.4.0.xml", "highmed-group.xml", "highmed-extension-group-id.xml", - "highmed-research-study-feasibility.xml", "highmed-task-request-simple-feasibility.xml", - "highmed-task-execute-simple-feasibility.xml", "highmed-task-single-medic-result-simple-feasibility.xml", - "highmed-task-compute-simple-feasibility.xml", "highmed-task-multi-medic-result-simple-feasibility.xml", - "highmed-task-error-simple-feasibility.xml"), + public static final ValidationSupportRule validationRule = new ValidationSupportRule( + Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group.xml", "highmed-extension-group-id.xml", + "highmed-research-study-feasibility.xml", "highmed-task-request-simple-feasibility.xml", + "highmed-task-execute-simple-feasibility.xml", + "highmed-task-single-medic-result-simple-feasibility.xml", + "highmed-task-compute-simple-feasibility.xml", + "highmed-task-multi-medic-result-simple-feasibility.xml", + "highmed-task-error-simple-feasibility.xml"), Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml"), Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml")); @@ -53,8 +88,9 @@ public void testTaskRequestSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test @@ -67,55 +103,56 @@ public void testTaskRequestSimpleFeasibilityValidWithOutput() throws Exception TaskOutputComponent outParticipatingMedics1 = task.addOutput(); outParticipatingMedics1.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("participating-medics"); - outParticipatingMedics1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId1)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); + outParticipatingMedics1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); TaskOutputComponent outMultiMedicResult1 = task.addOutput(); outMultiMedicResult1.setValue(new UnsignedIntType(25)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("multi-medic-result"); - outMultiMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId1)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY).setCode("multi-medic-result"); + outMultiMedicResult1 + .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId1)); TaskOutputComponent outParticipatingMedics2 = task.addOutput(); outParticipatingMedics2.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("participating-medics"); - outParticipatingMedics2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId2)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); + outParticipatingMedics2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); TaskOutputComponent outMultiMedicResult2 = task.addOutput(); outMultiMedicResult2.setValue(new UnsignedIntType(25)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("multi-medic-result"); - outMultiMedicResult2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId2)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT); + outMultiMedicResult2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskRequestSimpleFeasibility() { Task task = new Task(); - task.getMeta() - .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0"); + task.getMeta().addProfile(REQUEST_FEASIBILITY_TASK_PROFILE); + task.setInstantiatesUri(REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); - task.addInput().setValue(new StringType("requestSimpleFeasibilityMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(REQUEST_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new Reference("ResearchStudy/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("research-study-reference"); - task.addInput().setValue(new BooleanType(false)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-record-linkage"); - task.addInput().setValue(new BooleanType(false)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-consent-check"); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); + task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); + task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); return task; } @@ -128,8 +165,9 @@ public void testTaskExecuteSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test @@ -137,42 +175,44 @@ public void testTaskExecuteSimpleFeasibilityValidWithBloomFilterConfig() throws { Task task = createValidTaskExecuteSimpleFeasibility(); task.addInput().setValue(new Base64BinaryType("TEST".getBytes(StandardCharsets.UTF_8))).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("bloom-filter-configuration"); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskExecuteSimpleFeasibility() { Task task = new Task(); - task.getMeta() - .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/executeSimpleFeasibility/0.4.0"); + task.getMeta().addProfile(EXECUTE_FEASIBILITY_TASK_PROFILE); + task.setInstantiatesUri(EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_2"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 2"); - task.addInput().setValue(new StringType("executeSimpleFeasibilityMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(EXECUTE_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("correlation-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY); task.addInput().setValue(new Reference("ResearchStudy/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("research-study-reference"); - task.addInput().setValue(new BooleanType(false)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-record-linkage"); - task.addInput().setValue(new BooleanType(false)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-consent-check"); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); + task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); + task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); return task; } @@ -185,8 +225,9 @@ public void testTaskSingleMedicResultSimpleFeasibilityUnsignedIntResultValid() t 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test @@ -197,30 +238,30 @@ public void testTaskSingleMedicResultSimpleFeasibilityReferenceResultValid() thr 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskSingleMedicResultSimpleFeasibility() { Task task = new Task(); - task.getMeta().addProfile( - "http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/computeSimpleFeasibility/0.4.0"); + task.getMeta().addProfile(SINGLE_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE); + task.setInstantiatesUri(COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_2"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 2"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); - task.addInput().setValue(new StringType("resultSingleMedicSimpleFeasibilityMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("correlation-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY); return task; } @@ -234,14 +275,14 @@ private Task createValidTaskSingleMedicResultSimpleFeasibilityUnsignedIntResult( ParameterComponent inSingleMedicResult1 = task.addInput(); inSingleMedicResult1.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("single-medic-result"); - inSingleMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId1)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT); + inSingleMedicResult1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); ParameterComponent inSingleMedicResult2 = task.addInput(); inSingleMedicResult2.setValue(new UnsignedIntType(10)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("single-medic-result"); - inSingleMedicResult2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId2)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT); + inSingleMedicResult2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); return task; } @@ -255,14 +296,14 @@ private Task createValidTaskSingleMedicResultSimpleFeasibilityReferenceResult() ParameterComponent inSingleMedicResult1 = task.addInput(); inSingleMedicResult1.setValue(new Reference("Binary/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("single-medic-result-reference"); - inSingleMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId1)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE); + inSingleMedicResult1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); ParameterComponent inSingleMedicResult2 = task.addInput(); inSingleMedicResult2.setValue(new Reference("Binary/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("single-medic-result-reference"); - inSingleMedicResult2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId2)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE); + inSingleMedicResult2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); return task; } @@ -275,36 +316,38 @@ public void testTaskComputeSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskComputeSimpleFeasibility() { Task task = new Task(); - task.getMeta() - .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/computeSimpleFeasibility/0.4.0"); + task.getMeta().addProfile(COMPUTE_FEASIBILITY_TASK_PROFILE); + task.setInstantiatesUri(COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); - task.addInput().setValue(new StringType("computeSimpleFeasibilityMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(COMPUTE_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("medic-correlation-key"); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("medic-correlation-key"); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY); - task.addInput().setValue(new BooleanType(false)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-record-linkage"); + task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); return task; } @@ -317,53 +360,53 @@ public void testTaskMultiMedicResultSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskMultiMedicResultSimpleFeasibility() { Task task = new Task(); - task.getMeta().addProfile( - "http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0"); + task.getMeta().addProfile(MULTI_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE); + task.setInstantiatesUri(REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); - task.addInput().setValue(new StringType("resultMultiMedicSimpleFeasibilityMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); String groupId1 = "Group/" + UUID.randomUUID().toString(); String groupId2 = "Group/" + UUID.randomUUID().toString(); ParameterComponent inParticipatingMedics1 = task.addInput(); inParticipatingMedics1.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("participating-medics"); - inParticipatingMedics1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId1)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); + inParticipatingMedics1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); ParameterComponent inMultiMedicResult1 = task.addInput(); inMultiMedicResult1.setValue(new UnsignedIntType(25)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("multi-medic-result"); - inMultiMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId1)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT); + inMultiMedicResult1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); ParameterComponent inParticipatingMedics2 = task.addInput(); inParticipatingMedics2.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("participating-medics"); - inParticipatingMedics2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId2)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); + inParticipatingMedics2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); ParameterComponent inMultiMedicResult2 = task.addInput(); inMultiMedicResult2.setValue(new UnsignedIntType(25)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("multi-medic-result"); - inMultiMedicResult2.addExtension("http://highmed.org/fhir/StructureDefinition/group-id", - new Reference(groupId2)); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT); + inMultiMedicResult2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); return task; } @@ -376,32 +419,33 @@ public void testTaskErrorSimpleFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskErrorSimpleFeasibility() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-error-simple-feasibility"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0"); + task.getMeta().addProfile(ERROR_FEASIBILITY_TASK_PROFILE); + task.setInstantiatesUri(REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); - task.addInput().setValue(new StringType("errorMultiMedicSimpleFeasibilityMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(ERROR_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); ParameterComponent error = task.addInput(); error.setValue(new StringType( "An error occurred while calculating the multi medic feasibility result for all defined cohorts")) - .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("error"); + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR); return task; } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java index cf940b2c3..924ddb751 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java @@ -7,7 +7,7 @@ public interface ConstantsLocalServices String LOCAL_SERVICES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"; String LOCAL_SERVICES_PROCESS_LATEST_VERSION = "0.4.0"; String LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION = - LOCAL_SERVICES_PROCESS_URI + "/" + LOCAL_SERVICES_PROCESS_LATEST_VERSION; + LOCAL_SERVICES_PROCESS_URI + LOCAL_SERVICES_PROCESS_LATEST_VERSION; String LOCAL_SERVICES_MESSAGE_NAME = "localServicesIntegrationMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 3633df889..bf045ebc4 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -1,5 +1,17 @@ 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.CODESYSTEM_QUERY_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_TASK_PROFILE; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -11,6 +23,7 @@ import org.highmed.dsf.fhir.validation.ValidationSupportRule; import org.hl7.fhir.r4.model.Base64BinaryType; import org.hl7.fhir.r4.model.BooleanType; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.junit.ClassRule; @@ -45,41 +58,42 @@ public void testTaskLocalServiceIntegrationValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskLocalServiceIntegration() { Task task = new Task(); - task.getMeta() - .addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/localServicesIntegration/0.4.0"); + task.getMeta().addProfile(LOCAL_SERVICES_TASK_PROFILE); + task.setInstantiatesUri(LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(Task.TaskStatus.REQUESTED); task.setIntent(Task.TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC"); - task.addInput().setValue(new StringType("localServicesIntegrationMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/query-type").setCode("application/x-aql-query"); - task.addInput().setValue(new BooleanType(true)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-consent-check"); - task.addInput().setValue(new BooleanType(true)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("needs-record-linkage"); + .setSystem(CODESYSTEM_QUERY_TYPE).setCode(CODESYSTEM_QUERY_TYPE_AQL); + task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); + task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - byte[] bloomFilterConfig = Base64.getDecoder().decode( - "CIw/x19d3Oj+GLOKgYAX5KrFAl11q6qMi0qkDiyUOCvMXuF2KffVvSnjUjkTvqh4z8Xs+MuQdK6FqTedM5FY9t4qm+k92A+P"); + byte[] bloomFilterConfig = Base64.getDecoder() + .decode("CIw/x19d3Oj+GLOKgYAX5KrFAl11q6qMi0qkDiyUOCvMXuF2KffVvSnjUjkTvqh4z8Xs+MuQdK6FqTedM5FY9t4qm+k92A+P"); task.addInput().setValue(new Base64BinaryType(bloomFilterConfig)).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/feasibility").setCode("bloom-filter-configuration"); + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); return task; } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java index 863dff40e..a98672283 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java @@ -1,12 +1,21 @@ package org.highmed.dsf.bpe.variables; +import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; + public interface ConstantsPing { String START_PING_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"; - String START_PING_PROCESS_URI = "http://highmed.org/bpe/Process/ping"; - String START_PING_PROCESS_LATEST_VERSION = "0.4.0"; - String START_PING_PROCESS_URI_AND_LATEST_VERSION = - START_PING_PROCESS_URI + "/" + START_PING_PROCESS_LATEST_VERSION; - String START_PING_MESSAGE_NAME = "startPingProcessMessage"; + + String PING_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-ping"; + String PING_PROCESS_URI = PROCESS_URI_BASE + "ping/"; + String PING_PROCESS_LATEST_VERSION = "0.4.0"; + String PING_PROCESS_URI_AND_LATEST_VERSION = PING_PROCESS_URI + PING_PROCESS_LATEST_VERSION; + String PING_MESSAGE_NAME = "pingMessage"; + + String PONG_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-pong"; + String PONG_PROCESS_URI = PROCESS_URI_BASE + "pong/"; + String PONG_PROCESS_LATEST_VERSION = "0.4.0"; + String PONG_PROCESS_URI_AND_LATEST_VERSION = PONG_PROCESS_URI + PONG_PROCESS_LATEST_VERSION; + String PONG_MESSAGE_NAME = "pongMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index a5c94e4d4..1115747be 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -7,8 +7,8 @@ import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; +import static org.highmed.dsf.bpe.variables.ConstantsPing.PING_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_TASK_PROFILE; import java.io.IOException; @@ -50,7 +50,7 @@ public static void main(String[] args) Task task = new Task(); task.getMeta().addProfile(START_PING_TASK_PROFILE); - task.setInstantiatesUri(START_PING_PROCESS_URI_AND_LATEST_VERSION); + task.setInstantiatesUri(PING_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java index 314a0bf62..bdd12b262 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java @@ -1,5 +1,18 @@ package org.highmed.dsf.fhir.profiles; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.variables.ConstantsPing.PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsPing.PING_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsPing.PING_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsPing.PONG_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsPing.PONG_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsPing.PONG_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_TASK_PROFILE; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -9,6 +22,7 @@ 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; @@ -28,8 +42,7 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-start-ping-process.xml", "highmed-task-ping.xml", - "highmed-task-pong.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml"), + "highmed-task-pong.xml"), Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml"), Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), @@ -43,8 +56,9 @@ public void testTaskStartPingProcessProfileValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test @@ -56,8 +70,9 @@ public void testTaskStartPingProcessProfileNotValid1() throws Exception ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(1, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test @@ -69,8 +84,9 @@ public void testTaskStartPingProcessProfileNotValid2() throws Exception ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(1, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test @@ -82,25 +98,26 @@ public void testTaskStartPingProcessProfileNotValid3() throws Exception ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(1, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskStartPingProcess() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.4.0"); + task.getMeta().addProfile(START_PING_TASK_PROFILE); + task.setInstantiatesUri(PING_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); - task.addInput().setValue(new StringType("startPingProcessMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(START_PING_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); return task; } @@ -113,29 +130,30 @@ public void testTaskPingValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskPing() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.4.0"); + task.getMeta().addProfile(PING_TASK_PROFILE); + task.setInstantiatesUri(PONG_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); - task.addInput().setValue(new StringType("pingMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(PING_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("correlation-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY); return task; } @@ -148,29 +166,30 @@ public void testTaskPongValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskPong() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-pong"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.4.0"); + task.getMeta().addProfile(PONG_TASK_PROFILE); + task.setInstantiatesUri(PING_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); - task.addInput().setValue(new StringType("pongMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(PONG_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("correlation-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY); return task; } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java index 3dd781af9..3435de2c8 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java @@ -1,23 +1,23 @@ package org.highmed.dsf.bpe.variables; +import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; + public interface ConstantsUpdateAllowList { String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST = "http://highmed.org/fhir/CodeSystem/update-allow-list"; String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST = "highmed_allow_list"; String DOWNLOAD_ALLOW_LIST_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"; - String DOWNLOAD_ALLOW_LIST_PROCESS_URI = "http://highmed.org/bpe/Process/downloadAllowList"; + String DOWNLOAD_ALLOW_LIST_PROCESS_URI = PROCESS_URI_BASE + "downloadAllowList/"; String DOWNLOAD_ALLOW_LIST_PROCESS_LATEST_VERSION = "0.4.0"; String DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = - DOWNLOAD_ALLOW_LIST_PROCESS_URI + "/" + DOWNLOAD_ALLOW_LIST_PROCESS_LATEST_VERSION; - + DOWNLOAD_ALLOW_LIST_PROCESS_URI + DOWNLOAD_ALLOW_LIST_PROCESS_LATEST_VERSION; String DOWNLOAD_ALLOW_LIST_MESSAGE_NAME = "downloadAllowListMessage"; String UPDATE_ALLOW_LIST_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"; - String UPDATE_ALLOW_LIST_PROCESS_URI = "http://highmed.org/bpe/Process/updateAllowList"; + String UPDATE_ALLOW_LIST_PROCESS_URI = PROCESS_URI_BASE + "updateAllowList/"; String UPDATE_ALLOW_LIST_PROCESS_LATEST_VERSION = "0.4.0"; String UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = - UPDATE_ALLOW_LIST_PROCESS_URI + "/" + UPDATE_ALLOW_LIST_PROCESS_LATEST_VERSION; - + UPDATE_ALLOW_LIST_PROCESS_URI + UPDATE_ALLOW_LIST_PROCESS_LATEST_VERSION; String UPDATE_ALLOW_LIST_MESSAGE_NAME = "updateAllowListMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index cc36f4c4c..da780c6ea 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -1,5 +1,16 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_TASK_PROFILE; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -11,6 +22,7 @@ import org.highmed.dsf.fhir.validation.ValidationSupportRule; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; @@ -54,8 +66,8 @@ public void testTaskUpdateAllowlistValidWithOutput() throws Exception { Task task = createValidTaskUpdateAllowList(); task.addOutput().setValue(new Reference(new IdType("Bundle", UUID.randomUUID().toString(), "1"))).getType() - .addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") - .setCode("highmed_allow_list"); + .addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) + .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -67,49 +79,18 @@ public void testTaskUpdateAllowlistValidWithOutput() throws Exception private Task createValidTaskUpdateAllowList() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.4.0"); + task.getMeta().addProfile(UPDATE_ALLOW_LIST_TASK_PROFILE); + task.setInstantiatesUri(UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); - task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); - - return task; - } - - @Test - public void testTaskRequestUpdateResourcesAllowListValid() throws Exception - { - Task task = createValidTaskRequestUpdateAllowListResources(); - - 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 createValidTaskRequestUpdateAllowListResources() - { - Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/updateAllowList/0.4.0"); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - - task.addInput().setValue(new StringType("updateAllowListMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); return task; } @@ -129,23 +110,23 @@ public void testTaskDownloadAllowListValid() throws Exception private Task createValidTaskDownloadAllowList() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/downloadAllowList/0.4.0"); + task.getMeta().addProfile(DOWNLOAD_ALLOW_LIST_TASK_PROFILE); + task.setInstantiatesUri(DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM ).setValue("MeDIC 1"); - task.addInput().setValue(new StringType("downloadAllowListMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput() .setValue( new Reference(new IdType("https://foo.bar/fhir", "Bundle", UUID.randomUUID().toString(), "1"))) - .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-allow-list") - .setCode("highmed_allow_list"); + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) + .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); return task; } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java index b213efc30..e88f632de 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java @@ -1,5 +1,7 @@ package org.highmed.dsf.bpe.variables; +import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; + public interface ConstantsUpdateResources { String CODESYSTEM_HIGHMED_UPDATE_RESOURCE = "http://highmed.org/fhir/CodeSystem/update-resources"; @@ -7,10 +9,16 @@ public interface ConstantsUpdateResources String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER = "organization-identifier-search-parameter"; String REQUEST_UPDATE_RESOURCES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"; - String REQUEST_UPDATE_RESOURCES_PROCESS_URI = "http://highmed.org/bpe/Process/requestUpdateResources"; + String REQUEST_UPDATE_RESOURCES_PROCESS_URI = PROCESS_URI_BASE + "requestUpdateResources/"; String REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION = "0.4.0"; String REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = - REQUEST_UPDATE_RESOURCES_PROCESS_URI + "/" + REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION; - + REQUEST_UPDATE_RESOURCES_PROCESS_URI + REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION; String REQUEST_UPDATE_RESOURCES_MESSAGE_NAME = "requestUpdateResourcesMessage"; + + String EXECUTE_UPDATE_RESOURCES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources"; + String EXECUTE_UPDATE_RESOURCES_PROCESS_URI = PROCESS_URI_BASE + "executeUpdateResources/"; + String EXECUTE_UPDATE_RESOURCES_PROCESS_LATEST_VERSION = "0.4.0"; + String EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = + EXECUTE_UPDATE_RESOURCES_PROCESS_URI + EXECUTE_UPDATE_RESOURCES_PROCESS_LATEST_VERSION; + String EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME = "executeUpdateResourcesMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 243698988..1ff4d14a7 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -1,5 +1,18 @@ 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_BUSINESS_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_TASK_PROFILE; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -18,6 +31,7 @@ import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; 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.StructureDefinition; import org.hl7.fhir.r4.model.Task; @@ -81,23 +95,24 @@ public void testTaskRequestUpdateResourcesValid() throws Exception private Task createValidTaskRequestUpdateResources() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/requestUpdateResources/0.4.0"); + task.getMeta().addProfile(REQUEST_UPDATE_RESOURCES_TASK_PROFILE); + task.setInstantiatesUri(REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_TTP"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + + task.addInput().setValue(new StringType(REQUEST_UPDATE_RESOURCES_MESSAGE_NAME )).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new StringType("requestUpdateResourcesMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/update-resources").setCode("bundle-reference"); + .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE).setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); task.addInput().setValue(new StringType("http://highmed.org/fhir/NamingSystem/organization-identifier|")) - .getType().addCoding().setSystem("http://highmed.org/fhir/CodeSystem/update-resources") - .setCode("organization-identifier-search-parameter"); + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) + .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER); return task; } @@ -117,22 +132,22 @@ public void testTaskExecuteUpdateResourcesValid() throws Exception private Task createValidTaskExecuteUpdateResources() { Task task = new Task(); - task.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources"); - task.setInstantiatesUri("http://highmed.org/bpe/Process/executeUpdateResources/0.4.0"); + task.getMeta().addProfile(EXECUTE_UPDATE_RESOURCES_TASK_PROFILE); + task.setInstantiatesUri(EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); - task.getRequester().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); - task.getRestriction().addRecipient().setType("Organization").getIdentifier() - .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test_MeDIC_1"); + task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); - task.addInput().setValue(new StringType("executeUpdateResourcesMessage")).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("message-name"); + task.addInput().setValue(new StringType(EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME)).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message").setCode("business-key"); + .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem("http://highmed.org/fhir/CodeSystem/update-resources").setCode("bundle-reference"); + .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE).setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); return task; } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/group/GroupHelperImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/group/GroupHelperImpl.java index f3e634a2d..ff9a93e55 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/group/GroupHelperImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/group/GroupHelperImpl.java @@ -1,9 +1,11 @@ package org.highmed.dsf.fhir.group; +import static org.highmed.dsf.bpe.ConstantsBase.AQL_QUERY_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_QUERY_URI; + import java.util.List; import java.util.stream.Collectors; -import org.highmed.dsf.bpe.ConstantsBase; import org.hl7.fhir.r4.model.Expression; import org.hl7.fhir.r4.model.Extension; import org.hl7.fhir.r4.model.Group; @@ -18,13 +20,13 @@ public class GroupHelperImpl implements GroupHelper public String extractAqlQuery(Group group) { List<Extension> queries = group.getExtension().stream() - .filter(extension -> extension.getUrl().equals(ConstantsBase.EXTENSION_QUERY_URI)).filter(extension -> - ConstantsBase.AQL_QUERY_TYPE.compareTo(((Expression) extension.getValue()).getLanguageElement()) - == 0).collect(Collectors.toList()); + .filter(extension -> extension.getUrl().equals(EXTENSION_QUERY_URI)) + .filter(extension -> AQL_QUERY_TYPE.compareTo(((Expression) extension.getValue()).getLanguageElement()) + == 0).collect(Collectors.toList()); if (queries.size() != 1) { - logger.error("Number of aql queries is not =1, got {}", queries.size()); + logger.error("Number of aql queries is not 1, got {}", queries.size()); throw new IllegalArgumentException("Number of aql queries is not =1, got " + queries.size()); } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java index b92650d46..e70eb8831 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java @@ -75,7 +75,7 @@ public void onTask(Task task) catch (Exception exception) { Task.TaskOutputComponent errorOutput = taskHelper.createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR_MESSAGE, exception.getMessage()); + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, exception.getMessage()); task.addOutput(errorOutput); task.setStatus(Task.TaskStatus.FAILED); webserviceClient.update(task); From 3ff084063d8b4b44810aa0175f0f99f296a3e82b Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Fri, 11 Dec 2020 21:08:50 +0100 Subject: [PATCH 53/75] reworks starter classes --- .../dsf/bpe/start/AbstractExampleStarter.java | 98 +++++++++++++++++++ .../bpe/start/ConstantsExampleStarters.java | 7 +- ...lityFromMedicsViaMedic1ExampleStarter.java | 95 ++++++------------ .../LocalServicesMedic1ExampleStarter.java | 87 +++++----------- .../Ping3MedicFromTtpExampleStarter.java | 38 ++----- ...lowListFromTtpViaMedic1ExampleStarter.java | 71 +++++--------- ...pdateAllowList3MedicTtpExampleStarter.java | 38 ++----- ...UpdateResource3MedicTtpExampleStarter.java | 58 +++++------ 8 files changed, 224 insertions(+), 268 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java new file mode 100644 index 000000000..3af16be3b --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java @@ -0,0 +1,98 @@ +package org.highmed.dsf.bpe.start; + +import java.nio.file.Paths; +import java.security.KeyStore; + +import org.highmed.dsf.fhir.service.ReferenceCleaner; +import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; +import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; +import org.highmed.fhir.client.FhirWebserviceClient; +import org.highmed.fhir.client.FhirWebserviceClientJersey; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Resource; +import org.hl7.fhir.r4.model.ResourceType; +import org.hl7.fhir.r4.model.Task; + +import ca.uhn.fhir.context.FhirContext; + +import de.rwh.utils.crypto.CertificateHelper; +import de.rwh.utils.crypto.io.CertificateReader; + +public abstract class AbstractExampleStarter +{ + private final String certificatePath; + private final char[] certificatePassword; + + public AbstractExampleStarter() + { + this("../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"); + } + + public AbstractExampleStarter(String certificatePath) + { + this(certificatePath, "password"); + } + + public AbstractExampleStarter(String certificatePath, String certificatePassword) + { + this.certificatePath = certificatePath; + this.certificatePassword = certificatePassword.toCharArray(); + } + + /** + * Use this method to start a process at an organization's FHIR endpoint. The resource that will start + * the process will be created by calling the method {@link #createStartResource()} + * + * @param baseUrl the URL of the organization's FHIR endpoint, that should receive the resource + * @throws Exception if the client cannot be initialized + */ + public final void startAt(String baseUrl) throws Exception + { + FhirWebserviceClient client = createClient(baseUrl); + Resource resource = createStartResource(); + + if (resource instanceof Bundle) + { + Bundle bundle = (Bundle) resource; + bundle.getEntry().stream().map(e -> e.getResource().getResourceType()).filter(t -> t == ResourceType.Task) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("Bundle does not contain a Task resource")); + + client.withMinimalReturn().postBundle(bundle); + } + else if (resource instanceof Task) + client.withMinimalReturn().create(resource); + else + throw new IllegalArgumentException("Resource should be of type Bundle or Task"); + } + + /** + * Creates a FHIR Webservice client based on the supplied baseUrl. + * + * @param baseUrl the URL of the organization's FHIR endpoint to which the client should connect + * @return a {@link FhirWebserviceClient} based to the supplied baseUrl + * @throws Exception if the client cannot be initialized + */ + protected FhirWebserviceClient createClient(String baseUrl) throws Exception + { + KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(certificatePath), certificatePassword); + KeyStore trustStore = CertificateHelper.extractTrust(keyStore); + + FhirContext context = FhirContext.forR4(); + ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); + + return new FhirWebserviceClientJersey(baseUrl, trustStore, keyStore, certificatePassword, null, null, null, 0, + 0, null, context, referenceCleaner); + } + + /** + * Returns a resource that can start a bpmn process. This should be either a {@link Task} + * or a {@link Bundle} containing a {@link Task} resource. + * <p> + * The task resource should be derived from the base profile + * "http://highmed.org/fhir/StructureDefinition/highmed-task-base" + * + * @return the resource that should be used to start a process + */ + public abstract Resource createStartResource() throws Exception; +} diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java index 8f1994275..6245b8c25 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java @@ -2,14 +2,15 @@ public interface ConstantsExampleStarters { - String CERTIFICATE_PATH = "../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"; - char[] CERTIFICATE_PASSWORD = "password".toCharArray(); - String TTP_FHIR_BASE_URL = "https://ttp/fhir/"; String ORGANIZATION_IDENTIFIER_VALUE_TTP = "Test_TTP"; String MEDIC_1_FHIR_BASE_URL = "https://medic1/fhir/"; String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1 = "Test_MeDIC_1"; + + String MEDIC_2_FHIR_BASE_URL = "https://medic2/fhir/"; String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2 = "Test_MeDIC_2"; + + String MEDIC_3_FHIR_BASE_URL = "https://medic3/fhir/"; String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3 = "Test_MeDIC_3"; } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java index 5650b6124..4ecf9a2bc 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -5,8 +5,6 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_QUERY_URI; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2; @@ -25,22 +23,9 @@ import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_TASK_PROFILE; import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.RESEARCH_STUDY_IDENTIFIER_SYSTEM; -import java.io.IOException; -import java.nio.file.Paths; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; import java.util.Date; import java.util.UUID; -import javax.ws.rs.WebApplicationException; - -import org.highmed.dsf.fhir.service.ReferenceCleaner; -import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; -import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.highmed.fhir.client.FhirWebserviceClientJersey; import org.hl7.fhir.r4.model.BooleanType; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Bundle.BundleType; @@ -51,68 +36,46 @@ import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Identifier; import org.hl7.fhir.r4.model.Narrative; -import org.hl7.fhir.r4.model.OperationOutcome; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResearchStudy; import org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus; +import org.hl7.fhir.r4.model.Resource; 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 ca.uhn.fhir.context.FhirContext; - -import de.rwh.utils.crypto.CertificateHelper; -import de.rwh.utils.crypto.io.CertificateReader; - -public class RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter +public class RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter extends AbstractExampleStarter { - public static void main(String[] args) - throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException + public static void main(String[] args) throws Exception + { + new RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter().startAt(MEDIC_1_FHIR_BASE_URL); + } + + @Override + public Resource createStartResource() { - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); - KeyStore trustStore = CertificateHelper.extractTrust(keyStore); - - FhirContext context = FhirContext.forR4(); - ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey(MEDIC_1_FHIR_BASE_URL, trustStore, keyStore, - CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); - - try - { - Group group1 = createGroup("Group 1"); - Group group2 = createGroup("Group 2"); - ResearchStudy researchStudy = createResearchStudy(group1, group2); - Task task = createTask(researchStudy); - - Bundle bundle = new Bundle(); - bundle.setType(BundleType.TRANSACTION); - bundle.addEntry().setResource(group1).setFullUrl(group1.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); - bundle.addEntry().setResource(group2).setFullUrl(group2.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); - bundle.addEntry().setResource(researchStudy).setFullUrl(researchStudy.getIdElement().getIdPart()) - .getRequest().setMethod(HTTPVerb.POST).setUrl(ResourceType.ResearchStudy.name()); - bundle.addEntry().setResource(task).setFullUrl(task.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.Task.name()); - - client.withMinimalReturn().postBundle(bundle); - } - catch (WebApplicationException e) - { - if (e.getResponse() != null && e.getResponse().hasEntity()) - { - OperationOutcome outcome = e.getResponse().readEntity(OperationOutcome.class); - String xml = context.newXmlParser().setPrettyPrint(true).encodeResourceToString(outcome); - System.out.println(xml); - } - else - e.printStackTrace(); - } + Group group1 = createGroup("Group 1"); + Group group2 = createGroup("Group 2"); + ResearchStudy researchStudy = createResearchStudy(group1, group2); + Task task = createTask(researchStudy); + + Bundle bundle = new Bundle(); + bundle.setType(BundleType.TRANSACTION); + bundle.addEntry().setResource(group1).setFullUrl(group1.getIdElement().getIdPart()).getRequest() + .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); + bundle.addEntry().setResource(group2).setFullUrl(group2.getIdElement().getIdPart()).getRequest() + .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); + bundle.addEntry().setResource(researchStudy).setFullUrl(researchStudy.getIdElement().getIdPart()).getRequest() + .setMethod(HTTPVerb.POST).setUrl(ResourceType.ResearchStudy.name()); + bundle.addEntry().setResource(task).setFullUrl(task.getIdElement().getIdPart()).getRequest() + .setMethod(HTTPVerb.POST).setUrl(ResourceType.Task.name()); + + return bundle; } - private static Group createGroup(String name) + private Group createGroup(String name) { Group group = new Group(); group.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); @@ -130,7 +93,7 @@ private static Group createGroup(String name) return group; } - private static ResearchStudy createResearchStudy(Group group1, Group group2) + private ResearchStudy createResearchStudy(Group group1, Group group2) { ResearchStudy researchStudy = new ResearchStudy(); researchStudy.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); @@ -162,7 +125,7 @@ private static ResearchStudy createResearchStudy(Group group1, Group group2) return researchStudy; } - private static Task createTask(ResearchStudy researchStudy) + private Task createTask(ResearchStudy researchStudy) { Task task = new Task(); task.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java index 4018f4479..3725bd7fc 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java @@ -5,8 +5,6 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; @@ -17,70 +15,32 @@ import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_TASK_PROFILE; -import java.io.IOException; -import java.nio.file.Paths; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; import java.util.Date; import java.util.Random; import javax.crypto.KeyGenerator; -import javax.ws.rs.WebApplicationException; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.highmed.dsf.bpe.variables.BloomFilterConfig; -import org.highmed.dsf.fhir.service.ReferenceCleaner; -import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; -import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.highmed.fhir.client.FhirWebserviceClientJersey; import org.hl7.fhir.r4.model.Base64BinaryType; import org.hl7.fhir.r4.model.BooleanType; -import org.hl7.fhir.r4.model.OperationOutcome; +import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; -import ca.uhn.fhir.context.FhirContext; - -import de.rwh.utils.crypto.CertificateHelper; -import de.rwh.utils.crypto.io.CertificateReader; - -public class LocalServicesMedic1ExampleStarter +public class LocalServicesMedic1ExampleStarter extends AbstractExampleStarter { - public static void main(String[] args) - throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException - { - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); - KeyStore trustStore = CertificateHelper.extractTrust(keyStore); - - FhirContext context = FhirContext.forR4(); - ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey(MEDIC_1_FHIR_BASE_URL, trustStore, keyStore, - CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); + private static boolean NEEDS_CONSENT_CHECK = true; + private static boolean NEEDS_RECORD_LINKAGE = true; - try - { - Task task = createTask(true, true); - client.withMinimalReturn().create(task); - } - catch (WebApplicationException e) - { - if (e.getResponse() != null && e.getResponse().hasEntity()) - { - OperationOutcome outcome = e.getResponse().readEntity(OperationOutcome.class); - String xml = context.newXmlParser().setPrettyPrint(true).encodeResourceToString(outcome); - System.out.println(xml); - } - else - e.printStackTrace(); - } + public static void main(String[] args) throws Exception + { + new LocalServicesMedic1ExampleStarter().startAt(MEDIC_1_FHIR_BASE_URL); } - private static Task createTask(boolean needsConsentCheck, boolean needsRecordLinkage) - throws NoSuchAlgorithmException + @Override + public Resource createStartResource() { Task task = new Task(); @@ -100,23 +60,30 @@ private static Task createTask(boolean needsConsentCheck, boolean needsRecordLin task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() .setSystem(CODESYSTEM_QUERY_TYPE).setCode(CODESYSTEM_QUERY_TYPE_AQL); - task.addInput().setValue(new BooleanType(needsConsentCheck)).getType().addCoding() + task.addInput().setValue(new BooleanType(NEEDS_CONSENT_CHECK)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); - task.addInput().setValue(new BooleanType(needsRecordLinkage)).getType().addCoding() + task.addInput().setValue(new BooleanType(NEEDS_RECORD_LINKAGE)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - if (needsRecordLinkage) + if (NEEDS_RECORD_LINKAGE) { - BouncyCastleProvider bouncyCastleProvider = new BouncyCastleProvider(); - BloomFilterConfig bloomFilterConfig = new BloomFilterConfig(new Random().nextLong(), - KeyGenerator.getInstance("HmacSHA256", bouncyCastleProvider).generateKey(), - KeyGenerator.getInstance("HmacSHA3-256", bouncyCastleProvider).generateKey()); - - task.addInput().setValue(new Base64BinaryType(bloomFilterConfig.toBytes())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); + try + { + BouncyCastleProvider bouncyCastleProvider = new BouncyCastleProvider(); + BloomFilterConfig bloomFilterConfig = new BloomFilterConfig(new Random().nextLong(), + KeyGenerator.getInstance("HmacSHA256", bouncyCastleProvider).generateKey(), + KeyGenerator.getInstance("HmacSHA3-256", bouncyCastleProvider).generateKey()); + + task.addInput().setValue(new Base64BinaryType(bloomFilterConfig.toBytes())).getType().addCoding() + .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) + .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); + } + catch (Exception exception) + { + throw new RuntimeException("Could not create BloomFilterConfig", exception); + } } return task; diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index 1115747be..db74f42ae 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -3,51 +3,31 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; import static org.highmed.dsf.bpe.variables.ConstantsPing.PING_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_MESSAGE_NAME; import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_TASK_PROFILE; -import java.io.IOException; -import java.nio.file.Paths; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; import java.util.Date; -import org.highmed.dsf.fhir.service.ReferenceCleaner; -import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; -import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.highmed.fhir.client.FhirWebserviceClientJersey; +import org.hl7.fhir.r4.model.Resource; 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 ca.uhn.fhir.context.FhirContext; - -import de.rwh.utils.crypto.CertificateHelper; -import de.rwh.utils.crypto.io.CertificateReader; - -public class Ping3MedicFromTtpExampleStarter +public class Ping3MedicFromTtpExampleStarter extends AbstractExampleStarter { - public static void main(String[] args) - throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException + public static void main(String[] args) throws Exception { - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); - KeyStore trustStore = CertificateHelper.extractTrust(keyStore); - - FhirContext context = FhirContext.forR4(); - ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey(TTP_FHIR_BASE_URL, trustStore, keyStore, - CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); + new Ping3MedicFromTtpExampleStarter().startAt(TTP_FHIR_BASE_URL); + } + @Override + public Resource createStartResource() + { Task task = new Task(); task.getMeta().addProfile(START_PING_TASK_PROFILE); task.setInstantiatesUri(PING_PROCESS_URI_AND_LATEST_VERSION); @@ -62,6 +42,6 @@ public static void main(String[] args) task.addInput().setValue(new StringType(START_PING_MESSAGE_NAME)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - client.withMinimalReturn().create(task); + return task; } } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index ec1068610..6a1b2ccc0 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -3,8 +3,6 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; @@ -14,60 +12,32 @@ import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_TASK_PROFILE; -import java.io.IOException; -import java.nio.file.Paths; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; import java.util.Collections; import java.util.Date; import java.util.Map; -import org.highmed.dsf.fhir.service.ReferenceCleaner; -import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; -import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; import org.highmed.fhir.client.FhirWebserviceClient; -import org.highmed.fhir.client.FhirWebserviceClientJersey; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.Resource; 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 ca.uhn.fhir.context.FhirContext; - -import de.rwh.utils.crypto.CertificateHelper; -import de.rwh.utils.crypto.io.CertificateReader; - -public class DownloadAllowListFromTtpViaMedic1ExampleStarter +public class DownloadAllowListFromTtpViaMedic1ExampleStarter extends AbstractExampleStarter { - public static void main(String[] args) - throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException + public static void main(String[] args) throws Exception { - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); - KeyStore trustStore = CertificateHelper.extractTrust(keyStore); - - FhirContext context = FhirContext.forR4(); - ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - - FhirWebserviceClient ttpClient = new FhirWebserviceClientJersey(TTP_FHIR_BASE_URL, trustStore, keyStore, - CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); - - Bundle searchResult = ttpClient.searchWithStrictHandling(Bundle.class, Map.of("identifier", - Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); - - if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) - throw new IllegalStateException("Expected a single allow list Bundle"); - Bundle allowList = (Bundle) searchResult.getEntryFirstRep().getResource(); - - System.out.println(context.newXmlParser().encodeResourceToString(allowList)); + new DownloadAllowListFromTtpViaMedic1ExampleStarter().startAt(MEDIC_1_FHIR_BASE_URL); + } - FhirWebserviceClient client = new FhirWebserviceClientJersey(MEDIC_1_FHIR_BASE_URL, trustStore, keyStore, - CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); + @Override + public Resource createStartResource() throws Exception + { + Bundle allowList = getAllowList(); Task task = new Task(); task.getMeta().addProfile(DOWNLOAD_ALLOW_LIST_TASK_PROFILE); @@ -76,19 +46,30 @@ public static void main(String[] args) task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); task.addInput().setValue(new StringType(DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new Reference( new IdType(TTP_FHIR_BASE_URL, ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), allowList.getIdElement().getVersionIdPart()))).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST).setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); + .setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) + .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); + + return task; + } + + private Bundle getAllowList() throws Exception + { + FhirWebserviceClient client = createClient(TTP_FHIR_BASE_URL); + Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", + Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); + + if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) + throw new IllegalStateException("Expected a single allow list Bundle"); - client.withMinimalReturn().create(task); + return (Bundle) searchResult.getEntryFirstRep().getResource(); } } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index 029df8738..ab5ec920d 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -3,51 +3,31 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_MESSAGE_NAME; import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_TASK_PROFILE; -import java.io.IOException; -import java.nio.file.Paths; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; import java.util.Date; -import org.highmed.dsf.fhir.service.ReferenceCleaner; -import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; -import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.highmed.fhir.client.FhirWebserviceClientJersey; +import org.hl7.fhir.r4.model.Resource; 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 ca.uhn.fhir.context.FhirContext; - -import de.rwh.utils.crypto.CertificateHelper; -import de.rwh.utils.crypto.io.CertificateReader; - -public class UpdateAllowList3MedicTtpExampleStarter +public class UpdateAllowList3MedicTtpExampleStarter extends AbstractExampleStarter { - public static void main(String[] args) - throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException + public static void main(String[] args) throws Exception { - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); - KeyStore trustStore = CertificateHelper.extractTrust(keyStore); - - FhirContext context = FhirContext.forR4(); - ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey(TTP_FHIR_BASE_URL, trustStore, keyStore, - CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); + new UpdateAllowList3MedicTtpExampleStarter().startAt(TTP_FHIR_BASE_URL); + } + @Override + public Resource createStartResource() + { Task task = new Task(); task.getMeta().addProfile(UPDATE_ALLOW_LIST_TASK_PROFILE); task.setInstantiatesUri(UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); @@ -62,6 +42,6 @@ public static void main(String[] args) task.addInput().setValue(new StringType(UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - client.withMinimalReturn().create(task); + return task; } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index f1e360b95..838c8fb13 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -3,8 +3,6 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PASSWORD; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.CERTIFICATE_PATH; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; @@ -14,56 +12,32 @@ import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; -import java.io.IOException; -import java.nio.file.Paths; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; import java.util.Collections; import java.util.Date; import java.util.Map; -import org.highmed.dsf.fhir.service.ReferenceCleaner; -import org.highmed.dsf.fhir.service.ReferenceCleanerImpl; -import org.highmed.dsf.fhir.service.ReferenceExtractorImpl; import org.highmed.fhir.client.FhirWebserviceClient; -import org.highmed.fhir.client.FhirWebserviceClientJersey; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; +import org.hl7.fhir.r4.model.Resource; 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 ca.uhn.fhir.context.FhirContext; - -import de.rwh.utils.crypto.CertificateHelper; -import de.rwh.utils.crypto.io.CertificateReader; - -public class UpdateResource3MedicTtpExampleStarter +public class UpdateResource3MedicTtpExampleStarter extends AbstractExampleStarter { - public static void main(String[] args) - throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException + public static void main(String[] args) throws Exception { - KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(CERTIFICATE_PATH), CERTIFICATE_PASSWORD); - KeyStore trustStore = CertificateHelper.extractTrust(keyStore); - - FhirContext context = FhirContext.forR4(); - ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl(new ReferenceExtractorImpl()); - FhirWebserviceClient client = new FhirWebserviceClientJersey(TTP_FHIR_BASE_URL, trustStore, keyStore, - CERTIFICATE_PASSWORD, null, null, null, 0, 0, null, context, referenceCleaner); - - Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", - Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); - - if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) - throw new IllegalStateException("Expected a single allow list Bundle"); - Bundle allowList = (Bundle) searchResult.getEntryFirstRep().getResource(); + new UpdateResource3MedicTtpExampleStarter().startAt(TTP_FHIR_BASE_URL); + } - System.out.println(context.newXmlParser().encodeResourceToString(allowList)); + @Override + public Resource createStartResource() throws Exception + { + Bundle allowList = getAllowList(); Task task = new Task(); task.getMeta().addProfile(REQUEST_UPDATE_RESOURCES_TASK_PROFILE); @@ -89,6 +63,18 @@ public static void main(String[] args) .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER); - client.withMinimalReturn().create(task); + return task; + } + + private Bundle getAllowList() throws Exception + { + FhirWebserviceClient client = createClient(TTP_FHIR_BASE_URL); + Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", + Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); + + if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) + throw new IllegalStateException("Expected a single allow list Bundle"); + + return (Bundle) searchResult.getEntryFirstRep().getResource(); } } From 93bb03222d814a47c6b098cfd7341b1dcbde23e9 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Fri, 11 Dec 2020 21:19:58 +0100 Subject: [PATCH 54/75] change visibility to protected --- .../org/highmed/dsf/bpe/start/AbstractExampleStarter.java | 8 ++++---- ...impleFeasibilityFromMedicsViaMedic1ExampleStarter.java | 2 +- .../dsf/bpe/start/LocalServicesMedic1ExampleStarter.java | 2 +- .../dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java | 2 +- .../DownloadAllowListFromTtpViaMedic1ExampleStarter.java | 2 +- .../bpe/start/UpdateAllowList3MedicTtpExampleStarter.java | 2 +- .../bpe/start/UpdateResource3MedicTtpExampleStarter.java | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java index 3af16be3b..7ed1c2cdc 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java @@ -23,17 +23,17 @@ public abstract class AbstractExampleStarter private final String certificatePath; private final char[] certificatePassword; - public AbstractExampleStarter() + protected AbstractExampleStarter() { this("../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"); } - public AbstractExampleStarter(String certificatePath) + protected AbstractExampleStarter(String certificatePath) { this(certificatePath, "password"); } - public AbstractExampleStarter(String certificatePath, String certificatePassword) + protected AbstractExampleStarter(String certificatePath, String certificatePassword) { this.certificatePath = certificatePath; this.certificatePassword = certificatePassword.toCharArray(); @@ -94,5 +94,5 @@ protected FhirWebserviceClient createClient(String baseUrl) throws Exception * * @return the resource that should be used to start a process */ - public abstract Resource createStartResource() throws Exception; + protected abstract Resource createStartResource() throws Exception; } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java index 4ecf9a2bc..be9ad178f 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -54,7 +54,7 @@ public static void main(String[] args) throws Exception } @Override - public Resource createStartResource() + protected Resource createStartResource() { Group group1 = createGroup("Group 1"); Group group2 = createGroup("Group 2"); diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java index 3725bd7fc..383b1db55 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java @@ -40,7 +40,7 @@ public static void main(String[] args) throws Exception } @Override - public Resource createStartResource() + protected Resource createStartResource() { Task task = new Task(); diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index db74f42ae..024cee3e9 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -26,7 +26,7 @@ public static void main(String[] args) throws Exception } @Override - public Resource createStartResource() + protected Resource createStartResource() { Task task = new Task(); task.getMeta().addProfile(START_PING_TASK_PROFILE); diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index 6a1b2ccc0..709bb093c 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -35,7 +35,7 @@ public static void main(String[] args) throws Exception } @Override - public Resource createStartResource() throws Exception + protected Resource createStartResource() throws Exception { Bundle allowList = getAllowList(); diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index ab5ec920d..ae7e98963 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -26,7 +26,7 @@ public static void main(String[] args) throws Exception } @Override - public Resource createStartResource() + protected Resource createStartResource() { Task task = new Task(); task.getMeta().addProfile(UPDATE_ALLOW_LIST_TASK_PROFILE); diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index 838c8fb13..f0a1a8224 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -35,7 +35,7 @@ public static void main(String[] args) throws Exception } @Override - public Resource createStartResource() throws Exception + protected Resource createStartResource() throws Exception { Bundle allowList = getAllowList(); From 7d010f5bd79cf388a6b05bb7d6db542ce9bcf70b Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 14 Dec 2020 16:19:53 +0100 Subject: [PATCH 55/75] dependency version upgrade, not upgrading HAPI to 5.2.0 FHIR validation with HAPI 5.2.0 is not working correctly. --- pom.xml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index a7fd7938b..1fa8c8612 100755 --- a/pom.xml +++ b/pom.xml @@ -22,12 +22,12 @@ <compileTarget>11</compileTarget> <slf4j.version>1.8.0-beta4</slf4j.version> - <log4j.version>2.13.3</log4j.version> + <log4j.version>2.14.0</log4j.version> - <jetty.version>9.4.32.v20200930</jetty.version> + <jetty.version>9.4.35.v20201120</jetty.version> <jersey.version>2.32</jersey.version> <tyrus.version>1.17</tyrus.version> - <spring.version>5.2.9.RELEASE</spring.version> + <spring.version>5.3.1</spring.version> <hapi.fhir.version>5.1.0</hapi.fhir.version> <hapi.hl7v2.version>2.3</hapi.hl7v2.version> @@ -106,7 +106,7 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> - <version>3.5.13</version> + <version>3.6.28</version> </dependency> <!-- database --> @@ -118,34 +118,34 @@ <dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-core</artifactId> - <version>4.1.1</version> + <version>4.2.0</version> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> - <version>42.2.17</version> + <version>42.2.18</version> </dependency> <!-- hhn rwh --> <dependency> <groupId>de.hs-heilbronn.mi</groupId> <artifactId>jetty-utils</artifactId> - <version>0.9.0</version> + <version>0.10.0</version> </dependency> <dependency> <groupId>de.hs-heilbronn.mi</groupId> <artifactId>crypto-utils</artifactId> - <version>2.8.0</version> + <version>2.9.0</version> </dependency> <dependency> <groupId>de.hs-heilbronn.mi</groupId> <artifactId>log4j2-utils</artifactId> - <version>0.7.0</version> + <version>0.8.0</version> </dependency> <dependency> <groupId>de.hs-heilbronn.mi</groupId> <artifactId>db-test-utils</artifactId> - <version>0.9.1</version> + <version>0.10.0</version> </dependency> <dependency> @@ -198,7 +198,12 @@ <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> - <version>2.11.3</version> + <version>2.12.0</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annotations</artifactId> + <version>2.12.0</version> </dependency> <!-- tyrus --> From 2f1e963f5796e29de1eff0c6d65f785205f30e90 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Mon, 14 Dec 2020 16:51:39 +0100 Subject: [PATCH 56/75] rework example starters --- ...xampleStarter.java => ExampleStarter.java} | 64 ++++++++----------- ...lityFromMedicsViaMedic1ExampleStarter.java | 19 +++--- .../LocalServicesMedic1ExampleStarter.java | 13 ++-- .../Ping3MedicFromTtpExampleStarter.java | 13 ++-- ...lowListFromTtpViaMedic1ExampleStarter.java | 20 +++--- ...pdateAllowList3MedicTtpExampleStarter.java | 13 ++-- ...UpdateResource3MedicTtpExampleStarter.java | 20 +++--- 7 files changed, 86 insertions(+), 76 deletions(-) rename dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/{AbstractExampleStarter.java => ExampleStarter.java} (52%) diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java similarity index 52% rename from dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java rename to dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java index 7ed1c2cdc..e70b5faa3 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/AbstractExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java @@ -18,43 +18,51 @@ import de.rwh.utils.crypto.CertificateHelper; import de.rwh.utils.crypto.io.CertificateReader; -public abstract class AbstractExampleStarter +public class ExampleStarter { + public static ExampleStarter forServer(String[] args, String baseUrl) + { + if (args.length != 2) + throw new IllegalArgumentException( + "Expects 2 args: 1. certificate path, 2. certificate password, found " + args.length); + + return ExampleStarter.forServer(args[0], args[1], baseUrl); + } + + public static ExampleStarter forServer(String certificatePath, String certificatePassword, String baseUrl) + { + return new ExampleStarter(certificatePath, certificatePassword, baseUrl); + } + private final String certificatePath; private final char[] certificatePassword; + private final String baseUrl; - protected AbstractExampleStarter() + private ExampleStarter(String certificatePath, String certificatePassword, String baseUrl) { - this("../../dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"); + this.certificatePath = certificatePath; + this.certificatePassword = certificatePassword.toCharArray(); + this.baseUrl = baseUrl; } - protected AbstractExampleStarter(String certificatePath) + public void startWith(Task task) throws Exception { - this(certificatePath, "password"); + start(task); } - protected AbstractExampleStarter(String certificatePath, String certificatePassword) + public void startWith(Bundle bundle) throws Exception { - this.certificatePath = certificatePath; - this.certificatePassword = certificatePassword.toCharArray(); + start(bundle); } - /** - * Use this method to start a process at an organization's FHIR endpoint. The resource that will start - * the process will be created by calling the method {@link #createStartResource()} - * - * @param baseUrl the URL of the organization's FHIR endpoint, that should receive the resource - * @throws Exception if the client cannot be initialized - */ - public final void startAt(String baseUrl) throws Exception + private void start(Resource resource) throws Exception { FhirWebserviceClient client = createClient(baseUrl); - Resource resource = createStartResource(); if (resource instanceof Bundle) { Bundle bundle = (Bundle) resource; - bundle.getEntry().stream().map(e -> e.getResource().getResourceType()).filter(t -> t == ResourceType.Task) + bundle.getEntry().stream().map(e -> e.getResource().getResourceType()).filter(ResourceType.Task::equals) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Bundle does not contain a Task resource")); @@ -66,14 +74,7 @@ else if (resource instanceof Task) throw new IllegalArgumentException("Resource should be of type Bundle or Task"); } - /** - * Creates a FHIR Webservice client based on the supplied baseUrl. - * - * @param baseUrl the URL of the organization's FHIR endpoint to which the client should connect - * @return a {@link FhirWebserviceClient} based to the supplied baseUrl - * @throws Exception if the client cannot be initialized - */ - protected FhirWebserviceClient createClient(String baseUrl) throws Exception + public FhirWebserviceClient createClient(String baseUrl) throws Exception { KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get(certificatePath), certificatePassword); KeyStore trustStore = CertificateHelper.extractTrust(keyStore); @@ -84,15 +85,4 @@ protected FhirWebserviceClient createClient(String baseUrl) throws Exception return new FhirWebserviceClientJersey(baseUrl, trustStore, keyStore, certificatePassword, null, null, null, 0, 0, null, context, referenceCleaner); } - - /** - * Returns a resource that can start a bpmn process. This should be either a {@link Task} - * or a {@link Bundle} containing a {@link Task} resource. - * <p> - * The task resource should be derived from the base profile - * "http://highmed.org/fhir/StructureDefinition/highmed-task-base" - * - * @return the resource that should be used to start a process - */ - protected abstract Resource createStartResource() throws Exception; } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java index be9ad178f..98fc55b2e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -39,22 +39,25 @@ import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResearchStudy; import org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus; -import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; import org.hl7.fhir.r4.model.Task.TaskStatus; -public class RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter extends AbstractExampleStarter +public class RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter { + // 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 + // args[1] the password of the client-certificate + // password public static void main(String[] args) throws Exception { - new RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter().startAt(MEDIC_1_FHIR_BASE_URL); + Bundle bundle = createStartResource(); + ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL).startWith(bundle); } - @Override - protected Resource createStartResource() + private static Bundle createStartResource() { Group group1 = createGroup("Group 1"); Group group2 = createGroup("Group 2"); @@ -75,7 +78,7 @@ protected Resource createStartResource() return bundle; } - private Group createGroup(String name) + private static Group createGroup(String name) { Group group = new Group(); group.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); @@ -93,7 +96,7 @@ private Group createGroup(String name) return group; } - private ResearchStudy createResearchStudy(Group group1, Group group2) + private static ResearchStudy createResearchStudy(Group group1, Group group2) { ResearchStudy researchStudy = new ResearchStudy(); researchStudy.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); @@ -125,7 +128,7 @@ private ResearchStudy createResearchStudy(Group group1, Group group2) return researchStudy; } - private Task createTask(ResearchStudy researchStudy) + private static Task createTask(ResearchStudy researchStudy) { Task task = new Task(); task.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java index 383b1db55..d9519ba67 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java @@ -24,23 +24,26 @@ import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.hl7.fhir.r4.model.Base64BinaryType; import org.hl7.fhir.r4.model.BooleanType; -import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; -public class LocalServicesMedic1ExampleStarter extends AbstractExampleStarter +public class LocalServicesMedic1ExampleStarter { private static boolean NEEDS_CONSENT_CHECK = true; private static boolean NEEDS_RECORD_LINKAGE = true; + // 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 + // args[1] the password of the client-certificate + // password public static void main(String[] args) throws Exception { - new LocalServicesMedic1ExampleStarter().startAt(MEDIC_1_FHIR_BASE_URL); + Task task = createStartResource(); + ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL).startWith(task); } - @Override - protected Resource createStartResource() + private static Task createStartResource() { Task task = new Task(); diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index 024cee3e9..f450ab7f8 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -11,22 +11,25 @@ import java.util.Date; -import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; import org.hl7.fhir.r4.model.Task.TaskStatus; -public class Ping3MedicFromTtpExampleStarter extends AbstractExampleStarter +public class Ping3MedicFromTtpExampleStarter { + // 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 + // args[1] the password of the client-certificate + // password public static void main(String[] args) throws Exception { - new Ping3MedicFromTtpExampleStarter().startAt(TTP_FHIR_BASE_URL); + Task task = createStartResource(); + ExampleStarter.forServer(args, TTP_FHIR_BASE_URL).startWith(task); } - @Override - protected Resource createStartResource() + private static Task createStartResource() { Task task = new Task(); task.getMeta().addProfile(START_PING_TASK_PROFILE); diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index 709bb093c..36705535b 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -20,24 +20,28 @@ import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; import org.hl7.fhir.r4.model.Task.TaskStatus; -public class DownloadAllowListFromTtpViaMedic1ExampleStarter extends AbstractExampleStarter +public class DownloadAllowListFromTtpViaMedic1ExampleStarter { + // 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 + // args[1] the password of the client-certificate + // password public static void main(String[] args) throws Exception { - new DownloadAllowListFromTtpViaMedic1ExampleStarter().startAt(MEDIC_1_FHIR_BASE_URL); + ExampleStarter starter = ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL); + Task task = createStartResource(starter); + starter.startWith(task); } - @Override - protected Resource createStartResource() throws Exception + private static Task createStartResource(ExampleStarter starter) throws Exception { - Bundle allowList = getAllowList(); + Bundle allowList = getAllowList(starter); Task task = new Task(); task.getMeta().addProfile(DOWNLOAD_ALLOW_LIST_TASK_PROFILE); @@ -61,9 +65,9 @@ protected Resource createStartResource() throws Exception return task; } - private Bundle getAllowList() throws Exception + private static Bundle getAllowList(ExampleStarter starter) throws Exception { - FhirWebserviceClient client = createClient(TTP_FHIR_BASE_URL); + FhirWebserviceClient client = starter.createClient(TTP_FHIR_BASE_URL); Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index ae7e98963..4aac9f969 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -11,22 +11,25 @@ import java.util.Date; -import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; import org.hl7.fhir.r4.model.Task.TaskStatus; -public class UpdateAllowList3MedicTtpExampleStarter extends AbstractExampleStarter +public class UpdateAllowList3MedicTtpExampleStarter { + // 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 + // args[1] the password of the client-certificate + // password public static void main(String[] args) throws Exception { - new UpdateAllowList3MedicTtpExampleStarter().startAt(TTP_FHIR_BASE_URL); + Task task = createStartResource(); + ExampleStarter.forServer(args, TTP_FHIR_BASE_URL).startWith(task); } - @Override - protected Resource createStartResource() + private static Task createStartResource() { Task task = new Task(); task.getMeta().addProfile(UPDATE_ALLOW_LIST_TASK_PROFILE); diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index f0a1a8224..6a53f80ba 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -20,24 +20,28 @@ import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Resource; import org.hl7.fhir.r4.model.ResourceType; import org.hl7.fhir.r4.model.StringType; import org.hl7.fhir.r4.model.Task; import org.hl7.fhir.r4.model.Task.TaskIntent; import org.hl7.fhir.r4.model.Task.TaskStatus; -public class UpdateResource3MedicTtpExampleStarter extends AbstractExampleStarter +public class UpdateResource3MedicTtpExampleStarter { + // 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 + // args[1] the password of the client-certificate + // password public static void main(String[] args) throws Exception { - new UpdateResource3MedicTtpExampleStarter().startAt(TTP_FHIR_BASE_URL); + ExampleStarter starter = ExampleStarter.forServer(args, TTP_FHIR_BASE_URL); + Task task = createStartResource(starter); + starter.startWith(task); } - @Override - protected Resource createStartResource() throws Exception + private static Task createStartResource(ExampleStarter starter) throws Exception { - Bundle allowList = getAllowList(); + Bundle allowList = getAllowList(starter); Task task = new Task(); task.getMeta().addProfile(REQUEST_UPDATE_RESOURCES_TASK_PROFILE); @@ -66,9 +70,9 @@ protected Resource createStartResource() throws Exception return task; } - private Bundle getAllowList() throws Exception + private static Bundle getAllowList(ExampleStarter starter) throws Exception { - FhirWebserviceClient client = createClient(TTP_FHIR_BASE_URL); + FhirWebserviceClient client = starter.createClient(TTP_FHIR_BASE_URL); Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); From b4d745df87bc4f024ece0d5657c3a2564b37e4ce Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Tue, 15 Dec 2020 09:17:37 +0100 Subject: [PATCH 57/75] adds support for client certificate path and password environment variables --- .../bpe/start/ConstantsExampleStarters.java | 3 ++ .../highmed/dsf/bpe/start/ExampleStarter.java | 52 +++++++++++++++++-- ...lityFromMedicsViaMedic1ExampleStarter.java | 4 +- .../LocalServicesMedic1ExampleStarter.java | 4 +- .../Ping3MedicFromTtpExampleStarter.java | 4 +- ...lowListFromTtpViaMedic1ExampleStarter.java | 4 +- ...pdateAllowList3MedicTtpExampleStarter.java | 4 +- ...UpdateResource3MedicTtpExampleStarter.java | 4 +- 8 files changed, 63 insertions(+), 16 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java index 6245b8c25..74bdeb3bb 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java @@ -2,6 +2,9 @@ public interface ConstantsExampleStarters { + String ENV_DSF_CLIENT_CERTIFICATE_PATH = "DSF_CLIENT_CERTIFICATE_PATH"; + String ENV_DSF_CLIENT_CERTIFICATE_PASSWORD = "DSF_CLIENT_CERTIFICATE_PASSWORD"; + String TTP_FHIR_BASE_URL = "https://ttp/fhir/"; String ORGANIZATION_IDENTIFIER_VALUE_TTP = "Test_TTP"; diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java index e70b5faa3..027255826 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java @@ -1,5 +1,8 @@ package org.highmed.dsf.bpe.start; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ENV_DSF_CLIENT_CERTIFICATE_PASSWORD; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ENV_DSF_CLIENT_CERTIFICATE_PATH; + import java.nio.file.Paths; import java.security.KeyStore; @@ -20,17 +23,58 @@ public class ExampleStarter { + /** + * Creates an object to send start-process-messages to a given FHIR-Endpoint baseUrl based on the + * provided client-certificate path and client-certificate password. + * + * The client-certificate path is first read from the environment variable + * {@link ConstantsExampleStarters#ENV_DSF_CLIENT_CERTIFICATE_PATH}. + * If args[0] is set, the environment variable is overwritten by args[0]. + * + * The client-certificate password is first read from the environment variable + * {@link ConstantsExampleStarters#ENV_DSF_CLIENT_CERTIFICATE_PASSWORD}. + * If args[1] is set, the environment variable is overwritten by args[1]. + * + * @param args client-certificate arguments: + * args[0] can be the path of the client-certificate + * args[1] can be the password of the client-certificate + * @param baseUrl the baseUrl of the organization's FHIR-Endpoint + * @return initialized ExampleStarter instance + */ public static ExampleStarter forServer(String[] args, String baseUrl) { - if (args.length != 2) - throw new IllegalArgumentException( - "Expects 2 args: 1. certificate path, 2. certificate password, found " + args.length); + String certificatePath = System.getenv(ENV_DSF_CLIENT_CERTIFICATE_PATH); + String certificatePassword = System.getenv(ENV_DSF_CLIENT_CERTIFICATE_PASSWORD); + + if (args.length > 0 && !args[0].isBlank()) + certificatePath = args[0]; + + if (args.length > 1 && !args[1].isBlank()) + certificatePassword = args[1]; - return ExampleStarter.forServer(args[0], args[1], baseUrl); + return ExampleStarter.forServer(certificatePath, certificatePassword, baseUrl); } + /** + * Creates an object to send start-process-messages to a given FHIR-Endpoint baseUrl based on the + * provided client-certificate path and client-certificate password. + * + * @param certificatePath the path of the client-certificate + * @param certificatePassword the password of the client-certificate + * @param baseUrl the baseUrl of the organization's FHIR-Endpoint + * @return initialized ExampleStarter instance + */ public static ExampleStarter forServer(String certificatePath, String certificatePassword, String baseUrl) { + if (certificatePath.isBlank()) + throw new IllegalArgumentException("certificatePath is blank"); + + if (certificatePassword.isBlank()) + throw new IllegalArgumentException("certificatePassword is blank"); + + if (baseUrl.isBlank()) + throw new IllegalArgumentException("baseUrl is blank"); + return new ExampleStarter(certificatePath, certificatePassword, baseUrl); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java index 98fc55b2e..bdabcf7c7 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -47,9 +47,9 @@ public class RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter { - // args[0] the path to the client-certificate + // 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 - // args[1] the password of the client-certificate + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate // password public static void main(String[] args) throws Exception { diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java index d9519ba67..24fe6ca8f 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java @@ -33,9 +33,9 @@ public class LocalServicesMedic1ExampleStarter private static boolean NEEDS_CONSENT_CHECK = true; private static boolean NEEDS_RECORD_LINKAGE = true; - // args[0] the path to the client-certificate + // 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 - // args[1] the password of the client-certificate + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate // password public static void main(String[] args) throws Exception { diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index f450ab7f8..545ea186b 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -19,9 +19,9 @@ public class Ping3MedicFromTtpExampleStarter { - // args[0] the path to the client-certificate + // 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 - // args[1] the password of the client-certificate + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate // password public static void main(String[] args) throws Exception { diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index 36705535b..9f8c20bfd 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -28,9 +28,9 @@ public class DownloadAllowListFromTtpViaMedic1ExampleStarter { - // args[0] the path to the client-certificate + // 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 - // args[1] the password of the client-certificate + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate // password public static void main(String[] args) throws Exception { diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index 4aac9f969..f6706f310 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -19,9 +19,9 @@ public class UpdateAllowList3MedicTtpExampleStarter { - // args[0] the path to the client-certificate + // 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 - // args[1] the password of the client-certificate + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate // password public static void main(String[] args) throws Exception { diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index 6a53f80ba..356af3b6b 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -28,9 +28,9 @@ public class UpdateResource3MedicTtpExampleStarter { - // args[0] the path to the client-certificate + // 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 - // args[1] the password of the client-certificate + // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate // password public static void main(String[] args) throws Exception { From ace9ed1e97684e3d41f4987be98ad89225143f89 Mon Sep 17 00:00:00 2001 From: Alexander Kiel <alexanderkiel@gmx.net> Date: Wed, 6 Jan 2021 17:55:13 +0100 Subject: [PATCH 58/75] Fix Docker Test FHIR Server Base The server base was set to https://localhost/fhir but the actual hostname of the FHIR server inside the Docker network is fhir and not localhost. The server base is used to validate the fullUrl of transaction/batch bundles on update commands. In case one restarts the BPE, it tries to update resources like CodeSystem. For that update it uses https://fhir/fhir as base URL which doesn't match https://localhost/fhir. Steps to reproduce: 1. Follow https://github.com/highmed/highmed-dsf/wiki/Build-and-Test-Project#manual-integration-testing-local-with-docker 2. stop the BPE and restart it --- .../config-templates/docker-test-fhir-config.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/config-templates/docker-test-fhir-config.properties b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/config-templates/docker-test-fhir-config.properties index 294c10ae0..fe6ded61b 100755 --- a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/config-templates/docker-test-fhir-config.properties +++ b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/config-templates/docker-test-fhir-config.properties @@ -8,7 +8,7 @@ org.highmed.dsf.fhir.db.server_user=fhir_server_user org.highmed.dsf.fhir.db.server_user_password=xTZkzduUjYw3Bk7XQ4hYi2cRbunDAdNT org.highmed.dsf.fhir.organizationType=MeDIC -org.highmed.dsf.fhir.serverBase=https://localhost/fhir +org.highmed.dsf.fhir.serverBase=https://fhir/fhir org.highmed.dsf.fhir.defaultPageCount=20 org.highmed.dsf.fhir.local-user.thumbprints= @@ -21,4 +21,4 @@ org.highmed.dsf.fhir.webservice.keystore.password=password org.highmed.dsf.fhir.remote.webservice.readTimeout=2500 org.highmed.dsf.fhir.remote.webservice.connectTimeout=1500 -org.highmed.dsf.fhir.cors.origins=http://localhost:8080 \ No newline at end of file +org.highmed.dsf.fhir.cors.origins=http://localhost:8080 From d2e220aa23719eb985bbc344536b7819ade85dc1 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 11 Jan 2021 11:09:59 +0100 Subject: [PATCH 59/75] removed not needed import --- .../org/highmed/dsf/bpe/variables/ConstantsFeasibility.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java index 1f1bde750..411e37826 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java @@ -2,8 +2,6 @@ import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; -import org.hl7.fhir.r4.model.CodeType; - public interface ConstantsFeasibility { String VARIABLE_BLOOM_FILTER_CONFIG = "bloomFilterConfig"; From 2bf9fc3e25240e5b1e943cf8f958676175a1133c Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 11 Jan 2021 11:30:49 +0100 Subject: [PATCH 60/75] moved ProcessPluginDefinition and constant interfaces to bpe package --- .../{ => bpe}/ProcessPluginDefinition.java | 2 +- .../{variables => }/ConstantsFeasibility.java | 15 ++---- .../FeasibilityProcessPluginDefinition.java | 1 - .../dsf/bpe/message/SendMedicRequest.java | 2 +- .../bpe/message/SendMultiMedicResults.java | 2 +- .../bpe/message/SendSingleMedicResults.java | 2 +- .../dsf/bpe/message/SendTtpRequest.java | 2 +- .../service/CalculateMultiMedicResults.java | 2 +- .../service/CheckFeasibilityResources.java | 2 +- .../bpe/service/CheckMultiMedicResults.java | 2 +- .../highmed/dsf/bpe/service/CheckQueries.java | 2 +- .../bpe/service/CheckSingleMedicResults.java | 2 +- .../CheckTtpComputedMultiMedicResults.java | 4 +- .../service/DownloadFeasibilityResources.java | 4 +- .../DownloadResearchStudyResource.java | 2 +- .../dsf/bpe/service/DownloadResultSets.java | 2 +- .../dsf/bpe/service/ExecuteQueries.java | 2 +- .../dsf/bpe/service/ExecuteRecordLink.java | 2 +- .../service/FilterQueryResultsByConsent.java | 2 +- .../dsf/bpe/service/GenerateBloomFilters.java | 2 +- .../dsf/bpe/service/GenerateCountFromIds.java | 2 +- .../dsf/bpe/service/ModifyQueries.java | 2 +- .../dsf/bpe/service/SelectRequestTargets.java | 2 +- .../dsf/bpe/service/StoreCorrelationKeys.java | 2 +- .../highmed/dsf/bpe/service/StoreResults.java | 2 +- ...lityFromMedicsViaMedic1ExampleStarter.java | 24 ++++----- .../dsf/fhir/profile/GroupProfileTest.java | 2 +- .../profile/ResearchStudyProfileTest.java | 8 +-- .../dsf/fhir/profile/TaskProfileTest.java | 52 +++++++++---------- .../dsf/bpe/ConstantsLocalServices.java | 12 +++++ .../LocalServicesProcessPluginDefinition.java | 1 - .../dsf/bpe/service/ExtractInputValues.java | 2 +- .../highmed/dsf/bpe/service/StoreResult.java | 2 +- .../bpe/variables/ConstantsLocalServices.java | 13 ----- .../LocalServicesMedic1ExampleStarter.java | 14 ++--- .../dsf/fhir/profile/TaskProfileTest.java | 14 ++--- .../bpe/{variables => }/ConstantsPing.java | 9 ++-- .../dsf/bpe/PingProcessPluginDefinition.java | 1 - .../Ping3MedicFromTtpExampleStarter.java | 6 +-- .../dsf/fhir/profiles/TaskProfileTest.java | 16 +++--- .../ConstantsUpdateAllowList.java | 11 ++-- ...pdateAllowListProcessPluginDefinition.java | 1 - .../dsf/bpe/service/DownloadAllowList.java | 2 +- .../dsf/bpe/service/UpdateAllowList.java | 2 +- ...lowListFromTtpViaMedic1ExampleStarter.java | 10 ++-- ...pdateAllowList3MedicTtpExampleStarter.java | 6 +-- .../dsf/fhir/profile/TaskProfileTest.java | 16 +++--- .../ConstantsUpdateResources.java | 11 ++-- ...pdateResourcesProcessPluginDefinition.java | 1 - .../highmed/dsf/bpe/message/SendRequest.java | 2 +- .../bpe/service/SelectResourceAndTargets.java | 2 +- .../dsf/bpe/service/UpdateResources.java | 2 +- ...UpdateResource3MedicTtpExampleStarter.java | 12 ++--- .../dsf/fhir/profile/TaskProfileTest.java | 18 +++---- ...ProcessPluginDefinitionAndClassLoader.java | 2 +- .../bpe/plugin/ProcessPluginProviderImpl.java | 2 +- 56 files changed, 162 insertions(+), 180 deletions(-) rename dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/{ => bpe}/ProcessPluginDefinition.java (99%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/{variables => }/ConstantsFeasibility.java (86%) create mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java rename dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/{variables => }/ConstantsPing.java (80%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/{variables => }/ConstantsUpdateAllowList.java (65%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/{variables => }/ConstantsUpdateResources.java (76%) diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ProcessPluginDefinition.java similarity index 99% rename from dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java rename to dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ProcessPluginDefinition.java index 71d9fc6c6..0b43d6774 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/ProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ProcessPluginDefinition.java @@ -1,4 +1,4 @@ -package org.highmed.dsf; +package org.highmed.dsf.bpe; import java.util.Collections; import java.util.List; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java similarity index 86% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java index 411e37826..2fcf4a985 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/ConstantsFeasibility.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java @@ -1,6 +1,7 @@ -package org.highmed.dsf.bpe.variables; +package org.highmed.dsf.bpe; import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; +import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.VERSION; public interface ConstantsFeasibility { @@ -43,23 +44,17 @@ public interface ConstantsFeasibility String REQUEST_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility"; String REQUEST_FEASIBILITY_PROCESS_URI = PROCESS_URI_BASE + "requestSimpleFeasibility/"; - String REQUEST_FEASIBILITY_PROCESS_LATEST_VERSION = "0.4.0"; - String REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - REQUEST_FEASIBILITY_PROCESS_URI + REQUEST_FEASIBILITY_PROCESS_LATEST_VERSION; + String REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = REQUEST_FEASIBILITY_PROCESS_URI + VERSION; String REQUEST_FEASIBILITY_MESSAGE_NAME = "requestSimpleFeasibilityMessage"; String EXECUTE_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility"; String EXECUTE_FEASIBILITY_PROCESS_URI = PROCESS_URI_BASE + "executeSimpleFeasibility/"; - String EXECUTE_FEASIBILITY_PROCESS_LATEST_VERSION = "0.4.0"; - String EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - EXECUTE_FEASIBILITY_PROCESS_URI + EXECUTE_FEASIBILITY_PROCESS_LATEST_VERSION; + String EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = EXECUTE_FEASIBILITY_PROCESS_URI + VERSION; String EXECUTE_FEASIBILITY_MESSAGE_NAME = "executeSimpleFeasibilityMessage"; String COMPUTE_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility"; String COMPUTE_FEASIBILITY_PROCESS_URI = PROCESS_URI_BASE + "computeSimpleFeasibility/"; - String COMPUTE_FEASIBILITY_PROCESS_LATEST_VERSION = "0.4.0"; - String COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - COMPUTE_FEASIBILITY_PROCESS_URI + COMPUTE_FEASIBILITY_PROCESS_LATEST_VERSION; + String COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = COMPUTE_FEASIBILITY_PROCESS_URI + VERSION; String COMPUTE_FEASIBILITY_MESSAGE_NAME = "computeSimpleFeasibilityMessage"; String SINGLE_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility"; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index ba71549df..3d1399b17 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -5,7 +5,6 @@ import java.util.Map; import java.util.stream.Stream; -import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.FeasibilityConfig; import org.highmed.dsf.bpe.spring.config.FeasibilitySerializerConfig; import org.highmed.dsf.fhir.resources.AbstractResource; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java index fa4e7c669..e78daa8ff 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java @@ -3,11 +3,11 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; import org.highmed.dsf.fhir.task.TaskHelper; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java index ec77f9da8..38c819157 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java @@ -7,7 +7,7 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java index 834c683b9..c0bde341e 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java @@ -3,11 +3,11 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; import org.highmed.dsf.fhir.task.TaskHelper; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.hl7.fhir.r4.model.Extension; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java index cf1bf6848..ea5dbcd16 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java @@ -4,7 +4,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java index 094e0a0bb..0ced30238 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java @@ -5,8 +5,8 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java index da934ab2e..da0b3c6f9 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java @@ -5,8 +5,8 @@ import java.util.List; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.FhirResourcesList; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java index d3d55bb1b..c281261b7 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java @@ -5,8 +5,8 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java index 92e4659b3..1086aa4b4 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java @@ -8,8 +8,8 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.group.GroupHelper; import org.highmed.dsf.fhir.task.TaskHelper; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java index b784ad438..baf09a90f 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java @@ -6,8 +6,8 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java index 91e1423ac..672ed0838 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java @@ -2,7 +2,7 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.ERROR_CODE_MULTI_MEDIC_RESULT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.ERROR_CODE_MULTI_MEDIC_RESULT; import java.util.List; import java.util.stream.Collectors; @@ -10,8 +10,8 @@ import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java index 4829474e0..1ea3fa841 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java @@ -1,6 +1,6 @@ package org.highmed.dsf.bpe.service; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; import java.util.Collections; import java.util.List; @@ -10,10 +10,10 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java index 9841b0107..7e53b4cea 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java @@ -8,8 +8,8 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java index 8ec330cb3..04d60c595 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java @@ -11,8 +11,8 @@ import javax.ws.rs.core.MediaType; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java index b856aa1bf..a4bbaa165 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java @@ -6,8 +6,8 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java index 3dded8a65..94eaf0ffe 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java @@ -7,8 +7,8 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java index 0c3c2e216..b2310a6a5 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java @@ -4,8 +4,8 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java index bed50e0cd..aff3c9067 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java @@ -11,9 +11,9 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java index 8e07e0097..773f11384 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java @@ -4,8 +4,8 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java index 8284020b5..9d6399de5 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java @@ -6,8 +6,8 @@ import java.util.Objects; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.springframework.beans.factory.InitializingBean; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java index 0464eb148..cf690feba 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java @@ -12,10 +12,10 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java index d85f7d0fe..013bb86d5 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java @@ -5,8 +5,8 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java index d8bf18338..eb19b24cd 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java @@ -6,8 +6,8 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java index bdabcf7c7..57d821126 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -5,23 +5,23 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_QUERY_URI; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; +import static org.highmed.dsf.bpe.ConstantsFeasibility.FEASIBILITY_RESEARCH_STUDY_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.GROUP_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.RESEARCH_STUDY_IDENTIFIER_SYSTEM; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.FEASIBILITY_RESEARCH_STUDY_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.GROUP_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.RESEARCH_STUDY_IDENTIFIER_SYSTEM; import java.util.Date; import java.util.UUID; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java index c578d10e0..bae563a3f 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java @@ -3,7 +3,7 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_QUERY_URI; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.GROUP_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.GROUP_PROFILE; import static org.junit.Assert.assertEquals; import java.util.Arrays; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java index deb613cdb..e11a04114 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java @@ -1,10 +1,10 @@ package org.highmed.dsf.fhir.profile; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.FEASIBILITY_RESEARCH_STUDY_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.RESEARCH_STUDY_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; +import static org.highmed.dsf.bpe.ConstantsFeasibility.FEASIBILITY_RESEARCH_STUDY_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.RESEARCH_STUDY_IDENTIFIER_SYSTEM; import static org.junit.Assert.assertEquals; import java.util.Arrays; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 24ca460da..3e4e4f0d4 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -6,32 +6,32 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.COMPUTE_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.COMPUTE_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.ERROR_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.ERROR_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXECUTE_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXECUTE_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.EXTENSION_GROUP_ID_URI; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.MULTI_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.REQUEST_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.SINGLE_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.COMPUTE_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsFeasibility.COMPUTE_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.ERROR_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.ERROR_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXECUTE_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXECUTE_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_GROUP_ID_URI; +import static org.highmed.dsf.bpe.ConstantsFeasibility.MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.MULTI_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.SINGLE_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE; import static org.junit.Assert.assertEquals; import java.nio.charset.StandardCharsets; diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java new file mode 100644 index 000000000..25b62f374 --- /dev/null +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java @@ -0,0 +1,12 @@ +package org.highmed.dsf.bpe; + +import static org.highmed.dsf.bpe.ConstantsFeasibility.LOCAL_SERVICES_PROCESS_URI; +import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.VERSION; + +public interface ConstantsLocalServices +{ + String LOCAL_SERVICES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"; + String LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION = LOCAL_SERVICES_PROCESS_URI + VERSION; + + String LOCAL_SERVICES_MESSAGE_NAME = "localServicesIntegrationMessage"; +} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index 6e616b439..fa5d7a6b6 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -5,7 +5,6 @@ import java.util.Map; import java.util.stream.Stream; -import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.FeasibilitySerializerConfig; import org.highmed.dsf.bpe.spring.config.LocalServicesConfig; import org.highmed.dsf.fhir.resources.AbstractResource; diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java index 1e892a489..58204153a 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java @@ -9,10 +9,10 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.fhir.variables.FhirResourcesListValues; diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java index 10ff32afe..5089fff04 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java @@ -1,8 +1,8 @@ package org.highmed.dsf.bpe.service; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java deleted file mode 100644 index 924ddb751..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/variables/ConstantsLocalServices.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.LOCAL_SERVICES_PROCESS_URI; - -public interface ConstantsLocalServices -{ - String LOCAL_SERVICES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"; - String LOCAL_SERVICES_PROCESS_LATEST_VERSION = "0.4.0"; - String LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION = - LOCAL_SERVICES_PROCESS_URI + LOCAL_SERVICES_PROCESS_LATEST_VERSION; - - String LOCAL_SERVICES_MESSAGE_NAME = "localServicesIntegrationMessage"; -} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java index 24fe6ca8f..ea181dfde 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java @@ -5,15 +5,15 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_TASK_PROFILE; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_TASK_PROFILE; import java.util.Date; import java.util.Random; diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index bf045ebc4..4320ca630 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -5,13 +5,13 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.variables.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsLocalServices.LOCAL_SERVICES_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_TASK_PROFILE; import static org.junit.Assert.assertEquals; import java.util.Arrays; diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java similarity index 80% rename from dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java rename to dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java index a98672283..b255ec2e7 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/variables/ConstantsPing.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java @@ -1,6 +1,7 @@ -package org.highmed.dsf.bpe.variables; +package org.highmed.dsf.bpe; import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; +import static org.highmed.dsf.bpe.PingProcessPluginDefinition.VERSION; public interface ConstantsPing { @@ -9,13 +10,11 @@ public interface ConstantsPing String PING_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-ping"; String PING_PROCESS_URI = PROCESS_URI_BASE + "ping/"; - String PING_PROCESS_LATEST_VERSION = "0.4.0"; - String PING_PROCESS_URI_AND_LATEST_VERSION = PING_PROCESS_URI + PING_PROCESS_LATEST_VERSION; + String PING_PROCESS_URI_AND_LATEST_VERSION = PING_PROCESS_URI + VERSION; String PING_MESSAGE_NAME = "pingMessage"; String PONG_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-pong"; String PONG_PROCESS_URI = PROCESS_URI_BASE + "pong/"; - String PONG_PROCESS_LATEST_VERSION = "0.4.0"; - String PONG_PROCESS_URI_AND_LATEST_VERSION = PONG_PROCESS_URI + PONG_PROCESS_LATEST_VERSION; + String PONG_PROCESS_URI_AND_LATEST_VERSION = PONG_PROCESS_URI + VERSION; String PONG_MESSAGE_NAME = "pongMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java index b5defe07c..85ae68895 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java @@ -5,7 +5,6 @@ import java.util.Map; import java.util.stream.Stream; -import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.PingConfig; import org.highmed.dsf.fhir.resources.AbstractResource; import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index 545ea186b..3a260ec0d 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -3,11 +3,11 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsPing.PING_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsPing.START_PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsPing.START_PING_TASK_PROFILE; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.variables.ConstantsPing.PING_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_TASK_PROFILE; import java.util.Date; diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java index bdd12b262..71c8cbc0a 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java @@ -5,14 +5,14 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.variables.ConstantsPing.PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsPing.PING_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsPing.PING_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsPing.PONG_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsPing.PONG_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsPing.PONG_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsPing.START_PING_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsPing.PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsPing.PING_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsPing.PING_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsPing.PONG_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsPing.PONG_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsPing.PONG_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsPing.START_PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsPing.START_PING_TASK_PROFILE; import static org.junit.Assert.assertEquals; import java.util.Arrays; diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java similarity index 65% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java index 3435de2c8..b39d22da6 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateAllowList.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java @@ -1,6 +1,7 @@ -package org.highmed.dsf.bpe.variables; +package org.highmed.dsf.bpe; import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; +import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.VERSION; public interface ConstantsUpdateAllowList { @@ -9,15 +10,11 @@ public interface ConstantsUpdateAllowList String DOWNLOAD_ALLOW_LIST_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"; String DOWNLOAD_ALLOW_LIST_PROCESS_URI = PROCESS_URI_BASE + "downloadAllowList/"; - String DOWNLOAD_ALLOW_LIST_PROCESS_LATEST_VERSION = "0.4.0"; - String DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = - DOWNLOAD_ALLOW_LIST_PROCESS_URI + DOWNLOAD_ALLOW_LIST_PROCESS_LATEST_VERSION; + String DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = DOWNLOAD_ALLOW_LIST_PROCESS_URI + VERSION; String DOWNLOAD_ALLOW_LIST_MESSAGE_NAME = "downloadAllowListMessage"; String UPDATE_ALLOW_LIST_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"; String UPDATE_ALLOW_LIST_PROCESS_URI = PROCESS_URI_BASE + "updateAllowList/"; - String UPDATE_ALLOW_LIST_PROCESS_LATEST_VERSION = "0.4.0"; - String UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = - UPDATE_ALLOW_LIST_PROCESS_URI + UPDATE_ALLOW_LIST_PROCESS_LATEST_VERSION; + String UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = UPDATE_ALLOW_LIST_PROCESS_URI + VERSION; String UPDATE_ALLOW_LIST_MESSAGE_NAME = "updateAllowListMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java index a6c0d5f9f..dd0879c0d 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java @@ -5,7 +5,6 @@ import java.util.Map; import java.util.stream.Stream; -import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.UpdateAllowListConfig; import org.highmed.dsf.fhir.resources.AbstractResource; import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java index 29d7f57ce..9584b24f7 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java @@ -8,8 +8,8 @@ import javax.ws.rs.WebApplicationException; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsUpdateAllowList; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.fhir.client.FhirWebserviceClient; diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java index a26a9fd03..a5506756d 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java @@ -11,8 +11,8 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsUpdateAllowList; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index 9f8c20bfd..ae0daf025 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -3,14 +3,14 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_TASK_PROFILE; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_TASK_PROFILE; import java.util.Collections; import java.util.Date; diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index f6706f310..3073feb77 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -3,11 +3,11 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_TASK_PROFILE; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_TASK_PROFILE; import java.util.Date; diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index da780c6ea..9507a4d61 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -3,14 +3,14 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_TASK_PROFILE; import static org.junit.Assert.assertEquals; import java.util.Arrays; diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java similarity index 76% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java index e88f632de..78ee62c2b 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/variables/ConstantsUpdateResources.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java @@ -1,6 +1,7 @@ -package org.highmed.dsf.bpe.variables; +package org.highmed.dsf.bpe; import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; +import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.VERSION; public interface ConstantsUpdateResources { @@ -10,15 +11,11 @@ public interface ConstantsUpdateResources String REQUEST_UPDATE_RESOURCES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"; String REQUEST_UPDATE_RESOURCES_PROCESS_URI = PROCESS_URI_BASE + "requestUpdateResources/"; - String REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION = "0.4.0"; - String REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = - REQUEST_UPDATE_RESOURCES_PROCESS_URI + REQUEST_UPDATE_RESOURCES_PROCESS_LATEST_VERSION; + String REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = REQUEST_UPDATE_RESOURCES_PROCESS_URI + VERSION; String REQUEST_UPDATE_RESOURCES_MESSAGE_NAME = "requestUpdateResourcesMessage"; String EXECUTE_UPDATE_RESOURCES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources"; String EXECUTE_UPDATE_RESOURCES_PROCESS_URI = PROCESS_URI_BASE + "executeUpdateResources/"; - String EXECUTE_UPDATE_RESOURCES_PROCESS_LATEST_VERSION = "0.4.0"; - String EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = - EXECUTE_UPDATE_RESOURCES_PROCESS_URI + EXECUTE_UPDATE_RESOURCES_PROCESS_LATEST_VERSION; + String EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = EXECUTE_UPDATE_RESOURCES_PROCESS_URI + VERSION; String EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME = "executeUpdateResourcesMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java index 8480efcee..f5ff07eef 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java @@ -5,7 +5,6 @@ import java.util.Map; import java.util.stream.Stream; -import org.highmed.dsf.ProcessPluginDefinition; import org.highmed.dsf.bpe.spring.config.UpdateResourcesConfig; import org.highmed.dsf.fhir.resources.AbstractResource; import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java index 8182ba381..616d6dbf3 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java @@ -4,7 +4,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.variables.ConstantsUpdateResources; +import org.highmed.dsf.bpe.ConstantsUpdateResources; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java index 857b994ef..e1aa4e60a 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java @@ -7,8 +7,8 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; +import org.highmed.dsf.bpe.ConstantsUpdateResources; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsUpdateResources; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.TaskHelper; diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java index 872818aa9..dd120e2d9 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java @@ -8,8 +8,8 @@ import javax.ws.rs.WebApplicationException; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsUpdateResources; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.ConstantsUpdateResources; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.fhir.client.FhirWebserviceClient; diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index 356af3b6b..bde755ca9 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -3,14 +3,14 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; import java.util.Collections; import java.util.Date; diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 1ff4d14a7..630350d36 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -4,15 +4,15 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_TASK_PROFILE; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.variables.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java index fdd58fa45..858b8df6b 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginDefinitionAndClassLoader.java @@ -11,7 +11,7 @@ import org.camunda.bpm.model.bpmn.Bpmn; import org.camunda.bpm.model.bpmn.BpmnModelInstance; import org.camunda.bpm.model.bpmn.instance.Process; -import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.ProcessPluginDefinition; import org.highmed.dsf.bpe.process.BpmnFileAndModel; import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; import org.highmed.dsf.fhir.resources.ResourceProvider; diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java index 03985cd80..54db68881 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/plugin/ProcessPluginProviderImpl.java @@ -19,7 +19,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.highmed.dsf.ProcessPluginDefinition; +import org.highmed.dsf.bpe.ProcessPluginDefinition; import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; import org.highmed.dsf.fhir.resources.ResourceProvider; import org.slf4j.Logger; From 1382a4bad4442e373c80d6ed29c1fe0d7f17579c Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 11 Jan 2021 16:38:14 +0100 Subject: [PATCH 61/75] renamed service files (Interface moved to new package in 2bf9fc3) --- ...uginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} | 0 ...uginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} | 0 ...uginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} | 0 ...uginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} | 0 ...uginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/{org.highmed.dsf.ProcessPluginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} (100%) rename dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/{org.highmed.dsf.ProcessPluginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} (100%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/{org.highmed.dsf.ProcessPluginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/{org.highmed.dsf.ProcessPluginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/{org.highmed.dsf.ProcessPluginDefinition => org.highmed.dsf.bpe.ProcessPluginDefinition} (100%) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition similarity index 100% rename from dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition rename to dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition similarity index 100% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.ProcessPluginDefinition rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition From 0b4b4c923ab2955acd26a9de3fc1bcab97f1e549 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Mon, 11 Jan 2021 16:39:03 +0100 Subject: [PATCH 62/75] added not null tests --- .../org/highmed/dsf/bpe/start/ExampleStarter.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java index 027255826..9c5f1cc09 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ExampleStarter.java @@ -66,14 +66,14 @@ public static ExampleStarter forServer(String[] args, String baseUrl) */ public static ExampleStarter forServer(String certificatePath, String certificatePassword, String baseUrl) { - if (certificatePath.isBlank()) - throw new IllegalArgumentException("certificatePath is blank"); + if (certificatePath == null || certificatePath.isBlank()) + throw new IllegalArgumentException("certificatePath null or blank"); - if (certificatePassword.isBlank()) - throw new IllegalArgumentException("certificatePassword is blank"); + if (certificatePassword == null || certificatePassword.isBlank()) + throw new IllegalArgumentException("certificatePassword null or blank"); - if (baseUrl.isBlank()) - throw new IllegalArgumentException("baseUrl is blank"); + if (baseUrl == null || baseUrl.isBlank()) + throw new IllegalArgumentException("baseUrl null or blank"); return new ExampleStarter(certificatePath, certificatePassword, baseUrl); } From 28a2f5e8ef6358f0563234a6728762f4e3077da4 Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Fri, 15 Jan 2021 11:29:14 +0100 Subject: [PATCH 63/75] refactors namings in constants and fhir profiles, exclude data sharing processes in 3medic-ttp vm's, add script to shutdown all vm's --- .../org/highmed/dsf/bpe/ConstantsBase.java | 54 +- .../bpe/delegate/AbstractServiceDelegate.java | 42 +- .../fhir/task/AbstractTaskMessageSend.java | 21 +- .../bpe/start/ConstantsExampleStarters.java | 8 +- .../highmed/dsf/bpe/ConstantsFeasibility.java | 76 +- .../FeasibilityProcessPluginDefinition.java | 49 +- .../dsf/bpe/message/SendMedicRequest.java | 13 +- .../bpe/message/SendMultiMedicResults.java | 4 +- .../bpe/message/SendSingleMedicResults.java | 10 +- .../dsf/bpe/message/SendTtpRequest.java | 4 +- .../service/CalculateMultiMedicResults.java | 15 +- .../service/CheckFeasibilityResources.java | 16 +- .../bpe/service/CheckMultiMedicResults.java | 6 +- .../highmed/dsf/bpe/service/CheckQueries.java | 10 +- .../bpe/service/CheckSingleMedicResults.java | 12 +- .../CheckTtpComputedMultiMedicResults.java | 11 +- .../service/DownloadFeasibilityResources.java | 18 +- .../DownloadResearchStudyResource.java | 27 +- .../dsf/bpe/service/DownloadResultSets.java | 4 +- .../dsf/bpe/service/ExecuteQueries.java | 11 +- .../dsf/bpe/service/ExecuteRecordLink.java | 8 +- .../service/FilterQueryResultsByConsent.java | 8 +- .../dsf/bpe/service/GenerateBloomFilters.java | 14 +- .../dsf/bpe/service/GenerateCountFromIds.java | 4 +- .../dsf/bpe/service/ModifyQueries.java | 11 +- .../dsf/bpe/service/SelectRequestTargets.java | 19 +- .../service/SelectResponseTargetMedic.java | 2 +- .../bpe/service/SelectResponseTargetTtp.java | 4 +- .../dsf/bpe/service/StoreCorrelationKeys.java | 7 +- .../highmed/dsf/bpe/service/StoreResults.java | 12 +- .../bpe/spring/config/FeasibilityConfig.java | 6 +- ...asibility.bpmn => computeFeasibility.bpmn} | 26 +- ...asibility.bpmn => executeFeasibility.bpmn} | 14 +- ...asibility.bpmn => requestFeasibility.bpmn} | 34 +- ...ity.xml => highmed-computeFeasibility.xml} | 22 +- ...ity.xml => highmed-executeFeasibility.xml} | 16 +- ...ity.xml => highmed-requestFeasibility.xml} | 26 +- ...easibility.xml => highmed-feasibility.xml} | 0 ...{query-type.xml => highmed-query-type.xml} | 0 ... => highmed-research-study-identifier.xml} | 0 .../highmed-extension-group-id.xml | 6 +- .../highmed-extension-participating-medic.xml | 6 +- .../highmed-extension-participating-ttp.xml | 6 +- .../highmed-extension-query.xml | 4 +- .../StructureDefinition/highmed-group.xml | 4 +- .../highmed-research-study-feasibility.xml | 8 +- ...l => highmed-task-compute-feasibility.xml} | 10 +- ...xml => highmed-task-error-feasibility.xml} | 10 +- ...l => highmed-task-execute-feasibility.xml} | 12 +- ...d-task-multi-medic-result-feasibility.xml} | 14 +- ...l => highmed-task-request-feasibility.xml} | 16 +- ...-task-single-medic-result-feasibility.xml} | 14 +- ...easibility.xml => highmed-feasibility.xml} | 0 ...{query-type.xml => highmed-query-type.xml} | 0 ...ityFromMedicsViaMedic1ExampleStarter.java} | 80 ++- .../dsf/fhir/profile/GroupProfileTest.java | 18 +- .../profile/ResearchStudyProfileTest.java | 43 +- .../dsf/fhir/profile/TaskProfileTest.java | 206 +++--- .../dsf/bpe/ConstantsLocalServices.java | 10 +- .../LocalServicesProcessPluginDefinition.java | 32 +- .../dsf/bpe/service/ExtractInputValues.java | 19 +- .../highmed/dsf/bpe/service/StoreResult.java | 4 +- .../bpe/localServicesIntegration.bpmn | 8 +- ...l => highmed-localServicesIntegration.xml} | 4 +- ...ighmed-task-local-services-integration.xml | 8 +- .../LocalServicesMedic1ExampleStarter.java | 28 +- .../dsf/fhir/profile/TaskProfileTest.java | 32 +- .../org/highmed/dsf/bpe/ConstantsPing.java | 22 +- .../dsf/bpe/PingProcessPluginDefinition.java | 14 +- .../dsf/bpe/service/SelectPingTargets.java | 3 +- .../dsf/bpe/service/SelectPongTarget.java | 2 +- .../src/main/resources/bpe/ping.bpmn | 2 +- .../src/main/resources/bpe/pong.bpmn | 2 +- .../{ping.xml => highmed-ping.xml} | 8 +- .../{pong.xml => highmed-pong.xml} | 4 +- .../StructureDefinition/highmed-task-ping.xml | 4 +- .../StructureDefinition/highmed-task-pong.xml | 4 +- .../highmed-task-start-ping-process.xml | 4 +- .../Ping3MedicFromTtpExampleStarter.java | 22 +- .../dsf/fhir/profiles/TaskProfileTest.java | 53 +- .../dsf/bpe/ConstantsUpdateAllowList.java | 20 +- ...pdateAllowListProcessPluginDefinition.java | 18 +- .../dsf/bpe/service/UpdateAllowList.java | 26 +- ...List.xml => highmed-downloadAllowList.xml} | 4 +- ...owList.xml => highmed-updateAllowList.xml} | 4 +- ...list.xml => highmed-update-allow-list.xml} | 0 .../highmed-task-download-allow-list.xml | 4 +- .../highmed-task-update-allow-list.xml | 4 +- ...list.xml => highmed-update-allow-list.xml} | 0 ...lowListFromTtpViaMedic1ExampleStarter.java | 24 +- ...pdateAllowList3MedicTtpExampleStarter.java | 24 +- .../dsf/fhir/profile/TaskProfileTest.java | 64 +- .../dsf/bpe/ConstantsUpdateResources.java | 22 +- ...pdateResourcesProcessPluginDefinition.java | 19 +- .../highmed/dsf/bpe/message/SendRequest.java | 6 +- .../highmed/dsf/bpe/service/CheckRequest.java | 7 +- .../bpe/service/SelectResourceAndTargets.java | 5 +- .../resources/bpe/requestUpdateResources.bpmn | 2 +- ...xml => highmed-executeUpdateResources.xml} | 4 +- ...xml => highmed-requestUpdateResources.xml} | 4 +- ...urces.xml => highmed-update-resources.xml} | 0 .../highmed-task-execute-update-resources.xml | 4 +- .../highmed-task-request-update-resources.xml | 4 +- ...urces.xml => highmed-update-resources.xml} | 0 ...UpdateResource3MedicTtpExampleStarter.java | 24 +- .../dsf/fhir/profile/TaskProfileTest.java | 60 +- .../bpe/listener/CallActivityListener.java | 4 +- .../highmed/dsf/bpe/listener/EndListener.java | 11 +- .../dsf/bpe/listener/StartListener.java | 15 +- .../dsf/bpe/webservice/ProcessService.java | 2 +- .../dsf/fhir/group/GroupHelperImpl.java | 10 +- .../OrganizationProviderImpl.java | 4 +- .../highmed/dsf/fhir/task/TaskHandler.java | 26 +- .../dsf/bpe/client/TestBpeJerseyClient.java | 26 +- .../ansible-stop-all.sh | 3 + .../medic1/bpe/app/conf/config.properties | 2 +- .../medic2/bpe/app/conf/config.properties | 2 +- .../medic3/bpe/app/conf/config.properties | 2 +- .../ttp/bpe/app/conf/config.properties | 2 +- ...initionProcessAuthorizationExtensions.java | 2 +- .../OrganizationAuthorizationRule.java | 29 +- .../ResearchStudyAuthorizationRule.java | 37 +- .../authorization/ResearchStudyHelper.java | 4 +- .../dao/jdbc/ActivityDefinitionDaoJdbc.java | 2 +- .../fhir/dao/jdbc/OrganizationDaoJdbc.java | 21 +- .../fhir/dao/jdbc/ResearchStudyDaoJdbc.java | 19 +- .../parameters/user/GroupUserFilter.java | 8 +- .../user/PractitionerRoleUserFilter.java | 8 +- .../user/PractitionerUserFilter.java | 8 +- .../user/ResearchStudyUserFilter.java | 8 +- .../dsf/fhir/dao/OrganizationDaoTest.java | 23 +- .../dsf/fhir/dao/ResearchStudyDaoTest.java | 17 +- .../hapi/ActivityDefinitionWithExtension.java | 9 +- .../dsf/fhir/hapi/OrganizationTest.java | 4 +- .../dsf/fhir/hapi/ResearchStudyTest.java | 4 +- .../integration/AbstractIntegrationTest.java | 20 +- .../integration/BundleIntegrationTest.java | 10 +- .../integration/EndpointIntegrationTest.java | 24 +- .../OrganizationIntegrationTest.java | 26 +- .../fhir/integration/TaskIntegrationTest.java | 679 +++++++++--------- .../src/test/resources/bundle.xml | 8 +- .../resources/integration/allow-list.json | 24 +- .../resources/integration/task-bundle.json | 18 +- .../resources/integration/test-bundle.xml | 12 +- .../profiles/highmed-endpoint-0.5.0.xml | 4 +- ...extension-certificate-thumbprint-0.5.0.xml | 4 +- .../profiles/highmed-organization-0.5.0.xml | 8 +- .../resources/profiles/highmed-task-0.5.0.xml | 4 +- ...l => highmed-authorization-role-0.4.0.xml} | 0 ...highmed-authorization-role-0.4.0.xml.post} | 0 ...4.0.xml => highmed-bpmn-message-0.4.0.xml} | 0 ...st => highmed-bpmn-message-0.4.0.xml.post} | 0 ...ml => highmed-organization-type-0.4.0.xml} | 0 ... highmed-organization-type-0.4.0.xml.post} | 0 .../highmed-endpoint-0.4.0.xml | 4 +- .../highmed-endpoint-0.4.0.xml.post | 2 +- ...extension-certificate-thumbprint-0.4.0.xml | 4 +- ...sion-certificate-thumbprint-0.4.0.xml.post | 2 +- ...-extension-process-authorization-0.4.0.xml | 4 +- ...nsion-process-authorization-0.4.0.xml.post | 2 +- .../highmed-organization-0.4.0.xml | 6 +- .../highmed-organization-0.4.0.xml.post | 2 +- .../highmed-task-base-0.4.0.xml | 6 +- .../highmed-task-base-0.4.0.xml.post | 2 +- ...xml => highmed-bpmn-task-subscription.xml} | 0 ...> highmed-bpmn-task-subscription.xml.post} | 0 ...l => highmed-authorization-role-0.4.0.xml} | 0 ...highmed-authorization-role-0.4.0.xml.post} | 0 ...4.0.xml => highmed-bpmn-message-0.4.0.xml} | 0 ...st => highmed-bpmn-message-0.4.0.xml.post} | 0 ...ml => highmed-organization-type-0.4.0.xml} | 0 ... highmed-organization-type-0.4.0.xml.post} | 0 .../fhir/profiles/EndpointProfileTest.java | 16 +- .../profiles/OrganizationProfileTest.java | 60 +- .../fhir/validation/ValueSetExpanderTest.java | 7 +- .../dsf/tools/generator/BundleGenerator.java | 12 +- .../dsf/tools/generator/BundleGenerator.java | 22 +- .../bundle-templates/medic1-bundle.xml | 4 +- .../bundle-templates/medic2-bundle.xml | 4 +- .../bundle-templates/medic3-bundle.xml | 4 +- .../bundle-templates/test-bundle.xml | 6 +- .../resources/bundle-templates/ttp-bundle.xml | 24 +- 182 files changed, 1575 insertions(+), 1514 deletions(-) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/{computeSimpleFeasibility.bpmn => computeFeasibility.bpmn} (93%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/{executeSimpleFeasibility.bpmn => executeFeasibility.bpmn} (97%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/{requestSimpleFeasibility.bpmn => requestFeasibility.bpmn} (88%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/{computeSimpleFeasibility.xml => highmed-computeFeasibility.xml} (76%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/{executeSimpleFeasibility.xml => highmed-executeFeasibility.xml} (76%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/{requestSimpleFeasibility.xml => highmed-requestFeasibility.xml} (79%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/{feasibility.xml => highmed-feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/{query-type.xml => highmed-query-type.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/{highmed-research-study.xml => highmed-research-study-identifier.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-compute-simple-feasibility.xml => highmed-task-compute-feasibility.xml} (94%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-error-simple-feasibility.xml => highmed-task-error-feasibility.xml} (90%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-execute-simple-feasibility.xml => highmed-task-execute-feasibility.xml} (95%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-multi-medic-result-simple-feasibility.xml => highmed-task-multi-medic-result-feasibility.xml} (95%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-request-simple-feasibility.xml => highmed-task-request-feasibility.xml} (96%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/{highmed-task-single-medic-result-simple-feasibility.xml => highmed-task-single-medic-result-feasibility.xml} (94%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/{feasibility.xml => highmed-feasibility.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/{query-type.xml => highmed-query-type.xml} (100%) rename dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/{RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java => RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java} (64%) rename dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/{localServicesIntegration.xml => highmed-localServicesIntegration.xml} (91%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/{ping.xml => highmed-ping.xml} (93%) rename dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/{pong.xml => highmed-pong.xml} (95%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/{downloadAllowList.xml => highmed-downloadAllowList.xml} (94%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/{updateAllowList.xml => highmed-updateAllowList.xml} (93%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/{update-allow-list.xml => highmed-update-allow-list.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/{update-allow-list.xml => highmed-update-allow-list.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/{executeUpdateResources.xml => highmed-executeUpdateResources.xml} (94%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/{requestUpdateResources.xml => highmed-requestUpdateResources.xml} (93%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/{update-resources.xml => highmed-update-resources.xml} (100%) rename dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/{update-resources.xml => highmed-update-resources.xml} (100%) create mode 100755 dsf-docker-test-setup-3medic-ttp/ansible-stop-all.sh rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{authorization-role-0.4.0.xml => highmed-authorization-role-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{authorization-role-0.4.0.xml.post => highmed-authorization-role-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{bpmn-message-0.4.0.xml => highmed-bpmn-message-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{bpmn-message-0.4.0.xml.post => highmed-bpmn-message-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{organization-type-0.4.0.xml => highmed-organization-type-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/{organization-type-0.4.0.xml.post => highmed-organization-type-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/{bpmn-task-subscription.xml => highmed-bpmn-task-subscription.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/{bpmn-task-subscription.xml.post => highmed-bpmn-task-subscription.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{authorization-role-0.4.0.xml => highmed-authorization-role-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{authorization-role-0.4.0.xml.post => highmed-authorization-role-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{bpmn-message-0.4.0.xml => highmed-bpmn-message-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{bpmn-message-0.4.0.xml.post => highmed-bpmn-message-0.4.0.xml.post} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{organization-type-0.4.0.xml => highmed-organization-type-0.4.0.xml} (100%) rename dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/{organization-type-0.4.0.xml.post => highmed-organization-type-0.4.0.xml.post} (100%) diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java index bbbd64c7f..920e8c810 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java @@ -4,31 +4,29 @@ public interface ConstantsBase { - String VARIABLE_MESSAGE_NAME = "messageName"; - String VARIABLE_PROCESS_DEFINITION_KEY = "processDefinitionKey"; - String VARIABLE_VERSION_TAG = "versionTag"; - String VARIABLE_PROFILE = "profile"; - // String VARIABLE_TARGET_ORGANIZATION_ID = "targetOrganizationId"; - // String VARIABLE_CORRELATION_KEY = "correlationKey"; - String VARIABLE_TARGET = "target"; - String VARIABLE_TARGETS = "targets"; - String VARIABLE_TASK = "task"; - String VARIABLE_LEADING_TASK = "leadingTask"; - String VARIABLE_BUNDLE_ID = "bundleId"; - String VARIABLE_QUERY_PARAMETERS = "queryParameters"; - String VARIABLE_TTP_IDENTIFIER = "ttp"; + String BPMN_EXECUTION_VARIABLE_MESSAGE_NAME = "messageName"; + String BPMN_EXECUTION_VARIABLE_PROCESS_DEFINITION_KEY = "processDefinitionKey"; + String BPMN_EXECUTION_VARIABLE_VERSION_TAG = "versionTag"; + String BPMN_EXECUTION_VARIABLE_PROFILE = "profile"; + // String BPMN_EXECUTION_VARIABLE_TARGET_ORGANIZATION_ID = "targetOrganizationId"; + // String BPMN_EXECUTION_VARIABLE_CORRELATION_KEY = "correlationKey"; + String BPMN_EXECUTION_VARIABLE_TARGET = "target"; + String BPMN_EXECUTION_VARIABLE_TARGETS = "targets"; + String BPMN_EXECUTION_VARIABLE_TASK = "task"; + String BPMN_EXECUTION_VARIABLE_LEADING_TASK = "leadingTask"; + String BPMN_EXECUTION_VARIABLE_BUNDLE_ID = "bundleId"; + String BPMN_EXECUTION_VARIABLE_QUERY_PARAMETERS = "queryParameters"; + String BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER = "ttp"; /** * Used to distinguish if I am at the moment in a process called * by another process by a CallActivity or not */ - String VARIABLE_IN_CALLED_PROCESS = "inCalledProcess"; + String BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS = "inCalledProcess"; - String EXTENSION_QUERY_URI = "http://highmed.org/fhir/StructureDefinition/query"; - String CODESYSTEM_QUERY_TYPE = "http://highmed.org/fhir/CodeSystem/query-type"; - String CODESYSTEM_QUERY_TYPE_AQL = "application/x-aql-query"; - CodeType AQL_QUERY_TYPE = new CodeType(CODESYSTEM_QUERY_TYPE_AQL).setSystem(CODESYSTEM_QUERY_TYPE); - String OPENEHR_MIMETYPE_JSON = "application/json"; + String PROCESS_HIGHMED_URI_BASE = "http://highmed.org/bpe/Process/"; + + String EXTENSION_HIGHMED_QUERY = "http://highmed.org/fhir/StructureDefinition/extension-query"; String CODESYSTEM_HIGHMED_BPMN = "http://highmed.org/fhir/CodeSystem/bpmn-message"; String CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME = "message-name"; @@ -36,11 +34,17 @@ public interface ConstantsBase String CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY = "correlation-key"; String CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR = "error"; - String PROCESS_URI_BASE = "http://highmed.org/bpe/Process/"; + String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE = "http://highmed.org/fhir/CodeSystem/organization-type"; + String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP = "TTP"; + String CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC = "MeDIC"; + + String CODESYSTEM_HIGHMED_QUERY_TYPE = "http://highmed.org/fhir/CodeSystem/query-type"; + String CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL = "application/x-aql-query"; - String ORGANIZATION_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/organization-identifier"; - String ORGANIZATION_TYPE_SYSTEM = "http://highmed.org/fhir/CodeSystem/organization-type"; - String ORGANIZATION_TYPE_TTP = "TTP"; - String ORGANIZATION_TYPE_MEDIC = "MeDIC"; - String ENDPOINT_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/endpoint-identifier"; + String NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER = "http://highmed.org/fhir/NamingSystem/organization-identifier"; + String NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER = "http://highmed.org/fhir/NamingSystem/endpoint-identifier"; + + CodeType CODE_TYPE_AQL_QUERY = new CodeType(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL) + .setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE); + String OPENEHR_MIMETYPE_JSON = "application/json"; } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java index 70021a5cc..f8ee39d60 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java @@ -69,8 +69,9 @@ public final void execute(DelegateExecution execution) throws Exception execution.getProcessDefinitionId(), execution.getActivityInstanceId(), task.getId(), exception.getMessage()); - String errorMessage = "Process " + execution.getProcessDefinitionId() + " has fatal error in step " - + execution.getActivityInstanceId() + ", reason: " + exception.getMessage(); + String errorMessage = + "Process " + execution.getProcessDefinitionId() + " has fatal error in step " + execution + .getActivityInstanceId() + ", reason: " + exception.getMessage(); task.addOutput(taskHelper.createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); @@ -79,28 +80,25 @@ public final void execute(DelegateExecution execution) throws Exception clientProvider.getLocalWebserviceClient().withMinimalReturn().update(task); // TODO evaluate throwing exception as alternative to stopping the process instance - execution.getProcessEngine().getRuntimeService().deleteProcessInstance(execution.getProcessInstanceId(), - exception.getMessage()); + execution.getProcessEngine().getRuntimeService() + .deleteProcessInstance(execution.getProcessInstanceId(), exception.getMessage()); } } private Task getTask(DelegateExecution execution) { - return execution.getParentId() == null || execution.getParentId().equals(execution.getProcessInstanceId()) - ? getLeadingTaskFromExecutionVariables() - : getCurrentTaskFromExecutionVariables(); + return execution.getParentId() == null || execution.getParentId().equals(execution.getProcessInstanceId()) ? + getLeadingTaskFromExecutionVariables() : + getCurrentTaskFromExecutionVariables(); } /** * Method called by a BPMN service task * - * @param execution - * Process instance information and variables - * @throws BpmnError - * Thrown when an error boundary event should be called - * @throws Exception - * Uncaught exceptions will result in task status failed, the exception message will be written as an - * error output + * @param execution Process instance information and variables + * @throws BpmnError Thrown when an error boundary event should be called + * @throws Exception Uncaught exceptions will result in task status failed, the exception message will be written as an + * error output */ protected abstract void doExecute(DelegateExecution execution) throws BpmnError, Exception; @@ -116,31 +114,29 @@ protected final FhirWebserviceClientProvider getFhirWebserviceClientProvider() /** * @return the current task from execution variables, the task resource that started the current process or - * subprocess - * @throws IllegalStateException - * if execution of this service delegate has not been started - * @see ConstantsBase#VARIABLE_TASK + * subprocess + * @throws IllegalStateException if execution of this service delegate has not been started + * @see ConstantsBase#BPMN_EXECUTION_VARIABLE_TASK */ protected final Task getCurrentTaskFromExecutionVariables() { if (execution == null) throw new IllegalStateException("execution not started"); - return (Task) execution.getVariable(ConstantsBase.VARIABLE_TASK); + return (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK); } /** * @return the leading task from execution variables, same as current task if not in a subprocess - * @throws IllegalStateException - * if execution of this service delegate has not been started - * @see ConstantsBase#VARIABLE_LEADING_TASK + * @throws IllegalStateException if execution of this service delegate has not been started + * @see ConstantsBase#BPMN_EXECUTION_VARIABLE_LEADING_TASK */ protected final Task getLeadingTaskFromExecutionVariables() { if (execution == null) throw new IllegalStateException("execution not started"); - Task leadingTask = (Task) execution.getVariable(ConstantsBase.VARIABLE_LEADING_TASK); + Task leadingTask = (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_LEADING_TASK); return leadingTask != null ? leadingTask : getCurrentTaskFromExecutionVariables(); } } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java index 115a035c4..ede58b1e5 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java @@ -54,10 +54,11 @@ public void afterPropertiesSet() throws Exception @Override public void doExecute(DelegateExecution execution) throws Exception { - String processDefinitionKey = (String) execution.getVariable(ConstantsBase.VARIABLE_PROCESS_DEFINITION_KEY); - String versionTag = (String) execution.getVariable(ConstantsBase.VARIABLE_VERSION_TAG); - String messageName = (String) execution.getVariable(ConstantsBase.VARIABLE_MESSAGE_NAME); - String profile = (String) execution.getVariable(ConstantsBase.VARIABLE_PROFILE); + String processDefinitionKey = (String) execution + .getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_PROCESS_DEFINITION_KEY); + String versionTag = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_VERSION_TAG); + String messageName = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_MESSAGE_NAME); + String profile = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_PROFILE); String businessKey = execution.getBusinessKey(); // TODO see Bug https://app.camunda.com/jira/browse/CAM-9444 @@ -83,7 +84,7 @@ public void doExecute(DelegateExecution execution) throws Exception logger.debug("Removing target organization {} with error {} from target list", target.getTargetOrganizationIdentifierValue(), e.getMessage()); - Targets targets = (Targets) execution.getVariable(ConstantsBase.VARIABLE_TARGETS); + Targets targets = (Targets) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS); targets.removeTarget(target); Task task = getLeadingTaskFromExecutionVariables(); @@ -94,14 +95,14 @@ public void doExecute(DelegateExecution execution) throws Exception /** * Override this method to set a different target then the one defined in the process variable - * {@link ConstantsBase#VARIABLE_TARGET} + * {@link ConstantsBase#BPMN_EXECUTION_VARIABLE_TARGET} * * @param execution the delegate execution of this process instance * @return {@link Target} that should receive the message */ protected Target getTarget(DelegateExecution execution) { - return (Target) execution.getVariable(ConstantsBase.VARIABLE_TARGET); + return (Target) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET); } /** @@ -136,10 +137,8 @@ protected void sendTask(String targetOrganizationIdentifierValue, String process // http://highmed.org/bpe/Process/processDefinitionKey // http://highmed.org/bpe/Process/processDefinitionKey/versionTag - String instantiatesUri = - ConstantsBase.PROCESS_URI_BASE + processDefinitionKey + (versionTag != null && !versionTag.isEmpty() ? - ("/" + versionTag) : - ""); + String instantiatesUri = ConstantsBase.PROCESS_HIGHMED_URI_BASE + processDefinitionKey + ( + versionTag != null && !versionTag.isEmpty() ? ("/" + versionTag) : ""); task.setInstantiatesUri(instantiatesUri); ParameterComponent messageNameInput = new ParameterComponent(new CodeableConcept( diff --git a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java index 74bdeb3bb..46dc0e480 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java +++ b/dsf-bpe/dsf-bpe-process-base/src/test/java/org/highmed/dsf/bpe/start/ConstantsExampleStarters.java @@ -6,14 +6,14 @@ public interface ConstantsExampleStarters String ENV_DSF_CLIENT_CERTIFICATE_PASSWORD = "DSF_CLIENT_CERTIFICATE_PASSWORD"; String TTP_FHIR_BASE_URL = "https://ttp/fhir/"; - String ORGANIZATION_IDENTIFIER_VALUE_TTP = "Test_TTP"; + String NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP = "Test_TTP"; String MEDIC_1_FHIR_BASE_URL = "https://medic1/fhir/"; - String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1 = "Test_MeDIC_1"; + String NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1 = "Test_MeDIC_1"; String MEDIC_2_FHIR_BASE_URL = "https://medic2/fhir/"; - String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2 = "Test_MeDIC_2"; + String NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2 = "Test_MeDIC_2"; String MEDIC_3_FHIR_BASE_URL = "https://medic3/fhir/"; - String ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3 = "Test_MeDIC_3"; + String NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3 = "Test_MeDIC_3"; } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java index 2fcf4a985..a4640b03d 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java @@ -1,26 +1,26 @@ package org.highmed.dsf.bpe; -import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; +import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.VERSION; public interface ConstantsFeasibility { - String VARIABLE_BLOOM_FILTER_CONFIG = "bloomFilterConfig"; - String VARIABLE_QUERY_RESULTS = "queryResults"; - String VARIABLE_FINAL_QUERY_RESULTS = "finalQueryResults"; - String VARIABLE_RESEARCH_STUDY = "researchStudy"; - String VARIABLE_COHORTS = "cohorts"; - String VARIABLE_QUERIES = "queries"; - String VARIABLE_NEEDS_CONSENT_CHECK = "needsConsentCheck"; - String VARIABLE_NEEDS_RECORD_LINKAGE = "needsRecordLinkage"; + String BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY = "researchStudy"; + String BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK = "needsConsentCheck"; + String BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE = "needsRecordLinkage"; + String BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG = "bloomFilterConfig"; + String BPMN_EXECUTION_VARIABLE_COHORTS = "cohorts"; + String BPMN_EXECUTION_VARIABLE_QUERIES = "queries"; + String BPMN_EXECUTION_VARIABLE_QUERY_RESULTS = "queryResults"; + String BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS = "finalQueryResults"; - String ERROR_CODE_MULTI_MEDIC_RESULT = "errorMultiMedicSimpleFeasibilityResult"; + String BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_RESULT = "errorMultiMedicFeasibilityResult"; // Must be 3 or larger, as otherwise it is possible to draw conclusions about the individual MeDICs // (if I already know the cohort size in my MeDIC) int MIN_PARTICIPATING_MEDICS = 3; int MIN_COHORT_DEFINITIONS = 1; - String SIMPLE_FEASIBILITY_QUERY_PREFIX = "select count"; + String FEASIBILITY_QUERY_PREFIX = "select count"; String CODESYSTEM_HIGHMED_FEASIBILITY = "http://highmed.org/fhir/CodeSystem/feasibility"; String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY = "medic-correlation-key"; @@ -34,37 +34,41 @@ public interface ConstantsFeasibility String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT = "multi-medic-result"; String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE = "research-study-reference"; - String EXTENSION_PARTICIPATING_MEDIC_URI = "http://highmed.org/fhir/StructureDefinition/participating-medic"; - String EXTENSION_PARTICIPATING_TTP_URI = "http://highmed.org/fhir/StructureDefinition/participating-ttp"; - String EXTENSION_GROUP_ID_URI = "http://highmed.org/fhir/StructureDefinition/group-id"; + String EXTENSION_HIGHMED_PARTICIPATING_MEDIC = "http://highmed.org/fhir/StructureDefinition/extension-participating-medic"; + String EXTENSION_HIGHMED_PARTICIPATING_TTP = "http://highmed.org/fhir/StructureDefinition/extension-participating-ttp"; + String EXTENSION_HIGHMED_GROUP_ID = "http://highmed.org/fhir/StructureDefinition/extension-group-id"; - String GROUP_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-group"; - String FEASIBILITY_RESEARCH_STUDY_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility"; - String RESEARCH_STUDY_IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/research-study-identifier"; + String PROFILE_HIGHMED_GROUP = "http://highmed.org/fhir/StructureDefinition/group"; + String PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/research-study-feasibility"; - String REQUEST_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility"; - String REQUEST_FEASIBILITY_PROCESS_URI = PROCESS_URI_BASE + "requestSimpleFeasibility/"; - String REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = REQUEST_FEASIBILITY_PROCESS_URI + VERSION; - String REQUEST_FEASIBILITY_MESSAGE_NAME = "requestSimpleFeasibilityMessage"; + String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-request-feasibility"; + String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "requestFeasibility/"; + String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = + PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME = "requestFeasibilityMessage"; - String EXECUTE_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility"; - String EXECUTE_FEASIBILITY_PROCESS_URI = PROCESS_URI_BASE + "executeSimpleFeasibility/"; - String EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = EXECUTE_FEASIBILITY_PROCESS_URI + VERSION; - String EXECUTE_FEASIBILITY_MESSAGE_NAME = "executeSimpleFeasibilityMessage"; + String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "localServicesIntegration/"; - String COMPUTE_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility"; - String COMPUTE_FEASIBILITY_PROCESS_URI = PROCESS_URI_BASE + "computeSimpleFeasibility/"; - String COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = COMPUTE_FEASIBILITY_PROCESS_URI + VERSION; - String COMPUTE_FEASIBILITY_MESSAGE_NAME = "computeSimpleFeasibilityMessage"; + String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-execute-feasibility"; + String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "executeFeasibility/"; + String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = + PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_MESSAGE_NAME = "executeFeasibilityMessage"; - String SINGLE_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility"; - String SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultSingleMedicSimpleFeasibilityMessage"; + String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-compute-feasibility"; + String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "computeFeasibility/"; + String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = + PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME = "computeFeasibilityMessage"; - String MULTI_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility"; - String MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultMultiMedicSimpleFeasibilityMessage"; + String PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility"; + String PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultSingleMedicFeasibilityMessage"; - String ERROR_FEASIBILITY_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-error-simple-feasibility"; - String ERROR_FEASIBILITY_MESSAGE_NAME = "errorMultiMedicSimpleFeasibilityMessage"; + String PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility"; + String PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultMultiMedicFeasibilityMessage"; - String LOCAL_SERVICES_PROCESS_URI = PROCESS_URI_BASE + "localServicesIntegration/"; + String PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility"; + String PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY_MESSAGE_NAME = "errorMultiMedicFeasibilityMessage"; + + String NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER = "http://highmed.org/fhir/NamingSystem/research-study-identifier"; } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index 3d1399b17..9e9084780 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -36,8 +36,7 @@ public String getVersion() @Override public Stream<String> getBpmnFiles() { - return Stream.of("bpe/requestSimpleFeasibility.bpmn", "bpe/computeSimpleFeasibility.bpmn", - "bpe/executeSimpleFeasibility.bpmn"); + return Stream.of("bpe/requestFeasibility.bpmn", "bpe/computeFeasibility.bpmn", "bpe/executeFeasibility.bpmn"); } @Override @@ -49,14 +48,14 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aCom = ActivityDefinitionResource.file("fhir/ActivityDefinition/computeSimpleFeasibility.xml"); - var aExe = ActivityDefinitionResource.file("fhir/ActivityDefinition/executeSimpleFeasibility.xml"); - var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/requestSimpleFeasibility.xml"); + var aCom = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-computeFeasibility.xml"); + var aExe = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-executeFeasibility.xml"); + var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-requestFeasibility.xml"); - var cF = CodeSystemResource.file("fhir/CodeSystem/feasibility.xml"); - var cQT = CodeSystemResource.file("fhir/CodeSystem/query-type.xml"); + var cF = CodeSystemResource.file("fhir/CodeSystem/highmed-feasibility.xml"); + var cQT = CodeSystemResource.file("fhir/CodeSystem/highmed-query-type.xml"); - var n = NamingSystemResource.file("fhir/NamingSystem/highmed-research-study.xml"); + var n = NamingSystemResource.file("fhir/NamingSystem/highmed-research-study-identifier.xml"); var sExtG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-group-id.xml"); var sExtPartMeDic = StructureDefinitionResource @@ -66,31 +65,25 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader var sExtQ = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-query.xml"); var sG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-group.xml"); var sR = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-research-study-feasibility.xml"); - var sTCom = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml"); - var sTErr = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml"); - var sTExe = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml"); + var sTCom = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-compute-feasibility.xml"); + var sTErr = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-error-feasibility.xml"); + var sTExe = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-execute-feasibility.xml"); var sTResM = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml"); - var sTReq = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml"); + .file("fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml"); + var sTReq = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-request-feasibility.xml"); var sTResS = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml"); + .file("fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml"); - var vF = ValueSetResource.file("fhir/ValueSet/feasibility.xml"); - var vQT = ValueSetResource.file("fhir/ValueSet/query-type.xml"); + var vF = ValueSetResource.file("fhir/ValueSet/highmed-feasibility.xml"); + var vQT = ValueSetResource.file("fhir/ValueSet/highmed-query-type.xml"); Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of( - "computeSimpleFeasibility/" + VERSION, Arrays.asList(aCom, sTCom, vF, cF, sTResS, sExtG, sG), - "executeSimpleFeasibility/" + VERSION, - Arrays.asList(aExe, sTExe, vF, cF, sR, sExtPartTtp, sExtPartMeDic, n, sG, sExtQ, vQT, cQT), - "requestSimpleFeasibility/" + VERSION, Arrays.asList(aReq, sTReq, vF, cF, sR, sExtPartTtp, - sExtPartMeDic, n, sG, sExtQ, vQT, cQT, sTResM, sExtG, sTErr)); + "computeFeasibility/" + VERSION, Arrays.asList(aCom, cF, sExtG, sG, sTCom, sTResS, vF), + "executeFeasibility/" + VERSION, Arrays.asList(aExe, cF, cQT, n, sR, sExtPartMeDic, sExtPartTtp, sExtQ, sG, sTExe, vF, vQT), + "requestFeasibility/" + VERSION, Arrays.asList(aReq, cF, cQT, n, sExtG, sExtPartMeDic, sExtPartTtp, sG, sR, sExtQ, sTReq, sTResM, sTErr, vF, vQT)); - return ResourceProvider.read(VERSION, - () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + return ResourceProvider + .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java index e78daa8ff..7db929bbe 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java @@ -3,12 +3,12 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; +import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.hl7.fhir.r4.model.IdType; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.ResearchStudy; @@ -28,7 +28,7 @@ public SendMedicRequest(FhirWebserviceClientProvider clientProvider, TaskHelper protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { ResearchStudy researchStudy = (ResearchStudy) execution - .getVariable(ConstantsFeasibility.VARIABLE_RESEARCH_STUDY); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); IdType researchStudyId = new IdType( getFhirWebserviceClientProvider().getLocalBaseUrl() + "/" + researchStudy.getId()); @@ -37,14 +37,15 @@ protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecut ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE, new Reference().setReference(researchStudyId.toVersionless().getValueAsString())); - boolean needsConsentCheck = (boolean) execution.getVariable(ConstantsFeasibility.VARIABLE_NEEDS_CONSENT_CHECK); + boolean needsConsentCheck = (boolean) execution + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); ParameterComponent inputNeedsConsentCheck = getTaskHelper() .createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK, needsConsentCheck); boolean needsRecordLinkage = (boolean) execution - .getVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); ParameterComponent inputNeedsRecordLinkage = getTaskHelper() .createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, @@ -53,7 +54,7 @@ protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecut if (needsRecordLinkage) { BloomFilterConfig bloomFilterConfig = (BloomFilterConfig) execution - .getVariable(ConstantsFeasibility.VARIABLE_BLOOM_FILTER_CONFIG); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG); ParameterComponent inputBloomFilterConfig = getTaskHelper() .createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG, diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java index 38c819157..b010f279d 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java @@ -34,7 +34,7 @@ public SendMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHe protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { FinalFeasibilityQueryResults results = (FinalFeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_FINAL_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS); Stream<ParameterComponent> resultInputs = results.getResults().stream().flatMap(this::toInputs); Stream<ParameterComponent> errorInput = getErrorInput(execution); @@ -61,7 +61,7 @@ private Stream<ParameterComponent> toInputs(FinalFeasibilityQueryResult result) private Extension createCohortIdExtension(String cohortId) { - return new Extension(ConstantsFeasibility.EXTENSION_GROUP_ID_URI, new Reference(cohortId)); + return new Extension(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); } private Stream<ParameterComponent> getErrorInput(DelegateExecution execution) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java index c0bde341e..74d7bbe8b 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java @@ -3,13 +3,13 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.highmed.dsf.bpe.ConstantsFeasibility; +import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; +import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.hl7.fhir.r4.model.Extension; import org.hl7.fhir.r4.model.Reference; import org.hl7.fhir.r4.model.Task; @@ -33,7 +33,7 @@ public SendSingleMedicResults(FhirWebserviceClientProvider clientProvider, TaskH protected Stream<Task.ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); return results.getResults().stream().map(result -> toInput(result)); } @@ -69,6 +69,6 @@ else if (result.isIdResultSetUrlResult()) private Extension createCohortIdExtension(String cohortId) { - return new Extension(ConstantsFeasibility.EXTENSION_GROUP_ID_URI, new Reference(cohortId)); + return new Extension(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java index ea5dbcd16..add6578b2 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java @@ -25,7 +25,7 @@ public SendTtpRequest(FhirWebserviceClientProvider clientProvider, TaskHelper ta @Override protected Stream<Task.ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { - Targets multiInstanceTargets = (Targets) execution.getVariable(ConstantsBase.VARIABLE_TARGETS); + Targets multiInstanceTargets = (Targets) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS); Stream<Task.ParameterComponent> inputTargets = multiInstanceTargets.getEntries().stream() .map(target -> getTaskHelper().createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, @@ -33,7 +33,7 @@ protected Stream<Task.ParameterComponent> getAdditionalInputParameters(DelegateE target.getCorrelationKey())); boolean needsRecordLinkage = (boolean) execution - .getVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); Task.ParameterComponent inputNeedsRecordLinkage = getTaskHelper() .createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java index 0ced30238..893bb9215 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java @@ -7,13 +7,13 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.task.TaskHelper; public class CalculateMultiMedicResults extends AbstractServiceDelegate { @@ -26,11 +26,11 @@ public CalculateMultiMedicResults(FhirWebserviceClientProvider clientProvider, T protected void doExecute(DelegateExecution execution) throws Exception { List<FeasibilityQueryResult> results = ((FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS)).getResults(); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS)).getResults(); List<FinalFeasibilityQueryResult> finalResults = calculateResults(results); - execution.setVariable(ConstantsFeasibility.VARIABLE_FINAL_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, FinalFeasibilityQueryResultsValues.create(new FinalFeasibilityQueryResults(finalResults))); } @@ -39,10 +39,9 @@ private List<FinalFeasibilityQueryResult> calculateResults(List<FeasibilityQuery Map<String, List<FeasibilityQueryResult>> byCohortId = results.stream() .collect(Collectors.groupingBy(FeasibilityQueryResult::getCohortId)); - return byCohortId.entrySet().stream() - .map(e -> new FinalFeasibilityQueryResult(e.getKey(), - toInt(e.getValue().stream().filter(r -> r.getCohortSize() > 0).count()), - toInt(e.getValue().stream().mapToLong(FeasibilityQueryResult::getCohortSize).sum()))) + return byCohortId.entrySet().stream().map(e -> new FinalFeasibilityQueryResult(e.getKey(), + toInt(e.getValue().stream().filter(r -> r.getCohortSize() > 0).count()), + toInt(e.getValue().stream().mapToLong(FeasibilityQueryResult::getCohortSize).sum()))) .collect(Collectors.toList()); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java index da0b3c6f9..d5f9362f0 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java @@ -1,6 +1,6 @@ package org.highmed.dsf.bpe.service; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import java.util.List; @@ -25,10 +25,10 @@ public CheckFeasibilityResources(FhirWebserviceClientProvider clientProvider, Ta protected void doExecute(DelegateExecution execution) throws Exception { ResearchStudy researchStudy = (ResearchStudy) execution - .getVariable(ConstantsFeasibility.VARIABLE_RESEARCH_STUDY); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); - List<Group> cohorts = ((FhirResourcesList) execution.getVariable(ConstantsFeasibility.VARIABLE_COHORTS)) - .getResourcesAndCast(); + List<Group> cohorts = ((FhirResourcesList) execution + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS)).getResourcesAndCast(); checkNumberOfParticipatingMedics(researchStudy); checkFullyQualifiedCohortIds(cohorts); @@ -37,11 +37,11 @@ protected void doExecute(DelegateExecution execution) throws Exception private void checkNumberOfParticipatingMedics(ResearchStudy researchStudy) { - long medics = researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI).stream() - .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) + long medics = researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC) + .stream().filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) .map(r -> r.getIdentifier()) - .filter(i -> ORGANIZATION_IDENTIFIER_SYSTEM.equals(i.getSystem())) - .map(i -> i.getValue()).distinct().count(); + .filter(i -> NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER.equals(i.getSystem())).map(i -> i.getValue()) + .distinct().count(); if (medics < ConstantsFeasibility.MIN_PARTICIPATING_MEDICS) { diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java index c281261b7..eeadcd29a 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java @@ -69,7 +69,7 @@ private FinalFeasibilityQueryResults readFinalFeasibilityQueryResultsFromCurrent private FinalFeasibilityQueryResult toResult(Task task, ParameterComponent in) { - String cohortId = ((Reference) in.getExtensionByUrl(ConstantsFeasibility.EXTENSION_GROUP_ID_URI).getValue()) + String cohortId = ((Reference) in.getExtensionByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID).getValue()) .getReference(); int participatingMedics = getParticipatingMedicsCountByCohortId(task, cohortId); int cohortSize = ((UnsignedIntType) in.getValue()).getValue(); @@ -83,7 +83,7 @@ private int getParticipatingMedicsCountByCohortId(Task task, String cohortId) .equals(in.getType().getCodingFirstRep().getSystem()) && ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT .equals(in.getType().getCodingFirstRep().getCode()) && cohortId - .equals(((Reference) in.getExtensionByUrl(ConstantsFeasibility.EXTENSION_GROUP_ID_URI).getValue()) + .equals(((Reference) in.getExtensionByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID).getValue()) .getReference())).mapToInt(in -> ((UnsignedIntType) in.getValue()).getValue()).findFirst() .getAsInt(); } @@ -119,6 +119,6 @@ private void addResultOutput(FinalFeasibilityQueryResult result, Task toWrite) private Extension createCohortIdExtension(String cohortId) { - return new Extension(ConstantsFeasibility.EXTENSION_GROUP_ID_URI, new Reference(cohortId)); + return new Extension(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java index 1086aa4b4..73965e0ef 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java @@ -42,8 +42,8 @@ public void afterPropertiesSet() throws Exception @Override protected void doExecute(DelegateExecution execution) throws Exception { - List<Group> cohorts = ((FhirResourcesList) execution.getVariable(ConstantsFeasibility.VARIABLE_COHORTS)) - .getResourcesAndCast(); + List<Group> cohorts = ((FhirResourcesList) execution + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS)).getResourcesAndCast(); Map<String, String> queries = new HashMap<>(); @@ -52,12 +52,12 @@ protected void doExecute(DelegateExecution execution) throws Exception String aqlQuery = groupHelper.extractAqlQuery(group).toLowerCase(); String groupId = group.getId(); - if (!aqlQuery.startsWith(ConstantsFeasibility.SIMPLE_FEASIBILITY_QUERY_PREFIX)) + if (!aqlQuery.startsWith(ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX)) { String errorMessage = "Initial single medic feasibility query check failed, wrong format for query of group with id '" + groupId + "', expected query to start with '" - + ConstantsFeasibility.SIMPLE_FEASIBILITY_QUERY_PREFIX + "' but got '" + aqlQuery + "'"; + + ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX + "' but got '" + aqlQuery + "'"; logger.info(errorMessage); leadingTask.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, @@ -69,6 +69,6 @@ protected void doExecute(DelegateExecution execution) throws Exception } }); - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERIES, queries); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES, queries); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java index baf09a90f..6dd391ae2 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java @@ -30,14 +30,15 @@ public CheckSingleMedicResults(FhirWebserviceClientProvider clientProvider, Task protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); Task currentTask = getCurrentTaskFromExecutionVariables(); - List<FeasibilityQueryResult> filteredResults = filterErroneousResultsAndAddErrorsToCurrentTaskOutputs(results, currentTask); + List<FeasibilityQueryResult> filteredResults = filterErroneousResultsAndAddErrorsToCurrentTaskOutputs(results, + currentTask); // TODO: add percentage filter over results - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(filteredResults))); } @@ -70,7 +71,8 @@ private void addError(Task task, String cohortId, String error) String errorMessage = "Feasibility query result check failed for group with id '" + cohortId + "': " + error; logger.info(errorMessage); - task.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); + task.getOutput().add(getTaskHelper() + .createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, + errorMessage)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java index 672ed0838..a542ace95 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java @@ -2,7 +2,7 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; -import static org.highmed.dsf.bpe.ConstantsFeasibility.ERROR_CODE_MULTI_MEDIC_RESULT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_RESULT; import java.util.List; import java.util.stream.Collectors; @@ -35,19 +35,20 @@ protected void doExecute(DelegateExecution execution) throws Exception { Task leadingTask = getLeadingTaskFromExecutionVariables(); FinalFeasibilityQueryResults results = (FinalFeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_FINAL_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS); List<FinalFeasibilityQueryResult> resultsWithEnoughParticipatingMedics = filterResultsByParticipatingMedics( leadingTask, results); - execution.setVariable(ConstantsFeasibility.VARIABLE_FINAL_QUERY_RESULTS, FinalFeasibilityQueryResultsValues - .create(new FinalFeasibilityQueryResults(resultsWithEnoughParticipatingMedics))); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, + FinalFeasibilityQueryResultsValues + .create(new FinalFeasibilityQueryResults(resultsWithEnoughParticipatingMedics))); boolean existsAtLeastOneResult = checkIfAtLeastOneResultExists(leadingTask, resultsWithEnoughParticipatingMedics); if (!existsAtLeastOneResult) - throw new BpmnError(ERROR_CODE_MULTI_MEDIC_RESULT); + throw new BpmnError(BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_RESULT); } private List<FinalFeasibilityQueryResult> filterResultsByParticipatingMedics(Task leadingTask, diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java index 1ea3fa841..3b0d1307f 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java @@ -1,6 +1,6 @@ package org.highmed.dsf.bpe.service; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_TTP; import java.util.Collections; import java.util.List; @@ -61,24 +61,26 @@ protected void doExecute(DelegateExecution execution) throws Exception Bundle bundle = getResearchStudyAndCohortDefinitions(researchStudyId, client); ResearchStudy researchStudy = (ResearchStudy) bundle.getEntryFirstRep().getResource(); - execution.setVariable(ConstantsFeasibility.VARIABLE_RESEARCH_STUDY, FhirResourceValues.create(researchStudy)); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY, + FhirResourceValues.create(researchStudy)); List<Group> cohortDefinitions = getCohortDefinitions(bundle, client.getBaseUrl()); - execution.setVariable(ConstantsFeasibility.VARIABLE_COHORTS, FhirResourcesListValues.create(cohortDefinitions)); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS, + FhirResourcesListValues.create(cohortDefinitions)); String ttpIdentifier = getTtpIdentifier(researchStudy, client); - execution.setVariable(ConstantsBase.VARIABLE_TTP_IDENTIFIER, ttpIdentifier); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER, ttpIdentifier); boolean needsConsentCheck = getNeedsConsentCheck(task); - execution.setVariable(ConstantsFeasibility.VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); if (needsRecordLinkage) { BloomFilterConfig bloomFilterConfig = getBloomFilterConfig(task); - execution.setVariable(ConstantsFeasibility.VARIABLE_BLOOM_FILTER_CONFIG, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, BloomFilterConfigValues.create(bloomFilterConfig)); } } @@ -152,7 +154,7 @@ private List<Group> getCohortDefinitions(Bundle bundle, String baseUrl) private String getTtpIdentifier(ResearchStudy researchStudy, FhirWebserviceClient client) { - Extension ext = researchStudy.getExtensionByUrl(EXTENSION_PARTICIPATING_TTP_URI); + Extension ext = researchStudy.getExtensionByUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP); Reference ref = (Reference) ext.getValue(); return ref.getIdentifier().getValue(); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java index 7e53b4cea..105108645 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java @@ -1,7 +1,7 @@ package org.highmed.dsf.bpe.service; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_TYPE_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import java.util.List; import java.util.Objects; @@ -55,13 +55,13 @@ protected void doExecute(DelegateExecution execution) throws Exception FhirWebserviceClient client = getFhirWebserviceClientProvider().getLocalWebserviceClient(); ResearchStudy researchStudy = getResearchStudy(researchStudyId, client); researchStudy = addMissingOrganizations(researchStudy, client); - execution.setVariable(ConstantsFeasibility.VARIABLE_RESEARCH_STUDY, researchStudy); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY, researchStudy); boolean needsConsentCheck = getNeedsConsentCheck(task); - execution.setVariable(ConstantsFeasibility.VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); } private IdType getResearchStudyId(Task task) @@ -92,13 +92,14 @@ private ResearchStudy getResearchStudy(IdType researchStudyid, FhirWebserviceCli private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirWebserviceClient client) { - List<String> identifiers = organizationProvider.getOrganizationsByType(ORGANIZATION_TYPE_MEDIC) + List<String> identifiers = organizationProvider + .getOrganizationsByType(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC) .flatMap(o -> o.getIdentifier().stream()) - .filter(i -> ORGANIZATION_IDENTIFIER_SYSTEM.equals(i.getSystem())) - .map(i -> i.getValue()).collect(Collectors.toList()); + .filter(i -> NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER.equals(i.getSystem())).map(i -> i.getValue()) + .collect(Collectors.toList()); List<String> existingIdentifiers = researchStudy - .getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI).stream() + .getExtensionsByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC).stream() .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) .map(r -> r.getIdentifier().getValue()).collect(Collectors.toList()); @@ -111,10 +112,10 @@ private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirW "Adding missing organization with identifier='{}' to feasibility research study with id='{}'", identifier, researchStudy.getId()); - researchStudy.addExtension().setUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier(new Identifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue(identifier))); + researchStudy.addExtension().setUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC) + .setValue(new Reference().setType(ResourceType.Organization.name()).setIdentifier( + new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(identifier))); }); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java index 04d60c595..bac5bd75d 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java @@ -52,11 +52,11 @@ public void afterPropertiesSet() throws Exception protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); List<FeasibilityQueryResult> resultsWithResultSets = download(results); - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(resultsWithResultSets))); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java index a4bbaa165..c4fb0365a 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java @@ -46,16 +46,19 @@ protected void doExecute(DelegateExecution execution) throws Exception { // <groupId, query> @SuppressWarnings("unchecked") - Map<String, String> queries = (Map<String, String>) execution.getVariable(ConstantsFeasibility.VARIABLE_QUERIES); + Map<String, String> queries = (Map<String, String>) execution + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES); - Boolean needsConsentCheck = (Boolean) execution.getVariable(ConstantsFeasibility.VARIABLE_NEEDS_CONSENT_CHECK); - Boolean needsRecordLinkage = (Boolean) execution.getVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE); + Boolean needsConsentCheck = (Boolean) execution + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); + Boolean needsRecordLinkage = (Boolean) execution + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); boolean idQuery = Boolean.TRUE.equals(needsConsentCheck) || Boolean.TRUE.equals(needsRecordLinkage); List<FeasibilityQueryResult> results = queries.entrySet().stream() .map(entry -> executeQuery(entry.getKey(), entry.getValue(), idQuery)).collect(Collectors.toList()); - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(results))); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java index 94eaf0ffe..da6d21196 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java @@ -9,13 +9,13 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.pseudonymization.domain.PersonWithMdat; import org.highmed.pseudonymization.domain.impl.MatchedPersonImpl; import org.highmed.pseudonymization.recordlinkage.FederatedMatcherImpl; @@ -50,7 +50,7 @@ public void afterPropertiesSet() throws Exception protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); Map<String, List<FeasibilityQueryResult>> byCohortId = results.getResults().stream() .collect(Collectors.groupingBy(FeasibilityQueryResult::getCohortId)); @@ -60,7 +60,7 @@ protected void doExecute(DelegateExecution execution) throws Exception List<FinalFeasibilityQueryResult> matchedResults = byCohortId.entrySet().stream() .map(e -> match(matcher, e.getKey(), e.getValue())).collect(Collectors.toList()); - execution.setVariable(ConstantsFeasibility.VARIABLE_FINAL_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, FinalFeasibilityQueryResultsValues.create(new FinalFeasibilityQueryResults(matchedResults))); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java index b2310a6a5..ebdb9f026 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java @@ -6,11 +6,11 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; +import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; +import org.highmed.dsf.fhir.task.TaskHelper; import org.highmed.openehr.model.structure.ResultSet; public class FilterQueryResultsByConsent extends AbstractServiceDelegate @@ -24,11 +24,11 @@ public FilterQueryResultsByConsent(FhirWebserviceClientProvider clientProvider, protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); List<FeasibilityQueryResult> filteredResults = filterResults(results.getResults()); - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(filteredResults))); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java index aff3c9067..92e0e72c2 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java @@ -1,7 +1,7 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsBase.OPENEHR_MIMETYPE_JSON; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; import java.security.Key; import java.util.List; @@ -82,12 +82,12 @@ public void afterPropertiesSet() throws Exception protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); String securityIdentifier = getSecurityIdentifier(execution); BloomFilterConfig bloomFilterConfig = (BloomFilterConfig) execution - .getVariable(ConstantsFeasibility.VARIABLE_BLOOM_FILTER_CONFIG); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG); ResultSetTranslatorToTtpRbfOnly resultSetTranslator = createResultSetTranslator(bloomFilterConfig); @@ -95,7 +95,7 @@ protected void doExecute(DelegateExecution execution) throws Exception .map(result -> translateAndCreateBinary(resultSetTranslator, result, securityIdentifier)) .collect(Collectors.toList()); - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(translatedResults))); } @@ -103,10 +103,10 @@ private String getSecurityIdentifier(DelegateExecution execution) { Task task = getCurrentTaskFromExecutionVariables(); - if (task.getInstantiatesUri().startsWith(ConstantsFeasibility.LOCAL_SERVICES_PROCESS_URI)) + if (task.getInstantiatesUri().startsWith(ConstantsFeasibility.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI)) return task.getRequester().getIdentifier().getValue(); else - return (String) execution.getVariable(ConstantsBase.VARIABLE_TTP_IDENTIFIER); + return (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER); } protected ResultSetTranslatorToTtpRbfOnly createResultSetTranslator(BloomFilterConfig bloomFilterConfig) @@ -152,7 +152,7 @@ protected String saveResultSetAsBinaryForTtp(ResultSet resultSet, String securit byte[] content = serializeResultSet(resultSet); Reference securityContext = new Reference(); securityContext.setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(securityIdentifier); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue(securityIdentifier); Binary binary = new Binary().setContentType(OPENEHR_MIMETYPE_JSON).setSecurityContext(securityContext) .setData(content); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java index 773f11384..ef41cf4e1 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java @@ -23,11 +23,11 @@ public GenerateCountFromIds(FhirWebserviceClientProvider clientProvider, TaskHel protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); List<FeasibilityQueryResult> filteredResults = count(results.getResults()); - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(filteredResults))); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java index 9d6399de5..a2eeaf5a5 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java @@ -32,9 +32,10 @@ public void afterPropertiesSet() throws Exception @Override protected void doExecute(DelegateExecution execution) throws Exception { - Boolean needsConsentCheck = (Boolean) execution.getVariable(ConstantsFeasibility.VARIABLE_NEEDS_CONSENT_CHECK); + Boolean needsConsentCheck = (Boolean) execution + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); Boolean needsRecordLinkage = (Boolean) execution - .getVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); boolean idQuery = Boolean.TRUE.equals(needsConsentCheck) || Boolean.TRUE.equals(needsRecordLinkage); if (idQuery) @@ -42,11 +43,11 @@ protected void doExecute(DelegateExecution execution) throws Exception // <groupId, query> @SuppressWarnings("unchecked") Map<String, String> queries = (Map<String, String>) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERIES); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES); Map<String, String> modifiedQueries = modifyQueries(queries); - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERIES, modifiedQueries); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES, modifiedQueries); } } @@ -63,6 +64,6 @@ private Map<String, String> modifyQueries(Map<String, String> queries) protected String replaceSelectCountWithSelectMpiId(String value) { // TODO Implement correct replacement for default id query - return value.replace("select count(e)", "select e" + ehrIdColumnPath + " as EHRID"); + return value.replace("select count(e)", "select e" + ehrIdColumnPath + " as EHRID"); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java index cf690feba..ccc81f710 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java @@ -65,17 +65,19 @@ public void afterPropertiesSet() throws Exception protected void doExecute(DelegateExecution execution) throws Exception { ResearchStudy researchStudy = (ResearchStudy) execution - .getVariable(ConstantsFeasibility.VARIABLE_RESEARCH_STUDY); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); - execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(getMedicTargets(researchStudy))); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, + TargetsValues.create(getMedicTargets(researchStudy))); - execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues.create(getTtpTarget(researchStudy))); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, + TargetValues.create(getTtpTarget(researchStudy))); Boolean needsRecordLinkage = (Boolean) execution - .getVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); if (Boolean.TRUE.equals(needsRecordLinkage)) { - execution.setVariable(ConstantsFeasibility.VARIABLE_BLOOM_FILTER_CONFIG, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, BloomFilterConfigValues.create(createBloomFilterConfig())); } } @@ -88,8 +90,9 @@ private BloomFilterConfig createBloomFilterConfig() private Targets getMedicTargets(ResearchStudy researchStudy) { - List<Target> targets = researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI) - .stream().filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) + List<Target> targets = researchStudy + .getExtensionsByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC).stream() + .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) .map(r -> Target.createBiDirectionalTarget(r.getIdentifier().getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); @@ -98,7 +101,7 @@ private Targets getMedicTargets(ResearchStudy researchStudy) private Target getTtpTarget(ResearchStudy researchStudy) { - return researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI).stream() + return researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_TTP).stream() .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) .map(r -> Target.createUniDirectionalTarget(r.getIdentifier().getValue())).findFirst().get(); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java index 87dffa638..5e078184e 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java @@ -39,6 +39,6 @@ protected void doExecute(DelegateExecution execution) throws Exception Task task = getLeadingTaskFromExecutionVariables(); Target medicTarget = Target.createUniDirectionalTarget(task.getRequester().getIdentifier().getValue()); - execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues.create(medicTarget)); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(medicTarget)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java index 2bfc4818a..2677e6be8 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java @@ -34,11 +34,11 @@ public void afterPropertiesSet() throws Exception @Override protected void doExecute(DelegateExecution execution) throws Exception { - String ttpIdentifier = (String) execution.getVariable(ConstantsBase.VARIABLE_TTP_IDENTIFIER); + String ttpIdentifier = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER); String correlationKey = getCorrelationKey(execution); Target ttpTarget = Target.createBiDirectionalTarget(ttpIdentifier, correlationKey); - execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues.create(ttpTarget)); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(ttpTarget)); } private String getCorrelationKey(DelegateExecution execution) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java index 013bb86d5..286320056 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java @@ -34,12 +34,13 @@ protected void doExecute(DelegateExecution execution) throws Exception .map(correlationKey -> Target.createBiDirectionalTarget("", correlationKey)) .collect(Collectors.toList()); - execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); + execution + .setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(null))); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java index eb19b24cd..f56fa2f5b 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java @@ -43,10 +43,10 @@ public void afterPropertiesSet() throws Exception protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - boolean needsRecordLinkage = Boolean.TRUE - .equals((Boolean) execution.getVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE)); + boolean needsRecordLinkage = Boolean.TRUE.equals((Boolean) execution + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE)); Task task = getCurrentTaskFromExecutionVariables(); @@ -54,7 +54,7 @@ protected void doExecute(DelegateExecution execution) throws Exception extendedResults.addAll(results.getResults()); extendedResults.addAll(getResults(task, needsRecordLinkage)); - execution.setVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(extendedResults))); } @@ -67,7 +67,7 @@ private List<FeasibilityQueryResult> getResults(Task task, boolean needsRecordLi { return taskHelper.getInputParameterWithExtension(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, - ConstantsFeasibility.EXTENSION_GROUP_ID_URI).map(input -> { + ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID).map(input -> { String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); String resultSetUrl = ((Reference) input.getValue()).getReference(); @@ -78,7 +78,7 @@ private List<FeasibilityQueryResult> getResults(Task task, boolean needsRecordLi { return taskHelper.getInputParameterWithExtension(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, - ConstantsFeasibility.EXTENSION_GROUP_ID_URI).map(input -> { + ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID).map(input -> { String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); int cohortSize = ((UnsignedIntType) input.getValue()).getValue(); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java index 37b50c932..1abc6a6a5 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java @@ -81,7 +81,7 @@ public class FeasibilityConfig private String ehrIdColumnPath; // - // process requestSimpleFeasibility implementations + // process requestFeasibility implementations // @Bean @@ -121,7 +121,7 @@ public HandleErrorMultiMedicResults handleErrorMultiMedicResults() } // - // process executeSimpleFeasibility implementations + // process executeFeasibility implementations // @Bean @@ -210,7 +210,7 @@ public SendSingleMedicResults sendSingleMedicResults() } // - // process computeSimpleFeasibility implementations + // process computeFeasibility implementations // @Bean diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn similarity index 93% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn index 6d87f67c1..753a9f97d 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeSimpleFeasibility.bpmn +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1yff9tp" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="computeSimpleFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> + <bpmn:process id="computeFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:subProcess id="SubProcess_1gopxt4"> <bpmn:incoming>SequenceFlow_1lfe4wr</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0xxpamp</bpmn:outgoing> @@ -45,10 +45,10 @@ <bpmn:endEvent id="EndEventSuccess" name="send final result to leading MeDIC"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">requestSimpleFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility</camunda:inputParameter> + <camunda:inputParameter name="processDefinitionKey">requestFeasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">resultMultiMedicSimpleFeasibilityMessage</camunda:inputParameter> + <camunda:inputParameter name="messageName">resultMultiMedicFeasibilityMessage</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>Flow_1r6dq8y</bpmn:incoming> @@ -97,10 +97,10 @@ <bpmn:endEvent id="EndEventError" name="send error to leading MeDIC"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">requestSimpleFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-error-simple-feasibility</camunda:inputParameter> + <camunda:inputParameter name="processDefinitionKey">requestFeasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">errorMultiMedicSimpleFeasibilityMessage</camunda:inputParameter> + <camunda:inputParameter name="messageName">errorMultiMedicFeasibilityMessage</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>Flow_1tmnvhl</bpmn:incoming> @@ -119,13 +119,13 @@ </bpmn:boundaryEvent> <bpmn:sequenceFlow id="Flow_1tmnvhl" sourceRef="Event_1vp5qzs" targetRef="EndEventError" /> </bpmn:process> - <bpmn:message id="Message_0a1qxd8" name="resultSingleMedicSimpleFeasibilityMessage" /> - <bpmn:message id="Message_0ue93sz" name="resultMultiMedicSimpleFeasibilityMessage" /> - <bpmn:message id="Message_08676wn" name="computeSimpleFeasibilityMessage" /> - <bpmn:message id="Message_0kix95m" name="errorMultiMedicSimpleFeasibilityMessage" /> - <bpmn:error id="Error_0qub4jc" name="errorMultiMedicSimpleFeasibilityResult" errorCode="errorMultiMedicSimpleFeasibilityResult" camunda:errorMessage="errorMultiMedicSimpleFeasibilityResult" /> + <bpmn:message id="Message_0a1qxd8" name="resultSingleMedicFeasibilityMessage" /> + <bpmn:message id="Message_0ue93sz" name="resultMultiMedicFeasibilityMessage" /> + <bpmn:message id="Message_08676wn" name="computeFeasibilityMessage" /> + <bpmn:message id="Message_0kix95m" name="errorMultiMedicFeasibilityMessage" /> + <bpmn:error id="Error_0qub4jc" name="errorMultiMedicFeasibilityResult" errorCode="errorMultiMedicFeasibilityResult" camunda:errorMessage="errorMultiMedicFeasibilityResult" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="computeSimpleFeasibility"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="computeFeasibility"> <bpmndi:BPMNEdge id="Flow_1tmnvhl_di" bpmnElement="Flow_1tmnvhl"> <di:waypoint x="1820" y="300" /> <di:waypoint x="1820" y="350" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn similarity index 97% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn index 97bd4aa10..bbb01ebe9 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeSimpleFeasibility.bpmn +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0drkcb5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="executeSimpleFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> + <bpmn:process id="executeFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:serviceTask id="checkResults" name="check results" camunda:class="org.highmed.dsf.bpe.service.CheckSingleMedicResults"> <bpmn:incoming>SequenceFlow_0q803rh</bpmn:incoming> <bpmn:outgoing>SequenceFlow_04ouilq</bpmn:outgoing> @@ -24,10 +24,10 @@ <bpmn:endEvent id="EndEvent" name="send result to TTP"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="messageName">resultSingleMedicSimpleFeasibilityMessage</camunda:inputParameter> + <camunda:inputParameter name="messageName">resultSingleMedicFeasibilityMessage</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="processDefinitionKey">computeSimpleFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility</camunda:inputParameter> + <camunda:inputParameter name="processDefinitionKey">computeFeasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0ascyjc</bpmn:incoming> @@ -129,10 +129,10 @@ </bpmn:textAnnotation> <bpmn:association id="Association_1ncewqu" sourceRef="checkFeasibilityResources" targetRef="TextAnnotation_0euut3n" /> </bpmn:process> - <bpmn:message id="Message_1yz2a31" name="executeSimpleFeasibilityMessage" /> - <bpmn:message id="Message_1dr71re" name="resultSingleMedicSimpleFeasibilityMessage" /> + <bpmn:message id="Message_1yz2a31" name="executeFeasibilityMessage" /> + <bpmn:message id="Message_1dr71re" name="resultSingleMedicFeasibilityMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="executeSimpleFeasibility"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="executeFeasibility"> <bpmndi:BPMNEdge id="SequenceFlow_0ascyjc_di" bpmnElement="SequenceFlow_0ascyjc"> <di:waypoint x="2106" y="272" /> <di:waypoint x="2201" y="272" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn similarity index 88% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn index 62e87ff10..884b99ca1 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestSimpleFeasibility.bpmn +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0inb4ax" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="requestSimpleFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> + <bpmn:process id="requestFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> <bpmn:startEvent id="StartEvent" name="start"> <bpmn:outgoing>SequenceFlow_11k77gx</bpmn:outgoing> <bpmn:messageEventDefinition id="MessageEventDefinition_10c2suu" messageRef="Message_1pq9qxp" /> @@ -12,10 +12,10 @@ <bpmn:sendTask id="sendRequestToMedics" name="send request to medics" camunda:class="org.highmed.dsf.bpe.message.SendMedicRequest"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">executeSimpleFeasibility</camunda:inputParameter> + <camunda:inputParameter name="processDefinitionKey">executeFeasibility</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">executeSimpleFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility</camunda:inputParameter> + <camunda:inputParameter name="messageName">executeFeasibilityMessage</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-feasibility</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_035oihl</bpmn:incoming> @@ -33,10 +33,10 @@ <bpmn:intermediateThrowEvent id="sendCorreltationKeysToTTP" name="send correlation keys to TTP"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">computeSimpleFeasibility</camunda:inputParameter> + <camunda:inputParameter name="processDefinitionKey">computeFeasibility</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">computeSimpleFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility</camunda:inputParameter> + <camunda:inputParameter name="messageName">computeFeasibilityMessage</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-compute-feasibility</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0b5s4ef</bpmn:incoming> @@ -83,21 +83,21 @@ <bpmn:sequenceFlow id="Flow_0rkdr4f" sourceRef="handelError" targetRef="Gateway_12ly33g" /> <bpmn:sequenceFlow id="Flow_15k4oa2" sourceRef="Gateway_12ly33g" targetRef="EndEvent" /> </bpmn:process> - <bpmn:message id="Message_1pq9qxp" name="requestSimpleFeasibilityMessage" /> - <bpmn:message id="Message_07ayhv1" name="resultSimpleFeasibilityMessage" /> - <bpmn:message id="Message_0gifb86" name="computeSimpleFeasibilityMessage" /> + <bpmn:message id="Message_1pq9qxp" name="requestFeasibilityMessage" /> + <bpmn:message id="Message_07ayhv1" name="resultFeasibilityMessage" /> + <bpmn:message id="Message_0gifb86" name="computeFeasibilityMessage" /> <bpmn:error id="Error_0dl03kn" /> <bpmn:error id="Error_07exqe7" /> <bpmn:error id="Error_1jhmarr" /> <bpmn:message id="Message_0qfng3q" name="receiveMultiMedicCohortSizeResultMessage" /> - <bpmn:message id="Message_0srg3vv" name="resultMultiMedicSimpleFeasibilityMessage" /> - <bpmn:message id="Message_0nmxozg" name="errorSimpleFeasibilityMessage" /> - <bpmn:message id="Message_1y0yxv0" name="resultMultiMedicSimpleFeasibilityMessage" /> - <bpmn:message id="Message_0v1bo0o" name="errorSimpleFeasibilityMessage" /> - <bpmn:message id="Message_10vqhu0" name="errorMultiMedicSimpleFeasibilityMessage" /> - <bpmn:message id="Message_1vrxfsk" name="resultMultiMedicSimpleFeasibilityMessage" /> + <bpmn:message id="Message_0srg3vv" name="resultMultiMedicFeasibilityMessage" /> + <bpmn:message id="Message_0nmxozg" name="errorFeasibilityMessage" /> + <bpmn:message id="Message_1y0yxv0" name="resultMultiMedicFeasibilityMessage" /> + <bpmn:message id="Message_0v1bo0o" name="errorFeasibilityMessage" /> + <bpmn:message id="Message_10vqhu0" name="errorMultiMedicFeasibilityMessage" /> + <bpmn:message id="Message_1vrxfsk" name="resultMultiMedicFeasibilityMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="requestSimpleFeasibility"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="requestFeasibility"> <bpmndi:BPMNEdge id="Flow_15k4oa2_di" bpmnElement="Flow_15k4oa2"> <di:waypoint x="1385" y="220" /> <di:waypoint x="1452" y="220" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml similarity index 76% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml index dc0617ea5..1c973146d 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/computeSimpleFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml @@ -5,9 +5,9 @@ <code value="REMOTE" /> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> - <valueString value="computeSimpleFeasibilityMessage" /> + <valueString value="computeFeasibilityMessage" /> </extension> <extension url="authorization-roles"> <extension url="authorization-role"> @@ -34,12 +34,12 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility" /> </extension> </extension> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> - <valueString value="resultSingleMedicSimpleFeasibilityMessage" /> + <valueString value="resultSingleMedicFeasibilityMessage" /> </extension> <extension url="authorization-roles"> <extension url="authorization-role"> @@ -66,15 +66,15 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility" /> </extension> </extension> - <url value="http://highmed.org/bpe/Process/computeSimpleFeasibility" /> + <url value="http://highmed.org/bpe/Process/computeFeasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> - <name value="computeSimpleFeasibility" /> - <title value="Compute Simple Feasibility" /> - <subtitle value="Process to compute simple feasibility result" /> + <name value="computeFeasibility" /> + <title value="Compute Feasibility" /> + <subtitle value="Process to compute feasibility result" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> @@ -87,6 +87,6 @@ <value value="pmo@highmed.org" /> </telecom> </contact> - <description value="Process to compute a simple fesibility result and to send the result back to the requesting organization" /> + <description value="Process to compute a fesibility result and to send the result back to the requesting organization" /> <kind value="Task" /> </ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml similarity index 76% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml index 420986256..90abc1635 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/executeSimpleFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml @@ -5,9 +5,9 @@ <code value="REMOTE" /> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> - <valueString value="executeSimpleFeasibilityMessage" /> + <valueString value="executeFeasibilityMessage" /> </extension> <extension url="authorization-roles"> <extension url="authorization-role"> @@ -40,15 +40,15 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> </extension> </extension> - <url value="http://highmed.org/bpe/Process/executeSimpleFeasibility" /> + <url value="http://highmed.org/bpe/Process/executeFeasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> - <name value="executeSimpleFeasibility" /> - <title value="Execute a Simple Feasibility" /> - <subtitle value="Process to execute a simple feasibility query" /> + <name value="executeFeasibility" /> + <title value="Execute a Feasibility" /> + <subtitle value="Process to execute a feasibility query" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> @@ -61,6 +61,6 @@ <value value="pmo@highmed.org" /> </telecom> </contact> - <description value="Process to execute a simple feasibility query received from a MeDIC and to send result to a TTP" /> + <description value="Process to execute a feasibility query received from a MeDIC and to send result to a TTP" /> <kind value="Task" /> </ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml similarity index 79% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml index 9bd320ae2..973d52d9d 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/requestSimpleFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml @@ -5,9 +5,9 @@ <code value="REMOTE" /> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> - <valueString value="requestSimpleFeasibilityMessage" /> + <valueString value="requestFeasibilityMessage" /> </extension> <extension url="authorization-roles"> <extension url="authorization-role"> @@ -34,12 +34,12 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-feasibility" /> </extension> </extension> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> - <valueString value="resultMultiMedicSimpleFeasibilityMessage" /> + <valueString value="resultMultiMedicFeasibilityMessage" /> </extension> <extension url="authorization-roles"> <extension url="authorization-role"> @@ -66,12 +66,12 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility" /> </extension> </extension> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> - <valueString value="errorMultiMedicSimpleFeasibilityMessage" /> + <valueString value="errorMultiMedicFeasibilityMessage" /> </extension> <extension url="authorization-roles"> <extension url="authorization-role"> @@ -98,14 +98,14 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-error-simple-feasibility" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility" /> </extension> </extension> - <url value="http://highmed.org/bpe/Process/requestSimpleFeasibility" /> + <url value="http://highmed.org/bpe/Process/requestFeasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> - <name value="requestSimpleFeasibility" /> - <title value="Request simple feasibility" /> + <name value="requestFeasibility" /> + <title value="Request feasibility" /> <subtitle value="Feasibility Request Process" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -119,6 +119,6 @@ <value value="pmo@highmed.org" /> </telecom> </contact> - <description value="Process to start a simple feasibility, process sends messages to all MeDICs and a TTP, receives result from TTP" /> + <description value="Process to start a feasibility, process sends messages to all MeDICs and a TTP, receives result from TTP" /> <kind value="Task" /> </ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/feasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-query-type.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/query-type.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-query-type.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml index 1c8a818ce..0a100f492 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <url value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="GroupId" /> @@ -35,14 +35,14 @@ </element> <element id="Extension.url"> <path value="Extension.url" /> - <fixedUri value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <fixedUri value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> </element> <element id="Extension.value[x]"> <path value="Extension.value[x]" /> <min value="1" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-group" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/group" /> </type> </element> <element id="Extension.value[x].reference"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml index f6831a3d1..6730b2261 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/participating-medic" /> + <url value="http://highmed.org/fhir/StructureDefinition/extension-participating-medic" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="ParticipatingMedic" /> @@ -31,7 +31,7 @@ </element> <element id="Extension.url"> <path value="Extension.url" /> - <fixedUri value="http://highmed.org/fhir/StructureDefinition/participating-medic" /> + <fixedUri value="http://highmed.org/fhir/StructureDefinition/extension-participating-medic" /> </element> <element id="Extension.value[x]"> <path value="Extension.value[x]" /> @@ -40,7 +40,7 @@ <min value="1" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-organization" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/organization" /> </type> </element> <element id="Extension.value[x].reference"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml index 8fa6fe351..14fe84970 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/participating-ttp" /> + <url value="http://highmed.org/fhir/StructureDefinition/extension-participating-ttp" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="ParticipatingTtp" /> @@ -31,7 +31,7 @@ </element> <element id="Extension.url"> <path value="Extension.url" /> - <fixedUri value="http://highmed.org/fhir/StructureDefinition/participating-ttp" /> + <fixedUri value="http://highmed.org/fhir/StructureDefinition/extension-participating-ttp" /> </element> <element id="Extension.value[x]"> <path value="Extension.value[x]" /> @@ -40,7 +40,7 @@ <min value="1" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-organization" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/organization" /> </type> </element> <element id="Extension.value[x].reference"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml index 1f00a8565..59aef12ea 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/query" /> + <url value="http://highmed.org/fhir/StructureDefinition/extension-query" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="Query" /> @@ -26,7 +26,7 @@ <differential> <element id="Extension.url"> <path value="Extension.url" /> - <fixedUri value="http://highmed.org/fhir/StructureDefinition/query" /> + <fixedUri value="http://highmed.org/fhir/StructureDefinition/extension-query" /> </element> <element id="Extension.value[x]"> <path value="Extension.value[x]" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml index 9a3e93ca2..35e706a28 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-group" /> + <url value="http://highmed.org/fhir/StructureDefinition/group" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="Group" /> @@ -37,7 +37,7 @@ <max value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/query" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-query" /> </type> </element> <element id="Group.type"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml index 79fc47dbd..115b3642b 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility" /> + <url value="http://highmed.org/fhir/StructureDefinition/research-study-feasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="ResearchStudyFeasibility" /> @@ -37,7 +37,7 @@ <max value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/participating-ttp" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-participating-ttp" /> </type> </element> <element id="ResearchStudy.extension:participating-medic"> @@ -46,7 +46,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/participating-medic" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-participating-medic" /> </type> </element> <element id="ResearchStudy.identifier"> @@ -80,7 +80,7 @@ <min value="1" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-group" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/group" /> </type> </element> <element id="ResearchStudy.enrollment.reference"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml similarity index 94% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml index 1861cb45f..935abe580 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml @@ -5,10 +5,10 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-compute-simple-feasibility" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> - <name value="TaskComputeSimpleFeasibility" /> + <name value="TaskComputeFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> @@ -17,12 +17,12 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeSimpleFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -40,7 +40,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="computeSimpleFeasibilityMessage" /> + <fixedString value="computeFeasibilityMessage" /> </element> <element id="Task.input:business-key"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml similarity index 90% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml index deed9ce7e..6f4e4cba5 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml @@ -6,10 +6,10 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-error-simple-feasibility" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> - <name value="TaskErrorSimpleFeasibility" /> + <name value="TaskErrorFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> @@ -18,12 +18,12 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -41,7 +41,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="errorMultiMedicSimpleFeasibilityMessage" /> + <fixedString value="errorMultiMedicFeasibilityMessage" /> </element> <element id="Task.input:business-key"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml similarity index 95% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml index 70fba860e..12cd5b348 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml @@ -5,10 +5,10 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-execute-simple-feasibility" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> - <name value="TaskExecuteSimpleFeasibility" /> + <name value="TaskExecuteFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> @@ -17,12 +17,12 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeSimpleFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/executeFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -41,7 +41,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="executeSimpleFeasibilityMessage" /> + <fixedString value="executeFeasibilityMessage" /> </element> <element id="Task.input:business-key"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -97,7 +97,7 @@ <path value="Task.input.value[x]" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/research-study-feasibility" /> </type> </element> <element id="Task.input:needs-record-linkage"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml similarity index 95% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml index 304b1b10e..d6d6d2995 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml @@ -5,10 +5,10 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-multi-medic-result-simple-feasibility" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> - <name value="TaskMultiMedicResultSimpleFeasibility" /> + <name value="TaskMultiMedicResultFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> @@ -17,12 +17,12 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -40,7 +40,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="resultMultiMedicSimpleFeasibilityMessage" /> + <fixedString value="resultMultiMedicFeasibilityMessage" /> </element> <element id="Task.input:business-key"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -83,7 +83,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> </type> </element> <element id="Task.input:participating-medics.type"> @@ -141,7 +141,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> </type> </element> <element id="Task.input:multi-medic-result.type"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml similarity index 96% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml index ed98353f2..00f124afb 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml @@ -5,10 +5,10 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-simple-feasibility" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> - <name value="TaskRequestSimpleFeasibility" /> + <name value="TaskRequestFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> @@ -17,12 +17,12 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestSimpleFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -41,7 +41,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="requestSimpleFeasibilityMessage" /> + <fixedString value="requestFeasibilityMessage" /> </element> <element id="Task.input:business-key"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -97,7 +97,7 @@ <path value="Task.input.value[x]" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/research-study-feasibility" /> </type> </element> <element id="Task.input:research-study-reference.value[x].reference"> @@ -208,7 +208,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> </type> </element> <element id="Task.output:participating-medics.type"> @@ -262,7 +262,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> </type> </element> <element id="Task.output:multi-medic-result.type"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml similarity index 94% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml index 428ef339e..5ee81e6ae 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml @@ -5,10 +5,10 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility" /> <!-- version managed by bpe --> <version value="bpe-managed" /> - <name value="TaskSingleMedicResultSimpleFeasibility" /> + <name value="TaskSingleMedicResultFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> <experimental value="false" /> @@ -17,12 +17,12 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeSimpleFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/0.4.0" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -40,7 +40,7 @@ </element> <element id="Task.input:message-name.value[x]"> <path value="Task.input.value[x]" /> - <fixedString value="resultSingleMedicSimpleFeasibilityMessage" /> + <fixedString value="resultSingleMedicFeasibilityMessage" /> </element> <element id="Task.input:business-key"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> @@ -83,7 +83,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> </type> </element> <element id="Task.input:single-medic-result.type"> @@ -142,7 +142,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> </type> </element> <element id="Task.input:single-medic-result-reference.type"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/feasibility.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-query-type.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/query-type.xml rename to dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-query-type.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java similarity index 64% rename from dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java rename to dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java index 57d821126..ffdf12a6f 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -1,27 +1,27 @@ package org.highmed.dsf.bpe.start; -import static org.highmed.dsf.bpe.ConstantsBase.AQL_QUERY_TYPE; 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.EXTENSION_QUERY_URI; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.CODE_TYPE_AQL_QUERY; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; -import static org.highmed.dsf.bpe.ConstantsFeasibility.FEASIBILITY_RESEARCH_STUDY_PROFILE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.GROUP_PROFILE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.RESEARCH_STUDY_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_TTP; +import static org.highmed.dsf.bpe.ConstantsFeasibility.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_GROUP; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; import java.util.Date; import java.util.UUID; @@ -45,7 +45,7 @@ import org.hl7.fhir.r4.model.Task.TaskIntent; import org.hl7.fhir.r4.model.Task.TaskStatus; -public class RequestSimpleFeasibilityFromMedicsViaMedic1ExampleStarter +public class RequestFeasibilityFromMedicsViaMedic1ExampleStarter { // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 @@ -83,14 +83,14 @@ private static Group createGroup(String name) Group group = new Group(); group.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - group.getMeta().addProfile(GROUP_PROFILE); + group.getMeta().addProfile(PROFILE_HIGHMED_GROUP); group.getText().getDiv().addText("This is the description"); group.getText().setStatus(Narrative.NarrativeStatus.ADDITIONAL); group.setType(GroupType.PERSON); group.setActual(false); group.setActive(true); - group.addExtension().setUrl(EXTENSION_QUERY_URI).setValue( - new Expression().setLanguageElement(AQL_QUERY_TYPE).setExpression("SELECT COUNT(e) FROM EHR e")); + group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY).setValue( + new Expression().setLanguageElement(CODE_TYPE_AQL_QUERY).setExpression("SELECT COUNT(e) FROM EHR e")); group.setName(name); return group; @@ -101,29 +101,29 @@ private static ResearchStudy createResearchStudy(Group group1, Group group2) ResearchStudy researchStudy = new ResearchStudy(); researchStudy.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - researchStudy.getMeta().addProfile(FEASIBILITY_RESEARCH_STUDY_PROFILE); - researchStudy.addIdentifier().setSystem(RESEARCH_STUDY_IDENTIFIER_SYSTEM) + researchStudy.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY); + researchStudy.addIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER) .setValue(UUID.randomUUID().toString()); researchStudy.setStatus(ResearchStudyStatus.ACTIVE); researchStudy.addEnrollment().setReference(group1.getIdElement().getIdPart()); researchStudy.addEnrollment().setReference(group2.getIdElement().getIdPart()); - researchStudy.addExtension().setUrl(EXTENSION_PARTICIPATING_MEDIC_URI).setValue( + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1))); - researchStudy.addExtension().setUrl(EXTENSION_PARTICIPATING_MEDIC_URI).setValue( + new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1))); + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2))); - researchStudy.addExtension().setUrl(EXTENSION_PARTICIPATING_MEDIC_URI).setValue( + new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2))); + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3))); - researchStudy.addExtension().setUrl(EXTENSION_PARTICIPATING_TTP_URI).setValue( + new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3))); + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP).setValue( new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP))); + new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP))); return researchStudy; } @@ -133,18 +133,20 @@ private static Task createTask(ResearchStudy researchStudy) Task task = new Task(); task.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - task.getMeta().addProfile(REQUEST_FEASIBILITY_TASK_PROFILE); - task.setInstantiatesUri(REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.addInput().setValue(new StringType(REQUEST_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new Reference().setReference(researchStudy.getIdElement().getIdPart()) .setType(ResourceType.ResearchStudy.name())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java index bae563a3f..05fca5f53 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java @@ -1,9 +1,9 @@ package org.highmed.dsf.fhir.profile; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_QUERY_URI; -import static org.highmed.dsf.bpe.ConstantsFeasibility.GROUP_PROFILE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_GROUP; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -30,8 +30,8 @@ public class GroupProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-extension-query.xml", "highmed-group.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "query-type.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "query-type.xml")); + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-query-type.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-query-type.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -40,11 +40,11 @@ public class GroupProfileTest public void testGroupProfileValid() throws Exception { Group group = new Group(); - group.getMeta().addProfile(GROUP_PROFILE); + group.getMeta().addProfile(PROFILE_HIGHMED_GROUP); group.setType(GroupType.PERSON); group.setActual(false); - group.addExtension().setUrl(EXTENSION_QUERY_URI).setValue(new Expression() - .setLanguageElement(new CodeType(CODESYSTEM_QUERY_TYPE_AQL).setSystem(CODESYSTEM_QUERY_TYPE)) + group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY).setValue(new Expression().setLanguageElement( + new CodeType(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL).setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE)) .setExpression("SELECT COUNT(e) FROM EHR e")); ValidationResult result = resourceValidator.validate(group); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java index e11a04114..47698aa5e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java @@ -1,10 +1,10 @@ package org.highmed.dsf.fhir.profile; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_MEDIC_URI; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_PARTICIPATING_TTP_URI; -import static org.highmed.dsf.bpe.ConstantsFeasibility.FEASIBILITY_RESEARCH_STUDY_PROFILE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.RESEARCH_STUDY_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_TTP; +import static org.highmed.dsf.bpe.ConstantsFeasibility.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -33,8 +33,8 @@ public class ResearchStudyProfileTest public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-extension-participating-medic.xml", "highmed-extension-participating-ttp.xml", "highmed-research-study-feasibility.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "organization-type-0.4.0.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "organization-type-0.4.0.xml")); + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-organization-type-0.4.0.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-organization-type-0.4.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -43,29 +43,28 @@ public class ResearchStudyProfileTest public void testResearchStudyProfileValid() throws Exception { ResearchStudy res = new ResearchStudy(); - res.getMeta().addProfile(FEASIBILITY_RESEARCH_STUDY_PROFILE); - res.getIdentifierFirstRep().setSystem(RESEARCH_STUDY_IDENTIFIER_SYSTEM ) + res.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY); + res.getIdentifierFirstRep().setSystem(NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER) .setValue(UUID.randomUUID().toString()); res.setStatus(ResearchStudyStatus.ACTIVE); res.addEnrollment().setReference("Group/" + UUID.randomUUID().toString()); Reference medicRef1 = new Reference().setType(ResourceType.Organization.name()); - medicRef1.getIdentifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue("MeDIC 1"); - res.addExtension(EXTENSION_PARTICIPATING_MEDIC_URI, medicRef1); + medicRef1.getIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); + res.addExtension(EXTENSION_HIGHMED_PARTICIPATING_MEDIC, medicRef1); Reference medicRef2 = new Reference().setType(ResourceType.Organization.name()); - medicRef2.getIdentifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue("MeDIC 2"); - res.addExtension(EXTENSION_PARTICIPATING_MEDIC_URI, medicRef2); + medicRef2.getIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 2"); + res.addExtension(EXTENSION_HIGHMED_PARTICIPATING_MEDIC, medicRef2); Reference ttpRef = new Reference().setType(ResourceType.Organization.name()); - ttpRef.getIdentifier().setSystem(ORGANIZATION_IDENTIFIER_SYSTEM) - .setValue("TTP"); - res.addExtension(EXTENSION_PARTICIPATING_TTP_URI, ttpRef); + ttpRef.getIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); + res.addExtension(EXTENSION_HIGHMED_PARTICIPATING_TTP, ttpRef); ValidationResult result = resourceValidator.validate(res); - result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" - + m.getLocationCol() + " - " + m.getSeverity() + ": " + m.getMessage()).forEach(logger::info); + result.getMessages().stream() + .map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + m.getLocationCol() + " - " + m + .getSeverity() + ": " + m.getMessage()).forEach(logger::info); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 3e4e4f0d4..2dce21e67 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -5,7 +5,7 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT; @@ -16,22 +16,22 @@ import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.COMPUTE_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsFeasibility.COMPUTE_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.ERROR_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.ERROR_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXECUTE_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXECUTE_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_GROUP_ID_URI; -import static org.highmed.dsf.bpe.ConstantsFeasibility.MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.MULTI_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsFeasibility.REQUEST_FEASIBILITY_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.SINGLE_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; import static org.junit.Assert.assertEquals; import java.nio.charset.StandardCharsets; @@ -68,22 +68,22 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group.xml", "highmed-extension-group-id.xml", - "highmed-research-study-feasibility.xml", "highmed-task-request-simple-feasibility.xml", - "highmed-task-execute-simple-feasibility.xml", - "highmed-task-single-medic-result-simple-feasibility.xml", - "highmed-task-compute-simple-feasibility.xml", - "highmed-task-multi-medic-result-simple-feasibility.xml", - "highmed-task-error-simple-feasibility.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml")); + "highmed-research-study-feasibility.xml", "highmed-task-request-feasibility.xml", + "highmed-task-execute-feasibility.xml", "highmed-task-single-medic-result-feasibility.xml", + "highmed-task-compute-feasibility.xml", "highmed-task-multi-medic-result-feasibility.xml", + "highmed-task-error-feasibility.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + "highmed-feasibility.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + "highmed-feasibility.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @Test - public void testTaskRequestSimpleFeasibilityValid() throws Exception + public void testTaskRequestFeasibilityValid() throws Exception { - Task task = createValidTaskRequestSimpleFeasibility(); + Task task = createValidTaskRequestFeasibility(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -94,34 +94,34 @@ public void testTaskRequestSimpleFeasibilityValid() throws Exception } @Test - public void testTaskRequestSimpleFeasibilityValidWithOutput() throws Exception + public void testTaskRequestFeasibilityValidWithOutput() throws Exception { String groupId1 = "Group/" + UUID.randomUUID().toString(); String groupId2 = "Group/" + UUID.randomUUID().toString(); - Task task = createValidTaskRequestSimpleFeasibility(); + Task task = createValidTaskRequestFeasibility(); TaskOutputComponent outParticipatingMedics1 = task.addOutput(); outParticipatingMedics1.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); - outParticipatingMedics1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); + outParticipatingMedics1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); TaskOutputComponent outMultiMedicResult1 = task.addOutput(); outMultiMedicResult1.setValue(new UnsignedIntType(25)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY).setCode("multi-medic-result"); - outMultiMedicResult1 - .addExtension("http://highmed.org/fhir/StructureDefinition/group-id", new Reference(groupId1)); + outMultiMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/extension-group-id", + new Reference(groupId1)); TaskOutputComponent outParticipatingMedics2 = task.addOutput(); outParticipatingMedics2.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); - outParticipatingMedics2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); + outParticipatingMedics2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); TaskOutputComponent outMultiMedicResult2 = task.addOutput(); outMultiMedicResult2.setValue(new UnsignedIntType(25)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT); - outMultiMedicResult2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); + outMultiMedicResult2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -131,21 +131,21 @@ public void testTaskRequestSimpleFeasibilityValidWithOutput() throws Exception .equals(m.getSeverity())).count()); } - private Task createValidTaskRequestSimpleFeasibility() + private Task createValidTaskRequestFeasibility() { Task task = new Task(); - task.getMeta().addProfile(REQUEST_FEASIBILITY_TASK_PROFILE); - task.setInstantiatesUri(REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.addInput().setValue(new StringType(REQUEST_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new Reference("ResearchStudy/" + UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); @@ -158,9 +158,9 @@ private Task createValidTaskRequestSimpleFeasibility() } @Test - public void testTaskExecuteSimpleFeasibilityValid() throws Exception + public void testTaskExecuteFeasibilityValid() throws Exception { - Task task = createValidTaskExecuteSimpleFeasibility(); + Task task = createValidTaskExecuteFeasibility(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -171,9 +171,9 @@ public void testTaskExecuteSimpleFeasibilityValid() throws Exception } @Test - public void testTaskExecuteSimpleFeasibilityValidWithBloomFilterConfig() throws Exception + public void testTaskExecuteFeasibilityValidWithBloomFilterConfig() throws Exception { - Task task = createValidTaskExecuteSimpleFeasibility(); + Task task = createValidTaskExecuteFeasibility(); task.addInput().setValue(new Base64BinaryType("TEST".getBytes(StandardCharsets.UTF_8))).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); @@ -186,21 +186,21 @@ public void testTaskExecuteSimpleFeasibilityValidWithBloomFilterConfig() throws .equals(m.getSeverity())).count()); } - private Task createValidTaskExecuteSimpleFeasibility() + private Task createValidTaskExecuteFeasibility() { Task task = new Task(); - task.getMeta().addProfile(EXECUTE_FEASIBILITY_TASK_PROFILE); - task.setInstantiatesUri(EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 2"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 2"); - task.addInput().setValue(new StringType(EXECUTE_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() @@ -218,9 +218,9 @@ private Task createValidTaskExecuteSimpleFeasibility() } @Test - public void testTaskSingleMedicResultSimpleFeasibilityUnsignedIntResultValid() throws Exception + public void testTaskSingleMedicResultFeasibilityUnsignedIntResultValid() throws Exception { - Task task = createValidTaskSingleMedicResultSimpleFeasibilityUnsignedIntResult(); + Task task = createValidTaskSingleMedicResultFeasibilityUnsignedIntResult(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -231,9 +231,9 @@ public void testTaskSingleMedicResultSimpleFeasibilityUnsignedIntResultValid() t } @Test - public void testTaskSingleMedicResultSimpleFeasibilityReferenceResultValid() throws Exception + public void testTaskSingleMedicResultFeasibilityReferenceResultValid() throws Exception { - Task task = createValidTaskSingleMedicResultSimpleFeasibilityReferenceResult(); + Task task = createValidTaskSingleMedicResultFeasibilityReferenceResult(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -243,21 +243,22 @@ public void testTaskSingleMedicResultSimpleFeasibilityReferenceResultValid() thr .equals(m.getSeverity())).count()); } - private Task createValidTaskSingleMedicResultSimpleFeasibility() + private Task createValidTaskSingleMedicResultFeasibility() { Task task = new Task(); - task.getMeta().addProfile(SINGLE_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE); - task.setInstantiatesUri(COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 2"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 2"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.addInput().setValue(new StringType(SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME)) + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN) + .setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() @@ -266,9 +267,9 @@ private Task createValidTaskSingleMedicResultSimpleFeasibility() return task; } - private Task createValidTaskSingleMedicResultSimpleFeasibilityUnsignedIntResult() + private Task createValidTaskSingleMedicResultFeasibilityUnsignedIntResult() { - Task task = createValidTaskSingleMedicResultSimpleFeasibility(); + Task task = createValidTaskSingleMedicResultFeasibility(); String groupId1 = "Group/" + UUID.randomUUID().toString(); String groupId2 = "Group/" + UUID.randomUUID().toString(); @@ -277,19 +278,19 @@ private Task createValidTaskSingleMedicResultSimpleFeasibilityUnsignedIntResult( inSingleMedicResult1.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT); - inSingleMedicResult1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); + inSingleMedicResult1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); ParameterComponent inSingleMedicResult2 = task.addInput(); inSingleMedicResult2.setValue(new UnsignedIntType(10)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT); - inSingleMedicResult2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); + inSingleMedicResult2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); return task; } - private Task createValidTaskSingleMedicResultSimpleFeasibilityReferenceResult() + private Task createValidTaskSingleMedicResultFeasibilityReferenceResult() { - Task task = createValidTaskSingleMedicResultSimpleFeasibility(); + Task task = createValidTaskSingleMedicResultFeasibility(); String groupId1 = "Group/" + UUID.randomUUID().toString(); String groupId2 = "Group/" + UUID.randomUUID().toString(); @@ -298,20 +299,20 @@ private Task createValidTaskSingleMedicResultSimpleFeasibilityReferenceResult() inSingleMedicResult1.setValue(new Reference("Binary/" + UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE); - inSingleMedicResult1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); + inSingleMedicResult1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); ParameterComponent inSingleMedicResult2 = task.addInput(); inSingleMedicResult2.setValue(new Reference("Binary/" + UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE); - inSingleMedicResult2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); + inSingleMedicResult2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); return task; } @Test - public void testTaskComputeSimpleFeasibilityValid() throws Exception + public void testTaskComputeFeasibilityValid() throws Exception { - Task task = createValidTaskComputeSimpleFeasibility(); + Task task = createValidTaskComputeFeasibility(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -321,21 +322,21 @@ public void testTaskComputeSimpleFeasibilityValid() throws Exception .equals(m.getSeverity())).count()); } - private Task createValidTaskComputeSimpleFeasibility() + private Task createValidTaskComputeFeasibility() { Task task = new Task(); - task.getMeta().addProfile(COMPUTE_FEASIBILITY_TASK_PROFILE); - task.setInstantiatesUri(COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.addInput().setValue(new StringType(COMPUTE_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); @@ -353,9 +354,9 @@ private Task createValidTaskComputeSimpleFeasibility() } @Test - public void testTaskMultiMedicResultSimpleFeasibilityValid() throws Exception + public void testTaskMultiMedicResultFeasibilityValid() throws Exception { - Task task = createValidTaskMultiMedicResultSimpleFeasibility(); + Task task = createValidTaskMultiMedicResultFeasibility(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -365,21 +366,22 @@ public void testTaskMultiMedicResultSimpleFeasibilityValid() throws Exception .equals(m.getSeverity())).count()); } - private Task createValidTaskMultiMedicResultSimpleFeasibility() + private Task createValidTaskMultiMedicResultFeasibility() { Task task = new Task(); - task.getMeta().addProfile(MULTI_MEDIC_RESULT_FEASIBILITY_TASK_PROFILE); - task.setInstantiatesUri(REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.addInput().setValue(new StringType(MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME)) + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN) + .setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); @@ -390,31 +392,31 @@ private Task createValidTaskMultiMedicResultSimpleFeasibility() inParticipatingMedics1.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); - inParticipatingMedics1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); + inParticipatingMedics1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); ParameterComponent inMultiMedicResult1 = task.addInput(); inMultiMedicResult1.setValue(new UnsignedIntType(25)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT); - inMultiMedicResult1.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId1)); + inMultiMedicResult1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); ParameterComponent inParticipatingMedics2 = task.addInput(); inParticipatingMedics2.setValue(new UnsignedIntType(5)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); - inParticipatingMedics2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); + inParticipatingMedics2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); ParameterComponent inMultiMedicResult2 = task.addInput(); inMultiMedicResult2.setValue(new UnsignedIntType(25)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT); - inMultiMedicResult2.addExtension(EXTENSION_GROUP_ID_URI, new Reference(groupId2)); + inMultiMedicResult2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); return task; } @Test - public void testTaskErrorSimpleFeasibilityValid() throws Exception + public void testTaskErrorFeasibilityValid() throws Exception { - Task task = createValidTaskErrorSimpleFeasibility(); + Task task = createValidTaskErrorFeasibility(); ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); @@ -424,21 +426,21 @@ public void testTaskErrorSimpleFeasibilityValid() throws Exception .equals(m.getSeverity())).count()); } - private Task createValidTaskErrorSimpleFeasibility() + private Task createValidTaskErrorFeasibility() { Task task = new Task(); - task.getMeta().addProfile(ERROR_FEASIBILITY_TASK_PROFILE); - task.setInstantiatesUri(REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.addInput().setValue(new StringType(ERROR_FEASIBILITY_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java index 25b62f374..7dba08561 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java @@ -1,12 +1,12 @@ package org.highmed.dsf.bpe; -import static org.highmed.dsf.bpe.ConstantsFeasibility.LOCAL_SERVICES_PROCESS_URI; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI; import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.VERSION; public interface ConstantsLocalServices { - String LOCAL_SERVICES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"; - String LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION = LOCAL_SERVICES_PROCESS_URI + VERSION; - - String LOCAL_SERVICES_MESSAGE_NAME = "localServicesIntegrationMessage"; + String PROFILE_HIGHMED_TASK_LOCAL_SERVICES = "http://highmed.org/fhir/StructureDefinition/task-local-services-integration"; + String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION = + PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME = "localServicesIntegrationMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index fa5d7a6b6..05decc6d1 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -56,28 +56,32 @@ public List<String> getDependencyNamesAndVersions() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aL = ActivityDefinitionResource.file("fhir/ActivityDefinition/localServicesIntegration.xml"); + var aL = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-localServicesIntegration.xml"); var sTL = StructureDefinitionResource .file("fhir/StructureDefinition/highmed-task-local-services-integration.xml"); var sExtG = StructureDefinitionResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, - "http://highmed.org/fhir/StructureDefinition/group-id", DEPENDENCY_FEASIBILITY_VERSION); + "http://highmed.org/fhir/StructureDefinition/extension-group-id", DEPENDENCY_FEASIBILITY_VERSION); var sExtQ = StructureDefinitionResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, - "http://highmed.org/fhir/StructureDefinition/query", DEPENDENCY_FEASIBILITY_VERSION); + "http://highmed.org/fhir/StructureDefinition/extension-query", DEPENDENCY_FEASIBILITY_VERSION); - var vF = ValueSetResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, - "http://highmed.org/fhir/ValueSet/feasibility", DEPENDENCY_FEASIBILITY_VERSION); - var vQt = ValueSetResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, - "http://highmed.org/fhir/ValueSet/query-type", DEPENDENCY_FEASIBILITY_VERSION); - var cF = CodeSystemResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, - "http://highmed.org/fhir/CodeSystem/feasibility", DEPENDENCY_FEASIBILITY_VERSION); - var cQt = CodeSystemResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, - "http://highmed.org/fhir/CodeSystem/query-type", DEPENDENCY_FEASIBILITY_VERSION); + var vF = ValueSetResource + .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/ValueSet/feasibility", + DEPENDENCY_FEASIBILITY_VERSION); + var vQt = ValueSetResource + .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/ValueSet/query-type", + DEPENDENCY_FEASIBILITY_VERSION); + var cF = CodeSystemResource + .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/CodeSystem/feasibility", + DEPENDENCY_FEASIBILITY_VERSION); + var cQt = CodeSystemResource + .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/CodeSystem/query-type", + DEPENDENCY_FEASIBILITY_VERSION); Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map .of("localServicesIntegration/" + VERSION, Arrays.asList(aL, sTL, vF, cF, vQt, cQt, sExtG, sExtQ)); - return ResourceProvider.read(VERSION, - () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + return ResourceProvider + .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java index 58204153a..9cbc0f20e 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java @@ -1,6 +1,6 @@ package org.highmed.dsf.bpe.service; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_QUERY_URI; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; import java.util.List; import java.util.UUID; @@ -36,26 +36,27 @@ protected void doExecute(DelegateExecution execution) throws Exception Stream<String> queries = getQueries(task); List<Group> cohortDefinitions = getCohortDefinitions(queries); - execution.setVariable(ConstantsFeasibility.VARIABLE_COHORTS, FhirResourcesListValues.create(cohortDefinitions)); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS, + FhirResourcesListValues.create(cohortDefinitions)); boolean needsConsentCheck = getNeedsConsentCheck(task); - execution.setVariable(ConstantsFeasibility.VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(ConstantsFeasibility.VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); if (needsRecordLinkage) { BloomFilterConfig bloomFilterConfig = getBloomFilterConfig(task); - execution.setVariable(ConstantsFeasibility.VARIABLE_BLOOM_FILTER_CONFIG, + execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, BloomFilterConfigValues.create(bloomFilterConfig)); } } private Stream<String> getQueries(Task task) { - return getTaskHelper().getInputParameterStringValues(task, ConstantsBase.CODESYSTEM_QUERY_TYPE, - ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL); + return getTaskHelper().getInputParameterStringValues(task, ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE, + ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); } private List<Group> getCohortDefinitions(Stream<String> queries) @@ -63,8 +64,8 @@ private List<Group> getCohortDefinitions(Stream<String> queries) return queries.map(q -> { Group group = new Group(); group.setIdElement(new IdType(UUID.randomUUID().toString())); - group.addExtension().setUrl(EXTENSION_QUERY_URI).setValue( - new Expression().setLanguageElement(ConstantsBase.AQL_QUERY_TYPE).setExpression(q)); + group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY) + .setValue(new Expression().setLanguageElement(ConstantsBase.CODE_TYPE_AQL_QUERY).setExpression(q)); return group; }).collect(Collectors.toList()); } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java index 5089fff04..9dbd31b27 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java @@ -28,7 +28,7 @@ protected void doExecute(DelegateExecution execution) throws Exception { Task task = getCurrentTaskFromExecutionVariables(); FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.VARIABLE_QUERY_RESULTS); + .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); addOutputs(task, results); } @@ -70,6 +70,6 @@ else if (result.isIdResultSetUrlResult()) private Extension createCohortIdExtension(String cohortId) { - return new Extension(ConstantsFeasibility.EXTENSION_GROUP_ID_URI, new Reference(cohortId)); + return new Extension(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); } } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn index 12d02cbc5..6228d6d87 100755 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn @@ -94,10 +94,10 @@ <bpmn:endEvent id="EndEvent"> <bpmn:extensionElements> <camunda:inputOutput> - <camunda:inputParameter name="messageName">resultSingleMedicSimpleFeasibilityMessage</camunda:inputParameter> + <camunda:inputParameter name="messageName">resultSingleMedicFeasibilityMessage</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="processDefinitionKey">computeSimpleFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-single-medic-result-simple-feasibility</camunda:inputParameter> + <camunda:inputParameter name="processDefinitionKey">computeFeasibility</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>Flow_0m4rhl9</bpmn:incoming> @@ -120,7 +120,7 @@ <bpmn:sequenceFlow id="SequenceFlow_07wtgee" sourceRef="checkQueries" targetRef="ExclusiveGateway_1dln3in" /> </bpmn:process> <bpmn:message id="Message_1yz2a31" name="localServicesIntegrationMessage" /> - <bpmn:message id="Message_1dr71re" name="resultSingleMedicSimpleFeasibilityMessage" /> + <bpmn:message id="Message_1dr71re" name="resultSingleMedicFeasibilityMessage" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="localServicesIntegration"> <bpmndi:BPMNEdge id="Flow_125i149_di" bpmnElement="Flow_125i149"> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml similarity index 91% rename from dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration.xml rename to dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml index 3f446ce70..40d0c0e6a 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/localServicesIntegration.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml @@ -5,7 +5,7 @@ <code value="REMOTE"/> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="localServicesIntegrationMessage"/> </extension> @@ -35,7 +35,7 @@ </extension> <extension url="task-profile"> <valueCanonical - value="http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration"/> + value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration"/> </extension> </extension> <url value="http://highmed.org/bpe/Process/localServicesIntegration"/> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml index d3553023f..47f04b76c 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml @@ -6,7 +6,7 @@ <code value="LOCAL" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-local-services-integration" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="TaskLocalServicesIntegration" /> @@ -18,7 +18,7 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> @@ -235,7 +235,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> </type> </element> <element id="Task.output:single-medic-result.type"> @@ -292,7 +292,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/group-id" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> </type> </element> <element id="Task.output:single-medic-result-reference.type"> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java index ea181dfde..c7cee546f 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java @@ -2,18 +2,18 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES; +import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; import java.util.Date; import java.util.Random; @@ -47,22 +47,24 @@ private static Task createStartResource() { Task task = new Task(); - task.getMeta().addProfile(LOCAL_SERVICES_TASK_PROFILE); - task.setInstantiatesUri(LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_LOCAL_SERVICES); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(Task.TaskStatus.REQUESTED); task.setIntent(Task.TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.addInput().setValue(new StringType(LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() - .setSystem(CODESYSTEM_QUERY_TYPE).setCode(CODESYSTEM_QUERY_TYPE_AQL); + .setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE).setCode(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); task.addInput().setValue(new BooleanType(NEEDS_CONSENT_CHECK)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 4320ca630..b1ea3b234 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -2,16 +2,16 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_QUERY_TYPE_AQL; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsLocalServices.LOCAL_SERVICES_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES; +import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -42,10 +42,10 @@ public class TaskProfileTest public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group.xml", "highmed-extension-group-id.xml", "highmed-extension-query.xml", "highmed-task-local-services-integration.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml", - "query-type.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "feasibility.xml", - "query-type.xml")); + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + "highmed-feasibility.xml", "highmed-query-type.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + "highmed-feasibility.xml", "highmed-query-type.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -67,22 +67,22 @@ private Task createValidTaskLocalServiceIntegration() { Task task = new Task(); - task.getMeta().addProfile(LOCAL_SERVICES_TASK_PROFILE); - task.setInstantiatesUri(LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_LOCAL_SERVICES); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(Task.TaskStatus.REQUESTED); task.setIntent(Task.TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC"); - task.addInput().setValue(new StringType(LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() - .setSystem(CODESYSTEM_QUERY_TYPE).setCode(CODESYSTEM_QUERY_TYPE_AQL); + .setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE).setCode(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java index b255ec2e7..f3c80bb2e 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java @@ -1,20 +1,20 @@ package org.highmed.dsf.bpe; -import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; +import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; import static org.highmed.dsf.bpe.PingProcessPluginDefinition.VERSION; public interface ConstantsPing { - String START_PING_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"; - String START_PING_MESSAGE_NAME = "startPingProcessMessage"; + String PROFILE_HIGHMED_TASK_START_PING = "http://highmed.org/fhir/StructureDefinition/task-start-ping-process"; + String PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME = "startPingProcessMessage"; - String PING_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-ping"; - String PING_PROCESS_URI = PROCESS_URI_BASE + "ping/"; - String PING_PROCESS_URI_AND_LATEST_VERSION = PING_PROCESS_URI + VERSION; - String PING_MESSAGE_NAME = "pingMessage"; + String PROFILE_HIGHMED_TASK_PING = "http://highmed.org/fhir/StructureDefinition/task-ping"; + String PROFILE_HIGHMED_TASK_PING_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "ping/"; + String PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_PING_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_PING_MESSAGE_NAME = "pingMessage"; - String PONG_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-pong"; - String PONG_PROCESS_URI = PROCESS_URI_BASE + "pong/"; - String PONG_PROCESS_URI_AND_LATEST_VERSION = PONG_PROCESS_URI + VERSION; - String PONG_MESSAGE_NAME = "pongMessage"; + String PROFILE_HIGHMED_TASK_PONG_TASK = "http://highmed.org/fhir/StructureDefinition/task-pong"; + String PROFILE_HIGHMED_TASK_PONG_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "pong/"; + String PROFILE_HIGHMED_TASK_PONG_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_PONG_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_PONG_MESSAGE_NAME = "pongMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java index 85ae68895..a0ebf7197 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java @@ -44,17 +44,19 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aPing = ActivityDefinitionResource.file("fhir/ActivityDefinition/ping.xml"); - var aPong = ActivityDefinitionResource.file("fhir/ActivityDefinition/pong.xml"); + var aPing = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-ping.xml"); + var aPong = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-pong.xml"); var tPing = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-pong.xml"); var tStartPing = StructureDefinitionResource .file("fhir/StructureDefinition/highmed-task-start-ping-process.xml"); var tPong = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-ping.xml"); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("ping/" + VERSION, - Arrays.asList(aPing, tPong, tStartPing), "pong/" + VERSION, Arrays.asList(aPong, tPing)); + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map + .of("ping/" + VERSION, Arrays.asList(aPing, tPong, tStartPing), "pong/" + VERSION, + Arrays.asList(aPong, tPing)); - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + return ResourceProvider + .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java index d822ffa47..68ab05c99 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java @@ -42,6 +42,7 @@ public void doExecute(DelegateExecution execution) throws Exception .createBiDirectionalTarget(identifier.getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); - execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); + execution + .setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); } } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java index 317871241..2b36fea48 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java @@ -28,7 +28,7 @@ public void doExecute(DelegateExecution execution) throws Exception ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).get(); Identifier targetOrganizationIdentifier = task.getRequester().getIdentifier(); - execution.setVariable(ConstantsBase.VARIABLE_TARGET, TargetValues + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, TargetValues .create(Target.createBiDirectionalTarget(targetOrganizationIdentifier.getValue(), correlationKey))); } } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn index fbfd887f4..6bf868a04 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn @@ -13,7 +13,7 @@ <camunda:inputParameter name="processDefinitionKey">pong</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="messageName">pingMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-ping</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-ping</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_05ia6lz</bpmn:incoming> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn index bd0ac6d19..4d207a6a5 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn @@ -12,7 +12,7 @@ <camunda:inputParameter name="messageName">pongMessage</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="processDefinitionKey">ping</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-pong</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-pong</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_1ism9wt</bpmn:incoming> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml similarity index 93% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml index cd6b3c34a..c6b06e4ad 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/ping.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="startPingProcessMessage" /> </extension> @@ -46,10 +46,10 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process" /> </extension> </extension> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="pongMessage" /> </extension> @@ -90,7 +90,7 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-pong" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-pong" /> </extension> </extension> <url value="http://highmed.org/bpe/Process/ping" /> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml similarity index 95% rename from dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong.xml rename to dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml index 4b186ddf3..adcc5e653 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/pong.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="pingMessage" /> </extension> @@ -46,7 +46,7 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-ping" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-ping" /> </extension> </extension> <url value="http://highmed.org/bpe/Process/pong" /> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml index bb60fd8c2..eae71d505 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-ping" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-ping" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="TaskPing" /> @@ -17,7 +17,7 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml index ed98ab8f4..e15541e25 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-pong" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-pong" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="TaskPong" /> @@ -17,7 +17,7 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml index 6e6f71f2d..d8437524c 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="TaskStartProcess" /> @@ -17,7 +17,7 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java index 3a260ec0d..a782ab525 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java @@ -2,11 +2,11 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.ConstantsPing.PING_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsPing.START_PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsPing.START_PING_TASK_PROFILE; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; import java.util.Date; @@ -32,17 +32,19 @@ public static void main(String[] args) throws Exception private static Task createStartResource() { Task task = new Task(); - task.getMeta().addProfile(START_PING_TASK_PROFILE); - task.setInstantiatesUri(PING_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_START_PING); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.addInput().setValue(new StringType(START_PING_MESSAGE_NAME)).getType().addCoding() + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); return task; diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java index 71c8cbc0a..03880a9ef 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java @@ -4,15 +4,15 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.ConstantsPing.PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsPing.PING_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsPing.PING_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsPing.PONG_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsPing.PONG_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsPing.PONG_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsPing.START_PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsPing.START_PING_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PING; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PONG_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PONG_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PONG_TASK; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING; +import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -42,8 +42,9 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-start-ping-process.xml", "highmed-task-ping.xml", - "highmed-task-pong.xml"), Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml")); + "highmed-task-pong.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -106,17 +107,17 @@ public void testTaskStartPingProcessProfileNotValid3() throws Exception private Task createValidTaskStartPingProcess() { Task task = new Task(); - task.getMeta().addProfile(START_PING_TASK_PROFILE); - task.setInstantiatesUri(PING_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_START_PING); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.addInput().setValue(new StringType(START_PING_MESSAGE_NAME)).getType().addCoding() + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); return task; @@ -138,17 +139,17 @@ public void testTaskPingValid() throws Exception private Task createValidTaskPing() { Task task = new Task(); - task.getMeta().addProfile(PING_TASK_PROFILE); - task.setInstantiatesUri(PONG_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_PING); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PONG_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(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.addInput().setValue(new StringType(PING_MESSAGE_NAME)).getType().addCoding() + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_PING_MESSAGE_NAME)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); @@ -174,17 +175,17 @@ public void testTaskPongValid() throws Exception private Task createValidTaskPong() { Task task = new Task(); - task.getMeta().addProfile(PONG_TASK_PROFILE); - task.setInstantiatesUri(PING_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_PONG_TASK); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.addInput().setValue(new StringType(PONG_MESSAGE_NAME)).getType().addCoding() + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_PONG_MESSAGE_NAME)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java index b39d22da6..920befdd0 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java @@ -1,6 +1,6 @@ package org.highmed.dsf.bpe; -import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; +import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.VERSION; public interface ConstantsUpdateAllowList @@ -8,13 +8,15 @@ public interface ConstantsUpdateAllowList String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST = "http://highmed.org/fhir/CodeSystem/update-allow-list"; String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST = "highmed_allow_list"; - String DOWNLOAD_ALLOW_LIST_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list"; - String DOWNLOAD_ALLOW_LIST_PROCESS_URI = PROCESS_URI_BASE + "downloadAllowList/"; - String DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = DOWNLOAD_ALLOW_LIST_PROCESS_URI + VERSION; - String DOWNLOAD_ALLOW_LIST_MESSAGE_NAME = "downloadAllowListMessage"; + String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST = "http://highmed.org/fhir/StructureDefinition/task-download-allow-list"; + String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "downloadAllowList/"; + String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = + PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME = "downloadAllowListMessage"; - String UPDATE_ALLOW_LIST_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list"; - String UPDATE_ALLOW_LIST_PROCESS_URI = PROCESS_URI_BASE + "updateAllowList/"; - String UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = UPDATE_ALLOW_LIST_PROCESS_URI + VERSION; - String UPDATE_ALLOW_LIST_MESSAGE_NAME = "updateAllowListMessage"; + String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST = "http://highmed.org/fhir/StructureDefinition/task-update-allow-list"; + String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "updateAllowList/"; + String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = + PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME = "updateAllowListMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java index dd0879c0d..3790c8231 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java @@ -46,17 +46,19 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aDown = ActivityDefinitionResource.file("fhir/ActivityDefinition/downloadAllowList.xml"); - var aUp = ActivityDefinitionResource.file("fhir/ActivityDefinition/updateAllowList.xml"); - var c = CodeSystemResource.file("fhir/CodeSystem/update-allow-list.xml"); + var aDown = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-downloadAllowList.xml"); + var aUp = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-updateAllowList.xml"); + var c = CodeSystemResource.file("fhir/CodeSystem/highmed-update-allow-list.xml"); var sDown = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-download-allow-list.xml"); var sUp = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-update-allow-list.xml"); - var v = ValueSetResource.file("fhir/ValueSet/update-allow-list.xml"); + var v = ValueSetResource.file("fhir/ValueSet/highmed-update-allow-list.xml"); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of("downloadAllowList/" + VERSION, - Arrays.asList(aDown, c, sDown, v), "updateAllowList/" + VERSION, Arrays.asList(aUp, c, sUp, v)); + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map + .of("downloadAllowList/" + VERSION, Arrays.asList(aDown, c, sDown, v), "updateAllowList/" + VERSION, + Arrays.asList(aUp, c, sUp, v)); - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + return ResourceProvider + .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java index a5506756d..67bd86f32 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java @@ -73,16 +73,15 @@ public void doExecute(DelegateExecution execution) throws Exception .setValue(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); searchSet.getEntry().stream() .filter(e -> e.hasSearch() && SearchEntryMode.MATCH.equals(e.getSearch().getMode()) && e.hasResource() - && e.getResource() instanceof Organization) - .map(e -> (Organization) e.getResource()).forEach(addAllowListEntry(transaction, searchSet)); + && e.getResource() instanceof Organization).map(e -> (Organization) e.getResource()) + .forEach(addAllowListEntry(transaction, searchSet)); logger.debug("Uploading new allow list transaction bundle: {}", FhirContext.forR4().newJsonParser().encodeResourceToString(transaction)); - IdType result = client.withMinimalReturn().updateConditionaly(transaction, - Map.of("identifier", - Collections.singletonList(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST + "|" - + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST))); + IdType result = client.withMinimalReturn().updateConditionaly(transaction, Map.of("identifier", Collections + .singletonList(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST + "|" + + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST))); Task task = getLeadingTaskFromExecutionVariables(); task.addOutput().setValue(new Reference(new IdType("Bundle", result.getIdPart(), result.getVersionIdPart()))) @@ -92,8 +91,7 @@ public void doExecute(DelegateExecution execution) throws Exception private Consumer<? super Organization> addAllowListEntry(Bundle transaction, Bundle searchSet) { - return organization -> - { + return organization -> { Identifier identifier = getDefaultIdentifier(organization).get(); BundleEntryComponent organizationEntry = transaction.addEntry(); @@ -115,8 +113,7 @@ private Consumer<? super Organization> addAllowListEntry(Bundle transaction, Bun private Function<Reference, Optional<Reference>> addAllowListEntryReturnReference(Bundle transaction, String organizationId, Bundle searchSet) { - return endpointRef -> getEndpoint(endpointRef, searchSet).map(endpoint -> - { + return endpointRef -> getEndpoint(endpointRef, searchSet).map(endpoint -> { Identifier identifier = getDefaultIdentifier(endpoint).get(); BundleEntryComponent endpointEntry = transaction.addEntry(); @@ -142,15 +139,14 @@ private Optional<Identifier> getDefaultIdentifier(Organization org) private Optional<Identifier> getDefaultIdentifier(Endpoint ept) { - return ept.getIdentifier().stream().filter(i -> ConstantsBase.ENDPOINT_IDENTIFIER_SYSTEM.equals(i.getSystem())) - .findFirst(); + return ept.getIdentifier().stream() + .filter(i -> ConstantsBase.NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER.equals(i.getSystem())).findFirst(); } private Optional<Endpoint> getEndpoint(Reference endpoint, Bundle searchSet) { return searchSet.getEntry().stream() - .filter(e -> e.hasResource() && e.getResource() instanceof Endpoint - && e.getFullUrl().endsWith(endpoint.getReference())) - .map(e -> (Endpoint) e.getResource()).findFirst(); + .filter(e -> e.hasResource() && e.getResource() instanceof Endpoint && e.getFullUrl() + .endsWith(endpoint.getReference())).map(e -> (Endpoint) e.getResource()).findFirst(); } } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml similarity index 94% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml index 124247884..0a1164d83 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/downloadAllowList.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="downloadAllowListMessage" /> </extension> @@ -46,7 +46,7 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list" /> </extension> </extension> <url value="http://highmed.org/bpe/Process/downloadAllowList" /> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml similarity index 93% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml index 73f48690f..25469b897 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/updateAllowList.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="updateAllowListMessage" /> </extension> @@ -34,7 +34,7 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list" /> </extension> </extension> <url value="http://highmed.org/bpe/Process/updateAllowList" /> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/update-allow-list.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml index a3efdd039..f52f95636 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml @@ -6,7 +6,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-download-allow-list" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="TaskDownloadAllowList" /> @@ -18,7 +18,7 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml index 7e49a5e73..4110a42a3 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-update-allow-list" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="TaskUpdateAllowList" /> @@ -17,7 +17,7 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/update-allow-list.xml rename to dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java index ae0daf025..5e729dba6 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java @@ -2,14 +2,14 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; import java.util.Collections; @@ -44,18 +44,20 @@ private static Task createStartResource(ExampleStarter starter) throws Exception Bundle allowList = getAllowList(starter); Task task = new Task(); - task.getMeta().addProfile(DOWNLOAD_ALLOW_LIST_TASK_PROFILE); - task.setInstantiatesUri(DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.addInput().setValue(new StringType(DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new Reference( new IdType(TTP_FHIR_BASE_URL, ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), allowList.getIdElement().getVersionIdPart()))).getType().addCoding() diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java index 3073feb77..6d08e8ba6 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java @@ -2,11 +2,11 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_TASK_PROFILE; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; import java.util.Date; @@ -32,18 +32,20 @@ public static void main(String[] args) throws Exception private static Task createStartResource() { Task task = new Task(); - task.getMeta().addProfile(UPDATE_ALLOW_LIST_TASK_PROFILE); - task.setInstantiatesUri(UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.addInput().setValue(new StringType(UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); return task; } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 9507a4d61..c3baf04de 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -2,15 +2,15 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.DOWNLOAD_ALLOW_LIST_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.UPDATE_ALLOW_LIST_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -43,8 +43,10 @@ public class TaskProfileTest public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-update-allow-list.xml", "highmed-task-download-allow-list.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "update-allow-list.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "update-allow-list.xml")); + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + "highmed-update-allow-list.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + "highmed-update-allow-list.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -57,8 +59,9 @@ public void testTaskUpdateAllowListValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test @@ -72,25 +75,26 @@ public void testTaskUpdateAllowlistValidWithOutput() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskUpdateAllowList() { Task task = new Task(); - task.getMeta().addProfile(UPDATE_ALLOW_LIST_TASK_PROFILE); - task.setInstantiatesUri(UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.addInput().setValue(new StringType(UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); return task; } @@ -103,28 +107,28 @@ public void testTaskDownloadAllowListValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskDownloadAllowList() { Task task = new Task(); - task.getMeta().addProfile(DOWNLOAD_ALLOW_LIST_TASK_PROFILE); - task.setInstantiatesUri(DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM ).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.addInput().setValue(new StringType(DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput() - .setValue( - new Reference(new IdType("https://foo.bar/fhir", "Bundle", UUID.randomUUID().toString(), "1"))) + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue( + new Reference(new IdType("https://foo.bar/fhir", "Bundle", UUID.randomUUID().toString(), "1"))) .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java index 78ee62c2b..d9ab66f31 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java @@ -1,6 +1,6 @@ package org.highmed.dsf.bpe; -import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_URI_BASE; +import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.VERSION; public interface ConstantsUpdateResources @@ -9,13 +9,17 @@ public interface ConstantsUpdateResources String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE = "bundle-reference"; String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER = "organization-identifier-search-parameter"; - String REQUEST_UPDATE_RESOURCES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources"; - String REQUEST_UPDATE_RESOURCES_PROCESS_URI = PROCESS_URI_BASE + "requestUpdateResources/"; - String REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = REQUEST_UPDATE_RESOURCES_PROCESS_URI + VERSION; - String REQUEST_UPDATE_RESOURCES_MESSAGE_NAME = "requestUpdateResourcesMessage"; + String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES = "http://highmed.org/fhir/StructureDefinition/task-request-update-resources"; + String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI = + PROCESS_HIGHMED_URI_BASE + "requestUpdateResources/"; + String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = + PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME = "requestUpdateResourcesMessage"; - String EXECUTE_UPDATE_RESOURCES_TASK_PROFILE = "http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources"; - String EXECUTE_UPDATE_RESOURCES_PROCESS_URI = PROCESS_URI_BASE + "executeUpdateResources/"; - String EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = EXECUTE_UPDATE_RESOURCES_PROCESS_URI + VERSION; - String EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME = "executeUpdateResourcesMessage"; + String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES = "http://highmed.org/fhir/StructureDefinition/task-execute-update-resources"; + String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI = + PROCESS_HIGHMED_URI_BASE + "executeUpdateResources/"; + String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = + PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI + VERSION; + String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME = "executeUpdateResourcesMessage"; } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java index f5ff07eef..6807af084 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java @@ -46,20 +46,21 @@ public Stream<Class<?>> getSpringConfigClasses() @Override public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) { - var aExec = ActivityDefinitionResource.file("fhir/ActivityDefinition/executeUpdateResources.xml"); - var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/requestUpdateResources.xml"); - var c = CodeSystemResource.file("fhir/CodeSystem/update-resources.xml"); + var aExec = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-executeUpdateResources.xml"); + var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-requestUpdateResources.xml"); + var c = CodeSystemResource.file("fhir/CodeSystem/highmed-update-resources.xml"); var sExec = StructureDefinitionResource .file("fhir/StructureDefinition/highmed-task-execute-update-resources.xml"); var sReq = StructureDefinitionResource .file("fhir/StructureDefinition/highmed-task-request-update-resources.xml"); - var v = ValueSetResource.file("fhir/ValueSet/update-resources.xml"); + var v = ValueSetResource.file("fhir/ValueSet/highmed-update-resources.xml"); - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of( - "executeUpdateResources/" + VERSION, Arrays.asList(aExec, c, sExec, v), - "requestUpdateResources/" + VERSION, Arrays.asList(aReq, c, sReq, v)); + Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map + .of("executeUpdateResources/" + VERSION, Arrays.asList(aExec, c, sExec, v), + "requestUpdateResources/" + VERSION, Arrays.asList(aReq, c, sReq, v)); - return ResourceProvider.read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), - classLoader, resourcesByProcessKeyAndVersion); + return ResourceProvider + .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, + resourcesByProcessKeyAndVersion); } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java index 616d6dbf3..a908e5f20 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java @@ -27,7 +27,7 @@ public SendRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskH @Override protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { - String bundleId = (String) execution.getVariable(ConstantsBase.VARIABLE_BUNDLE_ID); + String bundleId = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_BUNDLE_ID); return Stream .of(toInputParameterBundleReference(getFhirWebserviceClientProvider().getLocalBaseUrl(), bundleId)); } @@ -37,8 +37,8 @@ private ParameterComponent toInputParameterBundleReference(String localBaseUrl, if (bundleId == null || bundleId.isEmpty()) throw new IllegalArgumentException("bundleId null or empty"); - return new ParameterComponent( - new CodeableConcept(new Coding(ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE, + return new ParameterComponent(new CodeableConcept( + new Coding(ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE, ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, null)), new Reference().setReference(localBaseUrl + (localBaseUrl.endsWith("/") ? "" : "/") + bundleId)); } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java index 5716aba5d..4360bbb21 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java @@ -43,7 +43,7 @@ protected void doExecute(DelegateExecution execution) throws Exception { throw new RuntimeException( "Request check failed: process can only be started by requesting organization of type='" - + ConstantsBase.ORGANIZATION_TYPE_TTP + "'"); + + ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP + "'"); } } @@ -53,7 +53,8 @@ private boolean requesterIsNotOfTypeTtp(Identifier requester) .getOrganization(requester.getSystem(), requester.getValue()); return !organization.map(value -> value.getType().stream().anyMatch(type -> type.getCoding().stream().anyMatch( - coding -> coding.getSystem().equals(ConstantsBase.ORGANIZATION_TYPE_SYSTEM) && coding.getCode() - .equals(ConstantsBase.ORGANIZATION_TYPE_TTP)))).orElse(false); + coding -> coding.getSystem().equals(ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE) && coding + .getCode().equals(ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP)))) + .orElse(false); } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java index e1aa4e60a..69768325e 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java @@ -68,7 +68,7 @@ else if (!BUNDLE_ID_PATTERN.matcher(references.get(0).getReference()).matches()) } String bundleId = references.get(0).getReference(); - execution.setVariable(ConstantsBase.VARIABLE_BUNDLE_ID, bundleId); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_BUNDLE_ID, bundleId); List<String> targetIdentifierSearchParameters = getTaskHelper() .getInputParameterStringValues(task, ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE, @@ -79,6 +79,7 @@ else if (!BUNDLE_ID_PATTERN.matcher(references.get(0).getReference()).matches()) .flatMap(organizationProvider::searchRemoteOrganizationsIdentifiers) .map(identifier -> Target.createUniDirectionalTarget(identifier.getValue())) .collect(Collectors.toList()); - execution.setVariable(ConstantsBase.VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); + execution + .setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn index d2221b808..13825c359 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn @@ -13,7 +13,7 @@ <camunda:inputParameter name="processDefinitionKey">executeUpdateResources</camunda:inputParameter> <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> <camunda:inputParameter name="messageName">executeUpdateResourcesMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources</camunda:inputParameter> + <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-update-resources</camunda:inputParameter> </camunda:inputOutput> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_1u4zxix</bpmn:incoming> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml similarity index 94% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml index c8b580604..2caa19c8e 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/executeUpdateResources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="executeUpdateResourcesMessage" /> </extension> @@ -40,7 +40,7 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources" /> </extension> </extension> <url value="http://highmed.org/bpe/Process/executeUpdateResources" /> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml similarity index 93% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml index 5a2f7ba50..4aa96abe4 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/requestUpdateResources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/process-authorization"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> <extension url="message-name"> <valueString value="requestUpdateResourcesMessage" /> </extension> @@ -34,7 +34,7 @@ </extension> </extension> <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources" /> + <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources" /> </extension> </extension> <url value="http://highmed.org/bpe/Process/requestUpdateResources" /> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/update-resources.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml index 5017f1fd7..d3f324807 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-execute-update-resources" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="TaskExecuteUpdateResources" /> @@ -17,7 +17,7 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml index fd191d10d..d7a58996b 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-update-resources" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources" /> <!-- version managed by bpe --> <version value="bpe-managed" /> <name value="TaskRequestUpdateResources" /> @@ -17,7 +17,7 @@ <kind value="resource" /> <abstract value="false" /> <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> <derivation value="constraint" /> <differential> <element id="Task.instantiatesUri"> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml similarity index 100% rename from dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/update-resources.xml rename to dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java index bde755ca9..3cc79c9d3 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java @@ -2,14 +2,14 @@ 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.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.ORGANIZATION_IDENTIFIER_VALUE_TTP; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; import java.util.Collections; @@ -44,18 +44,20 @@ private static Task createStartResource(ExampleStarter starter) throws Exception Bundle allowList = getAllowList(starter); Task task = new Task(); - task.getMeta().addProfile(REQUEST_UPDATE_RESOURCES_TASK_PROFILE); - task.setInstantiatesUri(REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue(ORGANIZATION_IDENTIFIER_VALUE_TTP); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) + .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.addInput().setValue(new StringType(REQUEST_UPDATE_RESOURCES_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new Reference( new IdType(ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 630350d36..3deb7a0ad 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -3,16 +3,16 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.EXECUTE_UPDATE_RESOURCES_TASK_PROFILE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.REQUEST_UPDATE_RESOURCES_TASK_PROFILE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -54,8 +54,10 @@ public class TaskProfileTest public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-request-update-resources.xml", "highmed-task-execute-update-resources.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "update-resources.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml", "update-resources.xml")); + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + "highmed-update-resources.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", + "highmed-update-resources.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -88,28 +90,30 @@ public void testTaskRequestUpdateResourcesValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskRequestUpdateResources() { Task task = new Task(); - task.getMeta().addProfile(REQUEST_UPDATE_RESOURCES_TASK_PROFILE); - task.setInstantiatesUri(REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("TTP"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.addInput().setValue(new StringType(REQUEST_UPDATE_RESOURCES_MESSAGE_NAME )).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE).setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); + .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) + .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); task.addInput().setValue(new StringType("http://highmed.org/fhir/NamingSystem/organization-identifier|")) .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER); @@ -125,29 +129,31 @@ public void testTaskExecuteUpdateResourcesValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } private Task createValidTaskExecuteUpdateResources() { Task task = new Task(); - task.getMeta().addProfile(EXECUTE_UPDATE_RESOURCES_TASK_PROFILE); - task.setInstantiatesUri(EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); + task.getMeta().addProfile(PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES); + task.setInstantiatesUri(PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); task.setStatus(TaskStatus.REQUESTED); task.setIntent(TaskIntent.ORDER); task.setAuthoredOn(new Date()); task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(ORGANIZATION_IDENTIFIER_SYSTEM).setValue("MeDIC 1"); + .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.addInput().setValue(new StringType(EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); + task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME)).getType() + .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE).setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); + .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) + .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); return task; } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/CallActivityListener.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/CallActivityListener.java index 99ca98a42..bd695b555 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/CallActivityListener.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/CallActivityListener.java @@ -6,7 +6,7 @@ /** * Added to each BPMN CallActivity Task by the {@link DefaultBpmnParseListener}. - * Sets the variable {@link ConstantsBase#VARIABLE_IN_CALLED_PROCESS} to <code>true</code> if a sub process was + * Sets the variable {@link ConstantsBase#BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS} to <code>true</code> if a sub process was * called inside the same BPE. */ public class CallActivityListener implements ExecutionListener @@ -15,6 +15,6 @@ public class CallActivityListener implements ExecutionListener public void notify(DelegateExecution execution) throws Exception { // mark that we enter a process called by another process. - execution.setVariable(ConstantsBase.VARIABLE_IN_CALLED_PROCESS, true); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS, true); } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/EndListener.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/EndListener.java index c42641653..fb10b2293 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/EndListener.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/EndListener.java @@ -12,7 +12,7 @@ /** * Added to each BPMN EndEvent by the {@link DefaultBpmnParseListener}. Is used to set the FHIR {@link Task} status as * {@link Task.TaskStatus#COMPLETED} if the process ends successfully and sets {@link Task}.output values. Sets the - * {@link ConstantsBase#VARIABLE_IN_CALLED_PROCESS} back to <code>false</code> if a called sub process ends. + * {@link ConstantsBase#BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS} back to <code>false</code> if a called sub process ends. */ public class EndListener implements ExecutionListener { @@ -30,7 +30,8 @@ public EndListener(FhirWebserviceClient webserviceClient, TaskHelper taskHelper) @Override public void notify(DelegateExecution execution) throws Exception { - boolean inCalledProcess = (boolean) execution.getVariable(ConstantsBase.VARIABLE_IN_CALLED_PROCESS); + boolean inCalledProcess = (boolean) execution + .getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS); // not in a called process --> process end if it is not a subprocess if (!inCalledProcess) @@ -39,13 +40,13 @@ public void notify(DelegateExecution execution) throws Exception if (execution.getParentId() == null || execution.getParentId().equals(execution.getProcessInstanceId())) { // not in a subprocess --> end of main process, write process outputs to task - task = (Task) execution.getVariable(ConstantsBase.VARIABLE_LEADING_TASK); + task = (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_LEADING_TASK); log(execution, task); } else { // in a subprocess --> process does not end here, outputs do not have to be written - task = (Task) execution.getVariable(ConstantsBase.VARIABLE_TASK); + task = (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK); } if (task.getStatus().equals(Task.TaskStatus.INPROGRESS)) @@ -59,7 +60,7 @@ public void notify(DelegateExecution execution) throws Exception { // in a called process --> process does not end here, don't change the task variable // reset VARIABLE_IS_CALL_ACTIVITY to false, since we leave the called process - execution.setVariable(ConstantsBase.VARIABLE_IN_CALLED_PROCESS, false); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS, false); } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/StartListener.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/StartListener.java index 0f94a4c9b..2d449dc78 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/StartListener.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/StartListener.java @@ -12,7 +12,7 @@ /** * Added to each BPMN StartEvent by the {@link DefaultBpmnParseListener}. Initializes the - * {@link ConstantsBase#VARIABLE_IN_CALLED_PROCESS} variable with <code>false</code> for processes started via a + * {@link ConstantsBase#BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS} variable with <code>false</code> for processes started via a * {@link Task} resource. */ public class StartListener implements ExecutionListener @@ -33,20 +33,20 @@ public void notify(DelegateExecution execution) throws Exception // start of main process instance if no parent available or the parent id is same as the actual process id if (execution.getParentId() == null || execution.getParentId().equals(execution.getProcessInstanceId())) { - Task task = (Task) execution.getVariable(ConstantsBase.VARIABLE_TASK); + Task task = (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK); // sets initial task variable a second time in a different variable. subprocesses which start // with a task resource override the initially set task variable - execution.setVariable(ConstantsBase.VARIABLE_LEADING_TASK, task); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_LEADING_TASK, task); log(execution, task); } // if a main process is started (not a call- or subprocess), this variable has to be initialized. // it is set to false, since a main process is not a called process - if (!execution.getVariableNames().contains(ConstantsBase.VARIABLE_IN_CALLED_PROCESS)) + if (!execution.getVariableNames().contains(ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS)) { - execution.setVariable(ConstantsBase.VARIABLE_IN_CALLED_PROCESS, false); + execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS, false); } } @@ -57,8 +57,9 @@ private void log(DelegateExecution execution, Task task) ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME).orElse(null); String businessKey = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); - String correlationKey = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); + String correlationKey = taskHelper + .getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); String taskId = task.getIdElement().getIdPart(); logger.info("Starting process {} [message: {}, businessKey: {}, correlationKey: {}, taskId: {}]", processUrl, diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/webservice/ProcessService.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/webservice/ProcessService.java index 6162a2af8..5d2f27247 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/webservice/ProcessService.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/webservice/ProcessService.java @@ -84,7 +84,7 @@ private Response start(String processDefinitionKey, String versionTag, Map<Strin } runtimeService.startProcessInstanceById(processDefinition.getId(), UUID.randomUUID().toString(), - Map.of(ConstantsBase.VARIABLE_QUERY_PARAMETERS, queryParameters)); + Map.of(ConstantsBase.BPMN_EXECUTION_VARIABLE_QUERY_PARAMETERS, queryParameters)); return Response.status(Status.CREATED).build(); } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/group/GroupHelperImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/group/GroupHelperImpl.java index ff9a93e55..021a63f91 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/group/GroupHelperImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/group/GroupHelperImpl.java @@ -1,7 +1,7 @@ package org.highmed.dsf.fhir.group; -import static org.highmed.dsf.bpe.ConstantsBase.AQL_QUERY_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_QUERY_URI; +import static org.highmed.dsf.bpe.ConstantsBase.CODE_TYPE_AQL_QUERY; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; import java.util.List; import java.util.stream.Collectors; @@ -20,9 +20,9 @@ public class GroupHelperImpl implements GroupHelper public String extractAqlQuery(Group group) { List<Extension> queries = group.getExtension().stream() - .filter(extension -> extension.getUrl().equals(EXTENSION_QUERY_URI)) - .filter(extension -> AQL_QUERY_TYPE.compareTo(((Expression) extension.getValue()).getLanguageElement()) - == 0).collect(Collectors.toList()); + .filter(extension -> extension.getUrl().equals(EXTENSION_HIGHMED_QUERY)).filter(extension -> + CODE_TYPE_AQL_QUERY.compareTo(((Expression) extension.getValue()).getLanguageElement()) == 0) + .collect(Collectors.toList()); if (queries.size() != 1) { diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/organization/OrganizationProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/organization/OrganizationProviderImpl.java index 0b98dae55..d9143d197 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/organization/OrganizationProviderImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/organization/OrganizationProviderImpl.java @@ -47,13 +47,13 @@ public void afterPropertiesSet() throws Exception @Override public String getDefaultTypeSystem() { - return ConstantsBase.ORGANIZATION_TYPE_SYSTEM; + return ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; } @Override public String getDefaultIdentifierSystem() { - return ConstantsBase.ORGANIZATION_IDENTIFIER_SYSTEM; + return ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; } @Override diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java index e70eb8831..b44e8f45a 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java @@ -63,10 +63,12 @@ public void onTask(Task task) ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME).orElse(null); String businessKey = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); - String correlationKey = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); + String correlationKey = taskHelper + .getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, + ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); - Map<String, Object> variables = Map.of(ConstantsBase.VARIABLE_TASK, FhirResourceValues.create(task)); + Map<String, Object> variables = Map + .of(ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK, FhirResourceValues.create(task)); try { @@ -98,18 +100,12 @@ private ProcessDefinition getProcessDefinition(String processDefinitionKey, Stri } /** - * @param businessKey - * may be <code>null</code> - * @param correlationKey - * may be <code>null</code> - * @param processDefinitionKey - * not <code>null</code> - * @param versionTag - * not <code>null</code> - * @param messageName - * not <code>null</code> - * @param variables - * may be <code>null</code> + * @param businessKey may be <code>null</code> + * @param correlationKey may be <code>null</code> + * @param processDefinitionKey not <code>null</code> + * @param versionTag not <code>null</code> + * @param messageName not <code>null</code> + * @param variables may be <code>null</code> */ protected void onMessage(String businessKey, String correlationKey, String processDefinitionKey, String versionTag, String messageName, Map<String, Object> variables) diff --git a/dsf-bpe/dsf-bpe-webservice-client/src/test/java/org/highmed/dsf/bpe/client/TestBpeJerseyClient.java b/dsf-bpe/dsf-bpe-webservice-client/src/test/java/org/highmed/dsf/bpe/client/TestBpeJerseyClient.java index 4ff47b76b..fb1fbba85 100755 --- a/dsf-bpe/dsf-bpe-webservice-client/src/test/java/org/highmed/dsf/bpe/client/TestBpeJerseyClient.java +++ b/dsf-bpe/dsf-bpe-webservice-client/src/test/java/org/highmed/dsf/bpe/client/TestBpeJerseyClient.java @@ -10,9 +10,6 @@ import java.util.Collections; import java.util.Map; -import org.highmed.dsf.bpe.client.WebserviceClient; -import org.highmed.dsf.bpe.client.WebserviceClientJersey; - import de.rwh.utils.crypto.CertificateHelper; import de.rwh.utils.crypto.io.CertificateReader; @@ -22,28 +19,29 @@ public static void main(String[] args) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { char[] keyStorePassword = "password".toCharArray(); - KeyStore keyStore = CertificateReader - .fromPkcs12(Paths.get("dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"), keyStorePassword); + KeyStore keyStore = CertificateReader.fromPkcs12(Paths.get( + "dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12"), + keyStorePassword); KeyStore trustStore = CertificateHelper.extractTrust(keyStore); WebserviceClient client = new WebserviceClientJersey("https://localhost:8002/bpe", trustStore, keyStore, keyStorePassword, null, null, null, 0, 0, null); -// WebserviceClient client = new WebserviceClientJersey("https://localhost:8443/bpe", trustStore, keyStore, -// keyStorePassword, null, null, null, 0, 0, null); + // WebserviceClient client = new WebserviceClientJersey("https://localhost:8443/bpe", trustStore, keyStore, + // keyStorePassword, null, null, null, 0, 0, null); -// client.startProcessWithVersion("ping", "1.0.0"); + // client.startProcessWithVersion("ping", "1.0.0"); -// client.startProcessWithVersion("updateAllowList", "1.0.0"); + // client.startProcessWithVersion("updateAllowList", "1.0.0"); client.startProcessWithVersion("requestUpdateResources", "1.0.0", Map.of("target-identifier", Collections.singletonList("http://highmed.org/fhir/NamingSystem/organization-identifier|"), "bundle-id", Arrays.asList("Bundle/2548395d-83d3-488a-859e-a844e62ce3fd"))); -// client.startProcessWithVersion("requestUpdateResources", "1.0.0", Map.of("target-identifier", -// Collections.singletonList("http://highmed.org/fhir/NamingSystem/organization-identifier|"), "bundle-id", -// Arrays.asList("Bundle/30a376fa-f3ba-4f68-8e04-c5b9c0c4f5c9"))); + // client.startProcessWithVersion("requestUpdateResources", "1.0.0", Map.of("target-identifier", + // Collections.singletonList("http://highmed.org/fhir/NamingSystem/organization-identifier|"), "bundle-id", + // Arrays.asList("Bundle/30a376fa-f3ba-4f68-8e04-c5b9c0c4f5c9"))); -// client.startProcessWithVersion("requestSimpleCohortSizeQuery", "1.0.0"); -// client.startProcessWithVersion("executeSimpleCohortSizeQuery", "1.0.0"); + // client.startProcessWithVersion("requestCohortSizeQuery", "1.0.0"); + // client.startProcessWithVersion("executeCohortSizeQuery", "1.0.0"); } } diff --git a/dsf-docker-test-setup-3medic-ttp/ansible-stop-all.sh b/dsf-docker-test-setup-3medic-ttp/ansible-stop-all.sh new file mode 100755 index 000000000..1c52e3ff4 --- /dev/null +++ b/dsf-docker-test-setup-3medic-ttp/ansible-stop-all.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ansible HiGHmed -a "shutdown -h now" --become \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties index 0884db1d4..7924e45a8 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/conf/config.properties @@ -57,6 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.4.0,requestUpdateResources/0.4.0,updateAllowList/0.4.0 +org.highmed.dsf.bpe.process.excluded=computeFeasibility/0.4.0,computeDataSharing/0.4.0,requestUpdateResources/0.4.0,updateAllowList/0.4.0 #org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties index 93c84cc1d..e7c708a37 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/conf/config.properties @@ -57,6 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.4.0,requestUpdateResources/0.4.0,updateAllowList/0.4.0 +org.highmed.dsf.bpe.process.excluded=computeFeasibility/0.4.0,computeDataSharing/0.4.0,requestUpdateResources/0.4.0,updateAllowList/0.4.0 #org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties index 2606a0e47..0bc3f6fbe 100755 --- a/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/conf/config.properties @@ -57,6 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.process.excluded=computeSimpleFeasibility/0.4.0,requestUpdateResources/0.4.0,updateAllowList/0.4.0 +org.highmed.dsf.bpe.process.excluded=computeFeasibility/0.4.0,computeDataSharing/0.4.0,requestUpdateResources/0.4.0,updateAllowList/0.4.0 #org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties index b6b2afa23..c2023375a 100755 --- a/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties +++ b/dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/conf/config.properties @@ -57,6 +57,6 @@ org.highmed.dsf.bpe.fhir.task.subscription.lastEventTimeFile=last_event/time.fil #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.namespaceId= #org.highmed.dsf.bpe.mpi.pdq.assigningAuthority.universalId= -org.highmed.dsf.bpe.process.excluded=localServicesIntegration/0.4.0,requestSimpleFeasibility/0.4.0,executeSimpleFeasibility/0.4.0 +org.highmed.dsf.bpe.process.excluded=localServicesIntegration/0.4.0,requestFeasibility/0.4.0,executeFeasibility/0.4.0,requestDataSharing/0.4.0,executeDataSharing/0.4.0 #org.highmed.dsf.bpe.process.retired= #org.highmed.dsf.bpe.process_plugin_directroy=process \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ActivityDefinitionProcessAuthorizationExtensions.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ActivityDefinitionProcessAuthorizationExtensions.java index 8cd14c76c..1d58e836b 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ActivityDefinitionProcessAuthorizationExtensions.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ActivityDefinitionProcessAuthorizationExtensions.java @@ -8,7 +8,7 @@ public class ActivityDefinitionProcessAuthorizationExtensions { - public static final String PROCESS_AUTHORIZATION_EXTENSION_URL = "http://highmed.org/fhir/StructureDefinition/process-authorization"; + public static final String PROCESS_AUTHORIZATION_EXTENSION_URL = "http://highmed.org/fhir/StructureDefinition/extension-process-authorization"; private final ActivityDefinition activityDefinition; diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/OrganizationAuthorizationRule.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/OrganizationAuthorizationRule.java index 56a5cc04b..11f484200 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/OrganizationAuthorizationRule.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/OrganizationAuthorizationRule.java @@ -27,7 +27,7 @@ public class OrganizationAuthorizationRule extends AbstractAuthorizationRule<Org private static final Logger logger = LoggerFactory.getLogger(OrganizationAuthorizationRule.class); private static final String IDENTIFIER_SYSTEM = "http://highmed.org/fhir/NamingSystem/organization-identifier"; - private static final String EXTENSION_THUMBPRINT_URL = "http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"; + private static final String EXTENSION_THUMBPRINT_URL = "http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"; private static final String EXTENSION_THUMBPRINT_VALUE_PATTERN_STRING = "[a-z0-9]{128}"; private static final Pattern EXTENSION_THUMBPRINT_VALUE_PATTERN = Pattern .compile(EXTENSION_THUMBPRINT_VALUE_PATTERN_STRING); @@ -94,9 +94,10 @@ private Optional<String> newResourceOk(Organization newResource) if (newResource.hasExtension()) { - if (!newResource.getExtension().stream().anyMatch(e -> e.hasUrl() && e.hasValue() - && (e.getValue() instanceof StringType) && EXTENSION_THUMBPRINT_URL.equals(e.getUrl()) - && EXTENSION_THUMBPRINT_VALUE_PATTERN.matcher(((StringType) e.getValue()).getValue()).matches())) + if (!newResource.getExtension().stream().anyMatch( + e -> e.hasUrl() && e.hasValue() && (e.getValue() instanceof StringType) && EXTENSION_THUMBPRINT_URL + .equals(e.getUrl()) && EXTENSION_THUMBPRINT_VALUE_PATTERN + .matcher(((StringType) e.getValue()).getValue()).matches())) { errors.add("Organization.extension missing extension with url '" + EXTENSION_THUMBPRINT_URL + "' and value matching " + EXTENSION_THUMBPRINT_VALUE_PATTERN_STRING + " pattern"); @@ -124,16 +125,16 @@ private boolean resourceExists(Connection connection, Organization newResource) .filter(i -> i.hasSystem() && i.hasValue() && IDENTIFIER_SYSTEM.equals(i.getSystem())) .map(i -> i.getValue()).findFirst().orElseThrow(); - return resourceExistsWithThumbprint(connection, newResource) - || organizationWithIdentifierExists(connection, identifierValue); + return resourceExistsWithThumbprint(connection, newResource) || organizationWithIdentifierExists(connection, + identifierValue); } private boolean resourceExistsWithThumbprint(Connection connection, Organization newResource) { String thumbprintValue = newResource.getExtension().stream() .filter(e -> e.hasUrl() && e.hasValue() && (e.getValue() instanceof StringType) - && EXTENSION_THUMBPRINT_URL.equals(e.getUrl())) - .map(e -> ((StringType) e.getValue()).getValue()).findFirst().orElseThrow(); + && EXTENSION_THUMBPRINT_URL.equals(e.getUrl())).map(e -> ((StringType) e.getValue()).getValue()) + .findFirst().orElseThrow(); return organizationWithThumbprintExists(connection, thumbprintValue); } @@ -154,8 +155,8 @@ private boolean organizationWithThumbprintExists(Connection connection, String t private boolean organizationWithIdentifierExists(Connection connection, String identifierValue) { - Map<String, List<String>> queryParameters = Map.of("identifier", - Collections.singletonList(IDENTIFIER_SYSTEM + "|" + identifierValue)); + Map<String, List<String>> queryParameters = Map + .of("identifier", Collections.singletonList(IDENTIFIER_SYSTEM + "|" + identifierValue)); OrganizationDao dao = getDao(); SearchQuery<Organization> query = dao.createSearchQueryWithoutUserFilter(0, 0) .configureParameters(queryParameters); @@ -214,16 +215,16 @@ public Optional<String> reasonUpdateAllowed(Connection connection, User user, Or logger.info( "Update of Organization authorized for local user '{}', identifier same as existing Organization and certificate-thumbprint same as existing or other Organization with thumbprint does not exist", user.getName()); - return Optional.of( - "local user; identifier same as existing Organization and certificate-thumbprint same as existing or other Organization with thumbprint does not exist"); + return Optional + .of("local user; identifier same as existing Organization and certificate-thumbprint same as existing or other Organization with thumbprint does not exist"); } else if (!resourceExists(connection, newResource)) { logger.info( "Update of Organization authorized for local user '{}', other Organization with certificate-thumbprint or identifier does not exist", user.getName()); - return Optional.of( - "local user; other Organization with certificate-thumbprint and identifier does not exist"); + return Optional + .of("local user; other Organization with certificate-thumbprint and identifier does not exist"); } else { diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ResearchStudyAuthorizationRule.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ResearchStudyAuthorizationRule.java index d786f57a2..1acef0118 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ResearchStudyAuthorizationRule.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ResearchStudyAuthorizationRule.java @@ -87,8 +87,7 @@ private Optional<String> newResourceOk(Connection connection, User user, Researc { if (newResource.getIdentifier().stream() .filter(i -> i.hasSystem() && i.hasValue() && RESEARCH_STUDY_IDENTIFIER.equals(i.getSystem()) - && RESEARCH_STUDY_IDENTIFIER_PATTERN.matcher(i.getValue()).matches()) - .count() != 1) + && RESEARCH_STUDY_IDENTIFIER_PATTERN.matcher(i.getValue()).matches()).count() != 1) { errors.add("ResearchStudy.identifier one with system '" + RESEARCH_STUDY_IDENTIFIER + "' and non empty value matching " + RESEARCH_STUDY_IDENTIFIER_PATTERN_STRING + " expected"); @@ -102,34 +101,34 @@ private Optional<String> newResourceOk(Connection connection, User user, Researc if (ResearchStudyHelper.getParticipatingMedicReferences(newResource).count() >= 0) { if (!organizationsResolvable(connection, user, - "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/participating-medic)", + "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/extension-participating-medic)", ResearchStudyHelper.getParticipatingMedicReferences(newResource)).allMatch(t -> t)) { errors.add( - "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/participating-medic) one or more participating-medic Organizations not resolved"); + "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/extension-participating-medic) one or more participating-medic Organizations not resolved"); } } else { errors.add( - "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/participating-medic) one or more participating-medic Organization references missing"); + "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/extension-participating-medic) one or more participating-medic Organization references missing"); } Optional<Reference> participatingTtpReference = ResearchStudyHelper.getParticipatingTtpReference(newResource); if (participatingTtpReference.isPresent()) { if (!organizationResolvable(connection, user, - "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/participating-ttp)", + "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/extension-participating-ttp)", participatingTtpReference.get())) { errors.add( - "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/participating-ttp) participating-ttp Organization not resolved"); + "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/extension-participating-ttp) participating-ttp Organization not resolved"); } } else { errors.add( - "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/participating-ttp) participating-ttp Organization reference missing"); + "ResearchStudy.extension(url:http://highmed.org/fhir/StructureDefinition/extension-participating-ttp) participating-ttp Organization reference missing"); } if (newResource.getEnrollment().size() >= 0) @@ -151,8 +150,8 @@ private Optional<String> newResourceOk(Connection connection, User user, Researc { Optional<Resource> practitioner = resolvePractitioner(connection, user, "ResearchStudy.principalInvestigator", newResource.getPrincipalInvestigator()); - if (practitioner.isPresent() && practitioner.get() instanceof Practitioner - && ((Practitioner) practitioner.get()).getActive()) + if (practitioner.isPresent() && practitioner.get() instanceof Practitioner && ((Practitioner) practitioner + .get()).getActive()) { if (!practitionerRoleExists(connection, user, practitioner.get().getIdElement())) { @@ -208,9 +207,9 @@ private Optional<Resource> resolvePractitioner(Connection connection, User user, private boolean practitionerRoleExists(Connection connection, User user, IdType practitionerId) { - Map<String, List<String>> queryParameters = Map.of("practitioner", - Collections.singletonList("Practitioner/" + practitionerId.getIdPart()), "active", - Collections.singletonList("true")); + Map<String, List<String>> queryParameters = Map + .of("practitioner", Collections.singletonList("Practitioner/" + practitionerId.getIdPart()), "active", + Collections.singletonList("true")); PractitionerRoleDao dao = daoProvider.getPractitionerRoleDao(); SearchQuery<PractitionerRole> query = dao.createSearchQuery(user, 0, 0).configureParameters(queryParameters); @@ -239,8 +238,8 @@ private boolean resourceExists(Connection connection, ResearchStudy newResource) private boolean researchStudyWithIdentifierExists(Connection connection, String identifierValue) { - Map<String, List<String>> queryParameters = Map.of("identifier", - Collections.singletonList(RESEARCH_STUDY_IDENTIFIER + "|" + identifierValue)); + Map<String, List<String>> queryParameters = Map + .of("identifier", Collections.singletonList(RESEARCH_STUDY_IDENTIFIER + "|" + identifierValue)); ResearchStudyDao dao = getDao(); SearchQuery<ResearchStudy> query = dao.createSearchQueryWithoutUserFilter(0, 0) .configureParameters(queryParameters); @@ -277,8 +276,8 @@ else if (isRemoteUser(user)) ResearchStudyHelper.getParticipatingMedicReferences(existingResource))) { logger.info("Read of ResearchStudy authorized, ResearchStudy.extension(url:" - + ResearchStudyHelper.PARTICIPATING_MEDIC_EXTENSION_URL - + ") reference could be resolved and remote user '{}' part of referenced MeDIC organization", + + ResearchStudyHelper.PARTICIPATING_MEDIC_EXTENSION_URL + + ") reference could be resolved and remote user '{}' part of referenced MeDIC organization", user.getName()); return Optional.of("remote user, ResearchStudy.extension(url:" + ResearchStudyHelper.PARTICIPATING_MEDIC_EXTENSION_URL @@ -298,8 +297,8 @@ else if (isUserPartOfTtp(user)) ResearchStudyHelper.getParticipatingTtpReference(existingResource).orElse(null))) { logger.info("Read of ResearchStudy authorized, ResearchStudy.extension(url:" - + ResearchStudyHelper.PARTICIPATING_TTP_EXTENSION_URL - + ") reference could be resolved and remote user '{}' part of referenced TTP organization", + + ResearchStudyHelper.PARTICIPATING_TTP_EXTENSION_URL + + ") reference could be resolved and remote user '{}' part of referenced TTP organization", user.getName()); return Optional.of("remote user, ResearchStudy.extension(url:" + ResearchStudyHelper.PARTICIPATING_TTP_EXTENSION_URL diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ResearchStudyHelper.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ResearchStudyHelper.java index 2f47ddeeb..57d2402c9 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ResearchStudyHelper.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/authorization/ResearchStudyHelper.java @@ -8,8 +8,8 @@ final class ResearchStudyHelper { - public static final String PARTICIPATING_MEDIC_EXTENSION_URL = "http://highmed.org/fhir/StructureDefinition/participating-medic"; - public static final String PARTICIPATING_TTP_EXTENSION_URL = "http://highmed.org/fhir/StructureDefinition/participating-ttp"; + public static final String PARTICIPATING_MEDIC_EXTENSION_URL = "http://highmed.org/fhir/StructureDefinition/extension-participating-medic"; + public static final String PARTICIPATING_TTP_EXTENSION_URL = "http://highmed.org/fhir/StructureDefinition/extension-participating-ttp"; private ResearchStudyHelper() { diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/ActivityDefinitionDaoJdbc.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/ActivityDefinitionDaoJdbc.java index ba65076d2..d661ec2ee 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/ActivityDefinitionDaoJdbc.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/ActivityDefinitionDaoJdbc.java @@ -101,7 +101,7 @@ public Optional<ActivityDefinition> readByOrganizationTypeUserRoleProcessUrlVers + "activity_definition->'extension' @> ?::jsonb AND " + "lower(activity_definition->>'status') <> 'retired'")) { - String extension = "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/process-authorization\",\"extension\":[" + String extension = "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-process-authorization\",\"extension\":[" + "{\"url\":\"message-name\",\"valueString\":\"" + messageName + "\"}," + "{\"url\":\"authorization-roles\",\"extension\":[{\"url\":\"authorization-role\",\"valueCoding\":{\"code\":\"" + userRole.toString() diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/OrganizationDaoJdbc.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/OrganizationDaoJdbc.java index 0b81fa6f3..469cef9cd 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/OrganizationDaoJdbc.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/OrganizationDaoJdbc.java @@ -29,9 +29,9 @@ public class OrganizationDaoJdbc extends AbstractResourceDaoJdbc<Organization> i public OrganizationDaoJdbc(DataSource dataSource, FhirContext fhirContext) { super(dataSource, fhirContext, Organization.class, "organizations", "organization", "organization_id", - OrganizationUserFilter::new, with(OrganizationActive::new, OrganizationEndpoint::new, - OrganizationIdentifier::new, OrganizationName::new, OrganizationType::new), - with(EndpointOrganizationRevInclude::new)); + OrganizationUserFilter::new, + with(OrganizationActive::new, OrganizationEndpoint::new, OrganizationIdentifier::new, + OrganizationName::new, OrganizationType::new), with(EndpointOrganizationRevInclude::new)); } @Override @@ -51,8 +51,9 @@ public Optional<Organization> readActiveNotDeletedByThumbprint(String thumbprint "SELECT organization FROM current_organizations WHERE organization->'extension' @> ?::jsonb AND organization->>'active' = 'true'")) { - String search = "[{\"url\": \"http://highmed.org/fhir/StructureDefinition/certificate-thumbprint\", \"valueString\": \"" - + thumbprintHex + "\"}]"; + String search = + "[{\"url\": \"http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint\", \"valueString\": \"" + + thumbprintHex + "\"}]"; statement.setString(1, search); logger.trace("Executing query '{}'", statement); @@ -94,8 +95,9 @@ public Optional<Organization> readActiveNotDeletedByIdentifier(String identifier "SELECT organization FROM current_organizations WHERE organization->'identifier' @> ?::jsonb AND organization->>'active' = 'true'")) { - String search = "[{\"system\": \"http://highmed.org/fhir/NamingSystem/organization-identifier\", \"value\": \"" - + identifierValue + "\"}]"; + String search = + "[{\"system\": \"http://highmed.org/fhir/NamingSystem/organization-identifier\", \"value\": \"" + + identifierValue + "\"}]"; statement.setString(1, search); logger.trace("Executing query '{}'", statement); @@ -136,8 +138,9 @@ public boolean existsNotDeletedByThumbprintWithTransaction(Connection connection try (PreparedStatement statement = connection.prepareStatement( "SELECT organization FROM current_organizations WHERE organization->'extension' @> ?::jsonb")) { - String search = "[{\"url\": \"http://highmed.org/fhir/StructureDefinition/certificate-thumbprint\", \"valueString\": \"" - + thumbprintHex + "\"}]"; + String search = + "[{\"url\": \"http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint\", \"valueString\": \"" + + thumbprintHex + "\"}]"; statement.setString(1, search); logger.trace("Executing query '{}'", statement); diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/ResearchStudyDaoJdbc.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/ResearchStudyDaoJdbc.java index ef34faf23..e2d57ef3e 100755 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/ResearchStudyDaoJdbc.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/dao/jdbc/ResearchStudyDaoJdbc.java @@ -29,8 +29,7 @@ public ResearchStudyDaoJdbc(DataSource dataSource, FhirContext fhirContext) { super(dataSource, fhirContext, ResearchStudy.class, "research_studies", "research_study", "research_study_id", ResearchStudyUserFilter::new, with(ResearchStudyEnrollment::new, ResearchStudyIdentifier::new, - ResearchStudyPrincipalInvestigator::new), - with()); + ResearchStudyPrincipalInvestigator::new), with()); } @Override @@ -49,8 +48,8 @@ public boolean existsByPrincipalInvestigatorIdAndOrganizationTypeAndOrganization Objects.requireNonNull(organizationType, "organizationType"); Objects.requireNonNull(organizationId, "organizationId"); - try (PreparedStatement statement = connection - .prepareStatement("SELECT COUNT(*) FROM current_research_studies WHERE " + try (PreparedStatement statement = connection.prepareStatement( + "SELECT COUNT(*) FROM current_research_studies WHERE " + "(research_study->'principalInvestigator'->>'reference' = ? OR research_study->'principalInvestigator'->>'reference' = ?) AND " + "(research_study->'extension' @> ?::jsonb OR research_study->'extension' @> ?::jsonb)")) { @@ -79,8 +78,8 @@ public boolean existsByEnrollmentIdAndOrganizationTypeAndOrganizationIdWithTrans Objects.requireNonNull(organizationType, "organizationType"); Objects.requireNonNull(organizationId, "organizationId"); - try (PreparedStatement statement = connection - .prepareStatement("SELECT COUNT(*) FROM current_research_studies WHERE " + try (PreparedStatement statement = connection.prepareStatement( + "SELECT COUNT(*) FROM current_research_studies WHERE " + "(? IN (SELECT enrollment->>'reference' FROM jsonb_array_elements(research_study->'enrollment') AS enrollment) OR " + "? IN (SELECT enrollment->>'reference' FROM jsonb_array_elements(research_study->'enrollment') AS enrollment)) AND " + "(research_study->'extension' @> ?::jsonb OR research_study->'extension' @> ?::jsonb)")) @@ -108,19 +107,19 @@ private void setOrganization(PreparedStatement statement, OrganizationType organ { case MeDIC: statement.setString(3, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + organizationId.getValue() + "\"}}]"); statement.setString(4, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + organizationId.toVersionless().getValue() + "\"}}]"); break; case TTP: statement.setString(3, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + organizationId.getValue() + "\"}}]"); statement.setString(4, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + organizationId.toVersionless().getValue() + "\"}}]"); break; } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/GroupUserFilter.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/GroupUserFilter.java index 33a411147..d1ad6be79 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/GroupUserFilter.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/GroupUserFilter.java @@ -48,22 +48,22 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep case MeDIC: if (subqueryParameterIndex == 1) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().getValue() + "\"}}]"); else if (subqueryParameterIndex == 2) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().toVersionless().getValue() + "\"}}]"); break; case TTP: if (subqueryParameterIndex == 1) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().getValue() + "\"}}]"); else if (subqueryParameterIndex == 2) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().toVersionless().getValue() + "\"}}]"); break; } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/PractitionerRoleUserFilter.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/PractitionerRoleUserFilter.java index 192d34db6..6af48c8a0 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/PractitionerRoleUserFilter.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/PractitionerRoleUserFilter.java @@ -57,22 +57,22 @@ else if (subqueryParameterIndex == 2) case MeDIC: if (subqueryParameterIndex == 3) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().getValue() + "\"}}]"); else if (subqueryParameterIndex == 4) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().toVersionless().getValue() + "\"}}]"); break; case TTP: if (subqueryParameterIndex == 3) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().getValue() + "\"}}]"); else if (subqueryParameterIndex == 4) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().toVersionless().getValue() + "\"}}]"); break; } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/PractitionerUserFilter.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/PractitionerUserFilter.java index ac08aecb3..852bb01e8 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/PractitionerUserFilter.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/PractitionerUserFilter.java @@ -55,22 +55,22 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep case MeDIC: if (subqueryParameterIndex == 1) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().getValue() + "\"}}]"); else if (subqueryParameterIndex == 2) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().toVersionless().getValue() + "\"}}]"); break; case TTP: if (subqueryParameterIndex == 1) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().getValue() + "\"}}]"); else if (subqueryParameterIndex == 2) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().toVersionless().getValue() + "\"}}]"); break; } diff --git a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/ResearchStudyUserFilter.java b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/ResearchStudyUserFilter.java index 1e884ca53..9f61f628f 100644 --- a/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/ResearchStudyUserFilter.java +++ b/dsf-fhir/dsf-fhir-server/src/main/java/org/highmed/dsf/fhir/search/parameters/user/ResearchStudyUserFilter.java @@ -47,22 +47,22 @@ public void modifyStatement(int parameterIndex, int subqueryParameterIndex, Prep case MeDIC: if (subqueryParameterIndex == 1) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().getValue() + "\"}}]"); else if (subqueryParameterIndex == 2) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-medic\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-medic\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().toVersionless().getValue() + "\"}}]"); break; case TTP: if (subqueryParameterIndex == 1) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().getValue() + "\"}}]"); else if (subqueryParameterIndex == 2) statement.setString(parameterIndex, - "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/participating-ttp\",\"valueReference\":{\"reference\":\"" + "[{\"url\":\"http://highmed.org/fhir/StructureDefinition/extension-participating-ttp\",\"valueReference\":{\"reference\":\"" + user.getOrganization().getIdElement().toVersionless().getValue() + "\"}}]"); break; } diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/OrganizationDaoTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/OrganizationDaoTest.java index eb5f232da..9585689a9 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/OrganizationDaoTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/OrganizationDaoTest.java @@ -59,7 +59,7 @@ public void testReadActiveNotDeletedByThumbprint() throws Exception Organization org = new Organization(); org.setActive(true); org.setName("Test"); - org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint") + org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint") .setValue(new StringType(certHex)); Organization created = dao.create(org); @@ -68,15 +68,14 @@ public void testReadActiveNotDeletedByThumbprint() throws Exception Optional<Organization> read = dao.readActiveNotDeletedByThumbprint(certHex); assertNotNull(read); assertTrue(read.isPresent()); - assertNotNull( - read.get().getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint")); - assertEquals(StringType.class, - read.get().getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint") - .getValue().getClass()); - assertEquals(certHex, - ((StringType) read.get() - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint") - .getValue()).asStringValue()); + assertNotNull(read.get() + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint")); + assertEquals(StringType.class, read.get() + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint") + .getValue().getClass()); + assertEquals(certHex, ((StringType) read.get() + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint") + .getValue()).asStringValue()); } @Test @@ -87,7 +86,7 @@ public void testReadActiveNotDeletedByThumbprintNotActive() throws Exception Organization org = new Organization(); org.setActive(false); org.setName("Test"); - org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint") + org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint") .setValue(new StringType(certHex)); Organization created = dao.create(org); @@ -110,7 +109,7 @@ public void testReadActiveNotDeletedByThumbprintDeleted() throws Exception Organization org = new Organization(); org.setActive(false); org.setName("Test"); - org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint") + org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint") .setValue(new StringType(certHex)); Organization created = dao.create(org); diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/ResearchStudyDaoTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/ResearchStudyDaoTest.java index d19f1465f..d17788f80 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/ResearchStudyDaoTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/dao/ResearchStudyDaoTest.java @@ -67,11 +67,11 @@ public void testReadByPrincipalInvestigatorIdAndOrganizationTypeAndOrganizationI ResearchStudy r = new ResearchStudy(); r.setPrincipalInvestigator(new Reference(piReference)); - r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-ttp") + r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-ttp") .setValue(new Reference(orgReference)); - r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-medic") + r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-medic") .setValue(new Reference("Organization/" + UUID.randomUUID().toString())); - r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-medic") + r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-medic") .setValue(new Reference("Organization/" + UUID.randomUUID().toString())); logger.debug(fhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(r)); @@ -80,8 +80,9 @@ public void testReadByPrincipalInvestigatorIdAndOrganizationTypeAndOrganizationI try (Connection connection = dao.newReadWriteTransaction()) { - boolean exists = dao.existsByPrincipalInvestigatorIdAndOrganizationTypeAndOrganizationIdWithTransaction( - connection, new IdType(piReference), OrganizationType.TTP, new IdType(orgReference)); + boolean exists = dao + .existsByPrincipalInvestigatorIdAndOrganizationTypeAndOrganizationIdWithTransaction(connection, + new IdType(piReference), OrganizationType.TTP, new IdType(orgReference)); assertTrue(exists); } } @@ -96,11 +97,11 @@ public void testReadByEnrollmentIdAndOrganizationTypeAndOrganizationIdWithTransa ResearchStudy r = new ResearchStudy(); r.addEnrollment(new Reference(enrollmentReference1)); r.addEnrollment(new Reference(enrollmentReference2)); - r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-ttp") + r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-ttp") .setValue(new Reference("Organization/" + UUID.randomUUID().toString())); - r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-medic") + r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-medic") .setValue(new Reference(orgReference)); - r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-medic") + r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-medic") .setValue(new Reference("Organization/" + UUID.randomUUID().toString())); logger.debug(fhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(r)); diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/ActivityDefinitionWithExtension.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/ActivityDefinitionWithExtension.java index 7aa5af986..d475f55a7 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/ActivityDefinitionWithExtension.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/ActivityDefinitionWithExtension.java @@ -41,7 +41,7 @@ public void test() throws Exception a.setKind(ActivityDefinitionKind.TASK); Extension e1 = a.addExtension(); - e1.setUrl("http://highmed.org/fhir/StructureDefinition/process-authorization"); + e1.setUrl("http://highmed.org/fhir/StructureDefinition/extension-process-authorization"); e1.addExtension("message-name", new StringType("startPingProcessMessage")); e1.addExtension("authorization-role", new Coding("http://highmed.org/fhir/CodeSystem/authorization-role", "LOCAL", null)); @@ -52,10 +52,10 @@ public void test() throws Exception ot12.addExtension("organization-type", new Coding("http://highmed.org/fhir/CodeSystem/authorization-role", "MeDIC", null)); e1.addExtension("task-profile", - new CanonicalType("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process")); + new CanonicalType("http://highmed.org/fhir/StructureDefinition/task-start-ping-process")); Extension e2 = a.addExtension(); - e2.setUrl("http://highmed.org/fhir/StructureDefinition/process-authorization"); + e2.setUrl("http://highmed.org/fhir/StructureDefinition/extension-process-authorization"); e2.addExtension("message-name", new StringType("pongMessage")); e2.addExtension("authorization-role", new Coding("http://highmed.org/fhir/CodeSystem/authorization-role", "REMOTE", null)); @@ -65,8 +65,7 @@ public void test() throws Exception new Coding("http://highmed.org/fhir/CodeSystem/authorization-role", "TTP", null)); ot22.addExtension("organization-type", new Coding("http://highmed.org/fhir/CodeSystem/authorization-role", "MeDIC", null)); - e2.addExtension("task-profile", - new CanonicalType("http://highmed.org/fhir/StructureDefinition/highmed-task-pong")); + e2.addExtension("task-profile", new CanonicalType("http://highmed.org/fhir/StructureDefinition/task-pong")); String xml = FhirContext.forR4().newXmlParser().setPrettyPrint(true).encodeResourceToString(a); logger.debug(xml); diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/OrganizationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/OrganizationTest.java index 0a91317c6..e2f803ea1 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/OrganizationTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/OrganizationTest.java @@ -27,10 +27,10 @@ public void testOrganizationJson() throws Exception { Organization organization = new Organization(); Extension thumbprint1 = organization.addExtension(); - thumbprint1.setUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + thumbprint1.setUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); thumbprint1.setValue(new StringType(Hex.encodeHexString("foo bar baz".getBytes()))); Extension thumbprint2 = organization.addExtension(); - thumbprint2.setUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + thumbprint2.setUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); thumbprint2.setValue(new StringType(Hex.encodeHexString("Blub Blub Blub".getBytes()))); organization.addEndpoint(new Reference(new IdType("Endpoint", UUID.randomUUID().toString()))); diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/ResearchStudyTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/ResearchStudyTest.java index de4dce724..5fdc109f6 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/ResearchStudyTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/hapi/ResearchStudyTest.java @@ -20,12 +20,12 @@ public class ResearchStudyTest public void testReferenceExtension() throws Exception { ResearchStudy r = new ResearchStudy(); - r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/participating-medic") + r.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-medic") .setValue(new Reference().setReference("Organization/" + UUID.randomUUID().toString())); logger.debug(FhirContext.forR4().newXmlParser().setPrettyPrint(true).encodeResourceToString(r)); - assertTrue(r.getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/participating-medic") + assertTrue(r.getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-medic") .getValue() instanceof Reference); } } diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/AbstractIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/AbstractIntegrationTest.java index 82c7be27e..864efc501 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/AbstractIntegrationTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/AbstractIntegrationTest.java @@ -70,6 +70,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.parser.IParser; + import de.rwh.utils.jetty.JettyServer; import de.rwh.utils.jetty.PropertiesReader; import de.rwh.utils.test.LiquibaseTemplateTestClassRule; @@ -154,28 +155,29 @@ private static FhirWebserviceClient createWebserviceClient(KeyStore trustStore, private static WebsocketClient createWebsocketClient(KeyStore trustStore, KeyStore keyStore, char[] keyStorePassword, String subscriptionIdPart) { - return new WebsocketClientTyrus(() -> {}, URI.create(WEBSOCKET_URL), trustStore, keyStore, keyStorePassword, subscriptionIdPart); + return new WebsocketClientTyrus(() -> { + }, URI.create(WEBSOCKET_URL), trustStore, keyStore, keyStorePassword, subscriptionIdPart); } private static JettyServer startFhirServer() throws Exception { - Properties properties = PropertiesReader.read(Paths.get("src/test/resources/integration/jetty.properties"), - StandardCharsets.UTF_8); + Properties properties = PropertiesReader + .read(Paths.get("src/test/resources/integration/jetty.properties"), StandardCharsets.UTF_8); overrideJettyPropertiesForTesting(properties); HttpConfiguration httpConfiguration = httpConfiguration(secureRequestCustomizer()); Function<Server, ServerConnector> connector = httpsConnector(httpConfiguration, properties); - Properties initParameter = PropertiesReader.read(Paths.get("src/test/resources/integration/config.properties"), - StandardCharsets.UTF_8); + Properties initParameter = PropertiesReader + .read(Paths.get("src/test/resources/integration/config.properties"), StandardCharsets.UTF_8); overrideConfigPropertiesForTesting(initParameter); Predicate<String> filter = s -> s.contains("fhir-server"); Stream<String> webInfClassesDirs = webInfClassesDirs(filter); Stream<String> webInfJars = webInfJars(filter); - List<Class<?>> initializers = Arrays.asList(SpringServletContainerInitializer.class, - JerseyServletContainerInitializer.class); + List<Class<?>> initializers = Arrays + .asList(SpringServletContainerInitializer.class, JerseyServletContainerInitializer.class); ErrorHandler errorHandler = statusCodeOnlyErrorHandler(); @@ -277,14 +279,14 @@ private static void createTestBundle(X509Certificate certificate, X509Certificat Organization organization = (Organization) testBundle.getEntry().get(0).getResource(); Extension thumbprintExtension = organization - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); String clientCertHashHex = calculateSha512CertificateThumbprintHex(certificate); thumbprintExtension.setValue(new StringType(clientCertHashHex)); Organization externalOrganization = (Organization) testBundle.getEntry().get(2).getResource(); Extension externalThumbprintExtension = externalOrganization - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); String externalClientCertHashHex = calculateSha512CertificateThumbprintHex(externalCertificate); externalThumbprintExtension.setValue(new StringType(externalClientCertHashHex)); diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java index a62ec0be2..ddb522a65 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BundleIntegrationTest.java @@ -99,7 +99,7 @@ public void testDeleteTaskProfileViaBundleTestSupportedProfilesInConformanceStat newS.setKind(StructureDefinitionKind.RESOURCE); newS.setAbstract(false); newS.setType("Task"); - newS.setBaseDefinition("http://highmed.org/fhir/StructureDefinition/highmed-task-base"); + newS.setBaseDefinition("http://highmed.org/fhir/StructureDefinition/task-base"); newS.setDerivation(TypeDerivationRule.CONSTRAINT); ElementDefinition diff = newS.getDifferential().addElement(); diff.setId("Task.instantiatesUri"); @@ -125,10 +125,10 @@ public void testDeleteTaskProfileViaBundleTestSupportedProfilesInConformanceStat getWebserviceClient().withMinimalReturn().postBundle(deleteBundle); assertFalse(testProfileSupported(taskProfileUrl)); - StructureDefinitionDao sDdao = getSpringWebApplicationContext().getBean("structureDefinitionDao", - StructureDefinitionDao.class); - StructureDefinitionDao sDsDao = getSpringWebApplicationContext().getBean("structureDefinitionSnapshotDao", - StructureDefinitionDao.class); + StructureDefinitionDao sDdao = getSpringWebApplicationContext() + .getBean("structureDefinitionDao", StructureDefinitionDao.class); + StructureDefinitionDao sDsDao = getSpringWebApplicationContext() + .getBean("structureDefinitionSnapshotDao", StructureDefinitionDao.class); assertTrue(sDdao.readByUrlAndVersion(taskProfileUrl, taskProfileVersion).isEmpty()); assertTrue(sDsDao.readByUrlAndVersion(taskProfileUrl, taskProfileVersion).isEmpty()); diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/EndpointIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/EndpointIntegrationTest.java index 9a5e5e8fe..f47645ce2 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/EndpointIntegrationTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/EndpointIntegrationTest.java @@ -102,8 +102,8 @@ public void testSearchWithUnsupportedQueryParameterLenientHandling() throws Exce @Test public void testSearchEndpointIncludeOrganization() throws Exception { - Bundle searchBundle = getWebserviceClient().search(Endpoint.class, - Map.of("_include", Collections.singletonList("Endpoint:organization"))); + Bundle searchBundle = getWebserviceClient() + .search(Endpoint.class, Map.of("_include", Collections.singletonList("Endpoint:organization"))); assertNotNull(searchBundle); assertEquals(2, searchBundle.getTotal()); assertEquals(4, searchBundle.getEntry().size()); @@ -136,8 +136,8 @@ public void testSearchEndpointIncludeOrganization() throws Exception @Test public void testSearchEndpointRevIncludeOrganization() throws Exception { - Bundle searchBundle = getWebserviceClient().search(Endpoint.class, - Map.of("_revinclude", Collections.singletonList("Organization:endpoint"))); + Bundle searchBundle = getWebserviceClient() + .search(Endpoint.class, Map.of("_revinclude", Collections.singletonList("Organization:endpoint"))); assertNotNull(searchBundle); assertEquals(2, searchBundle.getTotal()); assertEquals(4, searchBundle.getEntry().size()); @@ -201,8 +201,9 @@ public void testCreateReadWithLogicalReference() throws Exception .setCode("REMOTE"); organization.addIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") .setValue("bla-bla.de"); - organization.addExtension("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint", new StringType( - "6b83a92506d67265697c74f50a9cac0ec7182adcc5302e5ed487ae1a782fe278f5ca79808c971e061fadded2c303a2223140ef3450d1d27717dd704a823f95e9")); + organization.addExtension("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint", + new StringType( + "6b83a92506d67265697c74f50a9cac0ec7182adcc5302e5ed487ae1a782fe278f5ca79808c971e061fadded2c303a2223140ef3450d1d27717dd704a823f95e9")); Organization createdOrg = getWebserviceClient().create(organization); logger.debug("Organization: {}", @@ -278,12 +279,13 @@ public void testCreateReadWithLogicalReferenceViaBundle() throws Exception .setCode("REMOTE"); organization.addIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") .setValue("bla-bla.de"); - organization.addExtension("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint", new StringType( - "6b83a92506d67265697c74f50a9cac0ec7182adcc5302e5ed487ae1a782fe278f5ca79808c971e061fadded2c303a2223140ef3450d1d27717dd704a823f95e9")); + organization.addExtension("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint", + new StringType( + "6b83a92506d67265697c74f50a9cac0ec7182adcc5302e5ed487ae1a782fe278f5ca79808c971e061fadded2c303a2223140ef3450d1d27717dd704a823f95e9")); organization.addEndpoint().setReference(endTempId); Endpoint endpoint = new Endpoint(); - endpoint.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-endpoint"); + endpoint.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/endpoint"); endpoint.getMeta().addTag().setSystem("http://highmed.org/fhir/CodeSystem/authorization-role") .setCode("REMOTE"); endpoint.addIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/endpoint-identifier") @@ -304,8 +306,8 @@ public void testCreateReadWithLogicalReferenceViaBundle() throws Exception .setUrl("Organization"); bundle.addEntry().setFullUrl(endTempId).setResource(endpoint).getRequest().setMethod(HTTPVerb.POST) .setUrl("Endpoint"); - bundle.addEntry().getRequest().setMethod(HTTPVerb.GET).setUrl( - "Endpoint?identifier=http://highmed.org/fhir/NamingSystem/endpoint-identifier|foo-bar-baz.test.bla-bla.de"); + bundle.addEntry().getRequest().setMethod(HTTPVerb.GET) + .setUrl("Endpoint?identifier=http://highmed.org/fhir/NamingSystem/endpoint-identifier|foo-bar-baz.test.bla-bla.de"); logger.debug("bundle: {}", context.newXmlParser().setPrettyPrint(true).encodeResourceToString(bundle)); Bundle postBundle = getWebserviceClient().postBundle(bundle); diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/OrganizationIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/OrganizationIntegrationTest.java index f7424847d..e21c0fe85 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/OrganizationIntegrationTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/OrganizationIntegrationTest.java @@ -34,8 +34,8 @@ public void testSearchAll() throws Exception @Test public void testSearchOrganizationIncludeEndpoint() throws Exception { - Bundle searchBundle = getWebserviceClient().search(Organization.class, - Map.of("_include", Collections.singletonList("Organization:endpoint"))); + Bundle searchBundle = getWebserviceClient() + .search(Organization.class, Map.of("_include", Collections.singletonList("Organization:endpoint"))); assertNotNull(searchBundle); assertEquals(2, searchBundle.getTotal()); assertEquals(4, searchBundle.getEntry().size()); @@ -68,8 +68,8 @@ public void testSearchOrganizationIncludeEndpoint() throws Exception @Test public void testSearchOrganizationRevIncludeEndpoint() throws Exception { - Bundle searchBundle = getWebserviceClient().search(Organization.class, - Map.of("_revinclude", Collections.singletonList("Endpoint:organization"))); + Bundle searchBundle = getWebserviceClient() + .search(Organization.class, Map.of("_revinclude", Collections.singletonList("Endpoint:organization"))); assertNotNull(searchBundle); assertEquals(2, searchBundle.getTotal()); assertEquals(4, searchBundle.getEntry().size()); @@ -116,7 +116,7 @@ public void testUpdateOrganizationWithNewThumbprint() throws Exception Organization org = (Organization) bundle.getEntryFirstRep().getResource(); List<Extension> thumbprints = org - .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); assertNotNull(thumbprints); assertEquals(1, thumbprints.size()); @@ -142,14 +142,14 @@ public void testUpdateOrganizationWithExistingThumbprint() throws Exception Organization org1 = (Organization) bundle1.getEntryFirstRep().getResource(); List<Extension> thumbprints1 = org1 - .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); assertNotNull(thumbprints1); assertEquals(1, thumbprints1.size()); String existingThumbprint = ((StringType) thumbprints1.get(0).getValue()).getValue(); - Bundle bundle2 = getWebserviceClient().search(Organization.class, - Map.of("identifier", Collections.singletonList( + Bundle bundle2 = getWebserviceClient().search(Organization.class, Map.of("identifier", Collections + .singletonList( "http://highmed.org/fhir/NamingSystem/organization-identifier|External_Test_Organization"))); assertNotNull(bundle2); assertEquals(1, bundle2.getTotal()); @@ -163,7 +163,7 @@ public void testUpdateOrganizationWithExistingThumbprint() throws Exception Organization org2 = (Organization) bundle2.getEntryFirstRep().getResource(); List<Extension> thumbprints2 = org2 - .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); assertNotNull(thumbprints2); assertEquals(1, thumbprints2.size()); @@ -226,14 +226,14 @@ public void testUpdateOrganizationAddNewThumbprint() throws Exception Organization org = (Organization) bundle.getEntryFirstRep().getResource(); List<Extension> thumbprints = org - .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); assertNotNull(thumbprints); assertEquals(1, thumbprints.size()); Extension oldThumbprint = thumbprints.get(0); - Extension newThumbprint = new Extension("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint", - new StringType( - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")); + Extension newThumbprint = new Extension( + "http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint", new StringType( + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")); org.setExtension(List.of(newThumbprint, oldThumbprint)); getWebserviceClient().update(org); diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/TaskIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/TaskIntegrationTest.java index e8626b6ed..50d64e867 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/TaskIntegrationTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/TaskIntegrationTest.java @@ -1,7 +1,8 @@ package org.highmed.dsf.fhir.integration; import static junit.framework.TestCase.assertEquals; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; import java.util.Date; import java.util.EnumSet; @@ -24,120 +25,120 @@ public class TaskIntegrationTest extends AbstractIntegrationTest { -// private static final Logger logger = LoggerFactory.getLogger(TaskIntegrationTest.class); - -// TODO create test setup for testing against process profiles -// private List<Bundle.BundleEntryComponent> createTaskBundle() -// { -// Bundle bundle = readBundle(Paths.get("src/test/resources/integration/task-bundle.json"), newJsonParser()); -// Bundle resultBundle = getWebserviceClient().postBundle(bundle); -// return resultBundle.getEntry(); -// } - -// TODO create test setup for testing against process profiles -// @Test -// public void testHandleBundleForRequestSimpleFeasibility() throws Exception -// { -// WebsocketClient websocketClient = getWebsocketClient(); -// assertNotNull(websocketClient); -// -// BlockingDeque<DomainResource> events = new LinkedBlockingDeque<>(); -// websocketClient.setDomainResourceHandler(events::add, AbstractIntegrationTest::newJsonParser); -// websocketClient.connect(); -// -// try -// { -// List<Bundle.BundleEntryComponent> resultBundleEntries = createTaskBundle(); -// assertEquals(4, resultBundleEntries.size()); -// -// String taskId = new IdType(resultBundleEntries.get(3).getFullUrl()).getIdPart(); -// Task task = getWebserviceClient().read(Task.class, taskId); -// -// Task.ParameterComponent input = task.getInput().stream() -// .filter(c -> c.getType().getCoding().get(0).getCode().equals("research-study-reference")) -// .findFirst().orElse(new Task.ParameterComponent()); -// -// IdType taskInputResearchStudyId = new IdType(((Reference) input.getValue()).getReference()); -// IdType researchStudyId = new IdType(resultBundleEntries.get(2).getFullUrl()); -// -// assertEquals(researchStudyId.getResourceType(), taskInputResearchStudyId.getResourceType()); -// assertEquals(researchStudyId.getIdPart(), taskInputResearchStudyId.getIdPart()); -// assertEquals(researchStudyId.getVersionIdPart(), taskInputResearchStudyId.getVersionIdPart()); -// -// DomainResource event = events.pollFirst(5, TimeUnit.SECONDS); -// assertNotNull(event); -// assertTrue(event instanceof Task); -// -// Task taskViaWebsocket = (Task) event; -// Task.ParameterComponent inputViaWebsocket = taskViaWebsocket.getInput().stream() -// .filter(c -> c.getType().getCoding().get(0).getCode().equals("research-study-reference")) -// .findFirst().orElse(new Task.ParameterComponent()); -// -// IdType taskInputResearchStudyIdViaWebsocket = new IdType( -// ((Reference) inputViaWebsocket.getValue()).getReference()); -// assertEquals(researchStudyId.getResourceType(), taskInputResearchStudyIdViaWebsocket.getResourceType()); -// assertEquals(researchStudyId.getIdPart(), taskInputResearchStudyIdViaWebsocket.getIdPart()); -// assertEquals(researchStudyId.getVersionIdPart(), taskInputResearchStudyIdViaWebsocket.getVersionIdPart()); -// -// ResearchStudy researchStudy = getWebserviceClient().read(ResearchStudy.class, researchStudyId.getIdPart()); -// logger.debug("ResearchStudy: {}", -// FhirContext.forR4().newXmlParser().setPrettyPrint(true).encodeResourceToString(researchStudy)); -// -// List<Extension> medics = researchStudy -// .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/participating-medic"); -// assertNotNull(medics); -// assertEquals(1, medics.size()); -// Extension medicExt = medics.get(0); -// assertTrue(medicExt.hasValue()); -// assertTrue(medicExt.getValue() instanceof Reference); -// Reference medicRef = (Reference) medicExt.getValue(); -// assertTrue(medicRef.hasIdentifier()); -// assertFalse(medicRef.hasReference()); -// -// List<Extension> ttps = researchStudy -// .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/participating-ttp"); -// assertNotNull(ttps); -// assertEquals(1, ttps.size()); -// Extension ttpExt = medics.get(0); -// assertTrue(ttpExt.hasValue()); -// assertTrue(ttpExt.getValue() instanceof Reference); -// Reference ttpRef = (Reference) ttpExt.getValue(); -// assertTrue(ttpRef.hasIdentifier()); -// assertFalse(ttpRef.hasReference()); -// } -// finally -// { -// if (websocketClient != null) -// websocketClient.disconnect(); -// } -// } - -// TODO create test setup for testing against process profiles -// @Test -// public void testCreateTaskStartPingProcess() throws Exception -// { -// OrganizationProvider organizationProvider = getSpringWebApplicationContext() -// .getBean(OrganizationProvider.class); -// assertNotNull(organizationProvider); -// -// Task t = new Task(); -// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); -// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); -// t.setStatus(TaskStatus.REQUESTED); -// t.setIntent(TaskIntent.ORDER); -// t.setAuthoredOn(new Date()); -// Reference localOrg = new Reference(); -// localOrg.setType("Organization").getIdentifier() -// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") -// .setValue("Test_Organization"); -// t.setRequester(localOrg); -// t.getRestriction().addRecipient(localOrg); -// t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("message-name"); -// t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); -// -// getWebserviceClient().create(t); -// } + // private static final Logger logger = LoggerFactory.getLogger(TaskIntegrationTest.class); + + // TODO create test setup for testing against process profiles + // private List<Bundle.BundleEntryComponent> createTaskBundle() + // { + // Bundle bundle = readBundle(Paths.get("src/test/resources/integration/task-bundle.json"), newJsonParser()); + // Bundle resultBundle = getWebserviceClient().postBundle(bundle); + // return resultBundle.getEntry(); + // } + + // TODO create test setup for testing against process profiles + // @Test + // public void testHandleBundleForRequestFeasibility() throws Exception + // { + // WebsocketClient websocketClient = getWebsocketClient(); + // assertNotNull(websocketClient); + // + // BlockingDeque<DomainResource> events = new LinkedBlockingDeque<>(); + // websocketClient.setDomainResourceHandler(events::add, AbstractIntegrationTest::newJsonParser); + // websocketClient.connect(); + // + // try + // { + // List<Bundle.BundleEntryComponent> resultBundleEntries = createTaskBundle(); + // assertEquals(4, resultBundleEntries.size()); + // + // String taskId = new IdType(resultBundleEntries.get(3).getFullUrl()).getIdPart(); + // Task task = getWebserviceClient().read(Task.class, taskId); + // + // Task.ParameterComponent input = task.getInput().stream() + // .filter(c -> c.getType().getCoding().get(0).getCode().equals("research-study-reference")) + // .findFirst().orElse(new Task.ParameterComponent()); + // + // IdType taskInputResearchStudyId = new IdType(((Reference) input.getValue()).getReference()); + // IdType researchStudyId = new IdType(resultBundleEntries.get(2).getFullUrl()); + // + // assertEquals(researchStudyId.getResourceType(), taskInputResearchStudyId.getResourceType()); + // assertEquals(researchStudyId.getIdPart(), taskInputResearchStudyId.getIdPart()); + // assertEquals(researchStudyId.getVersionIdPart(), taskInputResearchStudyId.getVersionIdPart()); + // + // DomainResource event = events.pollFirst(5, TimeUnit.SECONDS); + // assertNotNull(event); + // assertTrue(event instanceof Task); + // + // Task taskViaWebsocket = (Task) event; + // Task.ParameterComponent inputViaWebsocket = taskViaWebsocket.getInput().stream() + // .filter(c -> c.getType().getCoding().get(0).getCode().equals("research-study-reference")) + // .findFirst().orElse(new Task.ParameterComponent()); + // + // IdType taskInputResearchStudyIdViaWebsocket = new IdType( + // ((Reference) inputViaWebsocket.getValue()).getReference()); + // assertEquals(researchStudyId.getResourceType(), taskInputResearchStudyIdViaWebsocket.getResourceType()); + // assertEquals(researchStudyId.getIdPart(), taskInputResearchStudyIdViaWebsocket.getIdPart()); + // assertEquals(researchStudyId.getVersionIdPart(), taskInputResearchStudyIdViaWebsocket.getVersionIdPart()); + // + // ResearchStudy researchStudy = getWebserviceClient().read(ResearchStudy.class, researchStudyId.getIdPart()); + // logger.debug("ResearchStudy: {}", + // FhirContext.forR4().newXmlParser().setPrettyPrint(true).encodeResourceToString(researchStudy)); + // + // List<Extension> medics = researchStudy + // .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-medic"); + // assertNotNull(medics); + // assertEquals(1, medics.size()); + // Extension medicExt = medics.get(0); + // assertTrue(medicExt.hasValue()); + // assertTrue(medicExt.getValue() instanceof Reference); + // Reference medicRef = (Reference) medicExt.getValue(); + // assertTrue(medicRef.hasIdentifier()); + // assertFalse(medicRef.hasReference()); + // + // List<Extension> ttps = researchStudy + // .getExtensionsByUrl("http://highmed.org/fhir/StructureDefinition/extension-participating-ttp"); + // assertNotNull(ttps); + // assertEquals(1, ttps.size()); + // Extension ttpExt = medics.get(0); + // assertTrue(ttpExt.hasValue()); + // assertTrue(ttpExt.getValue() instanceof Reference); + // Reference ttpRef = (Reference) ttpExt.getValue(); + // assertTrue(ttpRef.hasIdentifier()); + // assertFalse(ttpRef.hasReference()); + // } + // finally + // { + // if (websocketClient != null) + // websocketClient.disconnect(); + // } + // } + + // TODO create test setup for testing against process profiles + // @Test + // public void testCreateTaskStartPingProcess() throws Exception + // { + // OrganizationProvider organizationProvider = getSpringWebApplicationContext() + // .getBean(OrganizationProvider.class); + // assertNotNull(organizationProvider); + // + // Task t = new Task(); + // t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); + // t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + // t.setStatus(TaskStatus.REQUESTED); + // t.setIntent(TaskIntent.ORDER); + // t.setAuthoredOn(new Date()); + // Reference localOrg = new Reference(); + // localOrg.setType("Organization").getIdentifier() + // .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + // .setValue("Test_Organization"); + // t.setRequester(localOrg); + // t.getRestriction().addRecipient(localOrg); + // t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("message-name"); + // t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); + // + // getWebserviceClient().create(t); + // } @Test(expected = WebApplicationException.class) public void testCreateTaskStartPingProcessNotAllowedForRemoteUser() throws Exception @@ -147,7 +148,7 @@ public void testCreateTaskStartPingProcessNotAllowedForRemoteUser() throws Excep assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); t.setStatus(TaskStatus.REQUESTED); t.setIntent(TaskIntent.ORDER); @@ -174,159 +175,159 @@ public void testCreateTaskStartPingProcessNotAllowedForRemoteUser() throws Excep } } -// TODO create test setup for testing against process profiles -// @Test -// public void testCreateTaskStartPongProcessAllowedForRemoteUser() throws Exception -// { -// OrganizationProvider organizationProvider = getSpringWebApplicationContext() -// .getBean(OrganizationProvider.class); -// assertNotNull(organizationProvider); -// -// Task t = new Task(); -// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); -// t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); -// t.setStatus(TaskStatus.REQUESTED); -// t.setIntent(TaskIntent.ORDER); -// t.setAuthoredOn(new Date()); -// -// Reference requester = new Reference().setType("Organization"); -// requester.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") -// .setValue("External_Test_Organization"); -// t.setRequester(requester); -// -// Reference localOrg = new Reference(); -// localOrg.setType("Organization").getIdentifier() -// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") -// .setValue("Test_Organization"); -// t.getRestriction().addRecipient(localOrg); -// -// ParameterComponent in1 = t.addInput(); -// in1.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("message-name"); -// in1.setValue(new StringType("pingMessage")); -// -// ParameterComponent in2 = t.addInput(); -// in2.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("business-key"); -// in2.setValue(new StringType(UUID.randomUUID().toString())); -// -// ParameterComponent in3 = t.addInput(); -// in3.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("correlation-key"); -// in3.setValue(new StringType(UUID.randomUUID().toString())); -// -// getExternalWebserviceClient().create(t); -// } - -// TODO create test setup for testing against process profiles -// @Test -// public void testCreateTaskContinuePingProcessAllowedForRemoteUser() throws Exception -// { -// OrganizationProvider organizationProvider = getSpringWebApplicationContext() -// .getBean(OrganizationProvider.class); -// assertNotNull(organizationProvider); -// -// Task t = new Task(); -// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-pong"); -// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); -// t.setStatus(TaskStatus.REQUESTED); -// t.setIntent(TaskIntent.ORDER); -// t.setAuthoredOn(new Date()); -// -// Reference requester = new Reference().setType("Organization"); -// requester.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") -// .setValue("External_Test_Organization"); -// t.setRequester(requester); -// -// Reference localOrg = new Reference(); -// localOrg.setType("Organization").getIdentifier() -// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") -// .setValue("Test_Organization"); -// t.getRestriction().addRecipient(localOrg); -// -// ParameterComponent in1 = t.addInput(); -// in1.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("message-name"); -// in1.setValue(new StringType("pongMessage")); -// -// ParameterComponent in2 = t.addInput(); -// in2.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("business-key"); -// in2.setValue(new StringType(UUID.randomUUID().toString())); -// -// ParameterComponent in3 = t.addInput(); -// in3.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("correlation-key"); -// in3.setValue(new StringType(UUID.randomUUID().toString())); -// -// getExternalWebserviceClient().create(t); -// } - -// TODO create test setup for testing against process profiles -// @Test -// public void testUpdateTaskStartPingProcessStatusRequestedToInProgress() throws Exception -// { -// OrganizationProvider organizationProvider = getSpringWebApplicationContext() -// .getBean(OrganizationProvider.class); -// assertNotNull(organizationProvider); -// -// Task t = new Task(); -// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); -// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); -// t.setStatus(TaskStatus.REQUESTED); -// t.setIntent(TaskIntent.ORDER); -// t.setAuthoredOn(new Date()); -// Reference localOrg = new Reference(); -// localOrg.setType("Organization").getIdentifier() -// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") -// .setValue("Test_Organization"); -// t.setRequester(localOrg); -// t.getRestriction().addRecipient(localOrg); -// t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("message-name"); -// t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); -// -// TaskDao dao = getSpringWebApplicationContext().getBean(TaskDao.class); -// Task created = dao.create(t); -// -// created.setStatus(TaskStatus.INPROGRESS); -// -// getWebserviceClient().update(created); -// } - -// TODO create test setup for testing against process profiles -// @Test -// public void testUpdateTaskStartPingProcessStatusInProgressToCompleted() throws Exception -// { -// OrganizationProvider organizationProvider = getSpringWebApplicationContext() -// .getBean(OrganizationProvider.class); -// assertNotNull(organizationProvider); -// -// Task t = new Task(); -// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); -// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); -// t.setStatus(TaskStatus.INPROGRESS); -// t.setIntent(TaskIntent.ORDER); -// t.setAuthoredOn(new Date()); -// -// Reference localOrg = new Reference(); -// localOrg.setType("Organization").getIdentifier() -// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") -// .setValue("Test_Organization"); -// t.setRequester(localOrg); -// t.getRestriction().addRecipient(localOrg); -// -// t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("message-name"); -// t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); -// -// TaskDao dao = getSpringWebApplicationContext().getBean(TaskDao.class); -// Task created = dao.create(t); -// -// created.setStatus(TaskStatus.COMPLETED); -// -// getWebserviceClient().update(created); -// } + // TODO create test setup for testing against process profiles + // @Test + // public void testCreateTaskStartPongProcessAllowedForRemoteUser() throws Exception + // { + // OrganizationProvider organizationProvider = getSpringWebApplicationContext() + // .getBean(OrganizationProvider.class); + // assertNotNull(organizationProvider); + // + // Task t = new Task(); + // t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-ping"); + // t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); + // t.setStatus(TaskStatus.REQUESTED); + // t.setIntent(TaskIntent.ORDER); + // t.setAuthoredOn(new Date()); + // + // Reference requester = new Reference().setType("Organization"); + // requester.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + // .setValue("External_Test_Organization"); + // t.setRequester(requester); + // + // Reference localOrg = new Reference(); + // localOrg.setType("Organization").getIdentifier() + // .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + // .setValue("Test_Organization"); + // t.getRestriction().addRecipient(localOrg); + // + // ParameterComponent in1 = t.addInput(); + // in1.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("message-name"); + // in1.setValue(new StringType("pingMessage")); + // + // ParameterComponent in2 = t.addInput(); + // in2.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("business-key"); + // in2.setValue(new StringType(UUID.randomUUID().toString())); + // + // ParameterComponent in3 = t.addInput(); + // in3.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("correlation-key"); + // in3.setValue(new StringType(UUID.randomUUID().toString())); + // + // getExternalWebserviceClient().create(t); + // } + + // TODO create test setup for testing against process profiles + // @Test + // public void testCreateTaskContinuePingProcessAllowedForRemoteUser() throws Exception + // { + // OrganizationProvider organizationProvider = getSpringWebApplicationContext() + // .getBean(OrganizationProvider.class); + // assertNotNull(organizationProvider); + // + // Task t = new Task(); + // t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-pong"); + // t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + // t.setStatus(TaskStatus.REQUESTED); + // t.setIntent(TaskIntent.ORDER); + // t.setAuthoredOn(new Date()); + // + // Reference requester = new Reference().setType("Organization"); + // requester.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + // .setValue("External_Test_Organization"); + // t.setRequester(requester); + // + // Reference localOrg = new Reference(); + // localOrg.setType("Organization").getIdentifier() + // .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + // .setValue("Test_Organization"); + // t.getRestriction().addRecipient(localOrg); + // + // ParameterComponent in1 = t.addInput(); + // in1.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("message-name"); + // in1.setValue(new StringType("pongMessage")); + // + // ParameterComponent in2 = t.addInput(); + // in2.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("business-key"); + // in2.setValue(new StringType(UUID.randomUUID().toString())); + // + // ParameterComponent in3 = t.addInput(); + // in3.getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("correlation-key"); + // in3.setValue(new StringType(UUID.randomUUID().toString())); + // + // getExternalWebserviceClient().create(t); + // } + + // TODO create test setup for testing against process profiles + // @Test + // public void testUpdateTaskStartPingProcessStatusRequestedToInProgress() throws Exception + // { + // OrganizationProvider organizationProvider = getSpringWebApplicationContext() + // .getBean(OrganizationProvider.class); + // assertNotNull(organizationProvider); + // + // Task t = new Task(); + // t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); + // t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + // t.setStatus(TaskStatus.REQUESTED); + // t.setIntent(TaskIntent.ORDER); + // t.setAuthoredOn(new Date()); + // Reference localOrg = new Reference(); + // localOrg.setType("Organization").getIdentifier() + // .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + // .setValue("Test_Organization"); + // t.setRequester(localOrg); + // t.getRestriction().addRecipient(localOrg); + // t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("message-name"); + // t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); + // + // TaskDao dao = getSpringWebApplicationContext().getBean(TaskDao.class); + // Task created = dao.create(t); + // + // created.setStatus(TaskStatus.INPROGRESS); + // + // getWebserviceClient().update(created); + // } + + // TODO create test setup for testing against process profiles + // @Test + // public void testUpdateTaskStartPingProcessStatusInProgressToCompleted() throws Exception + // { + // OrganizationProvider organizationProvider = getSpringWebApplicationContext() + // .getBean(OrganizationProvider.class); + // assertNotNull(organizationProvider); + // + // Task t = new Task(); + // t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); + // t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + // t.setStatus(TaskStatus.INPROGRESS); + // t.setIntent(TaskIntent.ORDER); + // t.setAuthoredOn(new Date()); + // + // Reference localOrg = new Reference(); + // localOrg.setType("Organization").getIdentifier() + // .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + // .setValue("Test_Organization"); + // t.setRequester(localOrg); + // t.getRestriction().addRecipient(localOrg); + // + // t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("message-name"); + // t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); + // + // TaskDao dao = getSpringWebApplicationContext().getBean(TaskDao.class); + // Task created = dao.create(t); + // + // created.setStatus(TaskStatus.COMPLETED); + // + // getWebserviceClient().update(created); + // } @Test public void testCreateForbiddenLocalUserIllegalStatus() throws Exception @@ -335,12 +336,13 @@ public void testCreateForbiddenLocalUserIllegalStatus() throws Exception .getBean(OrganizationProvider.class); assertNotNull(organizationProvider); - EnumSet<TaskStatus> illegalCreateStates = EnumSet.of(TaskStatus.RECEIVED, TaskStatus.ACCEPTED, - TaskStatus.REJECTED, TaskStatus.READY, TaskStatus.CANCELLED, TaskStatus.INPROGRESS, TaskStatus.ONHOLD, - TaskStatus.FAILED, TaskStatus.COMPLETED, TaskStatus.ENTEREDINERROR, TaskStatus.NULL); + EnumSet<TaskStatus> illegalCreateStates = EnumSet + .of(TaskStatus.RECEIVED, TaskStatus.ACCEPTED, TaskStatus.REJECTED, TaskStatus.READY, + TaskStatus.CANCELLED, TaskStatus.INPROGRESS, TaskStatus.ONHOLD, TaskStatus.FAILED, + TaskStatus.COMPLETED, TaskStatus.ENTEREDINERROR, TaskStatus.NULL); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setAuthoredOn(new Date()); @@ -368,12 +370,13 @@ public void testCreateForbiddenExternalUserIllegalStatus() throws Exception .getBean(OrganizationProvider.class); assertNotNull(organizationProvider); - EnumSet<TaskStatus> illegalCreateStates = EnumSet.of(TaskStatus.RECEIVED, TaskStatus.ACCEPTED, - TaskStatus.REJECTED, TaskStatus.READY, TaskStatus.CANCELLED, TaskStatus.INPROGRESS, TaskStatus.ONHOLD, - TaskStatus.FAILED, TaskStatus.COMPLETED, TaskStatus.ENTEREDINERROR, TaskStatus.NULL); + EnumSet<TaskStatus> illegalCreateStates = EnumSet + .of(TaskStatus.RECEIVED, TaskStatus.ACCEPTED, TaskStatus.REJECTED, TaskStatus.READY, + TaskStatus.CANCELLED, TaskStatus.INPROGRESS, TaskStatus.ONHOLD, TaskStatus.FAILED, + TaskStatus.COMPLETED, TaskStatus.ENTEREDINERROR, TaskStatus.NULL); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-ping"); t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setAuthoredOn(new Date()); @@ -417,7 +420,7 @@ public void testCreateForbiddenLocalUserNotPartOfRequesterOrganization() throws assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -454,7 +457,7 @@ public void testCreateForbiddenExternalUserNotPartOfRequesterOrganization() thro assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-ping"); t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -489,7 +492,7 @@ public void testCreateForbiddenLocalUserRestrictionRecipientNotValidByLocalUser( assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -542,7 +545,7 @@ public void testCreateForbiddenLocalUserRestrictionRecipientNotValidByExternalUs assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-ping"); t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -597,7 +600,7 @@ public void testCreateForbiddenInstantiatesUriNotValidByLocalUser() throws Excep assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); // t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -624,7 +627,7 @@ public void testCreateForbiddenInstantiatesUriNotValidByExternalUser() throws Ex assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-ping"); // t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -654,7 +657,7 @@ public void testCreateForbiddenInputNotValidByLocalUser() throws Exception assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -717,7 +720,7 @@ public void testCreateForbiddenInputNotValidByExternalUser() throws Exception assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-ping"); t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -783,7 +786,7 @@ public void testCreateForbiddenOutputNotValidByLocalUser() throws Exception assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -808,7 +811,7 @@ public void testCreateForbiddenOutputNotValidByExternalUser() throws Exception assertNotNull(organizationProvider); Task t = new Task(); - t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-ping"); + t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-ping"); t.setInstantiatesUri("http://highmed.org/bpe/Process/pong/0.3.0"); t.setIntent(TaskIntent.ORDER); t.setStatus(TaskStatus.DRAFT); @@ -828,55 +831,55 @@ public void testCreateForbiddenOutputNotValidByExternalUser() throws Exception testCreateExpectForbidden(getExternalWebserviceClient(), t); } -// TODO create test setup for testing against process profiles -// @Test -// public void testSearchByStatusRequested() throws Exception -// { -// Task t = new Task(); -// t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-task-start-ping-process"); -// t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); -// t.setStatus(TaskStatus.REQUESTED); -// t.setIntent(TaskIntent.ORDER); -// t.setAuthoredOn(new Date()); -// Reference localOrg = new Reference(); -// localOrg.setType("Organization").getIdentifier() -// .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") -// .setValue("Test_Organization"); -// t.setRequester(localOrg); -// t.getRestriction().addRecipient(localOrg); -// t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") -// .setCode("message-name"); -// t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); -// -// getWebserviceClient().create(t); -// -// Bundle searchResult = getWebserviceClient().searchWithStrictHandling(Task.class, Map.of("status", -// Collections.singletonList("requested"), "_sort", Collections.singletonList("_lastUpdated"))); -// assertNotNull(searchResult); -// assertEquals(1, searchResult.getTotal()); -// assertTrue(searchResult.hasEntry()); -// assertNotNull(searchResult.getEntry()); -// assertEquals(1, searchResult.getEntry().size()); -// assertTrue(searchResult.getEntryFirstRep().hasResource()); -// assertNotNull(searchResult.getEntryFirstRep().getResource()); -// assertTrue(searchResult.getEntryFirstRep().getResource() instanceof Task); -// -// Task result = (Task) searchResult.getEntryFirstRep().getResource(); -// assertTrue(result.hasRequester()); -// assertTrue(result.hasRestriction()); -// assertTrue(result.getRestriction().hasRecipient()); -// assertNotNull(result.getRestriction().getRecipient()); -// assertEquals(1, result.getRestriction().getRecipient().size()); -// assertNotNull(result.getRestriction().getRecipientFirstRep()); -// -// Reference ref = result.getRestriction().getRecipientFirstRep(); -// assertFalse(ref.hasReference()); -// assertNull(ref.getReference()); -// assertTrue(ref.hasIdentifier()); -// assertNotNull(ref.getIdentifier()); -// assertTrue(ref.getIdentifier().hasSystem()); -// assertNotNull(ref.getIdentifier().getSystem()); -// assertTrue(ref.getIdentifier().hasValue()); -// assertNotNull(ref.getIdentifier().getValue()); -// } + // TODO create test setup for testing against process profiles + // @Test + // public void testSearchByStatusRequested() throws Exception + // { + // Task t = new Task(); + // t.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/task-start-ping-process"); + // t.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.3.0"); + // t.setStatus(TaskStatus.REQUESTED); + // t.setIntent(TaskIntent.ORDER); + // t.setAuthoredOn(new Date()); + // Reference localOrg = new Reference(); + // localOrg.setType("Organization").getIdentifier() + // .setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + // .setValue("Test_Organization"); + // t.setRequester(localOrg); + // t.getRestriction().addRecipient(localOrg); + // t.getInputFirstRep().getType().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/bpmn-message") + // .setCode("message-name"); + // t.getInputFirstRep().setValue(new StringType("startPingProcessMessage")); + // + // getWebserviceClient().create(t); + // + // Bundle searchResult = getWebserviceClient().searchWithStrictHandling(Task.class, Map.of("status", + // Collections.singletonList("requested"), "_sort", Collections.singletonList("_lastUpdated"))); + // assertNotNull(searchResult); + // assertEquals(1, searchResult.getTotal()); + // assertTrue(searchResult.hasEntry()); + // assertNotNull(searchResult.getEntry()); + // assertEquals(1, searchResult.getEntry().size()); + // assertTrue(searchResult.getEntryFirstRep().hasResource()); + // assertNotNull(searchResult.getEntryFirstRep().getResource()); + // assertTrue(searchResult.getEntryFirstRep().getResource() instanceof Task); + // + // Task result = (Task) searchResult.getEntryFirstRep().getResource(); + // assertTrue(result.hasRequester()); + // assertTrue(result.hasRestriction()); + // assertTrue(result.getRestriction().hasRecipient()); + // assertNotNull(result.getRestriction().getRecipient()); + // assertEquals(1, result.getRestriction().getRecipient().size()); + // assertNotNull(result.getRestriction().getRecipientFirstRep()); + // + // Reference ref = result.getRestriction().getRecipientFirstRep(); + // assertFalse(ref.hasReference()); + // assertNull(ref.getReference()); + // assertTrue(ref.hasIdentifier()); + // assertNotNull(ref.getIdentifier()); + // assertTrue(ref.getIdentifier().hasSystem()); + // assertNotNull(ref.getIdentifier().getSystem()); + // assertTrue(ref.getIdentifier().hasValue()); + // assertNotNull(ref.getIdentifier().getValue()); + // } } diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/bundle.xml b/dsf-fhir/dsf-fhir-server/src/test/resources/bundle.xml index f961571a8..3452c077b 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/resources/bundle.xml +++ b/dsf-fhir/dsf-fhir-server/src/test/resources/bundle.xml @@ -13,7 +13,7 @@ <fullUrl value="urn:uuid:ca7b7dcd-818b-4c57-849c-61c6fbf41f6a"></fullUrl> <resource> <Organization xmlns="http://hl7.org/fhir"> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="821be11d134e7070e3bcc402032fdab9d8ee865ef2b98ac70605864572fcd4e13cd55cb9d3841785a497234f1fb8447434cd07ca47e524db36fcfcccdea0d56f"></valueString> </extension> @@ -78,7 +78,7 @@ <fullUrl value="urn:uuid:c87d9528-a25f-4349-9d0e-5ffef0b4f090"></fullUrl> <resource> <Organization xmlns="http://hl7.org/fhir"> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="532a7736fd2187c4895765fa211cd076e70d0e9405c466b650ca3c2e89b9cd796a063f1840f26b6422b08aafdaff677fb53bec14916185355ae1b6ee1b0afc5f"></valueString> </extension> @@ -143,7 +143,7 @@ <fullUrl value="urn:uuid:e3dd1182-b396-406d-b8a2-9bb199a6731b"></fullUrl> <resource> <Organization xmlns="http://hl7.org/fhir"> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="f143826e22f1a95830ab32dde7b388c154039ed0633c9b0d1526078a9ee7f403540e3cd3459331a3c2caf72e006daff2f71ab7cd2136272e5e022ef392c32246"></valueString> </extension> @@ -208,7 +208,7 @@ <fullUrl value="urn:uuid:c656a1a4-e2d4-452e-ae69-b527fe5a42b7"></fullUrl> <resource> <Organization xmlns="http://hl7.org/fhir"> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="e4af921e6cbc35032ddb21b8a36f366ff7605bdb20bddddcbca6bcc437239b58e9189dfea3a66c584a9bb0a6006c243031c6c5504a43d059afa629d24f8b55bb"></valueString> </extension> diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/allow-list.json b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/allow-list.json index e4e73341a..cfa95e84d 100644 --- a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/allow-list.json +++ b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/allow-list.json @@ -17,7 +17,7 @@ "resource": { "resourceType": "Organization", "meta": { - "profile": ["http://highmed.org/fhir/StructureDefinition/highmed-organization"], + "profile": ["http://highmed.org/fhir/StructureDefinition/organization"], "tag": [{ "system": "http://highmed.org/fhir/CodeSystem/authorization-role", "code": "REMOTE" @@ -25,7 +25,7 @@ ] }, "extension": [{ - "url": "http://highmed.org/fhir/StructureDefinition/certificate-thumbprint", + "url": "http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint", "valueString": "b72203e163acc1bfd9c2db24c248b36cea282b5986b70e5c40ee33599c34e1b00d2bdea1598663a61a8441024f40b4924a453ed75108eeb2a7f7b9a2027871bc" } ], @@ -59,7 +59,7 @@ "resource": { "resourceType": "Endpoint", "meta": { - "profile": ["http://highmed.org/fhir/StructureDefinition/highmed-endpoint"], + "profile": ["http://highmed.org/fhir/StructureDefinition/endpoint"], "tag": [{ "system": "http://highmed.org/fhir/CodeSystem/authorization-role", "code": "REMOTE" @@ -101,7 +101,7 @@ "resource": { "resourceType": "Organization", "meta": { - "profile": ["http://highmed.org/fhir/StructureDefinition/highmed-organization"], + "profile": ["http://highmed.org/fhir/StructureDefinition/organization"], "tag": [{ "system": "http://highmed.org/fhir/CodeSystem/authorization-role", "code": "REMOTE" @@ -109,7 +109,7 @@ ] }, "extension": [{ - "url": "http://highmed.org/fhir/StructureDefinition/certificate-thumbprint", + "url": "http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint", "valueString": "fe9b49ccf259929485e55f8a03c1d74c147bd374debdc0c4ef48f75e74cdfd03e19cc2f79da1f53acd433734acae017c8d01c30f448675a1e77f0b80adf7023b" } ], @@ -143,7 +143,7 @@ "resource": { "resourceType": "Endpoint", "meta": { - "profile": ["http://highmed.org/fhir/StructureDefinition/highmed-endpoint"], + "profile": ["http://highmed.org/fhir/StructureDefinition/endpoint"], "tag": [{ "system": "http://highmed.org/fhir/CodeSystem/authorization-role", "code": "REMOTE" @@ -185,7 +185,7 @@ "resource": { "resourceType": "Organization", "meta": { - "profile": ["http://highmed.org/fhir/StructureDefinition/highmed-organization"], + "profile": ["http://highmed.org/fhir/StructureDefinition/organization"], "tag": [{ "system": "http://highmed.org/fhir/CodeSystem/authorization-role", "code": "REMOTE" @@ -193,7 +193,7 @@ ] }, "extension": [{ - "url": "http://highmed.org/fhir/StructureDefinition/certificate-thumbprint", + "url": "http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint", "valueString": "dc737f1a58605847002d422dc36127e6418c8b9cb295517ff4d8684af64aed49290729e8f9315ef5189b80dcaa9ccd3fdc4aa0210e425218de98c85145f3e88d" } ], @@ -227,7 +227,7 @@ "resource": { "resourceType": "Endpoint", "meta": { - "profile": ["http://highmed.org/fhir/StructureDefinition/highmed-endpoint"], + "profile": ["http://highmed.org/fhir/StructureDefinition/endpoint"], "tag": [{ "system": "http://highmed.org/fhir/CodeSystem/authorization-role", "code": "REMOTE" @@ -269,7 +269,7 @@ "resource": { "resourceType": "Organization", "meta": { - "profile": ["http://highmed.org/fhir/StructureDefinition/highmed-organization"], + "profile": ["http://highmed.org/fhir/StructureDefinition/organization"], "tag": [{ "system": "http://highmed.org/fhir/CodeSystem/authorization-role", "code": "REMOTE" @@ -277,7 +277,7 @@ ] }, "extension": [{ - "url": "http://highmed.org/fhir/StructureDefinition/certificate-thumbprint", + "url": "http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint", "valueString": "c1fdddaeff1cb9937a3ee7be7edcb43bd21d907c7f8060602d276b7c51662e8d023c0991262c7d89dfc8060b2a6f9f4b03258676ee6d9676569fb3d207cf828a" } ], @@ -311,7 +311,7 @@ "resource": { "resourceType": "Endpoint", "meta": { - "profile": ["http://highmed.org/fhir/StructureDefinition/highmed-endpoint"], + "profile": ["http://highmed.org/fhir/StructureDefinition/endpoint"], "tag": [{ "system": "http://highmed.org/fhir/CodeSystem/authorization-role", "code": "REMOTE" diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/task-bundle.json b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/task-bundle.json index 4770ab4d6..ea1a881d3 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/task-bundle.json +++ b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/task-bundle.json @@ -7,7 +7,7 @@ "resource": { "resourceType": "Group", "meta": { - "profile": "http://highmed.org/fhir/StructureDefinition/highmed-group" + "profile": "http://highmed.org/fhir/StructureDefinition/group" }, "text": { "div": "This is the description", @@ -17,7 +17,7 @@ "actual": false, "extension": [ { - "url": "http://highmed.org/fhir/StructureDefinition/query", + "url": "http://highmed.org/fhir/StructureDefinition/extension-query", "valueExpression": [ { "language": "application/x-aql-query", @@ -37,7 +37,7 @@ "resource": { "resourceType": "Group", "meta": { - "profile": "http://highmed.org/fhir/StructureDefinition/highmed-group" + "profile": "http://highmed.org/fhir/StructureDefinition/group" }, "text": { "div": "This is the description", @@ -47,7 +47,7 @@ "actual": false, "extension": [ { - "url": "http://highmed.org/fhir/StructureDefinition/query", + "url": "http://highmed.org/fhir/StructureDefinition/extension-query", "valueExpression": [ { "language": "application/x-aql-query", @@ -67,10 +67,10 @@ "resource": { "resourceType": "ResearchStudy", "meta": { - "profile": [ "http://highmed.org/fhir/StructureDefinition/highmed-research-study-feasibility" ] + "profile": [ "http://highmed.org/fhir/StructureDefinition/research-study-feasibility" ] }, "extension": [ { - "url": "http://highmed.org/fhir/StructureDefinition/participating-medic", + "url": "http://highmed.org/fhir/StructureDefinition/extension-participating-medic", "valueReference": { "type": "Organization", "identifier": { @@ -79,7 +79,7 @@ } } }, { - "url": "http://highmed.org/fhir/StructureDefinition/participating-ttp", + "url": "http://highmed.org/fhir/StructureDefinition/extension-participating-ttp", "valueReference": { "type": "Organization", "identifier": { @@ -108,7 +108,7 @@ "fullUrl": "urn:uuid:bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "resource": { "resourceType": "Task", - "instantiatesUri": "http://highmed.org/bpe/Process/requestSimpleFeasibility/0.3.0", + "instantiatesUri": "http://highmed.org/bpe/Process/requestFeasibility/0.3.0", "status": "requested", "intent": "order", "requester": { @@ -139,7 +139,7 @@ } ] }, - "valueString": "requestSimpleFeasibilityMessage" + "valueString": "requestFeasibilityMessage" }, { "type": { diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/test-bundle.xml b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/test-bundle.xml index b1b125f6a..d424fd3eb 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/test-bundle.xml +++ b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/test-bundle.xml @@ -9,9 +9,9 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <profile value="http://highmed.org/fhir/StructureDefinition/organization"/> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -46,7 +46,7 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint"/> + <profile value="http://highmed.org/fhir/StructureDefinition/endpoint"/> </meta> <identifier> <system value="http://highmed.org/fhir/NamingSystem/endpoint-identifier"/> @@ -87,9 +87,9 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <profile value="http://highmed.org/fhir/StructureDefinition/organization"/> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -124,7 +124,7 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint"/> + <profile value="http://highmed.org/fhir/StructureDefinition/endpoint"/> </meta> <identifier> <system value="http://highmed.org/fhir/NamingSystem/endpoint-identifier"/> diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-endpoint-0.5.0.xml b/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-endpoint-0.5.0.xml index df8ca636d..8a8da3812 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-endpoint-0.5.0.xml +++ b/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-endpoint-0.5.0.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <StructureDefinition xmlns="http://hl7.org/fhir"> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint"/> + <url value="http://highmed.org/fhir/StructureDefinition/endpoint"/> <version value="0.5.0"/> <name value="Endpoint"/> <status value="draft"/> @@ -43,7 +43,7 @@ <min value="1"/> <type> <code value="Reference"/> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/organization"/> </type> </element> </differential> diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-extension-certificate-thumbprint-0.5.0.xml b/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-extension-certificate-thumbprint-0.5.0.xml index 8d7301d24..609a6085b 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-extension-certificate-thumbprint-0.5.0.xml +++ b/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-extension-certificate-thumbprint-0.5.0.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <StructureDefinition xmlns="http://hl7.org/fhir"> - <url value="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"/> + <url value="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"/> <version value="0.5.0"/> <name value="CertificateThumbprint"/> <status value="draft"/> @@ -21,7 +21,7 @@ <type> <code value="uri"/> </type> - <fixedUri value="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"/> + <fixedUri value="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"/> </element> <element id="Extension.value[x]"> <path value="Extension.value[x]"/> diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-organization-0.5.0.xml b/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-organization-0.5.0.xml index ed8d3b1d5..21f075861 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-organization-0.5.0.xml +++ b/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-organization-0.5.0.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <StructureDefinition xmlns="http://hl7.org/fhir"> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <url value="http://highmed.org/fhir/StructureDefinition/organization"/> <version value="0.5.0"/> <name value="Organization"/> <status value="active"/> @@ -28,7 +28,7 @@ <min value="1"/> <type> <code value="Extension"/> - <profile value="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"/> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"/> </type> </element> <element id="Organization.identifier"> @@ -56,7 +56,7 @@ <path value="Organization.identifier.value"/> <binding> <strength value="required"/> - <valueSet value="http://highmed.org/fhir/ValueSet/highmed-organization"/> + <valueSet value="http://highmed.org/fhir/ValueSet/organization"/> </binding> </element> <element id="Organization.endpoint"> @@ -64,7 +64,7 @@ <min value="1"/> <type> <code value="Reference"/> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint"/> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/endpoint"/> </type> </element> </differential> diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-task-0.5.0.xml b/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-task-0.5.0.xml index 4c074986b..9bc6ce1a9 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-task-0.5.0.xml +++ b/dsf-fhir/dsf-fhir-server/src/test/resources/profiles/highmed-task-0.5.0.xml @@ -44,7 +44,7 @@ <min value="1"/> <type> <code value="Reference"/> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/organization"/> </type> </element> <element id="Task.restriction"> @@ -57,7 +57,7 @@ <max value="1"/> <type> <code value="Reference"/> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/organization"/> </type> </element> <element id="Task.input"> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-authorization-role-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-authorization-role-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-authorization-role-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/authorization-role-0.4.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-authorization-role-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-bpmn-message-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-bpmn-message-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-bpmn-message-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/bpmn-message-0.4.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-bpmn-message-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-organization-type-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-organization-type-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-organization-type-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/organization-type-0.4.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-organization-type-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml index 4bc178191..a3100834f 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint" /> + <url value="http://highmed.org/fhir/StructureDefinition/endpoint" /> <version value="0.4.0" /> <name value="Endpoint" /> <status value="active" /> @@ -63,7 +63,7 @@ <min value="1" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-organization" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/organization" /> </type> </element> <element id="Endpoint.managingOrganization.reference"> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post index bb1fa39c9..0c40562d7 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-endpoint&version=0.4.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/endpoint&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml index 1d90b2e0b..5a02c11df 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint" /> + <url value="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint" /> <version value="0.4.0" /> <name value="CertificateThumbprint" /> <status value="active" /> @@ -27,7 +27,7 @@ <type> <code value="uri" /> </type> - <fixedUri value="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint" /> + <fixedUri value="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint" /> </element> <element id="Extension.value[x]"> <path value="Extension.value[x]" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post index edbc79985..10e2c168c 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/certificate-thumbprint&version=0.4.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml index 476fe4928..029b2ab83 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/process-authorization" /> + <url value="http://highmed.org/fhir/StructureDefinition/extension-process-authorization" /> <version value="0.4.0" /> <name value="ProcessAuthorization" /> <status value="active" /> @@ -216,7 +216,7 @@ </element> <element id="Extension.url"> <path value="Extension.url" /> - <fixedUri value="http://highmed.org/fhir/StructureDefinition/process-authorization" /> + <fixedUri value="http://highmed.org/fhir/StructureDefinition/extension-process-authorization" /> </element> <element id="Extension.value[x]"> <path value="Extension.value[x]" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post index 197c68b47..aa0918d21 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/process-authorization&version=0.4.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/extension-process-authorization&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml index aacddebc5..76ea5304a 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-organization" /> + <url value="http://highmed.org/fhir/StructureDefinition/organization" /> <version value="0.4.0" /> <name value="Organization" /> <status value="active" /> @@ -34,7 +34,7 @@ <min value="1" /> <type> <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint" /> + <profile value="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint" /> </type> </element> <element id="Organization.identifier"> @@ -125,7 +125,7 @@ <max value="1" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/endpoint" /> </type> </element> <element id="Organization.endpoint.reference"> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post index 717820181..1b871f980 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-organization&version=0.4.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/organization&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml index 9f020332f..dfe995620 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml @@ -5,7 +5,7 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/highmed-task-base" /> + <url value="http://highmed.org/fhir/StructureDefinition/task-base" /> <version value="0.4.0" /> <name value="TaskBase" /> <status value="active" /> @@ -35,7 +35,7 @@ <min value="1" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-organization" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/organization" /> </type> </element> <element id="Task.requester.reference"> @@ -65,7 +65,7 @@ <max value="1" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/highmed-organization" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/organization" /> </type> </element> <element id="Task.restriction.recipient.reference"> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post index 2d98cb30e..15d375b52 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml.post @@ -1 +1 @@ -url=http://highmed.org/fhir/StructureDefinition/highmed-task-base&version=0.4.0 \ No newline at end of file +url=http://highmed.org/fhir/StructureDefinition/task-base&version=0.4.0 \ No newline at end of file diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/highmed-bpmn-task-subscription.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/highmed-bpmn-task-subscription.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/highmed-bpmn-task-subscription.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/bpmn-task-subscription.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/Subscription/highmed-bpmn-task-subscription.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-authorization-role-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-authorization-role-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-authorization-role-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/authorization-role-0.4.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-authorization-role-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-bpmn-message-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-bpmn-message-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-bpmn-message-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/bpmn-message-0.4.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-bpmn-message-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-organization-type-0.4.0.xml similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-organization-type-0.4.0.xml diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-organization-type-0.4.0.xml.post similarity index 100% rename from dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/organization-type-0.4.0.xml.post rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-organization-type-0.4.0.xml.post diff --git a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java index a5f5b36ad..b7f0988ae 100644 --- a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/EndpointProfileTest.java @@ -26,8 +26,8 @@ public class EndpointProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-endpoint-0.4.0.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "urn_ietf_bcp_13.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "valueset-mimetypes.xml")); + Arrays.asList("highmed-authorization-role-0.4.0.xml", "urn_ietf_bcp_13.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "valueset-mimetypes.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -36,7 +36,7 @@ public class EndpointProfileTest public void testEndpointProfileValid() throws Exception { Endpoint endpoint = new Endpoint(); - endpoint.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-endpoint"); + endpoint.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/endpoint"); endpoint.getMeta().addTag().setSystem("http://highmed.org/fhir/CodeSystem/authorization-role") .setCode("REMOTE"); endpoint.getIdentifierFirstRep().setSystem("http://highmed.org/fhir/NamingSystem/endpoint-identifier") @@ -52,10 +52,12 @@ public void testEndpointProfileValid() throws Exception endpoint.setAddress("https://fhir.test.com/fhir"); ValidationResult result = resourceValidator.validate(endpoint); - result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" - + m.getLocationCol() + " - " + m.getSeverity() + ": " + m.getMessage()).forEach(logger::info); + result.getMessages().stream() + .map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + m.getLocationCol() + " - " + m + .getSeverity() + ": " + m.getMessage()).forEach(logger::info); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } } diff --git a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java index c9441d05f..3479243dd 100755 --- a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/OrganizationProfileTest.java @@ -26,8 +26,8 @@ public class OrganizationProfileTest public static final ValidationSupportRule validationRule = new ValidationSupportRule( Arrays.asList("highmed-organization-0.4.0.xml", "highmed-extension-certificate-thumbprint-0.4.0.xml", "highmed-endpoint-0.4.0.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "organization-type-0.4.0.xml"), - Arrays.asList("authorization-role-0.4.0.xml", "organization-type-0.4.0.xml")); + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-organization-type-0.4.0.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-organization-type-0.4.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); @@ -36,80 +36,88 @@ public class OrganizationProfileTest public void testOrganizationProfileValid() throws Exception { Organization org = new Organization(); - org.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-organization"); + org.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/organization"); org.addIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test"); org.setActive(true); org.getTypeFirstRep().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/organization-type") .setCode("TTP"); org.addEndpoint().setReference("Endpoint/" + UUID.randomUUID().toString()); - org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint") + org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint") .setValue(new StringType("A2BF39FF2A7E3D218A32AADE3B2AAA1F")); ValidationResult result = resourceValidator.validate(org); - result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" - + m.getLocationCol() + " - " + m.getSeverity() + ": " + m.getMessage()).forEach(logger::info); + result.getMessages().stream() + .map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + m.getLocationCol() + " - " + m + .getSeverity() + ": " + m.getMessage()).forEach(logger::info); - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test public void testOrganizationProfileNotValid1() throws Exception { Organization org = new Organization(); - org.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-organization"); + org.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/organization"); org.addIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test"); org.setActive(true); org.getTypeFirstRep().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/organization-type") .setCode("NON_EXISTING_CODE"); org.addEndpoint().setReference("Endpoint/" + UUID.randomUUID().toString()); - org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint") + org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint") .setValue(new StringType("A2BF39FF2A7E3D218A32AADE3B2AAA1F")); ValidationResult result = resourceValidator.validate(org); - result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" - + m.getLocationCol() + " - " + m.getSeverity() + ": " + m.getMessage()).forEach(logger::info); + result.getMessages().stream() + .map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + m.getLocationCol() + " - " + m + .getSeverity() + ": " + m.getMessage()).forEach(logger::info); - assertEquals(2, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(2, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test public void testOrganizationProfileNotValid2() throws Exception { Organization org = new Organization(); - org.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-organization"); + org.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/organization"); org.addIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test"); org.setActive(true); org.getTypeFirstRep().getCodingFirstRep().setSystem("http://highmed.org/fhir/CodeSystem/organization-type"); org.addEndpoint().setReference("Endpoint/" + UUID.randomUUID().toString()); - org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint") + org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint") .setValue(new StringType("A2BF39FF2A7E3D218A32AADE3B2AAA1F")); ValidationResult result = resourceValidator.validate(org); - result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" - + m.getLocationCol() + " - " + m.getSeverity() + ": " + m.getMessage()).forEach(logger::info); + result.getMessages().stream() + .map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + m.getLocationCol() + " - " + m + .getSeverity() + ": " + m.getMessage()).forEach(logger::info); - assertEquals(2, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(2, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } @Test public void testOrganizationProfileNotValid3() throws Exception { Organization org = new Organization(); - org.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/highmed-organization"); + org.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/organization"); org.addIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier").setValue("Test"); org.setActive(true); org.addEndpoint().setReference("Endpoint/" + UUID.randomUUID().toString()); - org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint") + org.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint") .setValue(new StringType("A2BF39FF2A7E3D218A32AADE3B2AAA1F")); ValidationResult result = resourceValidator.validate(org); - result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" - + m.getLocationCol() + " - " + m.getSeverity() + ": " + m.getMessage()).forEach(logger::info); + result.getMessages().stream() + .map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + m.getLocationCol() + " - " + m + .getSeverity() + ": " + m.getMessage()).forEach(logger::info); - assertEquals(2, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); + assertEquals(2, result.getMessages().stream() + .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL + .equals(m.getSeverity())).count()); } } diff --git a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java index da9816a2b..152c93ca0 100755 --- a/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/validation/ValueSetExpanderTest.java @@ -44,15 +44,14 @@ public Locale getLocale() var validationSupport = new ValidationSupportChain(new InMemoryTerminologyServerValidationSupport(fhirContext), new ValidationSupportWithCustomResources(fhirContext, Collections.emptyList(), readCodeSystems(), - Collections.emptyList()), - new DefaultProfileValidationSupport(fhirContext)); + Collections.emptyList()), new DefaultProfileValidationSupport(fhirContext)); valueSetExpander = new ValueSetExpanderImpl(fhirContext, validationSupport); } private List<CodeSystem> readCodeSystems() { - return Stream.of("authorization-role-0.4.0.xml", "bpmn-message-0.4.0.xml") + return Stream.of("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml") .map(file -> "/fhir/CodeSystem/" + file).map(this::readCodeSystem).collect(Collectors.toList()); } @@ -72,7 +71,7 @@ private CodeSystem readCodeSystem(String file) public void testExpandFeasibility() throws Exception { ValueSetExpansionOutcome out = valueSetExpander - .expand(readValueSet("/fhir/ValueSet/authorization-role-0.4.0.xml")); + .expand(readValueSet("/fhir/ValueSet/highmed-authorization-role-0.4.0.xml")); assertNotNull(out); assertNull(out.getError()); diff --git a/dsf-tools/dsf-tools-bundle-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java b/dsf-tools/dsf-tools-bundle-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java index e177ab767..5ab579ea5 100755 --- a/dsf-tools/dsf-tools-bundle-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java +++ b/dsf-tools/dsf-tools-bundle-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java @@ -63,8 +63,7 @@ public Bundle generateBundle() throws IOException Bundle bundle = new Bundle(); bundle.setType(BundleType.TRANSACTION); - BundleEntryPutReader putReader = (resource, resourceFile, putFile) -> - { + BundleEntryPutReader putReader = (resource, resourceFile, putFile) -> { logger.debug("Reading {} at {} with put file {}", resource.getSimpleName(), resourceFile.toString(), putFile.toString()); @@ -84,8 +83,7 @@ public Bundle generateBundle() throws IOException } }; - BundleEntryPostReader postReader = (resource, resourceFile, postFile) -> - { + BundleEntryPostReader postReader = (resource, resourceFile, postFile) -> { logger.info("Reading {} at {} with post file {}", resource.getSimpleName(), resourceFile.toString(), postFile.toString()); @@ -127,8 +125,7 @@ private void generateStructureDefinitionSnapshots(Bundle bundle, IValidationSupp bundle.getEntry().stream().map(e -> e.getResource()).filter(r -> r instanceof StructureDefinition) .map(r -> (StructureDefinition) r).sorted(Comparator.comparing(StructureDefinition::getUrl).reversed()) - .forEach(s -> - { + .forEach(s -> { if (!s.hasSnapshot()) generator.generateSnapshot(s); }); @@ -139,8 +136,7 @@ private void expandValueSets(Bundle bundle, ValidationSupportChain validationSup ValueSetExpander valueSetExpander = new ValueSetExpander(fhirContext, validationSupport); bundle.getEntry().stream().map(e -> e.getResource()).filter(r -> r instanceof ValueSet).map(r -> (ValueSet) r) - .forEach(v -> - { + .forEach(v -> { if (!v.hasExpansion()) valueSetExpander.expand(v); }); diff --git a/dsf-tools/dsf-tools-test-data-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java b/dsf-tools/dsf-tools-test-data-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java index 594b002d1..f7a02a18f 100755 --- a/dsf-tools/dsf-tools-test-data-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java +++ b/dsf-tools/dsf-tools-test-data-generator/src/main/java/org/highmed/dsf/tools/generator/BundleGenerator.java @@ -85,7 +85,7 @@ public void createTestBundle(Map<String, CertificateFiles> clientCertificateFile Organization organization = (Organization) testBundle.getEntry().get(0).getResource(); Extension thumbprintExtension = organization - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); thumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("test-client").getCertificateSha512ThumbprintHex())); @@ -122,13 +122,13 @@ private void createDockerTestMedic1Bundle(Map<String, CertificateFiles> clientCe Organization organizationTtp = (Organization) medic1Bundle.getEntry().get(0).getResource(); Extension organizationTtpThumbprintExtension = organizationTtp - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationTtpThumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("ttp-client").getCertificateSha512ThumbprintHex())); Organization organizationMedic1 = (Organization) medic1Bundle.getEntry().get(1).getResource(); Extension organizationMedic1thumbprintExtension = organizationMedic1 - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationMedic1thumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("medic1-client").getCertificateSha512ThumbprintHex())); @@ -143,13 +143,13 @@ private void createDockerTestMedic2Bundle(Map<String, CertificateFiles> clientCe Organization organizationTtp = (Organization) medic2Bundle.getEntry().get(0).getResource(); Extension organizationTtpThumbprintExtension = organizationTtp - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationTtpThumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("ttp-client").getCertificateSha512ThumbprintHex())); Organization organizationMedic2 = (Organization) medic2Bundle.getEntry().get(1).getResource(); Extension organizationMedic2thumbprintExtension = organizationMedic2 - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationMedic2thumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("medic2-client").getCertificateSha512ThumbprintHex())); @@ -164,13 +164,13 @@ private void createDockerTestMedic3Bundle(Map<String, CertificateFiles> clientCe Organization organizationTtp = (Organization) medic3Bundle.getEntry().get(0).getResource(); Extension organizationTtpThumbprintExtension = organizationTtp - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationTtpThumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("ttp-client").getCertificateSha512ThumbprintHex())); Organization organizationMedic3 = (Organization) medic3Bundle.getEntry().get(1).getResource(); Extension organizationMedic3thumbprintExtension = organizationMedic3 - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationMedic3thumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("medic3-client").getCertificateSha512ThumbprintHex())); @@ -185,25 +185,25 @@ private void createDockerTestTtpBundle(Map<String, CertificateFiles> clientCerti Organization organizationTtp = (Organization) ttpBundle.getEntry().get(0).getResource(); Extension organizationTtpThumbprintExtension = organizationTtp - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationTtpThumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("ttp-client").getCertificateSha512ThumbprintHex())); Organization organizationMedic1 = (Organization) ttpBundle.getEntry().get(1).getResource(); Extension organizationMedic1thumbprintExtension = organizationMedic1 - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationMedic1thumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("medic1-client").getCertificateSha512ThumbprintHex())); Organization organizationMedic2 = (Organization) ttpBundle.getEntry().get(2).getResource(); Extension organizationMedic2thumbprintExtension = organizationMedic2 - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationMedic2thumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("medic2-client").getCertificateSha512ThumbprintHex())); Organization organizationMedic3 = (Organization) ttpBundle.getEntry().get(3).getResource(); Extension organizationMedic3thumbprintExtension = organizationMedic3 - .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"); + .getExtensionByUrl("http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"); organizationMedic3thumbprintExtension.setValue(new StringType( clientCertificateFilesByCommonName.get("medic3-client").getCertificateSha512ThumbprintHex())); diff --git a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic1-bundle.xml b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic1-bundle.xml index 822f1b6b7..15230a5da 100755 --- a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic1-bundle.xml +++ b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic1-bundle.xml @@ -10,7 +10,7 @@ <code value="REMOTE"/> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -47,7 +47,7 @@ <code value="REMOTE"/> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> diff --git a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic2-bundle.xml b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic2-bundle.xml index 02e960d01..e6d534dc5 100755 --- a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic2-bundle.xml +++ b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic2-bundle.xml @@ -10,7 +10,7 @@ <code value="REMOTE"/> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -47,7 +47,7 @@ <code value="REMOTE"/> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> diff --git a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic3-bundle.xml b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic3-bundle.xml index b111367d6..974547916 100755 --- a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic3-bundle.xml +++ b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/medic3-bundle.xml @@ -10,7 +10,7 @@ <code value="REMOTE"/> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -47,7 +47,7 @@ <code value="REMOTE"/> </tag> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> diff --git a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/test-bundle.xml b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/test-bundle.xml index 7e4f18bf1..4dce8166c 100755 --- a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/test-bundle.xml +++ b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/test-bundle.xml @@ -9,9 +9,9 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <profile value="http://highmed.org/fhir/StructureDefinition/organization"/> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -47,7 +47,7 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint"/> + <profile value="http://highmed.org/fhir/StructureDefinition/endpoint"/> </meta> <identifier> <system value="http://highmed.org/fhir/NamingSystem/endpoint-identifier"/> diff --git a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/ttp-bundle.xml b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/ttp-bundle.xml index 67a9124f9..b48ddd944 100755 --- a/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/ttp-bundle.xml +++ b/dsf-tools/dsf-tools-test-data-generator/src/main/resources/bundle-templates/ttp-bundle.xml @@ -9,9 +9,9 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <profile value="http://highmed.org/fhir/StructureDefinition/organization"/> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -46,9 +46,9 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <profile value="http://highmed.org/fhir/StructureDefinition/organization"/> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -83,9 +83,9 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <profile value="http://highmed.org/fhir/StructureDefinition/organization"/> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -120,9 +120,9 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-organization"/> + <profile value="http://highmed.org/fhir/StructureDefinition/organization"/> </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/certificate-thumbprint"> + <extension url="http://highmed.org/fhir/StructureDefinition/extension-certificate-thumbprint"> <valueString value="TODO"/> </extension> <identifier> @@ -157,7 +157,7 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint"/> + <profile value="http://highmed.org/fhir/StructureDefinition/endpoint"/> </meta> <identifier> <system value="http://highmed.org/fhir/NamingSystem/endpoint-identifier"/> @@ -198,7 +198,7 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint"/> + <profile value="http://highmed.org/fhir/StructureDefinition/endpoint"/> </meta> <identifier> <system value="http://highmed.org/fhir/NamingSystem/endpoint-identifier"/> @@ -239,7 +239,7 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint"/> + <profile value="http://highmed.org/fhir/StructureDefinition/endpoint"/> </meta> <identifier> <system value="http://highmed.org/fhir/NamingSystem/endpoint-identifier"/> @@ -280,7 +280,7 @@ <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> <code value="REMOTE"/> </tag> - <profile value="http://highmed.org/fhir/StructureDefinition/highmed-endpoint"/> + <profile value="http://highmed.org/fhir/StructureDefinition/endpoint"/> </meta> <identifier> <system value="http://highmed.org/fhir/NamingSystem/endpoint-identifier"/> From 95b128724edab305e34027063ed76b2aa2a13ef0 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Sun, 17 Jan 2021 16:06:57 +0100 Subject: [PATCH 64/75] added comment on hosts file entry, modified bpe server infos --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 322349b73..407ed33f9 100755 --- a/README.md +++ b/README.md @@ -38,4 +38,5 @@ Prerequisite: Java 11, Maven >= 3.6, Docker >= 18 ``` docker-compose up ``` -* To access the FHIR endpoint (https://localhost/fhir/...) and BPE rest interface (https://localhost:8443/bpe/...) via WebBrowser install *.../highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12* (Password: *password*) in your browsers certifiate store. The p12 file includes a client certificate for "Webbrowser Test User" and the "Test CA" certificate. All private-keys and certificates including the Test CA are generated during the maven build and are private to your machine. Make sure to protect the CA private-key at *.../highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/ca/testca_private-key.pem* from third-party access if you have installed the Test CA certificate in your certificate store. +* To access the FHIR endpoint (https://fhir/fhir/...) add a `127.0.0.1 fhir` entry to your local `hosts` file and install *.../highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12* (Password: *password*) in your web browsers certifiate store. The p12 file includes a client certificate for "Webbrowser Test User" and the "Test CA" certificate. All private-keys and certificates including the Test CA are generated during the maven build and are private to your machine. Make sure to protect the CA private-key at *.../highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/ca/testca_private-key.pem* from third-party access if you have installed the Test CA certificate in your certificate store. +* The BPE rest interface (https://localhost:8443/bpe/...) can be accessed via a web browser as well, but is currently not needed for testing. From 361d93ffd6b86eb863af322b14c311b1e8fa0e3a Mon Sep 17 00:00:00 2001 From: Reto Wettstein <Reto.Wettstein@med.uni-heidelberg.de> Date: Mon, 18 Jan 2021 18:52:34 +0100 Subject: [PATCH 65/75] moves generally valid profiles to fhir-validation, use static imports for constants --- .../org/highmed/dsf/bpe/ConstantsBase.java | 7 +++ .../bpe/delegate/AbstractServiceDelegate.java | 13 ++-- .../fhir/task/AbstractTaskMessageSend.java | 47 +++++++++------ .../highmed/dsf/bpe/ConstantsFeasibility.java | 9 --- .../FeasibilityProcessPluginDefinition.java | 18 +----- .../dsf/bpe/message/SendMedicRequest.java | 41 ++++++------- .../bpe/message/SendMultiMedicResults.java | 17 ++++-- .../bpe/message/SendSingleMedicResults.java | 21 ++++--- .../dsf/bpe/message/SendTtpRequest.java | 20 ++++--- .../service/CalculateMultiMedicResults.java | 8 ++- .../service/CheckFeasibilityResources.java | 27 +++++---- .../bpe/service/CheckMultiMedicResults.java | 59 +++++++++---------- .../CheckTtpComputedMultiMedicResults.java | 23 ++++---- .../service/DownloadFeasibilityResources.java | 56 ++++++++++-------- .../DownloadResearchStudyResource.java | 56 ++++++++++-------- .../dsf/bpe/service/DownloadResultSets.java | 6 +- .../dsf/bpe/service/GenerateBloomFilters.java | 16 ++--- .../dsf/bpe/service/ModifyQueries.java | 16 ++--- .../dsf/bpe/service/SelectRequestTargets.java | 20 ++++--- .../dsf/bpe/service/StoreCorrelationKeys.java | 27 +++++---- .../highmed/dsf/bpe/service/StoreResults.java | 38 +++++++----- .../highmed-task-execute-feasibility.xml | 2 +- .../highmed-task-request-feasibility.xml | 2 +- ...lityFromMedicsViaMedic1ExampleStarter.java | 12 ++-- .../dsf/fhir/profile/GroupProfileTest.java | 8 +-- .../profile/ResearchStudyProfileTest.java | 14 ++--- .../dsf/fhir/profile/TaskProfileTest.java | 12 ++-- .../LocalServicesProcessPluginDefinition.java | 12 +--- .../dsf/bpe/service/ExtractInputValues.java | 17 +++--- .../highmed/dsf/bpe/service/StoreResult.java | 4 +- .../dsf/fhir/profile/TaskProfileTest.java | 8 +-- .../dsf/bpe/service/SelectPingTargets.java | 6 +- .../dsf/bpe/service/SelectPongTarget.java | 12 ++-- .../dsf/bpe/service/DownloadAllowList.java | 34 +++++------ .../dsf/bpe/service/UpdateAllowList.java | 22 +++---- .../highmed/dsf/bpe/message/SendRequest.java | 13 ++-- .../highmed/dsf/bpe/service/CheckRequest.java | 11 ++-- .../bpe/service/SelectResourceAndTargets.java | 22 +++---- .../dsf/bpe/service/UpdateResources.java | 26 ++++---- .../highmed/dsf/bpe/listener/EndListener.java | 28 +++++---- .../dsf/bpe/listener/StartListener.java | 28 +++++---- .../dsf/bpe/webservice/ProcessService.java | 5 +- .../OrganizationProviderImpl.java | 4 +- .../highmed/dsf/fhir/task/TaskHandler.java | 28 +++++---- .../resources/integration/task-bundle.json | 2 +- .../CodeSystem/highmed-query-type-0.4.0.xml | 6 +- .../highmed-query-type-0.4.0.xml.post | 1 + .../highmed-research-study-identifier.xml | 3 +- ...highmed-research-study-identifier.xml.post | 1 + .../highmed-extension-group-id-0.4.0.xml | 6 +- .../highmed-extension-group-id-0.4.0.xml.post | 1 + ...ed-extension-participating-medic-0.4.0.xml | 6 +- ...tension-participating-medic-0.4.0.xml.post | 1 + ...hmed-extension-participating-ttp-0.4.0.xml | 6 +- ...extension-participating-ttp-0.4.0.xml.post | 1 + .../highmed-extension-query-0.4.0.xml | 6 +- .../highmed-extension-query-0.4.0.xml.post | 1 + .../highmed-group-0.4.0.xml | 6 +- .../highmed-group-0.4.0.xml.post | 1 + .../highmed-research-study-0.4.0.xml | 10 ++-- .../highmed-research-study-0.4.0.xml.post | 1 + .../ValueSet/highmed-query-type-0.4.0.xml | 6 +- .../highmed-query-type-0.4.0.xml.post | 1 + 63 files changed, 498 insertions(+), 443 deletions(-) rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-query-type.xml => dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml (86%) create mode 100644 dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml.post rename {dsf-bpe/dsf-bpe-process-feasibility => dsf-fhir/dsf-fhir-validation}/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml (91%) create mode 100755 dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml.post rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml => dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml (92%) create mode 100644 dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml.post rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml => dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml (95%) create mode 100644 dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml.post rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml => dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml (95%) create mode 100644 dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml.post rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml => dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml (92%) create mode 100644 dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml.post rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml => dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml (91%) create mode 100644 dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml.post rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml => dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml (94%) create mode 100644 dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml.post rename dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-query-type.xml => dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml (88%) create mode 100644 dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml.post diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java index 920e8c810..8c1f228d1 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/ConstantsBase.java @@ -26,8 +26,14 @@ public interface ConstantsBase String PROCESS_HIGHMED_URI_BASE = "http://highmed.org/bpe/Process/"; + String EXTENSION_HIGHMED_PARTICIPATING_MEDIC = "http://highmed.org/fhir/StructureDefinition/extension-participating-medic"; + String EXTENSION_HIGHMED_PARTICIPATING_TTP = "http://highmed.org/fhir/StructureDefinition/extension-participating-ttp"; + String EXTENSION_HIGHMED_GROUP_ID = "http://highmed.org/fhir/StructureDefinition/extension-group-id"; String EXTENSION_HIGHMED_QUERY = "http://highmed.org/fhir/StructureDefinition/extension-query"; + String PROFILE_HIGHMED_GROUP = "http://highmed.org/fhir/StructureDefinition/group"; + String PROFILE_HIGHEMD_RESEARCH_STUDY = "http://highmed.org/fhir/StructureDefinition/research-study"; + String CODESYSTEM_HIGHMED_BPMN = "http://highmed.org/fhir/CodeSystem/bpmn-message"; String CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME = "message-name"; String CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY = "business-key"; @@ -43,6 +49,7 @@ public interface ConstantsBase String NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER = "http://highmed.org/fhir/NamingSystem/organization-identifier"; String NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER = "http://highmed.org/fhir/NamingSystem/endpoint-identifier"; + String NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER = "http://highmed.org/fhir/NamingSystem/research-study-identifier"; CodeType CODE_TYPE_AQL_QUERY = new CodeType(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL) .setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE); diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java index f8ee39d60..1bfb80dfb 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/bpe/delegate/AbstractServiceDelegate.java @@ -1,5 +1,10 @@ package org.highmed.dsf.bpe.delegate; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_LEADING_TASK; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; + import java.util.Objects; import org.camunda.bpm.engine.delegate.BpmnError; @@ -73,8 +78,8 @@ public final void execute(DelegateExecution execution) throws Exception "Process " + execution.getProcessDefinitionId() + " has fatal error in step " + execution .getActivityInstanceId() + ", reason: " + exception.getMessage(); - task.addOutput(taskHelper.createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); + task.addOutput(taskHelper + .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); task.setStatus(Task.TaskStatus.FAILED); clientProvider.getLocalWebserviceClient().withMinimalReturn().update(task); @@ -123,7 +128,7 @@ protected final Task getCurrentTaskFromExecutionVariables() if (execution == null) throw new IllegalStateException("execution not started"); - return (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK); + return (Task) execution.getVariable(BPMN_EXECUTION_VARIABLE_TASK); } /** @@ -136,7 +141,7 @@ protected final Task getLeadingTaskFromExecutionVariables() if (execution == null) throw new IllegalStateException("execution not started"); - Task leadingTask = (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_LEADING_TASK); + Task leadingTask = (Task) execution.getVariable(BPMN_EXECUTION_VARIABLE_LEADING_TASK); return leadingTask != null ? leadingTask : getCurrentTaskFromExecutionVariables(); } } diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java index ede58b1e5..c4db29120 100755 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/task/AbstractTaskMessageSend.java @@ -1,5 +1,18 @@ package org.highmed.dsf.fhir.task; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_PROCESS_DEFINITION_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_PROFILE; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_VERSION_TAG; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; + import java.util.Date; import java.util.Objects; import java.util.stream.Stream; @@ -54,11 +67,10 @@ public void afterPropertiesSet() throws Exception @Override public void doExecute(DelegateExecution execution) throws Exception { - String processDefinitionKey = (String) execution - .getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_PROCESS_DEFINITION_KEY); - String versionTag = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_VERSION_TAG); - String messageName = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_MESSAGE_NAME); - String profile = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_PROFILE); + String processDefinitionKey = (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_PROCESS_DEFINITION_KEY); + String versionTag = (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_VERSION_TAG); + String messageName = (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_MESSAGE_NAME); + String profile = (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_PROFILE); String businessKey = execution.getBusinessKey(); // TODO see Bug https://app.camunda.com/jira/browse/CAM-9444 @@ -84,12 +96,12 @@ public void doExecute(DelegateExecution execution) throws Exception logger.debug("Removing target organization {} with error {} from target list", target.getTargetOrganizationIdentifierValue(), e.getMessage()); - Targets targets = (Targets) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS); + Targets targets = (Targets) execution.getVariable(BPMN_EXECUTION_VARIABLE_TARGETS); targets.removeTarget(target); Task task = getLeadingTaskFromExecutionVariables(); - task.addOutput(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); + task.addOutput(getTaskHelper() + .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); } } @@ -102,7 +114,7 @@ public void doExecute(DelegateExecution execution) throws Exception */ protected Target getTarget(DelegateExecution execution) { - return (Target) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET); + return (Target) execution.getVariable(BPMN_EXECUTION_VARIABLE_TARGET); } /** @@ -137,25 +149,26 @@ protected void sendTask(String targetOrganizationIdentifierValue, String process // http://highmed.org/bpe/Process/processDefinitionKey // http://highmed.org/bpe/Process/processDefinitionKey/versionTag - String instantiatesUri = ConstantsBase.PROCESS_HIGHMED_URI_BASE + processDefinitionKey + ( - versionTag != null && !versionTag.isEmpty() ? ("/" + versionTag) : ""); + String instantiatesUri = + PROCESS_HIGHMED_URI_BASE + processDefinitionKey + (versionTag != null && !versionTag.isEmpty() ? + ("/" + versionTag) : + ""); task.setInstantiatesUri(instantiatesUri); ParameterComponent messageNameInput = new ParameterComponent(new CodeableConcept( - new Coding(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME, null)), new StringType(messageName)); + new Coding(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME, null)), + new StringType(messageName)); task.getInput().add(messageNameInput); ParameterComponent businessKeyInput = new ParameterComponent(new CodeableConcept( - new Coding(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY, null)), new StringType(businessKey)); + new Coding(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY, null)), + new StringType(businessKey)); task.getInput().add(businessKeyInput); if (correlationKey != null) { ParameterComponent correlationKeyInput = new ParameterComponent(new CodeableConcept( - new Coding(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY, null)), + new Coding(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY, null)), new StringType(correlationKey)); task.getInput().add(correlationKeyInput); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java index a4640b03d..1a1b047e2 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java @@ -34,13 +34,6 @@ public interface ConstantsFeasibility String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT = "multi-medic-result"; String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE = "research-study-reference"; - String EXTENSION_HIGHMED_PARTICIPATING_MEDIC = "http://highmed.org/fhir/StructureDefinition/extension-participating-medic"; - String EXTENSION_HIGHMED_PARTICIPATING_TTP = "http://highmed.org/fhir/StructureDefinition/extension-participating-ttp"; - String EXTENSION_HIGHMED_GROUP_ID = "http://highmed.org/fhir/StructureDefinition/extension-group-id"; - - String PROFILE_HIGHMED_GROUP = "http://highmed.org/fhir/StructureDefinition/group"; - String PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/research-study-feasibility"; - String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-request-feasibility"; String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "requestFeasibility/"; String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = @@ -69,6 +62,4 @@ public interface ConstantsFeasibility String PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility"; String PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY_MESSAGE_NAME = "errorMultiMedicFeasibilityMessage"; - - String NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER = "http://highmed.org/fhir/NamingSystem/research-study-identifier"; } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index 9e9084780..4e040bce7 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -53,18 +53,7 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-requestFeasibility.xml"); var cF = CodeSystemResource.file("fhir/CodeSystem/highmed-feasibility.xml"); - var cQT = CodeSystemResource.file("fhir/CodeSystem/highmed-query-type.xml"); - var n = NamingSystemResource.file("fhir/NamingSystem/highmed-research-study-identifier.xml"); - - var sExtG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-group-id.xml"); - var sExtPartMeDic = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-extension-participating-medic.xml"); - var sExtPartTtp = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-extension-participating-ttp.xml"); - var sExtQ = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-extension-query.xml"); - var sG = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-group.xml"); - var sR = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-research-study-feasibility.xml"); var sTCom = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-compute-feasibility.xml"); var sTErr = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-error-feasibility.xml"); var sTExe = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-execute-feasibility.xml"); @@ -75,12 +64,11 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader .file("fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml"); var vF = ValueSetResource.file("fhir/ValueSet/highmed-feasibility.xml"); - var vQT = ValueSetResource.file("fhir/ValueSet/highmed-query-type.xml"); Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of( - "computeFeasibility/" + VERSION, Arrays.asList(aCom, cF, sExtG, sG, sTCom, sTResS, vF), - "executeFeasibility/" + VERSION, Arrays.asList(aExe, cF, cQT, n, sR, sExtPartMeDic, sExtPartTtp, sExtQ, sG, sTExe, vF, vQT), - "requestFeasibility/" + VERSION, Arrays.asList(aReq, cF, cQT, n, sExtG, sExtPartMeDic, sExtPartTtp, sG, sR, sExtQ, sTReq, sTResM, sTErr, vF, vQT)); + "computeFeasibility/" + VERSION, Arrays.asList(aCom, cF, sTCom, sTResS, vF), + "executeFeasibility/" + VERSION, Arrays.asList(aExe, cF, sTExe, vF), + "requestFeasibility/" + VERSION, Arrays.asList(aReq, cF, sTReq, sTResM, sTErr, vF)); return ResourceProvider .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java index 7db929bbe..efd4d7188 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java @@ -1,9 +1,18 @@ package org.highmed.dsf.bpe.message; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; + import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; @@ -27,38 +36,30 @@ public SendMedicRequest(FhirWebserviceClientProvider clientProvider, TaskHelper @Override protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { - ResearchStudy researchStudy = (ResearchStudy) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); + ResearchStudy researchStudy = (ResearchStudy) execution.getVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); IdType researchStudyId = new IdType( getFhirWebserviceClientProvider().getLocalBaseUrl() + "/" + researchStudy.getId()); - ParameterComponent inputResearchStudyReference = getTaskHelper() - .createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE, - new Reference().setReference(researchStudyId.toVersionless().getValueAsString())); + ParameterComponent inputResearchStudyReference = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE, + new Reference().setReference(researchStudyId.toVersionless().getValueAsString())); - boolean needsConsentCheck = (boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); + boolean needsConsentCheck = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); ParameterComponent inputNeedsConsentCheck = getTaskHelper() - .createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK, + .createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK, needsConsentCheck); - boolean needsRecordLinkage = (boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); + boolean needsRecordLinkage = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); ParameterComponent inputNeedsRecordLinkage = getTaskHelper() - .createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, + .createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); if (needsRecordLinkage) { BloomFilterConfig bloomFilterConfig = (BloomFilterConfig) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG); - ParameterComponent inputBloomFilterConfig = getTaskHelper() - .createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG, - bloomFilterConfig.toBytes()); + .getVariable(BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG); + ParameterComponent inputBloomFilterConfig = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG, bloomFilterConfig.toBytes()); return Stream.of(inputResearchStudyReference, inputNeedsConsentCheck, inputNeedsRecordLinkage, inputBloomFilterConfig); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java index b010f279d..7a9446925 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java @@ -2,6 +2,11 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT; import java.util.List; import java.util.stream.Stream; @@ -34,7 +39,7 @@ public SendMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHe protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { FinalFeasibilityQueryResults results = (FinalFeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS); Stream<ParameterComponent> resultInputs = results.getResults().stream().flatMap(this::toInputs); Stream<ParameterComponent> errorInput = getErrorInput(execution); @@ -45,14 +50,14 @@ protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecut private Stream<ParameterComponent> toInputs(FinalFeasibilityQueryResult result) { ParameterComponent input1 = getTaskHelper() - .createInputUnsignedInt(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT, + .createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT, result.getCohortSize()); input1.addExtension(createCohortIdExtension(result.getCohortId())); ParameterComponent input2 = getTaskHelper() - .createInputUnsignedInt(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT, + .createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT, result.getParticipatingMedics()); input2.addExtension(createCohortIdExtension(result.getCohortId())); @@ -61,7 +66,7 @@ private Stream<ParameterComponent> toInputs(FinalFeasibilityQueryResult result) private Extension createCohortIdExtension(String cohortId) { - return new Extension(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); + return new Extension(EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); } private Stream<ParameterComponent> getErrorInput(DelegateExecution execution) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java index 74d7bbe8b..e28c582d6 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java @@ -1,9 +1,14 @@ package org.highmed.dsf.bpe.message; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; + import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; @@ -33,7 +38,7 @@ public SendSingleMedicResults(FhirWebserviceClientProvider clientProvider, TaskH protected Stream<Task.ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); return results.getResults().stream().map(result -> toInput(result)); } @@ -42,17 +47,15 @@ private Task.ParameterComponent toInput(FeasibilityQueryResult result) { if (result.isCohortSizeResult()) { - ParameterComponent input = getTaskHelper() - .createInputUnsignedInt(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, - result.getCohortSize()); + ParameterComponent input = getTaskHelper().createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, result.getCohortSize()); input.addExtension(createCohortIdExtension(result.getCohortId())); return input; } else if (result.isIdResultSetUrlResult()) { - ParameterComponent input = getTaskHelper().createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, + ParameterComponent input = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, new Reference(result.getResultSetUrl())); input.addExtension(createCohortIdExtension(result.getCohortId())); return input; @@ -69,6 +72,6 @@ else if (result.isIdResultSetUrlResult()) private Extension createCohortIdExtension(String cohortId) { - return new Extension(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); + return new Extension(EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java index add6578b2..385d5bfb3 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java @@ -1,10 +1,14 @@ package org.highmed.dsf.bpe.message; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY; + import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -25,18 +29,16 @@ public SendTtpRequest(FhirWebserviceClientProvider clientProvider, TaskHelper ta @Override protected Stream<Task.ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { - Targets multiInstanceTargets = (Targets) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS); + Targets multiInstanceTargets = (Targets) execution.getVariable(BPMN_EXECUTION_VARIABLE_TARGETS); Stream<Task.ParameterComponent> inputTargets = multiInstanceTargets.getEntries().stream() - .map(target -> getTaskHelper().createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY, + .map(target -> getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY, target.getCorrelationKey())); - boolean needsRecordLinkage = (boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); + boolean needsRecordLinkage = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); Task.ParameterComponent inputNeedsRecordLinkage = getTaskHelper() - .createInput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, + .createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); return Stream.concat(inputTargets, Stream.of(inputNeedsRecordLinkage)); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java index 893bb9215..4508c07e1 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java @@ -1,11 +1,13 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; + import java.util.List; import java.util.Map; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; @@ -26,11 +28,11 @@ public CalculateMultiMedicResults(FhirWebserviceClientProvider clientProvider, T protected void doExecute(DelegateExecution execution) throws Exception { List<FeasibilityQueryResult> results = ((FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS)).getResults(); + .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS)).getResults(); List<FinalFeasibilityQueryResult> finalResults = calculateResults(results); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, FinalFeasibilityQueryResultsValues.create(new FinalFeasibilityQueryResults(finalResults))); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java index d5f9362f0..edbca48c4 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java @@ -1,11 +1,15 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.MIN_COHORT_DEFINITIONS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.MIN_PARTICIPATING_MEDICS; import java.util.List; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -24,11 +28,10 @@ public CheckFeasibilityResources(FhirWebserviceClientProvider clientProvider, Ta @Override protected void doExecute(DelegateExecution execution) throws Exception { - ResearchStudy researchStudy = (ResearchStudy) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); + ResearchStudy researchStudy = (ResearchStudy) execution.getVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); - List<Group> cohorts = ((FhirResourcesList) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS)).getResourcesAndCast(); + List<Group> cohorts = ((FhirResourcesList) execution.getVariable(BPMN_EXECUTION_VARIABLE_COHORTS)) + .getResourcesAndCast(); checkNumberOfParticipatingMedics(researchStudy); checkFullyQualifiedCohortIds(cohorts); @@ -37,17 +40,16 @@ protected void doExecute(DelegateExecution execution) throws Exception private void checkNumberOfParticipatingMedics(ResearchStudy researchStudy) { - long medics = researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC) - .stream().filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) + long medics = researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).stream() + .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) .map(r -> r.getIdentifier()) .filter(i -> NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER.equals(i.getSystem())).map(i -> i.getValue()) .distinct().count(); - if (medics < ConstantsFeasibility.MIN_PARTICIPATING_MEDICS) + if (medics < MIN_PARTICIPATING_MEDICS) { throw new RuntimeException( - "Number of distinct participanting MeDICs is < " + ConstantsFeasibility.MIN_PARTICIPATING_MEDICS - + ", got " + medics); + "Number of distinct participanting MeDICs is < " + MIN_PARTICIPATING_MEDICS + ", got " + medics); } } @@ -62,11 +64,10 @@ private void checkFullyQualifiedCohortIds(List<Group> cohorts) private void checkNumberOfCohortDefinitions(List<Group> cohorts) { int size = cohorts.size(); - if (size < ConstantsFeasibility.MIN_COHORT_DEFINITIONS) + if (size < MIN_COHORT_DEFINITIONS) { throw new RuntimeException( - "Number of defined cohorts is < " + ConstantsFeasibility.MIN_COHORT_DEFINITIONS + ", got " + cohorts - .size()); + "Number of defined cohorts is < " + MIN_COHORT_DEFINITIONS + ", got " + cohorts.size()); } } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java index eeadcd29a..96a62cc1c 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java @@ -1,11 +1,16 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT; + import java.util.List; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; @@ -46,22 +51,19 @@ protected void doExecute(DelegateExecution execution) throws Exception private void addFinalFeasibilityQueryErrorsToLeadingTask(Task toRead, Task toWrite) { - toRead.getInput().stream() - .filter(in -> in.hasType() && in.getType().hasCoding() && ConstantsBase.CODESYSTEM_HIGHMED_BPMN - .equals(in.getType().getCodingFirstRep().getSystem()) - && ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR - .equals(in.getType().getCodingFirstRep().getCode())).forEach(in -> toWrite.getOutput() - .add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, in.getValue().primitiveValue()))); + toRead.getInput().stream().filter(in -> in.hasType() && in.getType().hasCoding() && CODESYSTEM_HIGHMED_BPMN + .equals(in.getType().getCodingFirstRep().getSystem()) && CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR + .equals(in.getType().getCodingFirstRep().getCode())).forEach(in -> toWrite.getOutput() + .add(getTaskHelper().createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, + in.getValue().primitiveValue()))); } private FinalFeasibilityQueryResults readFinalFeasibilityQueryResultsFromCurrentTask(Task task) { List<FinalFeasibilityQueryResult> results = task.getInput().stream() - .filter(in -> in.hasType() && in.getType().hasCoding() - && ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY + .filter(in -> in.hasType() && in.getType().hasCoding() && CODESYSTEM_HIGHMED_FEASIBILITY .equals(in.getType().getCodingFirstRep().getSystem()) - && ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT + && CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT .equals(in.getType().getCodingFirstRep().getCode())).map(in -> toResult(task, in)) .collect(Collectors.toList()); return new FinalFeasibilityQueryResults(results); @@ -69,8 +71,7 @@ private FinalFeasibilityQueryResults readFinalFeasibilityQueryResultsFromCurrent private FinalFeasibilityQueryResult toResult(Task task, ParameterComponent in) { - String cohortId = ((Reference) in.getExtensionByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID).getValue()) - .getReference(); + String cohortId = ((Reference) in.getExtensionByUrl(EXTENSION_HIGHMED_GROUP_ID).getValue()).getReference(); int participatingMedics = getParticipatingMedicsCountByCohortId(task, cohortId); int cohortSize = ((UnsignedIntType) in.getValue()).getValue(); return new FinalFeasibilityQueryResult(cohortId, participatingMedics, cohortSize); @@ -78,14 +79,14 @@ private FinalFeasibilityQueryResult toResult(Task task, ParameterComponent in) private int getParticipatingMedicsCountByCohortId(Task task, String cohortId) { - return task.getInput().stream().filter(in -> in.hasType() && in.getType().hasCoding() - && ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY - .equals(in.getType().getCodingFirstRep().getSystem()) - && ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT - .equals(in.getType().getCodingFirstRep().getCode()) && cohortId - .equals(((Reference) in.getExtensionByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID).getValue()) - .getReference())).mapToInt(in -> ((UnsignedIntType) in.getValue()).getValue()).findFirst() - .getAsInt(); + return task.getInput().stream() + .filter(in -> in.hasType() && in.getType().hasCoding() && CODESYSTEM_HIGHMED_FEASIBILITY + .equals(in.getType().getCodingFirstRep().getSystem()) + && CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT + .equals(in.getType().getCodingFirstRep().getCode()) && cohortId + .equals(((Reference) in.getExtensionByUrl(EXTENSION_HIGHMED_GROUP_ID).getValue()) + .getReference())).mapToInt(in -> ((UnsignedIntType) in.getValue()).getValue()) + .findFirst().getAsInt(); } protected FinalFeasibilityQueryResults checkResults(FinalFeasibilityQueryResults results) @@ -102,23 +103,19 @@ private void addFinalFeasibilityQueryResultsToLeadingTask(FinalFeasibilityQueryR private void addResultOutput(FinalFeasibilityQueryResult result, Task toWrite) { - TaskOutputComponent output1 = getTaskHelper() - .createOutputUnsignedInt(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT, - result.getCohortSize()); + TaskOutputComponent output1 = getTaskHelper().createOutputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT, result.getCohortSize()); output1.addExtension(createCohortIdExtension(result.getCohortId())); toWrite.addOutput(output1); - TaskOutputComponent output2 = getTaskHelper() - .createOutputUnsignedInt(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT, - result.getParticipatingMedics()); + TaskOutputComponent output2 = getTaskHelper().createOutputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT, result.getParticipatingMedics()); output2.addExtension(createCohortIdExtension(result.getCohortId())); toWrite.addOutput(output2); } private Extension createCohortIdExtension(String cohortId) { - return new Extension(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); + return new Extension(EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java index a542ace95..77bbd2442 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java @@ -1,16 +1,18 @@ package org.highmed.dsf.bpe.service; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_RESULT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.MIN_PARTICIPATING_MEDICS; import java.util.List; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; @@ -35,14 +37,13 @@ protected void doExecute(DelegateExecution execution) throws Exception { Task leadingTask = getLeadingTaskFromExecutionVariables(); FinalFeasibilityQueryResults results = (FinalFeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS); List<FinalFeasibilityQueryResult> resultsWithEnoughParticipatingMedics = filterResultsByParticipatingMedics( leadingTask, results); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, - FinalFeasibilityQueryResultsValues - .create(new FinalFeasibilityQueryResults(resultsWithEnoughParticipatingMedics))); + execution.setVariable(BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, FinalFeasibilityQueryResultsValues + .create(new FinalFeasibilityQueryResults(resultsWithEnoughParticipatingMedics))); boolean existsAtLeastOneResult = checkIfAtLeastOneResultExists(leadingTask, resultsWithEnoughParticipatingMedics); @@ -56,12 +57,12 @@ private List<FinalFeasibilityQueryResult> filterResultsByParticipatingMedics(Tas { String taskId = leadingTask.getId(); String businessKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); + CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); String correlationKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); + CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); return results.getResults().stream().filter(result -> { - if (result.getParticipatingMedics() < ConstantsFeasibility.MIN_PARTICIPATING_MEDICS) + if (result.getParticipatingMedics() < MIN_PARTICIPATING_MEDICS) { logger.warn("Removed result with cohort id='{}' from feasibility request with task-id='{}', " + "business-key='{}' and correlation-key='{}' because of not enough participating MeDICs", @@ -83,9 +84,9 @@ private boolean checkIfAtLeastOneResultExists(Task leadingTask, List<FinalFeasib { String taskId = leadingTask.getId(); String businessKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); + CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); String correlationKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); + CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); if (results.size() < 1) { diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java index 3b0d1307f..d750ca404 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java @@ -1,6 +1,16 @@ package org.highmed.dsf.bpe.service; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_TTP; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; import java.util.Collections; import java.util.List; @@ -10,7 +20,6 @@ import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; @@ -61,26 +70,24 @@ protected void doExecute(DelegateExecution execution) throws Exception Bundle bundle = getResearchStudyAndCohortDefinitions(researchStudyId, client); ResearchStudy researchStudy = (ResearchStudy) bundle.getEntryFirstRep().getResource(); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY, - FhirResourceValues.create(researchStudy)); + execution.setVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY, FhirResourceValues.create(researchStudy)); List<Group> cohortDefinitions = getCohortDefinitions(bundle, client.getBaseUrl()); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS, - FhirResourcesListValues.create(cohortDefinitions)); + execution.setVariable(BPMN_EXECUTION_VARIABLE_COHORTS, FhirResourcesListValues.create(cohortDefinitions)); String ttpIdentifier = getTtpIdentifier(researchStudy, client); execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER, ttpIdentifier); boolean needsConsentCheck = getNeedsConsentCheck(task); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); + execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); + execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); if (needsRecordLinkage) { BloomFilterConfig bloomFilterConfig = getBloomFilterConfig(task); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, + execution.setVariable(BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, BloomFilterConfigValues.create(bloomFilterConfig)); } } @@ -88,9 +95,8 @@ protected void doExecute(DelegateExecution execution) throws Exception private IdType getResearchStudyId(Task task) { Reference researchStudyReference = getTaskHelper() - .getInputParameterReferenceValues(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE).findFirst() - .get(); + .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE).findFirst().get(); return new IdType(researchStudyReference.getReference()); } @@ -161,29 +167,27 @@ private String getTtpIdentifier(ResearchStudy researchStudy, FhirWebserviceClien private boolean getNeedsConsentCheck(Task task) { - return getTaskHelper() - .getFirstInputParameterBooleanValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( - () -> new IllegalArgumentException( - "NeedsConsentCheck boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( + () -> new IllegalArgumentException( + "NeedsConsentCheck boolean is not set in task with id='" + task.getId() + + "', this error should " + "have been caught by resource validation")); } private boolean getNeedsRecordLinkageCheck(Task task) { - return getTaskHelper() - .getFirstInputParameterBooleanValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( + () -> new IllegalArgumentException( + "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() + + "', this error should " + "have been caught by resource validation")); } private BloomFilterConfig getBloomFilterConfig(Task task) { return BloomFilterConfig.fromBytes(getTaskHelper() - .getFirstInputParameterByteValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG).orElseThrow( + .getFirstInputParameterByteValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG).orElseThrow( () -> new IllegalArgumentException( "BloomFilterConfig byte[] is not set in task with id='" + task.getId() + "', this error should " + "have been caught by resource validation"))); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java index 105108645..90b18e538 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java @@ -1,14 +1,21 @@ package org.highmed.dsf.bpe.service; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; @@ -55,23 +62,23 @@ protected void doExecute(DelegateExecution execution) throws Exception FhirWebserviceClient client = getFhirWebserviceClientProvider().getLocalWebserviceClient(); ResearchStudy researchStudy = getResearchStudy(researchStudyId, client); researchStudy = addMissingOrganizations(researchStudy, client); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY, researchStudy); + execution.setVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY, researchStudy); boolean needsConsentCheck = getNeedsConsentCheck(task); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); + execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); + execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); } private IdType getResearchStudyId(Task task) { Reference researchStudyReference = getTaskHelper() - .getInputParameterReferenceValues(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE).findFirst() - .orElseThrow(() -> new IllegalArgumentException( - "ResearchStudy reference is not set in task with id='" + task.getId() + "', this error should " - + "have been caught by resource validation")); + .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE).findFirst().orElseThrow( + () -> new IllegalArgumentException( + "ResearchStudy reference is not set in task with id='" + task.getId() + + "', this error should " + "have been caught by resource validation")); return new IdType(researchStudyReference.getReference()); } @@ -98,9 +105,8 @@ private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirW .filter(i -> NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER.equals(i.getSystem())).map(i -> i.getValue()) .collect(Collectors.toList()); - List<String> existingIdentifiers = researchStudy - .getExtensionsByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC).stream() - .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) + List<String> existingIdentifiers = researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC) + .stream().filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) .map(r -> r.getIdentifier().getValue()).collect(Collectors.toList()); identifiers.removeAll(existingIdentifiers); @@ -112,8 +118,8 @@ private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirW "Adding missing organization with identifier='{}' to feasibility research study with id='{}'", identifier, researchStudy.getId()); - researchStudy.addExtension().setUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC) - .setValue(new Reference().setType(ResourceType.Organization.name()).setIdentifier( + researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( + new Reference().setType(ResourceType.Organization.name()).setIdentifier( new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) .setValue(identifier))); @@ -140,21 +146,19 @@ private ResearchStudy update(ResearchStudy researchStudy, FhirWebserviceClient c private boolean getNeedsConsentCheck(Task task) { - return getTaskHelper() - .getFirstInputParameterBooleanValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( - () -> new IllegalArgumentException( - "NeedsConsentCheck boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( + () -> new IllegalArgumentException( + "NeedsConsentCheck boolean is not set in task with id='" + task.getId() + + "', this error should " + "have been caught by resource validation")); } private boolean getNeedsRecordLinkageCheck(Task task) { - return getTaskHelper() - .getFirstInputParameterBooleanValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( + () -> new IllegalArgumentException( + "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() + + "', this error should " + "have been caught by resource validation")); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java index bac5bd75d..5df78880b 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java @@ -1,6 +1,7 @@ package org.highmed.dsf.bpe.service; import static org.highmed.dsf.bpe.ConstantsBase.OPENEHR_MIMETYPE_JSON; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; import java.io.IOException; import java.io.InputStream; @@ -11,7 +12,6 @@ import javax.ws.rs.core.MediaType; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; @@ -52,11 +52,11 @@ public void afterPropertiesSet() throws Exception protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); List<FeasibilityQueryResult> resultsWithResultSets = download(results); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(resultsWithResultSets))); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java index 92e0e72c2..6a10c6b14 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java @@ -1,7 +1,11 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsBase.OPENEHR_MIMETYPE_JSON; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI; import java.security.Key; import java.util.List; @@ -10,8 +14,6 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; @@ -82,12 +84,12 @@ public void afterPropertiesSet() throws Exception protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); String securityIdentifier = getSecurityIdentifier(execution); BloomFilterConfig bloomFilterConfig = (BloomFilterConfig) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG); + .getVariable(BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG); ResultSetTranslatorToTtpRbfOnly resultSetTranslator = createResultSetTranslator(bloomFilterConfig); @@ -95,7 +97,7 @@ protected void doExecute(DelegateExecution execution) throws Exception .map(result -> translateAndCreateBinary(resultSetTranslator, result, securityIdentifier)) .collect(Collectors.toList()); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(translatedResults))); } @@ -103,10 +105,10 @@ private String getSecurityIdentifier(DelegateExecution execution) { Task task = getCurrentTaskFromExecutionVariables(); - if (task.getInstantiatesUri().startsWith(ConstantsFeasibility.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI)) + if (task.getInstantiatesUri().startsWith(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI)) return task.getRequester().getIdentifier().getValue(); else - return (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER); + return (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER); } protected ResultSetTranslatorToTtpRbfOnly createResultSetTranslator(BloomFilterConfig bloomFilterConfig) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java index a2eeaf5a5..82fec1468 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java @@ -1,12 +1,15 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES; + import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Objects; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -32,22 +35,19 @@ public void afterPropertiesSet() throws Exception @Override protected void doExecute(DelegateExecution execution) throws Exception { - Boolean needsConsentCheck = (Boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); - Boolean needsRecordLinkage = (Boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); + Boolean needsConsentCheck = (Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); + Boolean needsRecordLinkage = (Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); boolean idQuery = Boolean.TRUE.equals(needsConsentCheck) || Boolean.TRUE.equals(needsRecordLinkage); if (idQuery) { // <groupId, query> @SuppressWarnings("unchecked") - Map<String, String> queries = (Map<String, String>) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES); + Map<String, String> queries = (Map<String, String>) execution.getVariable(BPMN_EXECUTION_VARIABLE_QUERIES); Map<String, String> modifiedQueries = modifyQueries(queries); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES, modifiedQueries); + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERIES, modifiedQueries); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java index ccc81f710..016da37b1 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java @@ -1,5 +1,11 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; + import java.security.NoSuchAlgorithmException; import java.util.List; import java.util.Objects; @@ -12,7 +18,6 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; @@ -64,8 +69,7 @@ public void afterPropertiesSet() throws Exception @Override protected void doExecute(DelegateExecution execution) throws Exception { - ResearchStudy researchStudy = (ResearchStudy) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); + ResearchStudy researchStudy = (ResearchStudy) execution.getVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(getMedicTargets(researchStudy))); @@ -73,11 +77,10 @@ protected void doExecute(DelegateExecution execution) throws Exception execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(getTtpTarget(researchStudy))); - Boolean needsRecordLinkage = (Boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); + Boolean needsRecordLinkage = (Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); if (Boolean.TRUE.equals(needsRecordLinkage)) { - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, + execution.setVariable(BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, BloomFilterConfigValues.create(createBloomFilterConfig())); } } @@ -90,8 +93,7 @@ private BloomFilterConfig createBloomFilterConfig() private Targets getMedicTargets(ResearchStudy researchStudy) { - List<Target> targets = researchStudy - .getExtensionsByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC).stream() + List<Target> targets = researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).stream() .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) .map(r -> Target.createBiDirectionalTarget(r.getIdentifier().getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); @@ -101,7 +103,7 @@ private Targets getMedicTargets(ResearchStudy researchStudy) private Target getTtpTarget(ResearchStudy researchStudy) { - return researchStudy.getExtensionsByUrl(ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_TTP).stream() + return researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP).stream() .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) .map(r -> Target.createUniDirectionalTarget(r.getIdentifier().getValue())).findFirst().get(); } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java index 286320056..d4f3962ff 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java @@ -1,11 +1,16 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY; + import java.util.List; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; @@ -28,9 +33,8 @@ protected void doExecute(DelegateExecution execution) throws Exception { Task task = getCurrentTaskFromExecutionVariables(); - List<Target> targets = getTaskHelper() - .getInputParameterStringValues(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY) + List<Target> targets = getTaskHelper().getInputParameterStringValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY) .map(correlationKey -> Target.createBiDirectionalTarget("", correlationKey)) .collect(Collectors.toList()); @@ -38,19 +42,18 @@ protected void doExecute(DelegateExecution execution) throws Exception .setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); + execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(null))); } private boolean getNeedsRecordLinkageCheck(Task task) { - return getTaskHelper() - .getFirstInputParameterBooleanValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); + return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( + () -> new IllegalArgumentException( + "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() + + "', this error should " + "have been caught by resource validation")); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java index f56fa2f5b..322a8f9ef 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java @@ -1,12 +1,18 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; +import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; + import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; @@ -43,10 +49,10 @@ public void afterPropertiesSet() throws Exception protected void doExecute(DelegateExecution execution) throws Exception { FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); + .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - boolean needsRecordLinkage = Boolean.TRUE.equals((Boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE)); + boolean needsRecordLinkage = Boolean.TRUE + .equals((Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE)); Task task = getCurrentTaskFromExecutionVariables(); @@ -54,7 +60,7 @@ protected void doExecute(DelegateExecution execution) throws Exception extendedResults.addAll(results.getResults()); extendedResults.addAll(getResults(task, needsRecordLinkage)); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, + execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(extendedResults))); } @@ -65,20 +71,20 @@ private List<FeasibilityQueryResult> getResults(Task task, boolean needsRecordLi if (needsRecordLinkage) { - return taskHelper.getInputParameterWithExtension(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, - ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID).map(input -> { - String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); - String resultSetUrl = ((Reference) input.getValue()).getReference(); - - return FeasibilityQueryResult.idResult(requester.getIdentifier().getValue(), cohortId, resultSetUrl); - }).collect(Collectors.toList()); + return taskHelper.getInputParameterWithExtension(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, EXTENSION_HIGHMED_GROUP_ID) + .map(input -> { + String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); + String resultSetUrl = ((Reference) input.getValue()).getReference(); + + return FeasibilityQueryResult + .idResult(requester.getIdentifier().getValue(), cohortId, resultSetUrl); + }).collect(Collectors.toList()); } else { - return taskHelper.getInputParameterWithExtension(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, - ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID).map(input -> { + return taskHelper.getInputParameterWithExtension(task, CODESYSTEM_HIGHMED_FEASIBILITY, + CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, EXTENSION_HIGHMED_GROUP_ID).map(input -> { String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); int cohortSize = ((UnsignedIntType) input.getValue()).getValue(); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml index 12cd5b348..0fadae838 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml @@ -97,7 +97,7 @@ <path value="Task.input.value[x]" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/research-study-feasibility" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/research-study" /> </type> </element> <element id="Task.input:needs-record-linkage"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml index 00f124afb..731cd9dbd 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml @@ -97,7 +97,7 @@ <path value="Task.input.value[x]" /> <type> <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/research-study-feasibility" /> + <targetProfile value="http://highmed.org/fhir/StructureDefinition/research-study" /> </type> </element> <element id="Task.input:research-study-reference.value[x].reference"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java index ffdf12a6f..f400ae3ed 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java @@ -9,11 +9,11 @@ import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_TTP; -import static org.highmed.dsf.bpe.ConstantsFeasibility.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_GROUP; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHEMD_RESEARCH_STUDY; +import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHMED_GROUP; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; @@ -101,7 +101,7 @@ private static ResearchStudy createResearchStudy(Group group1, Group group2) ResearchStudy researchStudy = new ResearchStudy(); researchStudy.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - researchStudy.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY); + researchStudy.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY); researchStudy.addIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER) .setValue(UUID.randomUUID().toString()); researchStudy.setStatus(ResearchStudyStatus.ACTIVE); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java index 05fca5f53..d83ad4044 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java @@ -3,7 +3,7 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_GROUP; +import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHMED_GROUP; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -29,9 +29,9 @@ public class GroupProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-extension-query.xml", "highmed-group.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-query-type.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-query-type.xml")); + Arrays.asList("highmed-extension-query-0.4.0.xml", "highmed-group-0.4.0.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-query-type-0.4.0.xml"), + Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-query-type-0.4.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java index 47698aa5e..4cd809de9 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java @@ -1,10 +1,10 @@ package org.highmed.dsf.fhir.profile; import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_PARTICIPATING_TTP; -import static org.highmed.dsf.bpe.ConstantsFeasibility.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHEMD_RESEARCH_STUDY; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -31,8 +31,8 @@ public class ResearchStudyProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-extension-participating-medic.xml", "highmed-extension-participating-ttp.xml", - "highmed-research-study-feasibility.xml"), + Arrays.asList("highmed-extension-participating-medic-0.4.0.xml", "highmed-extension-participating-ttp-0.4.0.xml", + "highmed-research-study-0.4.0.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-organization-type-0.4.0.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-organization-type-0.4.0.xml")); @@ -43,7 +43,7 @@ public class ResearchStudyProfileTest public void testResearchStudyProfileValid() throws Exception { ResearchStudy res = new ResearchStudy(); - res.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY_FEASIBILITY); + res.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY); res.getIdentifierFirstRep().setSystem(NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER) .setValue(UUID.randomUUID().toString()); res.setStatus(ResearchStudyStatus.ACTIVE); diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 2dce21e67..2b21f6ef5 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -5,6 +5,7 @@ import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; @@ -16,7 +17,6 @@ import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; @@ -67,11 +67,11 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group.xml", "highmed-extension-group-id.xml", - "highmed-research-study-feasibility.xml", "highmed-task-request-feasibility.xml", - "highmed-task-execute-feasibility.xml", "highmed-task-single-medic-result-feasibility.xml", - "highmed-task-compute-feasibility.xml", "highmed-task-multi-medic-result-feasibility.xml", - "highmed-task-error-feasibility.xml"), + Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group-0.4.0.xml", + "highmed-extension-group-id-0.4.0.xml", "highmed-research-study-0.4.0.xml", + "highmed-task-request-feasibility.xml", "highmed-task-execute-feasibility.xml", + "highmed-task-single-medic-result-feasibility.xml", "highmed-task-compute-feasibility.xml", + "highmed-task-multi-medic-result-feasibility.xml", "highmed-task-error-feasibility.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", "highmed-feasibility.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java index 05decc6d1..7b173372b 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java @@ -59,26 +59,16 @@ public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader var aL = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-localServicesIntegration.xml"); var sTL = StructureDefinitionResource .file("fhir/StructureDefinition/highmed-task-local-services-integration.xml"); - var sExtG = StructureDefinitionResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, - "http://highmed.org/fhir/StructureDefinition/extension-group-id", DEPENDENCY_FEASIBILITY_VERSION); - var sExtQ = StructureDefinitionResource.dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, - "http://highmed.org/fhir/StructureDefinition/extension-query", DEPENDENCY_FEASIBILITY_VERSION); var vF = ValueSetResource .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/ValueSet/feasibility", DEPENDENCY_FEASIBILITY_VERSION); - var vQt = ValueSetResource - .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/ValueSet/query-type", - DEPENDENCY_FEASIBILITY_VERSION); var cF = CodeSystemResource .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/CodeSystem/feasibility", DEPENDENCY_FEASIBILITY_VERSION); - var cQt = CodeSystemResource - .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/CodeSystem/query-type", - DEPENDENCY_FEASIBILITY_VERSION); Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map - .of("localServicesIntegration/" + VERSION, Arrays.asList(aL, sTL, vF, cF, vQt, cQt, sExtG, sExtQ)); + .of("localServicesIntegration/" + VERSION, Arrays.asList(aL, sTL, vF, cF)); return ResourceProvider .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java index 9cbc0f20e..6a020529b 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java @@ -1,6 +1,11 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; +import static org.highmed.dsf.bpe.ConstantsBase.CODE_TYPE_AQL_QUERY; import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS; +import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; import java.util.List; import java.util.UUID; @@ -8,7 +13,6 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.bpe.variables.BloomFilterConfig; @@ -36,11 +40,10 @@ protected void doExecute(DelegateExecution execution) throws Exception Stream<String> queries = getQueries(task); List<Group> cohortDefinitions = getCohortDefinitions(queries); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS, - FhirResourcesListValues.create(cohortDefinitions)); + execution.setVariable(BPMN_EXECUTION_VARIABLE_COHORTS, FhirResourcesListValues.create(cohortDefinitions)); boolean needsConsentCheck = getNeedsConsentCheck(task); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); + execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); @@ -55,8 +58,8 @@ protected void doExecute(DelegateExecution execution) throws Exception private Stream<String> getQueries(Task task) { - return getTaskHelper().getInputParameterStringValues(task, ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE, - ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); + return getTaskHelper().getInputParameterStringValues(task, CODESYSTEM_HIGHMED_QUERY_TYPE, + CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); } private List<Group> getCohortDefinitions(Stream<String> queries) @@ -65,7 +68,7 @@ private List<Group> getCohortDefinitions(Stream<String> queries) Group group = new Group(); group.setIdElement(new IdType(UUID.randomUUID().toString())); group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY) - .setValue(new Expression().setLanguageElement(ConstantsBase.CODE_TYPE_AQL_QUERY).setExpression(q)); + .setValue(new Expression().setLanguageElement(CODE_TYPE_AQL_QUERY).setExpression(q)); return group; }).collect(Collectors.toList()); } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java index 9dbd31b27..da4623b06 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java @@ -1,5 +1,7 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; + import org.camunda.bpm.engine.delegate.DelegateExecution; import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; @@ -70,6 +72,6 @@ else if (result.isIdResultSetUrlResult()) private Extension createCohortIdExtension(String cohortId) { - return new Extension(ConstantsFeasibility.EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); + return new Extension(EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); } } diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index b1ea3b234..8feb93303 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -40,12 +40,12 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group.xml", "highmed-extension-group-id.xml", - "highmed-extension-query.xml", "highmed-task-local-services-integration.xml"), + Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group-0.4.0.xml", "highmed-extension-group-id-0.4.0.xml", + "highmed-extension-query-0.4.0.xml", "highmed-task-local-services-integration.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-feasibility.xml", "highmed-query-type.xml"), + "highmed-feasibility.xml", "highmed-query-type-0.4.0.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-feasibility.xml", "highmed-query-type.xml")); + "highmed-feasibility.xml", "highmed-query-type-0.4.0.xml")); private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), validationRule.getValidationSupport()); diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java index 68ab05c99..bb91420f9 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java @@ -1,12 +1,13 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS; + import java.util.List; import java.util.Objects; import java.util.UUID; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; @@ -42,7 +43,6 @@ public void doExecute(DelegateExecution execution) throws Exception .createBiDirectionalTarget(identifier.getValue(), UUID.randomUUID().toString())) .collect(Collectors.toList()); - execution - .setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); + execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); } } diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java index 2b36fea48..f0d0cb0ad 100755 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java @@ -1,7 +1,10 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; + import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -23,12 +26,11 @@ public void doExecute(DelegateExecution execution) throws Exception { Task task = getCurrentTaskFromExecutionVariables(); - String correlationKey = getTaskHelper() - .getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).get(); + String correlationKey = getTaskHelper().getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).get(); Identifier targetOrganizationIdentifier = task.getRequester().getIdentifier(); - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, TargetValues + execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGET, TargetValues .create(Target.createBiDirectionalTarget(targetOrganizationIdentifier.getValue(), correlationKey))); } } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java index 9584b24f7..dda7f7a42 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java @@ -1,5 +1,8 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; + import java.util.EnumSet; import java.util.List; import java.util.Objects; @@ -8,7 +11,6 @@ import javax.ws.rs.WebApplicationException; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsUpdateAllowList; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -62,8 +64,9 @@ protected void doExecute(DelegateExecution execution) throws Exception { logger.error("Error while reading Bundle with id {} from organization {}: {}", bundleId.getValue(), task.getRequester().getReference(), e.getMessage()); - throw new RuntimeException("Error while reading Bundle with id " + bundleId.getValue() - + " from organization " + task.getRequester().getReference() + ", " + e.getMessage(), e); + throw new RuntimeException( + "Error while reading Bundle with id " + bundleId.getValue() + " from organization " + task + .getRequester().getReference() + ", " + e.getMessage(), e); } if (!EnumSet.of(BundleType.TRANSACTION, BundleType.BATCH).contains(bundle.getType())) @@ -81,34 +84,31 @@ protected void doExecute(DelegateExecution execution) throws Exception { logger.error("Error while executing Bundle with id {} from organization {} locally: {}", bundleId.getValue(), task.getRequester().getReference(), e.getMessage()); - throw new RuntimeException("Error while executing Bundle with id " + bundleId.getValue() - + " from organization " + task.getRequester().getReference() + " locally, " + e.getMessage(), e); + throw new RuntimeException( + "Error while executing Bundle with id " + bundleId.getValue() + " from organization " + task + .getRequester().getReference() + " locally, " + e.getMessage(), e); } } private IdType getBundleId(Task task) { List<Reference> bundleReferences = getTaskHelper() - .getInputParameterReferenceValues(task, ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST, - ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST) - .collect(Collectors.toList()); + .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST, + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST).collect(Collectors.toList()); if (bundleReferences.size() != 1) { logger.error("Task input parameter {} contains unexpected number of Bundle IDs, expected 1, got {}", - ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST, - bundleReferences.size()); - throw new RuntimeException("Task input parameter " - + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST, bundleReferences.size()); + throw new RuntimeException("Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST + " contains unexpected number of Bundle IDs, expected 1, got " + bundleReferences.size()); } - else if (!bundleReferences.get(0).hasReference() - || !bundleReferences.get(0).getReference().contains("/Bundle/")) + else if (!bundleReferences.get(0).hasReference() || !bundleReferences.get(0).getReference() + .contains("/Bundle/")) { logger.error("Task input parameter {} has no Bundle reference", - ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); - throw new RuntimeException("Task input parameter " - + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); + throw new RuntimeException("Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST + " has no Bundle reference"); } diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java index 67bd86f32..68f38815b 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java @@ -1,5 +1,9 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; +import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; + import java.util.Collections; import java.util.Map; import java.util.Objects; @@ -10,8 +14,6 @@ import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsUpdateAllowList; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; @@ -69,8 +71,8 @@ public void doExecute(DelegateExecution execution) throws Exception Bundle transaction = new Bundle().setType(BundleType.TRANSACTION); transaction.getMeta().addTag().setSystem("http://highmed.org/fhir/CodeSystem/authorization-role") .setCode("REMOTE"); - transaction.getIdentifier().setSystem(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) - .setValue(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); + transaction.getIdentifier().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) + .setValue(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); searchSet.getEntry().stream() .filter(e -> e.hasSearch() && SearchEntryMode.MATCH.equals(e.getSearch().getMode()) && e.hasResource() && e.getResource() instanceof Organization).map(e -> (Organization) e.getResource()) @@ -80,13 +82,13 @@ public void doExecute(DelegateExecution execution) throws Exception FhirContext.forR4().newJsonParser().encodeResourceToString(transaction)); IdType result = client.withMinimalReturn().updateConditionaly(transaction, Map.of("identifier", Collections - .singletonList(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST + "|" - + ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST))); + .singletonList(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST + "|" + + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST))); Task task = getLeadingTaskFromExecutionVariables(); task.addOutput().setValue(new Reference(new IdType("Bundle", result.getIdPart(), result.getVersionIdPart()))) - .getType().addCoding().setSystem(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) - .setCode(ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); + .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) + .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); } private Consumer<? super Organization> addAllowListEntry(Bundle transaction, Bundle searchSet) @@ -139,8 +141,8 @@ private Optional<Identifier> getDefaultIdentifier(Organization org) private Optional<Identifier> getDefaultIdentifier(Endpoint ept) { - return ept.getIdentifier().stream() - .filter(i -> ConstantsBase.NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER.equals(i.getSystem())).findFirst(); + return ept.getIdentifier().stream().filter(i -> NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER.equals(i.getSystem())) + .findFirst(); } private Optional<Endpoint> getEndpoint(Reference endpoint, Bundle searchSet) diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java index a908e5f20..9ff3a6a74 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java @@ -1,10 +1,12 @@ package org.highmed.dsf.bpe.message; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_BUNDLE_ID; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; + import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsUpdateResources; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; @@ -27,7 +29,7 @@ public SendRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskH @Override protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) { - String bundleId = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_BUNDLE_ID); + String bundleId = (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_BUNDLE_ID); return Stream .of(toInputParameterBundleReference(getFhirWebserviceClientProvider().getLocalBaseUrl(), bundleId)); } @@ -37,9 +39,8 @@ private ParameterComponent toInputParameterBundleReference(String localBaseUrl, if (bundleId == null || bundleId.isEmpty()) throw new IllegalArgumentException("bundleId null or empty"); - return new ParameterComponent(new CodeableConcept( - new Coding(ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, null)), + return new ParameterComponent(new CodeableConcept(new Coding(CODESYSTEM_HIGHMED_UPDATE_RESOURCE, + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, null)), new Reference().setReference(localBaseUrl + (localBaseUrl.endsWith("/") ? "" : "/") + bundleId)); } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java index 4360bbb21..dd45cb078 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java @@ -1,10 +1,12 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP; + import java.util.Objects; import java.util.Optional; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; @@ -43,7 +45,7 @@ protected void doExecute(DelegateExecution execution) throws Exception { throw new RuntimeException( "Request check failed: process can only be started by requesting organization of type='" - + ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP + "'"); + + CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP + "'"); } } @@ -53,8 +55,7 @@ private boolean requesterIsNotOfTypeTtp(Identifier requester) .getOrganization(requester.getSystem(), requester.getValue()); return !organization.map(value -> value.getType().stream().anyMatch(type -> type.getCoding().stream().anyMatch( - coding -> coding.getSystem().equals(ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE) && coding - .getCode().equals(ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP)))) - .orElse(false); + coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE) && coding.getCode() + .equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP)))).orElse(false); } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java index 69768325e..a0f13f770 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java @@ -1,13 +1,17 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_BUNDLE_ID; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; + import java.util.List; import java.util.Objects; import java.util.regex.Pattern; import java.util.stream.Collectors; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsUpdateResources; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.organization.OrganizationProvider; @@ -51,9 +55,8 @@ public void doExecute(DelegateExecution execution) throws Exception { Task task = getCurrentTaskFromExecutionVariables(); List<Reference> references = getTaskHelper() - .getInputParameterReferenceValues(task, ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE) - .collect(Collectors.toList()); + .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_UPDATE_RESOURCE, + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE).collect(Collectors.toList()); if (references.size() != 1) { @@ -68,18 +71,17 @@ else if (!BUNDLE_ID_PATTERN.matcher(references.get(0).getReference()).matches()) } String bundleId = references.get(0).getReference(); - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_BUNDLE_ID, bundleId); + execution.setVariable(BPMN_EXECUTION_VARIABLE_BUNDLE_ID, bundleId); List<String> targetIdentifierSearchParameters = getTaskHelper() - .getInputParameterStringValues(task, ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER) + .getInputParameterStringValues(task, CODESYSTEM_HIGHMED_UPDATE_RESOURCE, + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER) .collect(Collectors.toList()); List<Target> targets = targetIdentifierSearchParameters.stream() .flatMap(organizationProvider::searchRemoteOrganizationsIdentifiers) .map(identifier -> Target.createUniDirectionalTarget(identifier.getValue())) .collect(Collectors.toList()); - execution - .setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); + execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); } } diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java index dd120e2d9..1f984efc2 100755 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java @@ -1,5 +1,8 @@ package org.highmed.dsf.bpe.service; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; +import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; + import java.util.EnumSet; import java.util.List; import java.util.Objects; @@ -8,7 +11,6 @@ import javax.ws.rs.WebApplicationException; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsUpdateResources; import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; import org.highmed.dsf.fhir.task.TaskHelper; @@ -92,27 +94,25 @@ public void doExecute(DelegateExecution execution) throws Exception private IdType getBundleId(Task task) { List<Reference> bundleReferences = getTaskHelper() - .getInputParameterReferenceValues(task, ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE) - .collect(Collectors.toList()); + .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_UPDATE_RESOURCE, + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE).collect(Collectors.toList()); if (bundleReferences.size() != 1) { logger.error("Task input parameter {} contains unexpected number of Bundle IDs, expected 1, got {}", - ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, - bundleReferences.size()); - throw new RuntimeException("Task input parameter " - + ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE - + " contains unexpected number of Bundle IDs, expected 1, got " + bundleReferences.size()); + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, bundleReferences.size()); + throw new RuntimeException( + "Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE + + " contains unexpected number of Bundle IDs, expected 1, got " + bundleReferences.size()); } else if (!bundleReferences.get(0).hasReference() || !bundleReferences.get(0).getReference() .contains("/Bundle/")) { logger.error("Task input parameter {} has no Bundle reference", - ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); - throw new RuntimeException("Task input parameter " - + ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE - + " has no Bundle reference"); + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); + throw new RuntimeException( + "Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE + + " has no Bundle reference"); } return new IdType(bundleReferences.get(0).getReference()); diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/EndListener.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/EndListener.java index fb10b2293..cd3c72914 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/EndListener.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/EndListener.java @@ -1,5 +1,13 @@ package org.highmed.dsf.bpe.listener; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_LEADING_TASK; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; + import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.ExecutionListener; import org.highmed.dsf.bpe.ConstantsBase; @@ -31,7 +39,7 @@ public EndListener(FhirWebserviceClient webserviceClient, TaskHelper taskHelper) public void notify(DelegateExecution execution) throws Exception { boolean inCalledProcess = (boolean) execution - .getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS); + .getVariable(BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS); // not in a called process --> process end if it is not a subprocess if (!inCalledProcess) @@ -40,13 +48,13 @@ public void notify(DelegateExecution execution) throws Exception if (execution.getParentId() == null || execution.getParentId().equals(execution.getProcessInstanceId())) { // not in a subprocess --> end of main process, write process outputs to task - task = (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_LEADING_TASK); + task = (Task) execution.getVariable(BPMN_EXECUTION_VARIABLE_LEADING_TASK); log(execution, task); } else { // in a subprocess --> process does not end here, outputs do not have to be written - task = (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK); + task = (Task) execution.getVariable(BPMN_EXECUTION_VARIABLE_TASK); } if (task.getStatus().equals(Task.TaskStatus.INPROGRESS)) @@ -60,20 +68,20 @@ public void notify(DelegateExecution execution) throws Exception { // in a called process --> process does not end here, don't change the task variable // reset VARIABLE_IS_CALL_ACTIVITY to false, since we leave the called process - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS, false); + execution.setVariable(BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS, false); } } private void log(DelegateExecution execution, Task task) { String processUrl = task.getInstantiatesUri(); - String messageName = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME).orElse(null); - String businessKey = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); + String messageName = taskHelper.getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME).orElse(null); + String businessKey = taskHelper.getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); String correlationKey = taskHelper - .getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); + .getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); String taskId = task.getIdElement().getIdPart(); logger.info("Process {} finished [message: {}, businessKey: {}, correlationKey: {}, taskId: {}]", processUrl, diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/StartListener.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/StartListener.java index 2d449dc78..226801972 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/StartListener.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/listener/StartListener.java @@ -1,5 +1,13 @@ package org.highmed.dsf.bpe.listener; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_LEADING_TASK; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; + import java.util.Objects; import org.camunda.bpm.engine.delegate.DelegateExecution; @@ -33,33 +41,33 @@ public void notify(DelegateExecution execution) throws Exception // start of main process instance if no parent available or the parent id is same as the actual process id if (execution.getParentId() == null || execution.getParentId().equals(execution.getProcessInstanceId())) { - Task task = (Task) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK); + Task task = (Task) execution.getVariable(BPMN_EXECUTION_VARIABLE_TASK); // sets initial task variable a second time in a different variable. subprocesses which start // with a task resource override the initially set task variable - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_LEADING_TASK, task); + execution.setVariable(BPMN_EXECUTION_VARIABLE_LEADING_TASK, task); log(execution, task); } // if a main process is started (not a call- or subprocess), this variable has to be initialized. // it is set to false, since a main process is not a called process - if (!execution.getVariableNames().contains(ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS)) + if (!execution.getVariableNames().contains(BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS)) { - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS, false); + execution.setVariable(BPMN_EXECUTION_VARIABLE_IN_CALLED_PROCESS, false); } } private void log(DelegateExecution execution, Task task) { String processUrl = task.getInstantiatesUri(); - String messageName = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME).orElse(null); - String businessKey = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); + String messageName = taskHelper.getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME).orElse(null); + String businessKey = taskHelper.getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); String correlationKey = taskHelper - .getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); + .getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); String taskId = task.getIdElement().getIdPart(); logger.info("Starting process {} [message: {}, businessKey: {}, correlationKey: {}, taskId: {}]", processUrl, diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/webservice/ProcessService.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/webservice/ProcessService.java index 5d2f27247..d2a95ae2a 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/webservice/ProcessService.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/webservice/ProcessService.java @@ -1,5 +1,7 @@ package org.highmed.dsf.bpe.webservice; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_QUERY_PARAMETERS; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -23,7 +25,6 @@ import org.camunda.bpm.engine.repository.Deployment; import org.camunda.bpm.engine.repository.ProcessDefinition; import org.camunda.bpm.model.bpmn.BpmnModelInstance; -import org.highmed.dsf.bpe.ConstantsBase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.InitializingBean; @@ -84,7 +85,7 @@ private Response start(String processDefinitionKey, String versionTag, Map<Strin } runtimeService.startProcessInstanceById(processDefinition.getId(), UUID.randomUUID().toString(), - Map.of(ConstantsBase.BPMN_EXECUTION_VARIABLE_QUERY_PARAMETERS, queryParameters)); + Map.of(BPMN_EXECUTION_VARIABLE_QUERY_PARAMETERS, queryParameters)); return Response.status(Status.CREATED).build(); } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/organization/OrganizationProviderImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/organization/OrganizationProviderImpl.java index d9143d197..c7ccc925d 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/organization/OrganizationProviderImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/organization/OrganizationProviderImpl.java @@ -1,5 +1,7 @@ package org.highmed.dsf.fhir.organization; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; + import java.util.Collections; import java.util.List; import java.util.Map; @@ -47,7 +49,7 @@ public void afterPropertiesSet() throws Exception @Override public String getDefaultTypeSystem() { - return ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; + return CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; } @Override diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java index b44e8f45a..1b970efda 100755 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/fhir/task/TaskHandler.java @@ -1,5 +1,12 @@ package org.highmed.dsf.fhir.task; +import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; +import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; + import java.util.Collections; import java.util.List; import java.util.Map; @@ -14,7 +21,6 @@ import org.camunda.bpm.engine.runtime.ProcessInstance; import org.camunda.bpm.engine.runtime.ProcessInstanceQuery; import org.camunda.bpm.engine.variable.Variables; -import org.highmed.dsf.bpe.ConstantsBase; import org.highmed.dsf.fhir.variables.FhirResourceValues; import org.highmed.fhir.client.FhirWebserviceClient; import org.hl7.fhir.r4.model.Task; @@ -59,16 +65,14 @@ public void onTask(Task task) String processDefinitionKey = pathSegments.get(2); String versionTag = pathSegments.size() == 4 ? pathSegments.get(3) : null; - String messageName = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME).orElse(null); - String businessKey = taskHelper.getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); - String correlationKey = taskHelper - .getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); + String messageName = taskHelper.getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME).orElse(null); + String businessKey = taskHelper.getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); + String correlationKey = taskHelper.getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, + CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); - Map<String, Object> variables = Map - .of(ConstantsBase.BPMN_EXECUTION_VARIABLE_TASK, FhirResourceValues.create(task)); + Map<String, Object> variables = Map.of(BPMN_EXECUTION_VARIABLE_TASK, FhirResourceValues.create(task)); try { @@ -76,8 +80,8 @@ public void onTask(Task task) } catch (Exception exception) { - Task.TaskOutputComponent errorOutput = taskHelper.createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, exception.getMessage()); + Task.TaskOutputComponent errorOutput = taskHelper + .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, exception.getMessage()); task.addOutput(errorOutput); task.setStatus(Task.TaskStatus.FAILED); webserviceClient.update(task); diff --git a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/task-bundle.json b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/task-bundle.json index ea1a881d3..6369032f3 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/resources/integration/task-bundle.json +++ b/dsf-fhir/dsf-fhir-server/src/test/resources/integration/task-bundle.json @@ -67,7 +67,7 @@ "resource": { "resourceType": "ResearchStudy", "meta": { - "profile": [ "http://highmed.org/fhir/StructureDefinition/research-study-feasibility" ] + "profile": [ "http://highmed.org/fhir/StructureDefinition/research-study" ] }, "extension": [ { "url": "http://highmed.org/fhir/StructureDefinition/extension-participating-medic", diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-query-type.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml similarity index 86% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-query-type.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml index 5904bf429..9a9020e65 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-query-type.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml @@ -6,12 +6,10 @@ </tag> </meta> <url value="http://highmed.org/fhir/CodeSystem/query-type"/> - <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="0.4.0"/> <name value="HiGHmed_Query_Type"/> <title value="HiGHmed Query Type"/> - <!-- status managed by bpe --> - <status value="unknown" /> + <status value="active"/> <experimental value="false"/> <date value="2020-11-23"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml.post new file mode 100644 index 000000000..ffdbfbed3 --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/CodeSystem/query-type&version=0.4.0 \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml similarity index 91% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml index 124008831..44a43bac6 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml @@ -6,8 +6,7 @@ </tag> </meta> <name value="HiGHmed_ResearchStudy_Identifier"/> - <!-- status managed by bpe --> - <status value="unknown" /> + <status value="active" /> <kind value="identifier"/> <date value="2020-11-23"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml.post new file mode 100755 index 000000000..a63f52dd4 --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml.post @@ -0,0 +1 @@ +name=HiGHmed_ResearchStudy_Identifier \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml similarity index 92% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml index 0a100f492..59ba8c88f 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml @@ -6,11 +6,9 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> - <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="0.4.0" /> <name value="GroupId" /> - <!-- status managed by bpe --> - <status value="unknown" /> + <status value="active" /> <experimental value="false" /> <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml.post new file mode 100644 index 000000000..e1bf415a7 --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/StructureDefinition/extension-group-id&version=0.4.0 \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml similarity index 95% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml index 6730b2261..8eb41f218 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml @@ -6,11 +6,9 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/extension-participating-medic" /> - <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="0.4.0" /> <name value="ParticipatingMedic" /> - <!-- status managed by bpe --> - <status value="unknown" /> + <status value="active" /> <experimental value="false" /> <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml.post new file mode 100644 index 000000000..a8fba13a8 --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/StructureDefinition/extension-participating-medic&version=0.4.0 \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml similarity index 95% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml index 14fe84970..b4cee3acc 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml @@ -6,11 +6,9 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/extension-participating-ttp" /> - <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="0.4.0" /> <name value="ParticipatingTtp" /> - <!-- status managed by bpe --> - <status value="unknown" /> + <status value="active" /> <experimental value="false" /> <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml.post new file mode 100644 index 000000000..0a7afca30 --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/StructureDefinition/extension-participating-ttp&version=0.4.0 \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml similarity index 92% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml index 59aef12ea..32b501a45 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-extension-query.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml @@ -6,11 +6,9 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/extension-query" /> - <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="0.4.0" /> <name value="Query" /> - <!-- status managed by bpe --> - <status value="unknown" /> + <status value="active" /> <experimental value="false" /> <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml.post new file mode 100644 index 000000000..b05bf5bf0 --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/StructureDefinition/extension-query&version=0.4.0 \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml similarity index 91% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml index 35e706a28..18747716b 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-group.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml @@ -6,11 +6,9 @@ </tag> </meta> <url value="http://highmed.org/fhir/StructureDefinition/group" /> - <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="0.4.0" /> <name value="Group" /> - <!-- status managed by bpe --> - <status value="unknown" /> + <status value="active" /> <experimental value="false" /> <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml.post new file mode 100644 index 000000000..38ef9ff5e --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/StructureDefinition/group&version=0.4.0 \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml similarity index 94% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml index 115b3642b..6e22c8129 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-research-study-feasibility.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml @@ -5,12 +5,10 @@ <code value="REMOTE" /> </tag> </meta> - <url value="http://highmed.org/fhir/StructureDefinition/research-study-feasibility" /> - <!-- version managed by bpe --> - <version value="bpe-managed" /> - <name value="ResearchStudyFeasibility" /> - <!-- status managed by bpe --> - <status value="unknown" /> + <url value="http://highmed.org/fhir/StructureDefinition/research-study" /> + <version value="0.4.0" /> + <name value="ResearchStudy" /> + <status value="active" /> <experimental value="false" /> <date value="2020-11-23" /> <fhirVersion value="4.0.1" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml.post new file mode 100644 index 000000000..594d957b3 --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/StructureDefinition/research-study&version=0.4.0 \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-query-type.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml similarity index 88% rename from dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-query-type.xml rename to dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml index 6cde8914e..91c0d6770 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-query-type.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml @@ -6,12 +6,10 @@ </tag> </meta> <url value="http://highmed.org/fhir/ValueSet/query-type"/> - <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="0.4.0" /> <name value="HiGHmed_Query_Type"/> <title value="HiGHmed Query Type"/> - <!-- status managed by bpe --> - <status value="unknown" /> + <status value="active" /> <experimental value="false"/> <date value="2020-11-23"/> <publisher value="HiGHmed"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml.post b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml.post new file mode 100644 index 000000000..d648fe653 --- /dev/null +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml.post @@ -0,0 +1 @@ +url=http://highmed.org/fhir/ValueSet/query-type&version=0.4.0 \ No newline at end of file From 30b6ef93c2035a36e47d748ec78ac1ecab1b9f5c Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 19 Jan 2021 00:12:35 +0100 Subject: [PATCH 66/75] added test deleting deleted resource --- .../integration/BinaryIntegrationTest.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BinaryIntegrationTest.java b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BinaryIntegrationTest.java index 134ebd4d7..46ba3a3c5 100755 --- a/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BinaryIntegrationTest.java +++ b/dsf-fhir/dsf-fhir-server/src/test/java/org/highmed/dsf/fhir/integration/BinaryIntegrationTest.java @@ -1613,6 +1613,43 @@ public void testDelete() throws Exception binaryDao.read(UUID.fromString(created.getIdElement().getIdPart())); } + @Test(expected = ResourceDeletedException.class) + public void testDeleteDeleted() throws Exception + { + OrganizationDao orgDao = getSpringWebApplicationContext().getBean(OrganizationDao.class); + Organization createdOrg = orgDao.create(new Organization()); + + final String contentType = MediaType.TEXT_PLAIN; + final byte[] data1 = "Hello World".getBytes(StandardCharsets.UTF_8); + + Binary binary = new Binary(); + binary.setContentType(contentType); + binary.setData(data1); + binary.setSecurityContext(new Reference(createdOrg.getIdElement().toVersionless())); + + BinaryDao binaryDao = getSpringWebApplicationContext().getBean(BinaryDao.class); + Binary created = binaryDao.create(binary); + + assertNotNull(created); + assertNotNull(created.getIdElement().toString()); + assertEquals("1", created.getMeta().getVersionId()); + assertNotNull(created.getMeta().getLastUpdated()); + + assertNotNull(created.getContentType()); + assertEquals(contentType, created.getContentType()); + assertTrue(Arrays.equals(data1, created.getData())); + + assertNotNull(created.getSecurityContext()); + assertEquals(createdOrg.getIdElement().toVersionless(), created.getSecurityContext().getReferenceElement()); + + boolean deleted = binaryDao.delete(UUID.fromString(created.getIdElement().getIdPart())); + assertTrue(deleted); + + getWebserviceClient().delete(Binary.class, created.getIdElement().getIdPart()); + + binaryDao.read(UUID.fromString(created.getIdElement().getIdPart())); + } + @Test(expected = WebApplicationException.class) public void testDeleteNotAllowedExternalUser() throws Exception { From 78c5d97df7307bb11453b0849df6eaa348e053d5 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 19 Jan 2021 00:39:02 +0100 Subject: [PATCH 67/75] implements #165 creating and deleting of resources from draft processes Implementation allows for creating of FHIR resources added to an existing draft process after the process was deployed for the first time, as well as deleting of FHIR resources not needed any more by an already deployed at least once draft process. --- .../bpe/dao/ProcessPluginResourcesDao.java | 4 +- .../dao/ProcessPluginResourcesDaoJdbc.java | 23 +++++- .../highmed/dsf/bpe/process/ResourceInfo.java | 5 ++ .../bpe/service/FhirResourceHandlerImpl.java | 77 ++++++++++++++++--- .../src/main/resources/db/db.changelog.xml | 1 + ...ess_plugin_resources.changelog-0.4.0.1.xml | 14 ++++ 6 files changed, 111 insertions(+), 13 deletions(-) create mode 100644 dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_plugin_resources.changelog-0.4.0.1.xml diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDao.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDao.java index 7ba0caef5..a86618ba1 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDao.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDao.java @@ -4,6 +4,7 @@ import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.UUID; import org.highmed.dsf.bpe.process.ProcessKeyAndVersion; import org.highmed.dsf.bpe.process.ProcessesResource; @@ -15,5 +16,6 @@ public interface ProcessPluginResourcesDao Map<ProcessKeyAndVersion, List<ResourceInfo>> getResources() throws SQLException; - void addResources(Collection<? extends ProcessesResource> newResources) throws SQLException; + void addOrRemoveResources(Collection<? extends ProcessesResource> newResources, List<UUID> deletedResourcesIds) + throws SQLException; } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDaoJdbc.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDaoJdbc.java index 17d3238e5..fc437079e 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDaoJdbc.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/dao/ProcessPluginResourcesDaoJdbc.java @@ -104,9 +104,11 @@ public Map<ProcessKeyAndVersion, List<ResourceInfo>> getResources() throws SQLEx } @Override - public void addResources(Collection<? extends ProcessesResource> newResources) throws SQLException + public void addOrRemoveResources(Collection<? extends ProcessesResource> newResources, + List<UUID> deletedResourcesIds) throws SQLException { Objects.requireNonNull(newResources, "newResources"); + Objects.requireNonNull(deletedResourcesIds, "deletedResourcesIds"); if (newResources.isEmpty()) return; @@ -184,6 +186,25 @@ public void addResources(Collection<? extends ProcessesResource> newResources) t throw e; } + try (PreparedStatement statement = connection + .prepareStatement("DELETE FROM process_plugin_resources WHERE resource_id = ?")) + { + for (UUID deletedId : deletedResourcesIds) + { + statement.setObject(1, uuidToPgObject(deletedId)); + + statement.addBatch(); + logger.trace("Executing query '{}'", statement); + } + + statement.executeBatch(); + } + catch (SQLException e) + { + connection.rollback(); + throw e; + } + connection.commit(); } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ResourceInfo.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ResourceInfo.java index 9187f5521..9717828b8 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ResourceInfo.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/process/ResourceInfo.java @@ -157,4 +157,9 @@ public ResourceInfo setResourceId(UUID resourceId) return this; } + + public boolean hasResourceId() + { + return resourceId != null; + } } diff --git a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java index 5ecc8b507..24c302aaf 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java +++ b/dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/service/FhirResourceHandlerImpl.java @@ -81,25 +81,44 @@ public void applyStateChangesAndStoreNewResourcesInDb( Stream<ProcessesResource> proccessResources = getResources(definitionByProcessKeyAndVersion, dbResourcesByProcess, change.getProcessKeyAndVersion()); - proccessResources.forEach(r -> + proccessResources.forEach(res -> { - resources.computeIfPresent(r.getResourceInfo(), (k, v) -> + resources.computeIfPresent(res.getResourceInfo(), (k, v) -> { - v.addAll(r.getProcesses()); + v.addAll(res.getProcesses()); if (change.getNewProcessState().isHigherPriority(v.getNewProcessState())) v.setNewProcessState(change.getNewProcessState()); - if (change.getOldProcessState().isHigherPriority(v.getOldProcessState())) + + // only override resource state if not special case for previously unknown resource (no resource id) + if (v.getResourceInfo().hasResourceId() + && change.getOldProcessState().isHigherPriority(v.getOldProcessState())) v.setOldProcessState(change.getOldProcessState()); return v; }); - resources.putIfAbsent(r.getResourceInfo(), r.setNewProcessState(change.getNewProcessState()) - .setOldProcessState(change.getOldProcessState())); + ProcessesResource nullIfNotNeededByOther = resources.putIfAbsent(res.getResourceInfo(), + res.setNewProcessState(change.getNewProcessState()) + .setOldProcessState(change.getOldProcessState())); + + if (nullIfNotNeededByOther == null) + { + // special case for previously unknown resource (no resource id) + if (ProcessState.DRAFT.equals(change.getOldProcessState()) + && ProcessState.DRAFT.equals(change.getNewProcessState()) + && !res.getResourceInfo().hasResourceId()) + { + logger.info("Adding new resource {}?{}", res.getResourceInfo().getResourceType(), + res.getResourceInfo().toConditionalCreateUrl()); + res.setOldProcessState(ProcessState.NEW); + } + } }); } + addRemovedResources(changes, dbResourcesByProcess, resources); + List<ProcessesResource> resourceValues = new ArrayList<>( resources.values().stream().filter(ProcessesResource::hasStateChangeOrDraft) .filter(ProcessesResource::notNewToExcludedChange).collect(Collectors.toList())); @@ -119,14 +138,14 @@ public void applyStateChangesAndStoreNewResourcesInDb( logger.debug("Executing process plugin resources bundle"); logger.trace("Bundle: {}", fhirContext.newJsonParser().encodeResourceToString(batchBundle)); - // // TODO retries + // TODO retries Bundle returnBundle = localWebserviceClient.withMinimalReturn().withRetry(1).postBundle(batchBundle); - addIds(resourceValues, returnBundle); + List<UUID> deletedResourcesIds = addIdsAndReturnDeleted(resourceValues, returnBundle); try { - dao.addResources(resources.values()); + dao.addOrRemoveResources(resources.values(), deletedResourcesIds); } catch (SQLException e) { @@ -145,12 +164,41 @@ public void applyStateChangesAndStoreNewResourcesInDb( } } - private void addIds(List<ProcessesResource> resourceValues, Bundle returnBundle) + private void addRemovedResources(List<ProcessStateChangeOutcome> changes, + Map<ProcessKeyAndVersion, List<ResourceInfo>> dbResourcesByProcess, + Map<ResourceInfo, ProcessesResource> resources) + { + for (ProcessStateChangeOutcome change : changes) + { + if (ProcessState.DRAFT.equals(change.getOldProcessState()) + && ProcessState.DRAFT.equals(change.getNewProcessState())) + { + List<ResourceInfo> dbResources = dbResourcesByProcess.getOrDefault(change.getProcessKeyAndVersion(), + Collections.emptyList()); + + dbResources.forEach(dbRes -> + { + ProcessesResource processRes = ProcessesResource.from(dbRes); + processRes.setOldProcessState(ProcessState.DRAFT); + processRes.setNewProcessState(ProcessState.EXCLUDED); + + ProcessesResource nullIfNotNeededByOther = resources.putIfAbsent(dbRes, processRes); + + if (nullIfNotNeededByOther == null) + logger.info("Deleting resource {}?{} with id {} if exists", dbRes.getResourceType(), + dbRes.toConditionalCreateUrl(), dbRes.getResourceId()); + }); + } + } + } + + private List<UUID> addIdsAndReturnDeleted(List<ProcessesResource> resourceValues, Bundle returnBundle) { if (resourceValues.size() != returnBundle.getEntry().size()) throw new RuntimeException("Return bundle size unexpeced, expected " + resourceValues.size() + " got " + returnBundle.getEntry().size()); + List<UUID> deletedIds = new ArrayList<>(); for (int i = 0; i < resourceValues.size(); i++) { ProcessesResource resource = resourceValues.get(i); @@ -181,8 +229,14 @@ else if (resource.getResourceInfo().getResourceId() != null resource.getResourceInfo().setResourceId(toUuid(id.getIdPart())); } else + { + deletedIds.add(resource.getResourceInfo().getResourceId()); + resource.getResourceInfo().setResourceId(null); + } } + + return deletedIds; } private Stream<ProcessesResource> getResources( @@ -200,6 +254,7 @@ private Stream<ProcessesResource> getResources( Optional<UUID> resourceId = getResourceId(dbResourcesByProcess, process, resource.getResourceInfo()); resourceId.ifPresent(id -> resource.getResourceInfo().setResourceId(id)); + // not present: new resource, unknown to bpe db return resource; }); @@ -421,7 +476,7 @@ private BundleEntryComponent delete(ProcessesResource resource) BundleEntryRequestComponent request = entry.getRequest(); request.setMethod(HTTPVerb.DELETE); - request.setUrl(resource.getResourceInfo().getResourceType() + "/" + request.setUrl(resource.getResourceInfo().getResourceType() + "?_id=" + resource.getResourceInfo().getResourceId().toString()); return entry; diff --git a/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.changelog.xml b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.changelog.xml index 67d9af4cd..5c2490060 100644 --- a/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.changelog.xml +++ b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.changelog.xml @@ -14,6 +14,7 @@ <include file="db/db.camunda_engine.changelog-0.3.0.xml" /> <include file="db/db.process_plugin_resources.changelog-0.4.0.xml" /> + <include file="db/db.process_plugin_resources.changelog-0.4.0.1.xml" /> <include file="db/db.process_states.changelog-0.4.0.xml" /> </databaseChangeLog> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_plugin_resources.changelog-0.4.0.1.xml b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_plugin_resources.changelog-0.4.0.1.xml new file mode 100644 index 000000000..13a8d75f4 --- /dev/null +++ b/dsf-bpe/dsf-bpe-server/src/main/resources/db/db.process_plugin_resources.changelog-0.4.0.1.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<databaseChangeLog + xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog + http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + + <changeSet author="hhund" id="db.process_plugin_resources.changelog-0.4.0.1"> + <sql dbms="postgresql"> + GRANT DELETE ON TABLE process_plugin_resources TO ${db.server_users_group}; + </sql> + </changeSet> + +</databaseChangeLog> \ No newline at end of file From 1c17efede029ea6f56585ef2e72827e860a8f580 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 19 Jan 2021 13:00:32 +0100 Subject: [PATCH 68/75] bug fix, all reponse objects from jaxrs clients need to be closed If the response body is not read (readEntity(..)) and implicitly closed, the response object needs to be closed explicitly otherwise the http client connection pool will run out of connections resulting in the thread waiting for an connection to be release. --- .../org/highmed/fhir/client/FhirWebserviceClientJersey.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dsf-fhir/dsf-fhir-webservice-client/src/main/java/org/highmed/fhir/client/FhirWebserviceClientJersey.java b/dsf-fhir/dsf-fhir-webservice-client/src/main/java/org/highmed/fhir/client/FhirWebserviceClientJersey.java index cc9d05364..7d26a3728 100755 --- a/dsf-fhir/dsf-fhir-webservice-client/src/main/java/org/highmed/fhir/client/FhirWebserviceClientJersey.java +++ b/dsf-fhir/dsf-fhir-webservice-client/src/main/java/org/highmed/fhir/client/FhirWebserviceClientJersey.java @@ -419,6 +419,8 @@ public void delete(Class<? extends Resource> resourceClass, String id) if (Status.OK.getStatusCode() != response.getStatus() && Status.NO_CONTENT.getStatusCode() != response.getStatus()) throw handleError(response); + else + response.close(); } @Override @@ -441,6 +443,8 @@ public void deleteConditionaly(Class<? extends Resource> resourceClass, Map<Stri if (Status.OK.getStatusCode() != response.getStatus() && Status.NO_CONTENT.getStatusCode() != response.getStatus()) throw handleError(response); + else + response.close(); } @Override From 7ebf0c959f0c7439298bfaf01d27dcb23cebdada Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 19 Jan 2021 13:47:22 +0100 Subject: [PATCH 69/75] removing unused imports --- .../org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java | 1 - .../java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java | 1 - 2 files changed, 2 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java index 4e040bce7..da228a4dd 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java @@ -10,7 +10,6 @@ import org.highmed.dsf.fhir.resources.AbstractResource; import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; import org.highmed.dsf.fhir.resources.CodeSystemResource; -import org.highmed.dsf.fhir.resources.NamingSystemResource; import org.highmed.dsf.fhir.resources.ResourceProvider; import org.highmed.dsf.fhir.resources.StructureDefinitionResource; import org.highmed.dsf.fhir.resources.ValueSetResource; diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java index 7a9446925..8597de859 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java @@ -12,7 +12,6 @@ import java.util.stream.Stream; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; From 1594ed096ddacd9ec9e0740ce7d647ecaa004f6d Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 19 Jan 2021 21:10:32 +0100 Subject: [PATCH 70/75] version management of FHIR resource now via replacing ${version} The bpe now replaces all occurances of ${version} in FHIR resources with the version of the process plugin configured in the ProcessPluginDefinition --- .../fhir/resources/ResourceProviderImpl.java | 17 +++++++++++------ .../highmed-computeFeasibility.xml | 2 +- .../highmed-executeFeasibility.xml | 2 +- .../highmed-requestFeasibility.xml | 2 +- .../fhir/CodeSystem/highmed-feasibility.xml | 2 +- .../highmed-task-compute-feasibility.xml | 4 ++-- .../highmed-task-error-feasibility.xml | 4 ++-- .../highmed-task-execute-feasibility.xml | 4 ++-- ...hmed-task-multi-medic-result-feasibility.xml | 4 ++-- .../highmed-task-request-feasibility.xml | 4 ++-- ...med-task-single-medic-result-feasibility.xml | 4 ++-- .../fhir/ValueSet/highmed-feasibility.xml | 2 +- .../highmed-localServicesIntegration.xml | 2 +- .../highmed-task-local-services-integration.xml | 4 ++-- .../fhir/ActivityDefinition/highmed-ping.xml | 2 +- .../fhir/ActivityDefinition/highmed-pong.xml | 2 +- .../StructureDefinition/highmed-task-ping.xml | 4 ++-- .../StructureDefinition/highmed-task-pong.xml | 4 ++-- .../highmed-task-start-ping-process.xml | 4 ++-- .../highmed-downloadAllowList.xml | 2 +- .../highmed-updateAllowList.xml | 2 +- .../CodeSystem/highmed-update-allow-list.xml | 2 +- .../highmed-task-download-allow-list.xml | 4 ++-- .../highmed-task-update-allow-list.xml | 4 ++-- .../fhir/ValueSet/highmed-update-allow-list.xml | 2 +- .../highmed-executeUpdateResources.xml | 2 +- .../highmed-requestUpdateResources.xml | 2 +- .../CodeSystem/highmed-update-resources.xml | 2 +- .../highmed-task-execute-update-resources.xml | 4 ++-- .../highmed-task-request-update-resources.xml | 4 ++-- .../fhir/ValueSet/highmed-update-resources.xml | 2 +- 31 files changed, 55 insertions(+), 50 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java index e74e0fcda..842c81265 100644 --- a/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java +++ b/dsf-bpe/dsf-bpe-process-base/src/main/java/org/highmed/dsf/fhir/resources/ResourceProviderImpl.java @@ -2,6 +2,7 @@ import java.io.IOException; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -13,9 +14,11 @@ import java.util.function.Function; import java.util.function.Predicate; import java.util.function.Supplier; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.apache.commons.io.IOUtils; import org.hl7.fhir.r4.model.ActivityDefinition; import org.hl7.fhir.r4.model.CodeSystem; import org.hl7.fhir.r4.model.MetadataResource; @@ -31,6 +34,9 @@ class ResourceProviderImpl implements ResourceProvider { private static final Logger logger = LoggerFactory.getLogger(ResourceProviderImpl.class); + private static final String VERSION_PATTERN_STRING = "${version}"; + private static final Pattern VERSION_PATTERN = Pattern.compile(Pattern.quote(VERSION_PATTERN_STRING)); + private final Map<String, List<ActivityDefinition>> activityDefinitionsByProcessKeyAndVersion = new HashMap<>(); private final Map<String, List<CodeSystem>> codeSystemsByProcessKeyAndVersion = new HashMap<>(); private final Map<String, List<NamingSystem>> namingSystemsByProcessKeyAndVersion = new HashMap<>(); @@ -278,16 +284,15 @@ private static MetadataResource read(String processPluginVersion, Supplier<IPars private static <T extends MetadataResource> T parseResourceAndSetVersion(String processPluginVersion, Supplier<IParser> parserSupplier, ClassLoader classLoader, String fileName, Class<T> type) { - logger.debug("Reading {} from {}", type.getSimpleName(), fileName); + logger.debug("Reading {} from {} and replacing all occurrence of {} with {}", type.getSimpleName(), fileName, + VERSION_PATTERN_STRING, processPluginVersion); try (InputStream in = classLoader.getResourceAsStream(fileName)) { - T r = parserSupplier.get().parseResource(type, in); - - if (!(r instanceof NamingSystem)) - r.setVersion(processPluginVersion); + String read = IOUtils.toString(in, StandardCharsets.UTF_8); + read = VERSION_PATTERN.matcher(read).replaceAll(processPluginVersion); - return r; + return parserSupplier.get().parseResource(type, read); } catch (IOException e) { diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml index 1c973146d..9c04a616a 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml @@ -71,7 +71,7 @@ </extension> <url value="http://highmed.org/bpe/Process/computeFeasibility" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="computeFeasibility" /> <title value="Compute Feasibility" /> <subtitle value="Process to compute feasibility result" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml index 90abc1635..6cd870cb6 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml @@ -45,7 +45,7 @@ </extension> <url value="http://highmed.org/bpe/Process/executeFeasibility" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="executeFeasibility" /> <title value="Execute a Feasibility" /> <subtitle value="Process to execute a feasibility query" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml index 973d52d9d..e5e709526 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml @@ -103,7 +103,7 @@ </extension> <url value="http://highmed.org/bpe/Process/requestFeasibility" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="requestFeasibility" /> <title value="Request feasibility" /> <subtitle value="Feasibility Request Process" /> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml index c95bd4517..b8b9f218e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/CodeSystem/feasibility"/> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="HiGHmed_Feasibility"/> <title value="HiGHmed Feasibility"/> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml index 935abe580..3a6f2904c 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskComputeFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml index 6f4e4cba5..09e592fd0 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml @@ -8,7 +8,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskErrorFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -23,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml index 0fadae838..03472fe64 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskExecuteFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/executeFeasibility/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml index d6d6d2995..c38a106c6 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskMultiMedicResultFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml index 731cd9dbd..09b12a4ee 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskRequestFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml index 5ee81e6ae..fe30a2b4e 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskSingleMedicResultFeasibility" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml index 960e57e5c..eab1079f6 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/ValueSet/feasibility"/> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="HiGHmed_Feasibility"/> <title value="HiGHmed Feasibility"/> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml index 40d0c0e6a..85ce0a72c 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml @@ -40,7 +40,7 @@ </extension> <url value="http://highmed.org/bpe/Process/localServicesIntegration"/> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="localServicesIntegration"/> <title value="Local services integration"/> <subtitle value="Service integration process"/> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml index 47f04b76c..89fae40e2 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml +++ b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml @@ -8,7 +8,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskLocalServicesIntegration" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -23,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/localServicesIntegration/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/localServicesIntegration/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml index c6b06e4ad..a2f36cd07 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml @@ -95,7 +95,7 @@ </extension> <url value="http://highmed.org/bpe/Process/ping" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="ping" /> <title value="PING process" /> <subtitle value="Communication Testing Process" /> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml index adcc5e653..77c5cc099 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml @@ -51,7 +51,7 @@ </extension> <url value="http://highmed.org/bpe/Process/pong" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="pong" /> <title value="PONG process" /> <subtitle value="Communication Testing Process" /> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml index eae71d505..9e4c3db4d 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-ping" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskPing" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/pong/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/pong/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml index e15541e25..435d27165 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-pong" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskPong" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/ping/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/ping/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml index d8437524c..2d470832d 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml +++ b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskStartProcess" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/ping/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/ping/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml index 0a1164d83..7cc21051d 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml @@ -51,7 +51,7 @@ </extension> <url value="http://highmed.org/bpe/Process/downloadAllowList" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="downloadAllowList" /> <title value="Download Allow List" /> <subtitle value="Download Allow List Bundle Process" /> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml index 25469b897..bc4a69048 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml @@ -39,7 +39,7 @@ </extension> <url value="http://highmed.org/bpe/Process/updateAllowList" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="updateAllowList" /> <title value="Update Allow List" /> <subtitle value="Update Allow List Bundle Process" /> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml index 11b3fe979..3f1e93ac0 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/CodeSystem/update-allow-list"/> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="HiGHmed_Update_Allow_List"/> <title value="HiGHmed Update Allow List"/> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml index f52f95636..b42d542fe 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml @@ -8,7 +8,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskDownloadAllowList" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -23,7 +23,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/downloadAllowList/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/downloadAllowList/${version}" /> </element> <element id="Task.input"> <path value="Task.input" /> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml index 4110a42a3..2566f824d 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskUpdateAllowList" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/updateAllowList/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/updateAllowList/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml index 5dd19abf7..915c8ef5a 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/ValueSet/update-allow-list"/> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="HiGHmed_Update_Allow_List"/> <title value="HiGHmed Update Allow List"/> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml index 2caa19c8e..8d1a2c559 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml @@ -45,7 +45,7 @@ </extension> <url value="http://highmed.org/bpe/Process/executeUpdateResources" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="executeUpdateResources" /> <title value="Execute Update of Resources" /> <subtitle value="Process to Download and Execute FHIR Bundle" /> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml index 4aa96abe4..71cb25cb0 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml @@ -39,7 +39,7 @@ </extension> <url value="http://highmed.org/bpe/Process/requestUpdateResources" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="requestUpdateResources" /> <title value="Request Update of Resources" /> <subtitle value="Process to Request a Bundle Download" /> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml index 84fb949a0..3f1c4a727 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/CodeSystem/update-resources"/> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="HiGHmed_Update_Resources"/> <title value="HiGHmed Update Resources"/> <!-- status managed by bpe --> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml index d3f324807..b07ef3233 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskExecuteUpdateResources" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeUpdateResources/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/executeUpdateResources/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml index d7a58996b..60f4bcf14 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources" /> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="TaskRequestUpdateResources" /> <!-- status managed by bpe --> <status value="unknown" /> @@ -22,7 +22,7 @@ <differential> <element id="Task.instantiatesUri"> <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestUpdateResources/0.4.0" /> + <fixedUri value="http://highmed.org/bpe/Process/requestUpdateResources/${version}" /> </element> <element id="Task.input"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml index e5381bc19..db4f9de4c 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml @@ -7,7 +7,7 @@ </meta> <url value="http://highmed.org/fhir/ValueSet/update-resources"/> <!-- version managed by bpe --> - <version value="bpe-managed" /> + <version value="${version}" /> <name value="HiGHmed_Update_Resources"/> <title value="HiGHmed Update Resources"/> <!-- status managed by bpe --> From d7a86813605cd7b911272a8e355adb3e191de60b Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 19 Jan 2021 22:21:20 +0100 Subject: [PATCH 71/75] moved GroupProfileTest and ResearchStudyProfileTest to validation module Tests now in same module as the tested xml files --- .../dsf/fhir/profiles}/GroupProfileTest.java | 26 +++++------- .../profiles}/ResearchStudyProfileTest.java | 40 +++++++++---------- 2 files changed, 29 insertions(+), 37 deletions(-) rename {dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile => dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles}/GroupProfileTest.java (58%) rename {dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile => dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles}/ResearchStudyProfileTest.java (54%) diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/GroupProfileTest.java similarity index 58% rename from dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java rename to dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/GroupProfileTest.java index d83ad4044..85c401324 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/GroupProfileTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/GroupProfileTest.java @@ -1,9 +1,5 @@ -package org.highmed.dsf.fhir.profile; +package org.highmed.dsf.fhir.profiles; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; -import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHMED_GROUP; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -40,20 +36,20 @@ public class GroupProfileTest public void testGroupProfileValid() throws Exception { Group group = new Group(); - group.getMeta().addProfile(PROFILE_HIGHMED_GROUP); + group.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/group"); group.setType(GroupType.PERSON); group.setActual(false); - group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY).setValue(new Expression().setLanguageElement( - new CodeType(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL).setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE)) - .setExpression("SELECT COUNT(e) FROM EHR e")); + group.addExtension().setUrl("http://highmed.org/fhir/StructureDefinition/extension-query") + .setValue(new Expression() + .setLanguageElement(new CodeType("application/x-aql-query") + .setSystem("http://highmed.org/fhir/CodeSystem/query-type")) + .setExpression("SELECT COUNT(e) FROM EHR e")); ValidationResult result = resourceValidator.validate(group); - result.getMessages().stream() - .map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + m.getLocationCol() + " - " + m - .getSeverity() + ": " + m.getMessage()).forEach(logger::info); + result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + + m.getLocationCol() + " - " + m.getSeverity() + ": " + m.getMessage()).forEach(logger::info); - assertEquals(0, result.getMessages().stream() - .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL - .equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } } diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/ResearchStudyProfileTest.java similarity index 54% rename from dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java rename to dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/ResearchStudyProfileTest.java index 4cd809de9..4ecc2f603 100644 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/ResearchStudyProfileTest.java +++ b/dsf-fhir/dsf-fhir-validation/src/test/java/org/highmed/dsf/fhir/profiles/ResearchStudyProfileTest.java @@ -1,10 +1,5 @@ -package org.highmed.dsf.fhir.profile; +package org.highmed.dsf.fhir.profiles; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHEMD_RESEARCH_STUDY; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -31,8 +26,8 @@ public class ResearchStudyProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-extension-participating-medic-0.4.0.xml", "highmed-extension-participating-ttp-0.4.0.xml", - "highmed-research-study-0.4.0.xml"), + Arrays.asList("highmed-extension-participating-medic-0.4.0.xml", + "highmed-extension-participating-ttp-0.4.0.xml", "highmed-research-study-0.4.0.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-organization-type-0.4.0.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-organization-type-0.4.0.xml")); @@ -43,28 +38,29 @@ public class ResearchStudyProfileTest public void testResearchStudyProfileValid() throws Exception { ResearchStudy res = new ResearchStudy(); - res.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY); - res.getIdentifierFirstRep().setSystem(NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER) + res.getMeta().addProfile("http://highmed.org/fhir/StructureDefinition/research-study"); + res.getIdentifierFirstRep().setSystem("http://highmed.org/fhir/NamingSystem/research-study-identifier") .setValue(UUID.randomUUID().toString()); res.setStatus(ResearchStudyStatus.ACTIVE); res.addEnrollment().setReference("Group/" + UUID.randomUUID().toString()); Reference medicRef1 = new Reference().setType(ResourceType.Organization.name()); - medicRef1.getIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - res.addExtension(EXTENSION_HIGHMED_PARTICIPATING_MEDIC, medicRef1); + medicRef1.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + .setValue("MeDIC 1"); + res.addExtension("http://highmed.org/fhir/StructureDefinition/extension-participating-medic", medicRef1); Reference medicRef2 = new Reference().setType(ResourceType.Organization.name()); - medicRef2.getIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 2"); - res.addExtension(EXTENSION_HIGHMED_PARTICIPATING_MEDIC, medicRef2); + medicRef2.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + .setValue("MeDIC 2"); + res.addExtension("http://highmed.org/fhir/StructureDefinition/extension-participating-medic", medicRef2); Reference ttpRef = new Reference().setType(ResourceType.Organization.name()); - ttpRef.getIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - res.addExtension(EXTENSION_HIGHMED_PARTICIPATING_TTP, ttpRef); + ttpRef.getIdentifier().setSystem("http://highmed.org/fhir/NamingSystem/organization-identifier") + .setValue("TTP"); + res.addExtension("http://highmed.org/fhir/StructureDefinition/extension-participating-ttp", ttpRef); ValidationResult result = resourceValidator.validate(res); - result.getMessages().stream() - .map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + m.getLocationCol() + " - " + m - .getSeverity() + ": " + m.getMessage()).forEach(logger::info); + result.getMessages().stream().map(m -> m.getLocationString() + " " + m.getLocationLine() + ":" + + m.getLocationCol() + " - " + m.getSeverity() + ": " + m.getMessage()).forEach(logger::info); - assertEquals(0, result.getMessages().stream() - .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL - .equals(m.getSeverity())).count()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } } From 11d349cd07a2b5901d9f4a09c93b9743664ce88d Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 19 Jan 2021 22:48:57 +0100 Subject: [PATCH 72/75] Task profile tests fixed to work with new version management mechanism --- dsf-bpe/dsf-bpe-process-base/pom.xml | 5 ++ .../dsf/fhir/profile/TaskProfileTest.java | 48 +++++++---------- .../dsf/fhir/profile/TaskProfileTest.java | 17 +++--- .../dsf/fhir/profiles/TaskProfileTest.java | 33 +++++------- .../dsf/fhir/profile/TaskProfileTest.java | 23 ++++---- .../dsf/fhir/profile/TaskProfileTest.java | 13 +++-- dsf-fhir/dsf-fhir-validation/pom.xml | 5 ++ .../validation/StructureDefinitionReader.java | 53 +++++++++++++++++++ .../validation/ValidationSupportRule.java | 51 ++++++++++++------ pom.xml | 5 ++ 10 files changed, 164 insertions(+), 89 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/pom.xml b/dsf-bpe/dsf-bpe-process-base/pom.xml index d355632b5..e759643fe 100755 --- a/dsf-bpe/dsf-bpe-process-base/pom.xml +++ b/dsf-bpe/dsf-bpe-process-base/pom.xml @@ -47,6 +47,11 @@ <groupId>org.camunda.bpm</groupId> <artifactId>camunda-engine</artifactId> </dependency> + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> <dependency> <groupId>de.hs-heilbronn.mi</groupId> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 2b21f6ef5..eb808a9e3 100755 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -32,6 +32,7 @@ import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY; import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; +import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import java.nio.charset.StandardCharsets; @@ -66,7 +67,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule( + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group-0.4.0.xml", "highmed-extension-group-id-0.4.0.xml", "highmed-research-study-0.4.0.xml", "highmed-task-request-feasibility.xml", "highmed-task-execute-feasibility.xml", @@ -88,9 +89,8 @@ public void testTaskRequestFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -126,9 +126,8 @@ public void testTaskRequestFeasibilityValidWithOutput() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskRequestFeasibility() @@ -165,9 +164,8 @@ public void testTaskExecuteFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -181,9 +179,8 @@ public void testTaskExecuteFeasibilityValidWithBloomFilterConfig() throws Except 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskExecuteFeasibility() @@ -225,9 +222,8 @@ public void testTaskSingleMedicResultFeasibilityUnsignedIntResultValid() throws 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -238,9 +234,8 @@ public void testTaskSingleMedicResultFeasibilityReferenceResultValid() throws Ex 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskSingleMedicResultFeasibility() @@ -317,9 +312,8 @@ public void testTaskComputeFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskComputeFeasibility() @@ -361,9 +355,8 @@ public void testTaskMultiMedicResultFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskMultiMedicResultFeasibility() @@ -421,9 +414,8 @@ public void testTaskErrorFeasibilityValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskErrorFeasibility() diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 8feb93303..364a3b7ce 100644 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -12,6 +12,7 @@ import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES; import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -39,9 +40,10 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule( - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group-0.4.0.xml", "highmed-extension-group-id-0.4.0.xml", - "highmed-extension-query-0.4.0.xml", "highmed-task-local-services-integration.xml"), + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, + Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group-0.4.0.xml", + "highmed-extension-group-id-0.4.0.xml", "highmed-extension-query-0.4.0.xml", + "highmed-task-local-services-integration.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", "highmed-feasibility.xml", "highmed-query-type-0.4.0.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", @@ -58,9 +60,8 @@ public void testTaskLocalServiceIntegrationValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskLocalServiceIntegration() @@ -88,8 +89,8 @@ private Task createValidTaskLocalServiceIntegration() task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - byte[] bloomFilterConfig = Base64.getDecoder() - .decode("CIw/x19d3Oj+GLOKgYAX5KrFAl11q6qMi0qkDiyUOCvMXuF2KffVvSnjUjkTvqh4z8Xs+MuQdK6FqTedM5FY9t4qm+k92A+P"); + byte[] bloomFilterConfig = Base64.getDecoder().decode( + "CIw/x19d3Oj+GLOKgYAX5KrFAl11q6qMi0qkDiyUOCvMXuF2KffVvSnjUjkTvqh4z8Xs+MuQdK6FqTedM5FY9t4qm+k92A+P"); task.addInput().setValue(new Base64BinaryType(bloomFilterConfig)).getType().addCoding() .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java index 03880a9ef..04b3a75b3 100644 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java @@ -13,6 +13,7 @@ import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PONG_TASK; import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING; import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME; +import static org.highmed.dsf.bpe.PingProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -40,7 +41,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule( + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-start-ping-process.xml", "highmed-task-ping.xml", "highmed-task-pong.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml"), @@ -57,9 +58,8 @@ public void testTaskStartPingProcessProfileValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -71,9 +71,8 @@ public void testTaskStartPingProcessProfileNotValid1() throws Exception ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(1, result.getMessages().stream() - .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL - .equals(m.getSeverity())).count()); + assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -85,9 +84,8 @@ public void testTaskStartPingProcessProfileNotValid2() throws Exception ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(1, result.getMessages().stream() - .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL - .equals(m.getSeverity())).count()); + assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -99,9 +97,8 @@ public void testTaskStartPingProcessProfileNotValid3() throws Exception ValidationResult result = resourceValidator.validate(task); ValidationSupportRule.logValidationMessages(logger, result); - assertEquals(1, result.getMessages().stream() - .filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) || ResultSeverityEnum.FATAL - .equals(m.getSeverity())).count()); + assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskStartPingProcess() @@ -131,9 +128,8 @@ public void testTaskPingValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskPing() @@ -167,9 +163,8 @@ public void testTaskPongValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskPong() diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index c3baf04de..a2e17f819 100644 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -11,6 +11,7 @@ import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import java.util.Arrays; @@ -40,7 +41,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule( + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-update-allow-list.xml", "highmed-task-download-allow-list.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", @@ -59,9 +60,8 @@ public void testTaskUpdateAllowListValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } @Test @@ -75,9 +75,8 @@ public void testTaskUpdateAllowlistValidWithOutput() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskUpdateAllowList() @@ -107,9 +106,8 @@ public void testTaskDownloadAllowListValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskDownloadAllowList() @@ -127,8 +125,9 @@ private Task createValidTaskDownloadAllowList() task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType() .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue( - new Reference(new IdType("https://foo.bar/fhir", "Bundle", UUID.randomUUID().toString(), "1"))) + task.addInput() + .setValue( + new Reference(new IdType("https://foo.bar/fhir", "Bundle", UUID.randomUUID().toString(), "1"))) .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java index 3deb7a0ad..addcc80f3 100644 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java @@ -13,6 +13,7 @@ import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES; import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; +import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.VERSION; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -51,7 +52,7 @@ public class TaskProfileTest private static final Logger logger = LoggerFactory.getLogger(TaskProfileTest.class); @ClassRule - public static final ValidationSupportRule validationRule = new ValidationSupportRule( + public static final ValidationSupportRule validationRule = new ValidationSupportRule(VERSION, Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-request-update-resources.xml", "highmed-task-execute-update-resources.xml"), Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", @@ -90,9 +91,8 @@ public void testTaskRequestUpdateResourcesValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskRequestUpdateResources() @@ -129,9 +129,8 @@ public void testTaskExecuteUpdateResourcesValid() throws Exception 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()); + assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) + || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); } private Task createValidTaskExecuteUpdateResources() diff --git a/dsf-fhir/dsf-fhir-validation/pom.xml b/dsf-fhir/dsf-fhir-validation/pom.xml index 5066ba02c..c23a8e033 100644 --- a/dsf-fhir/dsf-fhir-validation/pom.xml +++ b/dsf-fhir/dsf-fhir-validation/pom.xml @@ -31,6 +31,11 @@ <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-validation-resources-r5</artifactId> </dependency> + + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> <dependency> <groupId>junit</groupId> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/StructureDefinitionReader.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/StructureDefinitionReader.java index 6719d53de..61351e6c1 100755 --- a/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/StructureDefinitionReader.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/StructureDefinitionReader.java @@ -2,13 +2,16 @@ import java.io.IOException; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.Arrays; import java.util.List; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.apache.commons.io.IOUtils; import org.hl7.fhir.r4.model.StructureDefinition; import ca.uhn.fhir.context.FhirContext; @@ -16,11 +19,21 @@ public class StructureDefinitionReader { + private static final String VERSION_PATTERN_STRING = "${version}"; + private static final Pattern VERSION_PATTERN = Pattern.compile(Pattern.quote(VERSION_PATTERN_STRING)); + private final FhirContext context; + private final String version; public StructureDefinitionReader(FhirContext context) + { + this(context, null); + } + + public StructureDefinitionReader(FhirContext context, String version) { this.context = context; + this.version = version; } public List<StructureDefinition> readXml(Path... xmlPaths) @@ -54,6 +67,11 @@ public Stream<StructureDefinition> readXmlFromClassPath(Stream<String> xmlOnClas } public StructureDefinition readXml(Path xmlPath) + { + return version == null ? doReadXml(xmlPath) : doReadXmlAndReplaceVersion(xmlPath, version); + } + + private StructureDefinition doReadXml(Path xmlPath) { try (InputStream in = Files.newInputStream(xmlPath)) { @@ -65,7 +83,27 @@ public StructureDefinition readXml(Path xmlPath) } } + private StructureDefinition doReadXmlAndReplaceVersion(Path xmlPath, String version) + { + try (InputStream in = Files.newInputStream(xmlPath)) + { + String read = IOUtils.toString(in, StandardCharsets.UTF_8); + read = VERSION_PATTERN.matcher(read).replaceAll(version); + + return context.newXmlParser().parseResource(StructureDefinition.class, read); + } + catch (IOException e) + { + throw new RuntimeException(e); + } + } + public StructureDefinition readXml(String xmlOnClassPath) + { + return version == null ? doReadXml(xmlOnClassPath) : doReadXmlAndReplaceVersion(xmlOnClassPath, version); + } + + private StructureDefinition doReadXml(String xmlOnClassPath) { try (InputStream in = StructureDefinitionReader.class.getResourceAsStream(xmlOnClassPath)) { @@ -76,4 +114,19 @@ public StructureDefinition readXml(String xmlOnClassPath) throw new RuntimeException(e); } } + + private StructureDefinition doReadXmlAndReplaceVersion(String xmlOnClassPath, String version) + { + try (InputStream in = StructureDefinitionReader.class.getResourceAsStream(xmlOnClassPath)) + { + String read = IOUtils.toString(in, StandardCharsets.UTF_8); + read = VERSION_PATTERN.matcher(read).replaceAll(version); + + return context.newXmlParser().parseResource(StructureDefinition.class, read); + } + catch (IOException e) + { + throw new RuntimeException(e); + } + } } diff --git a/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java index ecc145ea9..d35a6ddcc 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java +++ b/dsf-fhir/dsf-fhir-validation/src/main/java/org/highmed/dsf/fhir/validation/ValidationSupportRule.java @@ -5,10 +5,13 @@ import java.io.IOException; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Locale; +import java.util.regex.Pattern; import java.util.stream.Stream; +import org.apache.commons.io.IOUtils; import org.highmed.dsf.fhir.validation.SnapshotGenerator.SnapshotWithValidationMessages; import org.hl7.fhir.common.hapi.validation.support.CommonCodeSystemsTerminologyService; import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; @@ -26,10 +29,19 @@ public class ValidationSupportRule extends ExternalResource { + private static final String VERSION_PATTERN_STRING = "${version}"; + private static final Pattern VERSION_PATTERN = Pattern.compile(Pattern.quote(VERSION_PATTERN_STRING)); + private final FhirContext context; private final IValidationSupport validationSupport; public ValidationSupportRule(List<String> structureDefinitions, List<String> codeSystems, List<String> valueSets) + { + this(null, structureDefinitions, codeSystems, valueSets); + } + + public ValidationSupportRule(String version, List<String> structureDefinitions, List<String> codeSystems, + List<String> valueSets) { context = FhirContext.forR4(); HapiLocalizer localizer = new HapiLocalizer() @@ -48,18 +60,18 @@ public Locale getLocale() customValidationSupport, new DefaultProfileValidationSupport(context), new CommonCodeSystemsTerminologyService(context)); - readProfilesAndGenerateSnapshots(context, customValidationSupport, + readProfilesAndGenerateSnapshots(context, version, customValidationSupport, new SnapshotGeneratorImpl(context, validationSupport), structureDefinitions.stream()); - readCodeSystems(context, customValidationSupport, codeSystems.stream()); - readValueSets(context, customValidationSupport, valueSets.stream()); + readCodeSystems(context, version, customValidationSupport, codeSystems.stream()); + readValueSets(context, version, customValidationSupport, valueSets.stream()); } - private static void readProfilesAndGenerateSnapshots(FhirContext context, + private static void readProfilesAndGenerateSnapshots(FhirContext context, String version, ValidationSupportWithCustomResources vSupport, SnapshotGenerator snapshotGenerator, Stream<String> structureDefinitions) { - StructureDefinitionReader reader = new StructureDefinitionReader(context); + StructureDefinitionReader reader = new StructureDefinitionReader(context, version); reader.readXmlFromClassPath(structureDefinitions.map(file -> "/fhir/StructureDefinition/" + file)) .forEach(diff -> { @@ -72,21 +84,27 @@ private static void readProfilesAndGenerateSnapshots(FhirContext context, }); } - private static void readCodeSystems(FhirContext context, ValidationSupportWithCustomResources vSupport, - Stream<String> codeSystems) + private static void readCodeSystems(FhirContext context, String version, + ValidationSupportWithCustomResources vSupport, Stream<String> codeSystems) { codeSystems.map(file -> "/fhir/CodeSystem/" + file).forEach(file -> { - var cS = readCodeSystem(context, file); + var cS = readCodeSystem(context, version, file); vSupport.addOrReplace(cS); }); } - private static CodeSystem readCodeSystem(FhirContext context, String file) + private static CodeSystem readCodeSystem(FhirContext context, String version, String file) { try (InputStream in = ValidationSupportRule.class.getResourceAsStream(file)) { - return context.newXmlParser().parseResource(CodeSystem.class, in); + if (in == null) + throw new IOException("File " + file + " not found"); + + String read = IOUtils.toString(in, StandardCharsets.UTF_8); + read = VERSION_PATTERN.matcher(read).replaceAll(version); + + return context.newXmlParser().parseResource(CodeSystem.class, read); } catch (IOException e) { @@ -94,24 +112,27 @@ private static CodeSystem readCodeSystem(FhirContext context, String file) } } - private static void readValueSets(FhirContext context, ValidationSupportWithCustomResources vSupport, - Stream<String> valueSets) + private static void readValueSets(FhirContext context, String version, + ValidationSupportWithCustomResources vSupport, Stream<String> valueSets) { valueSets.map(file -> "/fhir/ValueSet/" + file).forEach(file -> { - var vS = readValueSet(context, file); + var vS = readValueSet(context, version, file); vSupport.addOrReplace(vS); }); } - private static ValueSet readValueSet(FhirContext context, String file) + private static ValueSet readValueSet(FhirContext context, String version, String file) { try (InputStream in = ValidationSupportRule.class.getResourceAsStream(file)) { if (in == null) throw new IOException("File " + file + " not found"); - return context.newXmlParser().parseResource(ValueSet.class, in); + String read = IOUtils.toString(in, StandardCharsets.UTF_8); + read = VERSION_PATTERN.matcher(read).replaceAll(version); + + return context.newXmlParser().parseResource(ValueSet.class, read); } catch (IOException e) { diff --git a/pom.xml b/pom.xml index 1fa8c8612..139ec33f1 100755 --- a/pom.xml +++ b/pom.xml @@ -323,6 +323,11 @@ <artifactId>commons-csv</artifactId> <version>1.8</version> </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.8.0</version> + </dependency> </dependencies> </dependencyManagement> From 63a8ed35ba54eef9a12a03cc99b34c16bb646ba5 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Sun, 24 Jan 2021 20:29:07 +0100 Subject: [PATCH 73/75] removed highmed processes --- dsf-bpe/dsf-bpe-process-feasibility/pom.xml | 177 ------- .../highmed/dsf/bpe/ConstantsFeasibility.java | 65 --- .../FeasibilityProcessPluginDefinition.java | 76 --- .../dsf/bpe/message/SendMedicRequest.java | 70 --- .../dsf/bpe/message/SendMultiMedicErrors.java | 42 -- .../bpe/message/SendMultiMedicResults.java | 98 ---- .../bpe/message/SendSingleMedicResults.java | 77 --- .../dsf/bpe/message/SendTtpRequest.java | 46 -- .../service/CalculateMultiMedicResults.java | 57 --- .../service/CheckFeasibilityResources.java | 73 --- .../bpe/service/CheckMultiMedicResults.java | 121 ----- .../highmed/dsf/bpe/service/CheckQueries.java | 74 --- .../bpe/service/CheckSingleMedicResults.java | 78 --- .../CheckTtpComputedMultiMedicResults.java | 106 ----- .../service/DownloadFeasibilityResources.java | 195 -------- .../DownloadResearchStudyResource.java | 164 ------- .../dsf/bpe/service/DownloadResultSets.java | 105 ----- .../dsf/bpe/service/ExecuteQueries.java | 82 ---- .../dsf/bpe/service/ExecuteRecordLink.java | 98 ---- .../service/FilterQueryResultsByConsent.java | 52 -- .../dsf/bpe/service/GenerateBloomFilters.java | 192 -------- .../dsf/bpe/service/GenerateCountFromIds.java | 44 -- .../service/HandleErrorMultiMedicResults.java | 40 -- .../dsf/bpe/service/ModifyQueries.java | 69 --- .../dsf/bpe/service/SelectRequestTargets.java | 110 ----- .../service/SelectResponseTargetMedic.java | 44 -- .../bpe/service/SelectResponseTargetTtp.java | 53 --- .../dsf/bpe/service/StoreCorrelationKeys.java | 59 --- .../highmed/dsf/bpe/service/StoreResults.java | 96 ---- .../bpe/spring/config/FeasibilityConfig.java | 275 ----------- .../config/FeasibilitySerializerConfig.java | 49 -- .../dsf/bpe/variables/BloomFilterConfig.java | 106 ----- .../BloomFilterConfigSerializer.java | 70 --- .../variables/BloomFilterConfigValues.java | 54 --- .../bpe/variables/FeasibilityQueryResult.java | 89 ---- .../FeasibilityQueryResultSerializer.java | 70 --- .../FeasibilityQueryResultValues.java | 54 --- .../variables/FeasibilityQueryResults.java | 38 -- .../FeasibilityQueryResultsSerializer.java | 70 --- .../FeasibilityQueryResultsValues.java | 55 --- .../FinalFeasibilityQueryResult.java | 35 -- ...FinalFeasibilityQueryResultSerializer.java | 70 --- .../FinalFeasibilityQueryResultValues.java | 57 --- .../FinalFeasibilityQueryResults.java | 38 -- ...inalFeasibilityQueryResultsSerializer.java | 70 --- .../FinalFeasibilityQueryResultsValues.java | 57 --- ...rg.highmed.dsf.bpe.ProcessPluginDefinition | 1 - .../resources/bpe/computeFeasibility.bpmn | 270 ----------- .../resources/bpe/executeFeasibility.bpmn | 314 ------------ .../resources/bpe/requestFeasibility.bpmn | 206 -------- .../highmed-computeFeasibility.xml | 92 ---- .../highmed-executeFeasibility.xml | 66 --- .../highmed-requestFeasibility.xml | 124 ----- .../fhir/CodeSystem/highmed-feasibility.xml | 68 --- .../highmed-task-compute-feasibility.xml | 142 ------ .../highmed-task-error-feasibility.xml | 100 ---- .../highmed-task-execute-feasibility.xml | 224 --------- ...ed-task-multi-medic-result-feasibility.xml | 215 --------- .../highmed-task-request-feasibility.xml | 300 ------------ ...d-task-single-medic-result-feasibility.xml | 189 -------- .../fhir/ValueSet/highmed-feasibility.xml | 25 - ...lityFromMedicsViaMedic1ExampleStarter.java | 161 ------- .../bpe/variables/BloomFilterConfigTest.java | 61 --- .../dsf/fhir/profile/TaskProfileTest.java | 446 ------------------ .../src/test/resources/log4j2.xml | 67 --- .../dsf-bpe-process-local-services/pom.xml | 183 ------- .../dsf/bpe/ConstantsLocalServices.java | 12 - .../LocalServicesProcessPluginDefinition.java | 77 --- .../dsf/bpe/service/ExtractInputValues.java | 105 ----- .../highmed/dsf/bpe/service/StoreResult.java | 77 --- .../spring/config/LocalServicesConfig.java | 131 ----- ...rg.highmed.dsf.bpe.ProcessPluginDefinition | 1 - .../bpe/localServicesIntegration.bpmn | 287 ----------- .../highmed-localServicesIntegration.xml | 62 --- ...ighmed-task-local-services-integration.xml | 339 ------------- .../LocalServicesMedic1ExampleStarter.java | 96 ---- .../dsf/fhir/profile/TaskProfileTest.java | 101 ---- .../src/test/resources/log4j2.xml | 67 --- dsf-bpe/dsf-bpe-process-ping/pom.xml | 176 ------- .../org/highmed/dsf/bpe/ConstantsPing.java | 20 - .../dsf/bpe/PingProcessPluginDefinition.java | 62 --- .../org/highmed/dsf/bpe/message/SendPing.java | 17 - .../org/highmed/dsf/bpe/message/SendPong.java | 17 - .../org/highmed/dsf/bpe/service/LogPing.java | 27 -- .../org/highmed/dsf/bpe/service/LogPong.java | 27 -- .../dsf/bpe/service/SelectPingTargets.java | 48 -- .../dsf/bpe/service/SelectPongTarget.java | 36 -- .../dsf/bpe/spring/config/PingConfig.java | 68 --- ...rg.highmed.dsf.bpe.ProcessPluginDefinition | 1 - .../src/main/resources/bpe/ping.bpmn | 137 ------ .../src/main/resources/bpe/pong.bpmn | 62 --- .../fhir/ActivityDefinition/highmed-ping.xml | 116 ----- .../fhir/ActivityDefinition/highmed-pong.xml | 72 --- .../StructureDefinition/highmed-task-ping.xml | 63 --- .../StructureDefinition/highmed-task-pong.xml | 63 --- .../highmed-task-start-ping-process.xml | 62 --- .../Ping3MedicFromTtpExampleStarter.java | 52 -- .../dsf/fhir/profiles/TaskProfileTest.java | 192 -------- .../src/test/resources/log4j2.xml | 67 --- .../dsf-bpe-process-update-allow-list/pom.xml | 176 ------- .../dsf/bpe/ConstantsUpdateAllowList.java | 22 - ...pdateAllowListProcessPluginDefinition.java | 64 --- .../dsf/bpe/service/DownloadAllowList.java | 117 ----- .../dsf/bpe/service/UpdateAllowList.java | 154 ------ .../spring/config/UpdateAllowListConfig.java | 40 -- ...rg.highmed.dsf.bpe.ProcessPluginDefinition | 1 - .../main/resources/bpe/downloadAllowList.bpmn | 40 -- .../main/resources/bpe/updateAllowList.bpmn | 40 -- .../highmed-downloadAllowList.xml | 72 --- .../highmed-updateAllowList.xml | 60 --- .../CodeSystem/highmed-update-allow-list.xml | 28 -- .../highmed-task-download-allow-list.xml | 94 ---- .../highmed-task-update-allow-list.xml | 106 ----- .../ValueSet/highmed-update-allow-list.xml | 26 - ...lowListFromTtpViaMedic1ExampleStarter.java | 81 ---- ...pdateAllowList3MedicTtpExampleStarter.java | 52 -- .../dsf/fhir/profile/TaskProfileTest.java | 136 ------ .../src/test/resources/log4j2.xml | 67 --- .../dsf-bpe-process-update-resources/pom.xml | 177 ------- .../dsf/bpe/ConstantsUpdateResources.java | 25 - ...pdateResourcesProcessPluginDefinition.java | 66 --- .../highmed/dsf/bpe/message/SendRequest.java | 46 -- .../highmed/dsf/bpe/service/CheckRequest.java | 61 --- .../bpe/service/SelectResourceAndTargets.java | 87 ---- .../dsf/bpe/service/UpdateResources.java | 120 ----- .../spring/config/UpdateResourcesConfig.java | 54 --- ...rg.highmed.dsf.bpe.ProcessPluginDefinition | 1 - .../resources/bpe/executeUpdateResources.bpmn | 52 -- .../resources/bpe/requestUpdateResources.bpmn | 61 --- .../highmed-executeUpdateResources.xml | 66 --- .../highmed-requestUpdateResources.xml | 60 --- .../CodeSystem/highmed-update-resources.xml | 33 -- .../highmed-task-execute-update-resources.xml | 112 ----- .../highmed-task-request-update-resources.xml | 152 ------ .../ValueSet/highmed-update-resources.xml | 26 - ...UpdateResource3MedicTtpExampleStarter.java | 86 ---- .../dsf/fhir/profile/TaskProfileTest.java | 159 ------- .../src/test/resources/log4j2.xml | 67 --- dsf-bpe/pom.xml | 5 - 139 files changed, 12706 deletions(-) delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/pom.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilitySerializerConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfigSerializer.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfigValues.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResult.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultSerializer.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultValues.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResults.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultsSerializer.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultsValues.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResult.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultSerializer.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultValues.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsSerializer.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsValues.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigTest.java delete mode 100755 dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java delete mode 100644 dsf-bpe/dsf-bpe-process-feasibility/src/test/resources/log4j2.xml delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/pom.xml delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition delete mode 100755 dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java delete mode 100644 dsf-bpe/dsf-bpe-process-local-services/src/test/resources/log4j2.xml delete mode 100755 dsf-bpe/dsf-bpe-process-ping/pom.xml delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPing.java delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPong.java delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPing.java delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPong.java delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn delete mode 100755 dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java delete mode 100644 dsf-bpe/dsf-bpe-process-ping/src/test/resources/log4j2.xml delete mode 100755 dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java delete mode 100755 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn delete mode 100755 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-allow-list/src/test/resources/log4j2.xml delete mode 100755 dsf-bpe/dsf-bpe-process-update-resources/pom.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java delete mode 100755 dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java delete mode 100755 dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java delete mode 100755 dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java delete mode 100755 dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition delete mode 100755 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn delete mode 100755 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java delete mode 100644 dsf-bpe/dsf-bpe-process-update-resources/src/test/resources/log4j2.xml diff --git a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml b/dsf-bpe/dsf-bpe-process-feasibility/pom.xml deleted file mode 100755 index 6f93b7a6b..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/pom.xml +++ /dev/null @@ -1,177 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <artifactId>dsf-bpe-process-feasibility</artifactId> - - <parent> - <artifactId>dsf-bpe-pom</artifactId> - <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> - </parent> - - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>de.hs-heilbronn.mi</groupId> - <artifactId>log4j2-utils</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-fhir-validation</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>test</scope> - <type>test-jar</type> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-process-plugin-to-docker-test-setup</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clean-plugin</artifactId> - <configuration> - <filesets> - <fileset> - <directory>../../dsf-docker-test-setup/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - </filesets> - </configuration> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java deleted file mode 100644 index 1a1b047e2..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/ConstantsFeasibility.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.highmed.dsf.bpe; - -import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; -import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.VERSION; - -public interface ConstantsFeasibility -{ - String BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY = "researchStudy"; - String BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK = "needsConsentCheck"; - String BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE = "needsRecordLinkage"; - String BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG = "bloomFilterConfig"; - String BPMN_EXECUTION_VARIABLE_COHORTS = "cohorts"; - String BPMN_EXECUTION_VARIABLE_QUERIES = "queries"; - String BPMN_EXECUTION_VARIABLE_QUERY_RESULTS = "queryResults"; - String BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS = "finalQueryResults"; - - String BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_RESULT = "errorMultiMedicFeasibilityResult"; - - // Must be 3 or larger, as otherwise it is possible to draw conclusions about the individual MeDICs - // (if I already know the cohort size in my MeDIC) - int MIN_PARTICIPATING_MEDICS = 3; - int MIN_COHORT_DEFINITIONS = 1; - String FEASIBILITY_QUERY_PREFIX = "select count"; - - String CODESYSTEM_HIGHMED_FEASIBILITY = "http://highmed.org/fhir/CodeSystem/feasibility"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY = "medic-correlation-key"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK = "needs-consent-check"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE = "needs-record-linkage"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG = "bloom-filter-configuration"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT = "single-medic-result"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE = "single-medic-result-reference"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT = "participating-medics"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NOT_ENOUGH_PARTICIPATION = "not-enough-participation"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT = "multi-medic-result"; - String CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE = "research-study-reference"; - - String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-request-feasibility"; - String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "requestFeasibility/"; - String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME = "requestFeasibilityMessage"; - - String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "localServicesIntegration/"; - - String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-execute-feasibility"; - String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "executeFeasibility/"; - String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_MESSAGE_NAME = "executeFeasibilityMessage"; - - String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-compute-feasibility"; - String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "computeFeasibility/"; - String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME = "computeFeasibilityMessage"; - - String PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility"; - String PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultSingleMedicFeasibilityMessage"; - - String PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility"; - String PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME = "resultMultiMedicFeasibilityMessage"; - - String PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY = "http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility"; - String PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY_MESSAGE_NAME = "errorMultiMedicFeasibilityMessage"; -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java deleted file mode 100644 index da228a4dd..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/FeasibilityProcessPluginDefinition.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.highmed.dsf.bpe; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -import org.highmed.dsf.bpe.spring.config.FeasibilityConfig; -import org.highmed.dsf.bpe.spring.config.FeasibilitySerializerConfig; -import org.highmed.dsf.fhir.resources.AbstractResource; -import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; -import org.highmed.dsf.fhir.resources.CodeSystemResource; -import org.highmed.dsf.fhir.resources.ResourceProvider; -import org.highmed.dsf.fhir.resources.StructureDefinitionResource; -import org.highmed.dsf.fhir.resources.ValueSetResource; - -import ca.uhn.fhir.context.FhirContext; - -public class FeasibilityProcessPluginDefinition implements ProcessPluginDefinition -{ - public static final String VERSION = "0.4.0"; - - @Override - public String getName() - { - return "dsf-bpe-process-feasibility"; - } - - @Override - public String getVersion() - { - return VERSION; - } - - @Override - public Stream<String> getBpmnFiles() - { - return Stream.of("bpe/requestFeasibility.bpmn", "bpe/computeFeasibility.bpmn", "bpe/executeFeasibility.bpmn"); - } - - @Override - public Stream<Class<?>> getSpringConfigClasses() - { - return Stream.of(FeasibilityConfig.class, FeasibilitySerializerConfig.class); - } - - @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) - { - var aCom = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-computeFeasibility.xml"); - var aExe = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-executeFeasibility.xml"); - var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-requestFeasibility.xml"); - - var cF = CodeSystemResource.file("fhir/CodeSystem/highmed-feasibility.xml"); - - var sTCom = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-compute-feasibility.xml"); - var sTErr = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-error-feasibility.xml"); - var sTExe = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-execute-feasibility.xml"); - var sTResM = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml"); - var sTReq = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-request-feasibility.xml"); - var sTResS = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml"); - - var vF = ValueSetResource.file("fhir/ValueSet/highmed-feasibility.xml"); - - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map.of( - "computeFeasibility/" + VERSION, Arrays.asList(aCom, cF, sTCom, sTResS, vF), - "executeFeasibility/" + VERSION, Arrays.asList(aExe, cF, sTExe, vF), - "requestFeasibility/" + VERSION, Arrays.asList(aReq, cF, sTReq, sTResM, sTErr, vF)); - - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java deleted file mode 100755 index efd4d7188..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMedicRequest.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.highmed.dsf.bpe.message; - -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; - -import java.util.stream.Stream; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.variables.BloomFilterConfig; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResearchStudy; -import org.hl7.fhir.r4.model.Task.ParameterComponent; - -import ca.uhn.fhir.context.FhirContext; - -public class SendMedicRequest extends AbstractTaskMessageSend -{ - public SendMedicRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) - { - super(clientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Override - protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) - { - ResearchStudy researchStudy = (ResearchStudy) execution.getVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); - IdType researchStudyId = new IdType( - getFhirWebserviceClientProvider().getLocalBaseUrl() + "/" + researchStudy.getId()); - - ParameterComponent inputResearchStudyReference = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE, - new Reference().setReference(researchStudyId.toVersionless().getValueAsString())); - - boolean needsConsentCheck = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); - ParameterComponent inputNeedsConsentCheck = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK, - needsConsentCheck); - - boolean needsRecordLinkage = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); - ParameterComponent inputNeedsRecordLinkage = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, - needsRecordLinkage); - - if (needsRecordLinkage) - { - BloomFilterConfig bloomFilterConfig = (BloomFilterConfig) execution - .getVariable(BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG); - ParameterComponent inputBloomFilterConfig = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG, bloomFilterConfig.toBytes()); - - return Stream.of(inputResearchStudyReference, inputNeedsConsentCheck, inputNeedsRecordLinkage, - inputBloomFilterConfig); - } - else - return Stream.of(inputResearchStudyReference, inputNeedsConsentCheck, inputNeedsRecordLinkage); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java deleted file mode 100644 index 999e44dca..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicErrors.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.highmed.dsf.bpe.message; - -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; - -import java.util.stream.Stream; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.ParameterComponent; - -import ca.uhn.fhir.context.FhirContext; - -public class SendMultiMedicErrors extends AbstractTaskMessageSend -{ - public SendMultiMedicErrors(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) - { - super(clientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Override - protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) - { - Task task = getLeadingTaskFromExecutionVariables(); - - String taskUrl = new Reference(new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl() + "/Task" , task.getIdElement().getIdPart())) - .getReference(); - - Task.ParameterComponent input = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - "An error occurred while calculating the multi medic feasibility result for " - + "all defined cohorts, see task with url='" + taskUrl + "'"); - return Stream.of(input); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java deleted file mode 100644 index 8597de859..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendMultiMedicResults.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.highmed.dsf.bpe.message; - -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT; - -import java.util.List; -import java.util.stream.Stream; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.Extension; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.ParameterComponent; - -import ca.uhn.fhir.context.FhirContext; - -public class SendMultiMedicResults extends AbstractTaskMessageSend -{ - public SendMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) - { - super(clientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Override - protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) - { - FinalFeasibilityQueryResults results = (FinalFeasibilityQueryResults) execution - .getVariable(BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS); - - Stream<ParameterComponent> resultInputs = results.getResults().stream().flatMap(this::toInputs); - Stream<ParameterComponent> errorInput = getErrorInput(execution); - - return Stream.concat(resultInputs, errorInput); - } - - private Stream<ParameterComponent> toInputs(FinalFeasibilityQueryResult result) - { - ParameterComponent input1 = getTaskHelper() - .createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT, - result.getCohortSize()); - input1.addExtension(createCohortIdExtension(result.getCohortId())); - - ParameterComponent input2 = getTaskHelper() - .createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT, - result.getParticipatingMedics()); - input2.addExtension(createCohortIdExtension(result.getCohortId())); - - return Stream.of(input1, input2); - } - - private Extension createCohortIdExtension(String cohortId) - { - return new Extension(EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); - } - - private Stream<ParameterComponent> getErrorInput(DelegateExecution execution) - { - List<Task.TaskOutputComponent> outputs = getLeadingTaskFromExecutionVariables().getOutput(); - - if (hasErrorOutput(outputs)) - { - Task task = getLeadingTaskFromExecutionVariables(); - - String taskUrl = new Reference(new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl() + "/Task", - task.getIdElement().getIdPart())).getReference(); - - Task.ParameterComponent input = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - "Errors occurred for missing cohorts while calculating their multi medic feasibility " - + "result, see task with url='" + taskUrl + "'"); - return Stream.of(input); - } - - return Stream.empty(); - } - - private boolean hasErrorOutput(List<Task.TaskOutputComponent> outputs) - { - return outputs.stream().anyMatch(output -> output.getType().getCoding().stream().anyMatch( - coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_BPMN) && coding.getCode() - .equals(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR))); - } -} \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java deleted file mode 100755 index e28c582d6..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendSingleMedicResults.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.highmed.dsf.bpe.message; - -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; - -import java.util.stream.Stream; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.Extension; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.ParameterComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import ca.uhn.fhir.context.FhirContext; - -public class SendSingleMedicResults extends AbstractTaskMessageSend -{ - private static final Logger logger = LoggerFactory.getLogger(SendSingleMedicResults.class); - - public SendSingleMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) - { - super(clientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Override - protected Stream<Task.ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) - { - FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - - return results.getResults().stream().map(result -> toInput(result)); - } - - private Task.ParameterComponent toInput(FeasibilityQueryResult result) - { - if (result.isCohortSizeResult()) - { - ParameterComponent input = getTaskHelper().createInputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, result.getCohortSize()); - input.addExtension(createCohortIdExtension(result.getCohortId())); - return input; - } - else if (result.isIdResultSetUrlResult()) - { - ParameterComponent input = getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, - new Reference(result.getResultSetUrl())); - input.addExtension(createCohortIdExtension(result.getCohortId())); - return input; - } - else - { - logger.warn("Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result - .getCohortId()); - throw new RuntimeException( - "Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result - .getCohortId()); - } - } - - private Extension createCohortIdExtension(String cohortId) - { - return new Extension(EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java deleted file mode 100644 index 385d5bfb3..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/message/SendTtpRequest.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.highmed.dsf.bpe.message; - -import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY; - -import java.util.stream.Stream; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.Targets; -import org.hl7.fhir.r4.model.Task; - -import ca.uhn.fhir.context.FhirContext; - -public class SendTtpRequest extends AbstractTaskMessageSend -{ - public SendTtpRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) - { - super(clientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Override - protected Stream<Task.ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) - { - Targets multiInstanceTargets = (Targets) execution.getVariable(BPMN_EXECUTION_VARIABLE_TARGETS); - - Stream<Task.ParameterComponent> inputTargets = multiInstanceTargets.getEntries().stream() - .map(target -> getTaskHelper().createInput(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY, - target.getCorrelationKey())); - - boolean needsRecordLinkage = (boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); - Task.ParameterComponent inputNeedsRecordLinkage = getTaskHelper() - .createInput(CODESYSTEM_HIGHMED_FEASIBILITY, CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE, - needsRecordLinkage); - - return Stream.concat(inputTargets, Stream.of(inputNeedsRecordLinkage)); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java deleted file mode 100755 index 4508c07e1..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CalculateMultiMedicResults.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; - -public class CalculateMultiMedicResults extends AbstractServiceDelegate -{ - public CalculateMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - List<FeasibilityQueryResult> results = ((FeasibilityQueryResults) execution - .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS)).getResults(); - - List<FinalFeasibilityQueryResult> finalResults = calculateResults(results); - - execution.setVariable(BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, - FinalFeasibilityQueryResultsValues.create(new FinalFeasibilityQueryResults(finalResults))); - } - - private List<FinalFeasibilityQueryResult> calculateResults(List<FeasibilityQueryResult> results) - { - Map<String, List<FeasibilityQueryResult>> byCohortId = results.stream() - .collect(Collectors.groupingBy(FeasibilityQueryResult::getCohortId)); - - return byCohortId.entrySet().stream().map(e -> new FinalFeasibilityQueryResult(e.getKey(), - toInt(e.getValue().stream().filter(r -> r.getCohortSize() > 0).count()), - toInt(e.getValue().stream().mapToLong(FeasibilityQueryResult::getCohortSize).sum()))) - .collect(Collectors.toList()); - } - - private int toInt(long l) - { - if (l > Integer.MAX_VALUE) - throw new IllegalArgumentException("long > " + Integer.MAX_VALUE); - else - return (int) l; - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java deleted file mode 100755 index edbca48c4..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckFeasibilityResources.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.MIN_COHORT_DEFINITIONS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.MIN_PARTICIPATING_MEDICS; - -import java.util.List; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.FhirResourcesList; -import org.hl7.fhir.r4.model.Group; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResearchStudy; - -public class CheckFeasibilityResources extends AbstractServiceDelegate -{ - public CheckFeasibilityResources(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - ResearchStudy researchStudy = (ResearchStudy) execution.getVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); - - List<Group> cohorts = ((FhirResourcesList) execution.getVariable(BPMN_EXECUTION_VARIABLE_COHORTS)) - .getResourcesAndCast(); - - checkNumberOfParticipatingMedics(researchStudy); - checkFullyQualifiedCohortIds(cohorts); - checkNumberOfCohortDefinitions(cohorts); - } - - private void checkNumberOfParticipatingMedics(ResearchStudy researchStudy) - { - long medics = researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).stream() - .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> r.getIdentifier()) - .filter(i -> NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER.equals(i.getSystem())).map(i -> i.getValue()) - .distinct().count(); - - if (medics < MIN_PARTICIPATING_MEDICS) - { - throw new RuntimeException( - "Number of distinct participanting MeDICs is < " + MIN_PARTICIPATING_MEDICS + ", got " + medics); - } - } - - private void checkFullyQualifiedCohortIds(List<Group> cohorts) - { - if (cohorts.stream().anyMatch(g -> !g.getIdElement().hasBaseUrl())) - { - throw new RuntimeException("Not all cohorts have fully qualified ids (containing server base url)"); - } - } - - private void checkNumberOfCohortDefinitions(List<Group> cohorts) - { - int size = cohorts.size(); - if (size < MIN_COHORT_DEFINITIONS) - { - throw new RuntimeException( - "Number of defined cohorts is < " + MIN_COHORT_DEFINITIONS + ", got " + cohorts.size()); - } - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java deleted file mode 100755 index 96a62cc1c..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckMultiMedicResults.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT; - -import java.util.List; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.Extension; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.ParameterComponent; -import org.hl7.fhir.r4.model.Task.TaskOutputComponent; -import org.hl7.fhir.r4.model.UnsignedIntType; - -public class CheckMultiMedicResults extends AbstractServiceDelegate -{ - public CheckMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task currentTask = getCurrentTaskFromExecutionVariables(); - Task leadingTask = getLeadingTaskFromExecutionVariables(); - - addFinalFeasibilityQueryErrorsToLeadingTask(currentTask, leadingTask); - - FinalFeasibilityQueryResults results = readFinalFeasibilityQueryResultsFromCurrentTask(currentTask); - FinalFeasibilityQueryResults checkedResults = checkResults(results); - - addFinalFeasibilityQueryResultsToLeadingTask(checkedResults, leadingTask); - - // The current task finishes here but is not automatically set to completed - // because it is an additional task during the execution of the main process - currentTask.setStatus(Task.TaskStatus.COMPLETED); - getFhirWebserviceClientProvider().getLocalWebserviceClient().withMinimalReturn().update(currentTask); - } - - private void addFinalFeasibilityQueryErrorsToLeadingTask(Task toRead, Task toWrite) - { - toRead.getInput().stream().filter(in -> in.hasType() && in.getType().hasCoding() && CODESYSTEM_HIGHMED_BPMN - .equals(in.getType().getCodingFirstRep().getSystem()) && CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR - .equals(in.getType().getCodingFirstRep().getCode())).forEach(in -> toWrite.getOutput() - .add(getTaskHelper().createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - in.getValue().primitiveValue()))); - } - - private FinalFeasibilityQueryResults readFinalFeasibilityQueryResultsFromCurrentTask(Task task) - { - List<FinalFeasibilityQueryResult> results = task.getInput().stream() - .filter(in -> in.hasType() && in.getType().hasCoding() && CODESYSTEM_HIGHMED_FEASIBILITY - .equals(in.getType().getCodingFirstRep().getSystem()) - && CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT - .equals(in.getType().getCodingFirstRep().getCode())).map(in -> toResult(task, in)) - .collect(Collectors.toList()); - return new FinalFeasibilityQueryResults(results); - } - - private FinalFeasibilityQueryResult toResult(Task task, ParameterComponent in) - { - String cohortId = ((Reference) in.getExtensionByUrl(EXTENSION_HIGHMED_GROUP_ID).getValue()).getReference(); - int participatingMedics = getParticipatingMedicsCountByCohortId(task, cohortId); - int cohortSize = ((UnsignedIntType) in.getValue()).getValue(); - return new FinalFeasibilityQueryResult(cohortId, participatingMedics, cohortSize); - } - - private int getParticipatingMedicsCountByCohortId(Task task, String cohortId) - { - return task.getInput().stream() - .filter(in -> in.hasType() && in.getType().hasCoding() && CODESYSTEM_HIGHMED_FEASIBILITY - .equals(in.getType().getCodingFirstRep().getSystem()) - && CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT - .equals(in.getType().getCodingFirstRep().getCode()) && cohortId - .equals(((Reference) in.getExtensionByUrl(EXTENSION_HIGHMED_GROUP_ID).getValue()) - .getReference())).mapToInt(in -> ((UnsignedIntType) in.getValue()).getValue()) - .findFirst().getAsInt(); - } - - protected FinalFeasibilityQueryResults checkResults(FinalFeasibilityQueryResults results) - { - // TODO implement check for results - // - criterias tbd - return results; - } - - private void addFinalFeasibilityQueryResultsToLeadingTask(FinalFeasibilityQueryResults results, Task toWrite) - { - results.getResults().forEach(result -> addResultOutput(result, toWrite)); - } - - private void addResultOutput(FinalFeasibilityQueryResult result, Task toWrite) - { - TaskOutputComponent output1 = getTaskHelper().createOutputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT, result.getCohortSize()); - output1.addExtension(createCohortIdExtension(result.getCohortId())); - toWrite.addOutput(output1); - - TaskOutputComponent output2 = getTaskHelper().createOutputUnsignedInt(CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT, result.getParticipatingMedics()); - output2.addExtension(createCohortIdExtension(result.getCohortId())); - toWrite.addOutput(output2); - } - - private Extension createCohortIdExtension(String cohortId) - { - return new Extension(EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java deleted file mode 100644 index 73965e0ef..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckQueries.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.group.GroupHelper; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.FhirResourcesList; -import org.hl7.fhir.r4.model.Group; -import org.hl7.fhir.r4.model.Task; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.InitializingBean; - -public class CheckQueries extends AbstractServiceDelegate implements InitializingBean, JavaDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(CheckQueries.class); - - private final GroupHelper groupHelper; - - public CheckQueries(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, GroupHelper groupHelper) - { - super(clientProvider, taskHelper); - this.groupHelper = groupHelper; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - Objects.requireNonNull(groupHelper, "groupHelper"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - List<Group> cohorts = ((FhirResourcesList) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS)).getResourcesAndCast(); - - Map<String, String> queries = new HashMap<>(); - - Task leadingTask = getLeadingTaskFromExecutionVariables(); - cohorts.forEach(group -> { - String aqlQuery = groupHelper.extractAqlQuery(group).toLowerCase(); - - String groupId = group.getId(); - if (!aqlQuery.startsWith(ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX)) - { - String errorMessage = - "Initial single medic feasibility query check failed, wrong format for query of group with id '" - + groupId + "', expected query to start with '" - + ConstantsFeasibility.FEASIBILITY_QUERY_PREFIX + "' but got '" + aqlQuery + "'"; - - logger.info(errorMessage); - leadingTask.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, errorMessage)); - } - else - { - queries.put(groupId, aqlQuery); - } - }); - - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES, queries); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java deleted file mode 100755 index 6dd391ae2..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckSingleMedicResults.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.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 CheckSingleMedicResults extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(CheckSingleMedicResults.class); - - public CheckSingleMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - - Task currentTask = getCurrentTaskFromExecutionVariables(); - List<FeasibilityQueryResult> filteredResults = filterErroneousResultsAndAddErrorsToCurrentTaskOutputs(results, - currentTask); - - // TODO: add percentage filter over results - - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, - FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(filteredResults))); - } - - private List<FeasibilityQueryResult> filterErroneousResultsAndAddErrorsToCurrentTaskOutputs( - FeasibilityQueryResults results, Task task) - { - List<FeasibilityQueryResult> filteredResults = new ArrayList<>(); - for (FeasibilityQueryResult result : results.getResults()) - { - Optional<String> errorReason = testResultAndReturnErrorReason(result); - if (errorReason.isPresent()) - addError(task, result.getCohortId(), errorReason.get()); - else - filteredResults.add(result); - } - - return filteredResults; - } - - protected Optional<String> testResultAndReturnErrorReason(FeasibilityQueryResult result) - { - // TODO: implement check - // cohort size > 0 - // other filter criteria tbd - return Optional.empty(); - } - - private void addError(Task task, String cohortId, String error) - { - String errorMessage = "Feasibility query result check failed for group with id '" + cohortId + "': " + error; - logger.info(errorMessage); - - task.getOutput().add(getTaskHelper() - .createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - errorMessage)); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java deleted file mode 100644 index 77bbd2442..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/CheckTtpComputedMultiMedicResults.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_RESULT; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.MIN_PARTICIPATING_MEDICS; - -import java.util.List; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.BpmnError; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues; -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 CheckTtpComputedMultiMedicResults extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(CheckTtpComputedMultiMedicResults.class); - - public CheckTtpComputedMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task leadingTask = getLeadingTaskFromExecutionVariables(); - FinalFeasibilityQueryResults results = (FinalFeasibilityQueryResults) execution - .getVariable(BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS); - - List<FinalFeasibilityQueryResult> resultsWithEnoughParticipatingMedics = filterResultsByParticipatingMedics( - leadingTask, results); - - execution.setVariable(BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, FinalFeasibilityQueryResultsValues - .create(new FinalFeasibilityQueryResults(resultsWithEnoughParticipatingMedics))); - - boolean existsAtLeastOneResult = checkIfAtLeastOneResultExists(leadingTask, - resultsWithEnoughParticipatingMedics); - - if (!existsAtLeastOneResult) - throw new BpmnError(BPMN_EXECUTION_ERROR_CODE_MULTI_MEDIC_RESULT); - } - - private List<FinalFeasibilityQueryResult> filterResultsByParticipatingMedics(Task leadingTask, - FinalFeasibilityQueryResults results) - { - String taskId = leadingTask.getId(); - String businessKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN, - CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); - String correlationKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN, - CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); - - return results.getResults().stream().filter(result -> { - if (result.getParticipatingMedics() < MIN_PARTICIPATING_MEDICS) - { - logger.warn("Removed result with cohort id='{}' from feasibility request with task-id='{}', " - + "business-key='{}' and correlation-key='{}' because of not enough participating MeDICs", - result.getCohortId(), taskId, businessKey, correlationKey); - - leadingTask.getOutput().add(getTaskHelper() - .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - "Removed result with cohort id='" + result.getCohortId() - + "' from feasibility request because of not enough participating MeDICs")); - - return false; - } - - return true; - }).collect(Collectors.toList()); - } - - private boolean checkIfAtLeastOneResultExists(Task leadingTask, List<FinalFeasibilityQueryResult> results) - { - String taskId = leadingTask.getId(); - String businessKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN, - CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY).orElse(null); - String correlationKey = getTaskHelper().getFirstInputParameterStringValue(leadingTask, CODESYSTEM_HIGHMED_BPMN, - CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElse(null); - - if (results.size() < 1) - { - logger.warn("Did not receive enough results from participating MeDICs for any cohort definition in the " - + "feasibility request with task-id='{}', business-key='{}' " + "and correlation-key='{}'", taskId, - businessKey, correlationKey); - - leadingTask.getOutput().add(getTaskHelper() - .createOutput(CODESYSTEM_HIGHMED_BPMN, CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, - "Did not receive enough results from participating MeDICs for any cohort definition")); - - return false; - } - - return true; - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java deleted file mode 100644 index d750ca404..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadFeasibilityResources.java +++ /dev/null @@ -1,195 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; - -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.BloomFilterConfig; -import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.FhirResourceValues; -import org.highmed.dsf.fhir.variables.FhirResourcesListValues; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Extension; -import org.hl7.fhir.r4.model.Group; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResearchStudy; -import org.hl7.fhir.r4.model.Task; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.InitializingBean; - -public class DownloadFeasibilityResources extends AbstractServiceDelegate implements InitializingBean -{ - private static final Logger logger = LoggerFactory.getLogger(DownloadFeasibilityResources.class); - - private final OrganizationProvider organizationProvider; - - public DownloadFeasibilityResources(OrganizationProvider organizationProvider, - FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - - IdType researchStudyId = getResearchStudyId(task); - FhirWebserviceClient client = getWebserviceClient(researchStudyId); - Bundle bundle = getResearchStudyAndCohortDefinitions(researchStudyId, client); - - ResearchStudy researchStudy = (ResearchStudy) bundle.getEntryFirstRep().getResource(); - execution.setVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY, FhirResourceValues.create(researchStudy)); - - List<Group> cohortDefinitions = getCohortDefinitions(bundle, client.getBaseUrl()); - execution.setVariable(BPMN_EXECUTION_VARIABLE_COHORTS, FhirResourcesListValues.create(cohortDefinitions)); - - String ttpIdentifier = getTtpIdentifier(researchStudy, client); - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER, ttpIdentifier); - - boolean needsConsentCheck = getNeedsConsentCheck(task); - execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); - - boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); - - if (needsRecordLinkage) - { - BloomFilterConfig bloomFilterConfig = getBloomFilterConfig(task); - execution.setVariable(BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, - BloomFilterConfigValues.create(bloomFilterConfig)); - } - } - - private IdType getResearchStudyId(Task task) - { - Reference researchStudyReference = getTaskHelper() - .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE).findFirst().get(); - - return new IdType(researchStudyReference.getReference()); - } - - private FhirWebserviceClient getWebserviceClient(IdType researchStudyId) - { - if (researchStudyId.getBaseUrl() == null || researchStudyId.getBaseUrl() - .equals(getFhirWebserviceClientProvider().getLocalBaseUrl())) - { - return getFhirWebserviceClientProvider().getLocalWebserviceClient(); - } - else - { - return getFhirWebserviceClientProvider().getRemoteWebserviceClient(researchStudyId.getBaseUrl()); - } - } - - private Bundle getResearchStudyAndCohortDefinitions(IdType researchStudyId, FhirWebserviceClient client) - { - try - { - Bundle bundle = client.searchWithStrictHandling(ResearchStudy.class, - Map.of("_id", Collections.singletonList(researchStudyId.getIdPart()), "_include", - Collections.singletonList("ResearchStudy:enrollment"))); - - if (bundle.getEntry().size() < 2) - { - throw new RuntimeException("Returned search-set contained less then two entries"); - } - else if (!bundle.getEntryFirstRep().hasResource() || !(bundle.getEntryFirstRep() - .getResource() instanceof ResearchStudy)) - { - throw new RuntimeException("Returned search-set did not contain ResearchStudy at index == 0"); - } - else if (bundle.getEntry().stream().skip(1).map(c -> c.hasResource() && c.getResource() instanceof Group) - .filter(b -> !b).findAny().isPresent()) - { - throw new RuntimeException("Returned search-set contained unexpected resource at index >= 1"); - } - - return bundle; - } - catch (Exception e) - { - logger.warn("Error while reading ResearchStudy with id {} including Groups from {}: {}", - researchStudyId.getIdPart(), client.getBaseUrl(), e.getMessage()); - throw e; - } - } - - private List<Group> getCohortDefinitions(Bundle bundle, String baseUrl) - { - return bundle.getEntry().stream().skip(1).map(e -> { - Group group = (Group) e.getResource(); - IdType oldId = group.getIdElement(); - group.setIdElement( - new IdType(baseUrl, oldId.getResourceType(), oldId.getIdPart(), oldId.getVersionIdPart())); - return group; - }).collect(Collectors.toList()); - } - - private String getTtpIdentifier(ResearchStudy researchStudy, FhirWebserviceClient client) - { - Extension ext = researchStudy.getExtensionByUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP); - Reference ref = (Reference) ext.getValue(); - return ref.getIdentifier().getValue(); - } - - private boolean getNeedsConsentCheck(Task task) - { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( - () -> new IllegalArgumentException( - "NeedsConsentCheck boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); - } - - private boolean getNeedsRecordLinkageCheck(Task task) - { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); - } - - private BloomFilterConfig getBloomFilterConfig(Task task) - { - return BloomFilterConfig.fromBytes(getTaskHelper() - .getFirstInputParameterByteValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG).orElseThrow( - () -> new IllegalArgumentException( - "BloomFilterConfig byte[] is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation"))); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java deleted file mode 100644 index 90b18e538..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResearchStudyResource.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; - -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResearchStudy; -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.Task; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.InitializingBean; - -public class DownloadResearchStudyResource extends AbstractServiceDelegate implements InitializingBean -{ - private static final Logger logger = LoggerFactory.getLogger(DownloadResearchStudyResource.class); - - private final OrganizationProvider organizationProvider; - - public DownloadResearchStudyResource(OrganizationProvider organizationProvider, - FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - - IdType researchStudyId = getResearchStudyId(task); - FhirWebserviceClient client = getFhirWebserviceClientProvider().getLocalWebserviceClient(); - ResearchStudy researchStudy = getResearchStudy(researchStudyId, client); - researchStudy = addMissingOrganizations(researchStudy, client); - execution.setVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY, researchStudy); - - boolean needsConsentCheck = getNeedsConsentCheck(task); - execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); - - boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); - } - - private IdType getResearchStudyId(Task task) - { - Reference researchStudyReference = getTaskHelper() - .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE).findFirst().orElseThrow( - () -> new IllegalArgumentException( - "ResearchStudy reference is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); - - return new IdType(researchStudyReference.getReference()); - } - - private ResearchStudy getResearchStudy(IdType researchStudyid, FhirWebserviceClient client) - { - try - { - return client.read(ResearchStudy.class, researchStudyid.getIdPart()); - } - catch (Exception e) - { - logger.warn("Error while reading ResearchStudy with id {} from {}", researchStudyid.getIdPart(), - client.getBaseUrl()); - throw e; - } - } - - private ResearchStudy addMissingOrganizations(ResearchStudy researchStudy, FhirWebserviceClient client) - { - List<String> identifiers = organizationProvider - .getOrganizationsByType(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_MEDIC) - .flatMap(o -> o.getIdentifier().stream()) - .filter(i -> NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER.equals(i.getSystem())).map(i -> i.getValue()) - .collect(Collectors.toList()); - - List<String> existingIdentifiers = researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC) - .stream().filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> r.getIdentifier().getValue()).collect(Collectors.toList()); - - identifiers.removeAll(existingIdentifiers); - - if (!identifiers.isEmpty()) - { - identifiers.forEach(identifier -> { - logger.warn( - "Adding missing organization with identifier='{}' to feasibility research study with id='{}'", - identifier, researchStudy.getId()); - - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(identifier))); - - }); - - return update(researchStudy, client); - } - else - return researchStudy; - } - - private ResearchStudy update(ResearchStudy researchStudy, FhirWebserviceClient client) - { - try - { - return client.update(researchStudy); - } - catch (Exception e) - { - logger.warn("Error while updating ResearchStudy resoruce: " + e.getMessage(), e); - throw e; - } - } - - private boolean getNeedsConsentCheck(Task task) - { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( - () -> new IllegalArgumentException( - "NeedsConsentCheck boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); - } - - private boolean getNeedsRecordLinkageCheck(Task task) - { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java deleted file mode 100644 index 5df78880b..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/DownloadResultSets.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.OPENEHR_MIMETYPE_JSON; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; - -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import javax.ws.rs.core.MediaType; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.highmed.openehr.model.structure.ResultSet; -import org.hl7.fhir.r4.model.IdType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.databind.ObjectMapper; - -public class DownloadResultSets extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(DownloadResultSets.class); - - private final ObjectMapper openEhrObjectMapper; - - public DownloadResultSets(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - ObjectMapper openEhrObjectMapper) - { - super(clientProvider, taskHelper); - - this.openEhrObjectMapper = openEhrObjectMapper; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(openEhrObjectMapper, "openEhrObjectMapper"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - - List<FeasibilityQueryResult> resultsWithResultSets = download(results); - - execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, - FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(resultsWithResultSets))); - } - - private List<FeasibilityQueryResult> download(FeasibilityQueryResults results) - { - return results.getResults().stream().map(r -> download(r)).collect(Collectors.toList()); - } - - private FeasibilityQueryResult download(FeasibilityQueryResult result) - { - IdType id = new IdType(result.getResultSetUrl()); - FhirWebserviceClient client = getFhirWebserviceClientProvider().getRemoteWebserviceClient(id.getBaseUrl()); - - InputStream binary = readBinaryResource(client, id.getIdPart()); - ResultSet resultSet = deserializeResultSet(binary); - - return FeasibilityQueryResult.idResult(result.getOrganizationIdentifier(), result.getCohortId(), resultSet); - } - - private InputStream readBinaryResource(FhirWebserviceClient client, String id) - { - try - { - logger.info("Reading binary from {} with id {}", client.getBaseUrl(), id); - return client.readBinary(id, MediaType.valueOf(OPENEHR_MIMETYPE_JSON)); - } - catch (Exception e) - { - logger.warn("Error while reading Binary resoruce: " + e.getMessage(), e); - throw e; - } - } - - private ResultSet deserializeResultSet(InputStream content) - { - try (content) - { - return openEhrObjectMapper.readValue(content, ResultSet.class); - } - catch (IOException e) - { - logger.warn("Error while deserializing ResultSet: " + e.getMessage(), e); - throw new RuntimeException(e); - } - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java deleted file mode 100755 index c4fb0365a..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteQueries.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.openehr.client.OpenEhrClient; -import org.highmed.openehr.model.structure.ResultSet; -import org.springframework.beans.factory.InitializingBean; - -public class ExecuteQueries extends AbstractServiceDelegate implements InitializingBean -{ - private final OpenEhrClient openehrClient; - private final OrganizationProvider organizationProvider; - - public ExecuteQueries(FhirWebserviceClientProvider clientProvider, OpenEhrClient openehrClient, - TaskHelper taskHelper, OrganizationProvider organizationProvider) - { - super(clientProvider, taskHelper); - - this.openehrClient = openehrClient; - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(openehrClient, "openehrClient"); - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - // <groupId, query> - @SuppressWarnings("unchecked") - Map<String, String> queries = (Map<String, String>) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES); - - Boolean needsConsentCheck = (Boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); - Boolean needsRecordLinkage = (Boolean) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); - boolean idQuery = Boolean.TRUE.equals(needsConsentCheck) || Boolean.TRUE.equals(needsRecordLinkage); - - List<FeasibilityQueryResult> results = queries.entrySet().stream() - .map(entry -> executeQuery(entry.getKey(), entry.getValue(), idQuery)).collect(Collectors.toList()); - - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, - FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(results))); - } - - private FeasibilityQueryResult executeQuery(String cohortId, String cohortQuery, boolean idQuery) - { - // TODO We might want to introduce a more complex result type to represent a count, - // errors and possible meta-data. - - ResultSet resultSet = openehrClient.query(cohortQuery, null); - - if (idQuery) - { - return FeasibilityQueryResult.idResult(organizationProvider.getLocalIdentifierValue(), cohortId, resultSet); - } - else - { - int count = Integer.parseInt(resultSet.getRow(0).get(0).getValueAsString()); - return FeasibilityQueryResult.countResult(organizationProvider.getLocalIdentifierValue(), cohortId, count); - } - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java deleted file mode 100644 index da6d21196..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ExecuteRecordLink.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.pseudonymization.domain.PersonWithMdat; -import org.highmed.pseudonymization.domain.impl.MatchedPersonImpl; -import org.highmed.pseudonymization.recordlinkage.FederatedMatcherImpl; -import org.highmed.pseudonymization.recordlinkage.MatchedPerson; -import org.highmed.pseudonymization.translation.ResultSetTranslatorFromMedicRbfOnly; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ExecuteRecordLink extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(ExecuteRecordLink.class); - - private final ResultSetTranslatorFromMedicRbfOnly translator; - - public ExecuteRecordLink(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - ResultSetTranslatorFromMedicRbfOnly translator) - { - super(clientProvider, taskHelper); - - this.translator = translator; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(translator, "translator"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - - Map<String, List<FeasibilityQueryResult>> byCohortId = results.getResults().stream() - .collect(Collectors.groupingBy(FeasibilityQueryResult::getCohortId)); - - FederatedMatcherImpl<PersonWithMdat> matcher = createMatcher(); - - List<FinalFeasibilityQueryResult> matchedResults = byCohortId.entrySet().stream() - .map(e -> match(matcher, e.getKey(), e.getValue())).collect(Collectors.toList()); - - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_FINAL_QUERY_RESULTS, - FinalFeasibilityQueryResultsValues.create(new FinalFeasibilityQueryResults(matchedResults))); - } - - private FinalFeasibilityQueryResult match(FederatedMatcherImpl<PersonWithMdat> matcher, String cohortId, - List<FeasibilityQueryResult> results) - { - logger.debug("Matching results for cohort {}", cohortId); - - List<List<PersonWithMdat>> persons = results.stream().map(this::translate).collect(Collectors.toList()); - - Set<MatchedPerson<PersonWithMdat>> matchedPersons = matcher.matchPersons(persons); - - return new FinalFeasibilityQueryResult(cohortId, - toInt(persons.stream().mapToInt(r -> r.size()).filter(cohortSize -> cohortSize > 0).count()), - toInt(matchedPersons.size())); - } - - private List<PersonWithMdat> translate(FeasibilityQueryResult result) - { - return translator.translate(result.getOrganizationIdentifier(), result.getResultSet()); - } - - protected FederatedMatcherImpl<PersonWithMdat> createMatcher() - { - return new FederatedMatcherImpl<>(MatchedPersonImpl::new); - } - - private int toInt(long l) - { - if (l > Integer.MAX_VALUE) - throw new IllegalArgumentException("long > " + Integer.MAX_VALUE); - else - return (int) l; - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java deleted file mode 100644 index ebdb9f026..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/FilterQueryResultsByConsent.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import java.util.List; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.openehr.model.structure.ResultSet; - -public class FilterQueryResultsByConsent extends AbstractServiceDelegate -{ - public FilterQueryResultsByConsent(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - - List<FeasibilityQueryResult> filteredResults = filterResults(results.getResults()); - - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, - FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(filteredResults))); - } - - private List<FeasibilityQueryResult> filterResults(List<FeasibilityQueryResult> results) - { - return results.stream().map(this::filterResult).collect(Collectors.toList()); - } - - protected FeasibilityQueryResult filterResult(FeasibilityQueryResult result) - { - return FeasibilityQueryResult.idResult(result.getOrganizationIdentifier(), result.getCohortId(), - filterResultSet(result.getResultSet())); - } - - private ResultSet filterResultSet(ResultSet resultSet) - { - // TODO implement - - return resultSet; - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java deleted file mode 100644 index 6a10c6b14..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateBloomFilters.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsBase.OPENEHR_MIMETYPE_JSON; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI; - -import java.security.Key; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.BloomFilterConfig; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.mpi.client.MasterPatientIndexClient; -import org.highmed.openehr.model.structure.ResultSet; -import org.highmed.pseudonymization.bloomfilter.BloomFilterGenerator; -import org.highmed.pseudonymization.bloomfilter.RecordBloomFilterGenerator; -import org.highmed.pseudonymization.bloomfilter.RecordBloomFilterGeneratorImpl; -import org.highmed.pseudonymization.bloomfilter.RecordBloomFilterGeneratorImpl.FieldBloomFilterLengths; -import org.highmed.pseudonymization.bloomfilter.RecordBloomFilterGeneratorImpl.FieldWeights; -import org.highmed.pseudonymization.translation.ResultSetTranslatorToTtpRbfOnly; -import org.highmed.pseudonymization.translation.ResultSetTranslatorToTtpRbfOnlyImpl; -import org.hl7.fhir.r4.model.Binary; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.Task; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -import ca.uhn.fhir.context.FhirContext; - -public class GenerateBloomFilters extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(GenerateBloomFilters.class); - - private static final int RBF_LENGTH = 3000; - private static final FieldWeights FBF_WEIGHTS = new FieldWeights(0.1, 0.1, 0.1, 0.2, 0.05, 0.1, 0.05, 0.2, 0.1); - private static final FieldBloomFilterLengths FBF_LENGTHS = new FieldBloomFilterLengths(500, 500, 250, 50, 500, 250, - 500, 500, 500); - - private final String ehrIdColumnPath; - private final MasterPatientIndexClient masterPatientIndexClient; - private final ObjectMapper openEhrObjectMapper; - private final BouncyCastleProvider bouncyCastleProvider; - - public GenerateBloomFilters(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - String ehrIdColumnPath, MasterPatientIndexClient masterPatientIndexClient, ObjectMapper openEhrObjectMapper, - BouncyCastleProvider bouncyCastleProvider) - { - super(clientProvider, taskHelper); - - this.ehrIdColumnPath = ehrIdColumnPath; - this.masterPatientIndexClient = masterPatientIndexClient; - this.openEhrObjectMapper = openEhrObjectMapper; - this.bouncyCastleProvider = bouncyCastleProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(ehrIdColumnPath, "ehrIdColumnPath"); - Objects.requireNonNull(masterPatientIndexClient, "masterPatientIndexClient"); - Objects.requireNonNull(openEhrObjectMapper, "openEhrObjectMapper"); - Objects.requireNonNull(bouncyCastleProvider, "bouncyCastleProvider"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - - String securityIdentifier = getSecurityIdentifier(execution); - - BloomFilterConfig bloomFilterConfig = (BloomFilterConfig) execution - .getVariable(BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG); - - ResultSetTranslatorToTtpRbfOnly resultSetTranslator = createResultSetTranslator(bloomFilterConfig); - - List<FeasibilityQueryResult> translatedResults = results.getResults().stream() - .map(result -> translateAndCreateBinary(resultSetTranslator, result, securityIdentifier)) - .collect(Collectors.toList()); - - execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, - FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(translatedResults))); - } - - private String getSecurityIdentifier(DelegateExecution execution) - { - Task task = getCurrentTaskFromExecutionVariables(); - - if (task.getInstantiatesUri().startsWith(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI)) - return task.getRequester().getIdentifier().getValue(); - else - return (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER); - } - - protected ResultSetTranslatorToTtpRbfOnly createResultSetTranslator(BloomFilterConfig bloomFilterConfig) - { - return new ResultSetTranslatorToTtpRbfOnlyImpl(ehrIdColumnPath, - createRecordBloomFilterGenerator(bloomFilterConfig.getPermutationSeed(), - bloomFilterConfig.getHmacSha2Key(), bloomFilterConfig.getHmacSha3Key()), - masterPatientIndexClient, ResultSetTranslatorToTtpRbfOnlyImpl.FILTER_ON_IDAT_NOT_FOUND_EXCEPTION); - } - - protected RecordBloomFilterGenerator createRecordBloomFilterGenerator(long permutationSeed, Key hmacSha2Key, - Key hmacSha3Key) - { - return new RecordBloomFilterGeneratorImpl(RBF_LENGTH, permutationSeed, FBF_WEIGHTS, FBF_LENGTHS, - () -> new BloomFilterGenerator.HmacSha2HmacSha3BiGramHasher(hmacSha2Key, hmacSha3Key, - bouncyCastleProvider)); - } - - private FeasibilityQueryResult translateAndCreateBinary(ResultSetTranslatorToTtpRbfOnly resultSetTranslator, - FeasibilityQueryResult result, String ttpIdentifier) - { - ResultSet translatedResultSet = translate(resultSetTranslator, result.getResultSet()); - String resultSetUrl = saveResultSetAsBinaryForTtp(translatedResultSet, ttpIdentifier); - - return FeasibilityQueryResult.idResult(result.getOrganizationIdentifier(), result.getCohortId(), resultSetUrl); - } - - private ResultSet translate(ResultSetTranslatorToTtpRbfOnly resultSetTranslator, ResultSet resultSet) - { - try - { - return resultSetTranslator.translate(resultSet); - } - catch (Exception e) - { - logger.warn("Error while translating ResultSet: " + e.getMessage(), e); - throw e; - } - } - - protected String saveResultSetAsBinaryForTtp(ResultSet resultSet, String securityIdentifier) - { - byte[] content = serializeResultSet(resultSet); - Reference securityContext = new Reference(); - securityContext.setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue(securityIdentifier); - Binary binary = new Binary().setContentType(OPENEHR_MIMETYPE_JSON).setSecurityContext(securityContext) - .setData(content); - - IdType created = createBinaryResource(binary); - return new IdType(getFhirWebserviceClientProvider().getLocalBaseUrl(), ResourceType.Binary.name(), - created.getIdPart(), created.getVersionIdPart()).getValue(); - } - - private byte[] serializeResultSet(ResultSet resultSet) - { - try - { - return openEhrObjectMapper.writeValueAsBytes(resultSet); - } - catch (JsonProcessingException e) - { - logger.warn("Error while serializing ResultSet: " + e.getMessage(), e); - throw new RuntimeException(e); - } - } - - private IdType createBinaryResource(Binary binary) - { - try - { - return getFhirWebserviceClientProvider().getLocalWebserviceClient().withMinimalReturn().create(binary); - } - catch (Exception e) - { - logger.debug("Binary to create {}", FhirContext.forR4().newJsonParser().encodeResourceToString(binary)); - logger.warn("Error while creating Binary resoruce: " + e.getMessage(), e); - throw e; - } - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java deleted file mode 100644 index ef41cf4e1..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/GenerateCountFromIds.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import java.util.List; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; - -public class GenerateCountFromIds extends AbstractServiceDelegate -{ - public GenerateCountFromIds(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - - List<FeasibilityQueryResult> filteredResults = count(results.getResults()); - - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, - FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(filteredResults))); - } - - private List<FeasibilityQueryResult> count(List<FeasibilityQueryResult> results) - { - return results.stream().map(this::count).collect(Collectors.toList()); - } - - protected FeasibilityQueryResult count(FeasibilityQueryResult result) - { - return FeasibilityQueryResult.countResult(result.getOrganizationIdentifier(), result.getCohortId(), - result.getResultSet().getRows().size()); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java deleted file mode 100644 index c00384c4f..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/HandleErrorMultiMedicResults.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.Task; - -public class HandleErrorMultiMedicResults extends AbstractServiceDelegate -{ - public HandleErrorMultiMedicResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task currentTask = getCurrentTaskFromExecutionVariables(); - Task leadingTask = getLeadingTaskFromExecutionVariables(); - - currentTask.getInput().forEach(input -> { - boolean isErrorInput = input.getType().getCoding().stream().anyMatch( - code -> code.getSystem().equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN) && code.getCode() - .equals(ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR)); - - if (isErrorInput) - { - leadingTask.getOutput().add(getTaskHelper().createOutput(ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR, input.getValue().primitiveValue())); - } - }); - - // The current task finishes here but is not automatically set to completed - // because it is an additional task during the execution of the main process - currentTask.setStatus(Task.TaskStatus.COMPLETED); - getFhirWebserviceClientProvider().getLocalWebserviceClient().withMinimalReturn().update(currentTask); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java deleted file mode 100644 index 82fec1468..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/ModifyQueries.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERIES; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.springframework.beans.factory.InitializingBean; - -public class ModifyQueries extends AbstractServiceDelegate implements InitializingBean -{ - private final String ehrIdColumnPath; - - public ModifyQueries(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, String ehrIdColumnPath) - { - super(clientProvider, taskHelper); - this.ehrIdColumnPath = ehrIdColumnPath; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - Objects.requireNonNull(ehrIdColumnPath, "ehrIdColumnPath"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Boolean needsConsentCheck = (Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK); - Boolean needsRecordLinkage = (Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); - boolean idQuery = Boolean.TRUE.equals(needsConsentCheck) || Boolean.TRUE.equals(needsRecordLinkage); - - if (idQuery) - { - // <groupId, query> - @SuppressWarnings("unchecked") - Map<String, String> queries = (Map<String, String>) execution.getVariable(BPMN_EXECUTION_VARIABLE_QUERIES); - - Map<String, String> modifiedQueries = modifyQueries(queries); - - execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERIES, modifiedQueries); - } - } - - private Map<String, String> modifyQueries(Map<String, String> queries) - { - Map<String, String> modifiedQueries = new HashMap<>(); - - for (Entry<String, String> entry : queries.entrySet()) - modifiedQueries.put(entry.getKey(), replaceSelectCountWithSelectMpiId(entry.getValue())); - - return modifiedQueries; - } - - protected String replaceSelectCountWithSelectMpiId(String value) - { - // TODO Implement correct replacement for default id query - return value.replace("select count(e)", "select e" + ehrIdColumnPath + " as EHRID"); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java deleted file mode 100755 index 016da37b1..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectRequestTargets.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY; - -import java.security.NoSuchAlgorithmException; -import java.util.List; -import java.util.Objects; -import java.util.Random; -import java.util.UUID; -import java.util.stream.Collectors; - -import javax.crypto.KeyGenerator; - -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.BloomFilterConfig; -import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.Target; -import org.highmed.dsf.fhir.variables.TargetValues; -import org.highmed.dsf.fhir.variables.Targets; -import org.highmed.dsf.fhir.variables.TargetsValues; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResearchStudy; - -public class SelectRequestTargets extends AbstractServiceDelegate -{ - private static final Random random = new Random(); - - private final OrganizationProvider organizationProvider; - private final KeyGenerator hmacSha2Generator; - private final KeyGenerator hmacSha3Generator; - - public SelectRequestTargets(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, BouncyCastleProvider bouncyCastleProvider) - { - super(clientProvider, taskHelper); - - this.organizationProvider = organizationProvider; - - try - { - Objects.requireNonNull(bouncyCastleProvider, "bouncyCastleProvider"); - - hmacSha2Generator = KeyGenerator.getInstance("HmacSHA256", bouncyCastleProvider); - hmacSha3Generator = KeyGenerator.getInstance("HmacSHA3-256", bouncyCastleProvider); - } - catch (NoSuchAlgorithmException e) - { - throw new RuntimeException(e); - } - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - ResearchStudy researchStudy = (ResearchStudy) execution.getVariable(BPMN_EXECUTION_VARIABLE_RESEARCH_STUDY); - - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, - TargetsValues.create(getMedicTargets(researchStudy))); - - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, - TargetValues.create(getTtpTarget(researchStudy))); - - Boolean needsRecordLinkage = (Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE); - if (Boolean.TRUE.equals(needsRecordLinkage)) - { - execution.setVariable(BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, - BloomFilterConfigValues.create(createBloomFilterConfig())); - } - } - - private BloomFilterConfig createBloomFilterConfig() - { - return new BloomFilterConfig(random.nextLong(), hmacSha2Generator.generateKey(), - hmacSha3Generator.generateKey()); - } - - private Targets getMedicTargets(ResearchStudy researchStudy) - { - List<Target> targets = researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).stream() - .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> Target.createBiDirectionalTarget(r.getIdentifier().getValue(), UUID.randomUUID().toString())) - .collect(Collectors.toList()); - - return new Targets(targets); - } - - private Target getTtpTarget(ResearchStudy researchStudy) - { - return researchStudy.getExtensionsByUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP).stream() - .filter(e -> e.getValue() instanceof Reference).map(e -> (Reference) e.getValue()) - .map(r -> Target.createUniDirectionalTarget(r.getIdentifier().getValue())).findFirst().get(); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java deleted file mode 100755 index 5e078184e..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetMedic.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import java.util.Objects; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.Target; -import org.highmed.dsf.fhir.variables.TargetValues; -import org.hl7.fhir.r4.model.Task; -import org.springframework.beans.factory.InitializingBean; - -public class SelectResponseTargetMedic extends AbstractServiceDelegate implements InitializingBean -{ - private final OrganizationProvider organizationProvider; - - public SelectResponseTargetMedic(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) - { - super(clientProvider, taskHelper); - - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task task = getLeadingTaskFromExecutionVariables(); - - Target medicTarget = Target.createUniDirectionalTarget(task.getRequester().getIdentifier().getValue()); - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(medicTarget)); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java deleted file mode 100755 index 2677e6be8..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/SelectResponseTargetTtp.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import java.util.Objects; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.Target; -import org.highmed.dsf.fhir.variables.TargetValues; -import org.hl7.fhir.r4.model.Task; -import org.springframework.beans.factory.InitializingBean; - -public class SelectResponseTargetTtp extends AbstractServiceDelegate implements InitializingBean -{ - private final OrganizationProvider organizationProvider; - - public SelectResponseTargetTtp(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) - { - super(clientProvider, taskHelper); - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - String ttpIdentifier = (String) execution.getVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TTP_IDENTIFIER); - String correlationKey = getCorrelationKey(execution); - - Target ttpTarget = Target.createBiDirectionalTarget(ttpIdentifier, correlationKey); - execution.setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET, TargetValues.create(ttpTarget)); - } - - private String getCorrelationKey(DelegateExecution execution) - { - Task task = getCurrentTaskFromExecutionVariables(); - - return getTaskHelper().getFirstInputParameterStringValue(task, ConstantsBase.CODESYSTEM_HIGHMED_BPMN, - ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).orElseThrow( - () -> new IllegalStateException( - "No correlation key found, this error should have been caught by resource validation")); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java deleted file mode 100644 index d4f3962ff..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreCorrelationKeys.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY; - -import java.util.List; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsBase; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.Target; -import org.highmed.dsf.fhir.variables.Targets; -import org.highmed.dsf.fhir.variables.TargetsValues; -import org.hl7.fhir.r4.model.Task; - -public class StoreCorrelationKeys extends AbstractServiceDelegate -{ - public StoreCorrelationKeys(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - - List<Target> targets = getTaskHelper().getInputParameterStringValues(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY) - .map(correlationKey -> Target.createBiDirectionalTarget("", correlationKey)) - .collect(Collectors.toList()); - - execution - .setVariable(ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); - - boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); - - execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, - FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(null))); - } - - private boolean getNeedsRecordLinkageCheck(Task task) - { - return getTaskHelper().getFirstInputParameterBooleanValue(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java deleted file mode 100755 index 322a8f9ef..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/service/StoreResults.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.UnsignedIntType; -import org.springframework.beans.factory.InitializingBean; - -public class StoreResults extends AbstractServiceDelegate implements InitializingBean -{ - private final OrganizationProvider organizationProvider; - - public StoreResults(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) - { - super(clientProvider, taskHelper); - - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - - boolean needsRecordLinkage = Boolean.TRUE - .equals((Boolean) execution.getVariable(BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE)); - - Task task = getCurrentTaskFromExecutionVariables(); - - List<FeasibilityQueryResult> extendedResults = new ArrayList<>(); - extendedResults.addAll(results.getResults()); - extendedResults.addAll(getResults(task, needsRecordLinkage)); - - execution.setVariable(BPMN_EXECUTION_VARIABLE_QUERY_RESULTS, - FeasibilityQueryResultsValues.create(new FeasibilityQueryResults(extendedResults))); - } - - private List<FeasibilityQueryResult> getResults(Task task, boolean needsRecordLinkage) - { - TaskHelper taskHelper = getTaskHelper(); - Reference requester = task.getRequester(); - - if (needsRecordLinkage) - { - return taskHelper.getInputParameterWithExtension(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, EXTENSION_HIGHMED_GROUP_ID) - .map(input -> { - String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); - String resultSetUrl = ((Reference) input.getValue()).getReference(); - - return FeasibilityQueryResult - .idResult(requester.getIdentifier().getValue(), cohortId, resultSetUrl); - }).collect(Collectors.toList()); - } - else - { - return taskHelper.getInputParameterWithExtension(task, CODESYSTEM_HIGHMED_FEASIBILITY, - CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, EXTENSION_HIGHMED_GROUP_ID).map(input -> { - String cohortId = ((Reference) input.getExtension().get(0).getValue()).getReference(); - int cohortSize = ((UnsignedIntType) input.getValue()).getValue(); - - return FeasibilityQueryResult.countResult(requester.getIdentifier().getValue(), cohortId, cohortSize); - }).collect(Collectors.toList()); - } - } - -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java deleted file mode 100755 index 1abc6a6a5..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilityConfig.java +++ /dev/null @@ -1,275 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.highmed.dsf.bpe.message.SendMedicRequest; -import org.highmed.dsf.bpe.message.SendMultiMedicErrors; -import org.highmed.dsf.bpe.message.SendMultiMedicResults; -import org.highmed.dsf.bpe.message.SendSingleMedicResults; -import org.highmed.dsf.bpe.message.SendTtpRequest; -import org.highmed.dsf.bpe.service.CalculateMultiMedicResults; -import org.highmed.dsf.bpe.service.CheckFeasibilityResources; -import org.highmed.dsf.bpe.service.CheckMultiMedicResults; -import org.highmed.dsf.bpe.service.CheckQueries; -import org.highmed.dsf.bpe.service.CheckSingleMedicResults; -import org.highmed.dsf.bpe.service.CheckTtpComputedMultiMedicResults; -import org.highmed.dsf.bpe.service.DownloadFeasibilityResources; -import org.highmed.dsf.bpe.service.DownloadResearchStudyResource; -import org.highmed.dsf.bpe.service.DownloadResultSets; -import org.highmed.dsf.bpe.service.ExecuteQueries; -import org.highmed.dsf.bpe.service.ExecuteRecordLink; -import org.highmed.dsf.bpe.service.FilterQueryResultsByConsent; -import org.highmed.dsf.bpe.service.GenerateBloomFilters; -import org.highmed.dsf.bpe.service.GenerateCountFromIds; -import org.highmed.dsf.bpe.service.HandleErrorMultiMedicResults; -import org.highmed.dsf.bpe.service.ModifyQueries; -import org.highmed.dsf.bpe.service.SelectRequestTargets; -import org.highmed.dsf.bpe.service.SelectResponseTargetMedic; -import org.highmed.dsf.bpe.service.SelectResponseTargetTtp; -import org.highmed.dsf.bpe.service.StoreCorrelationKeys; -import org.highmed.dsf.bpe.service.StoreResults; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.group.GroupHelper; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.mpi.client.MasterPatientIndexClient; -import org.highmed.mpi.client.MasterPatientIndexClientFactory; -import org.highmed.openehr.client.OpenEhrClient; -import org.highmed.openehr.client.OpenEhrClientFactory; -import org.highmed.pseudonymization.translation.ResultSetTranslatorFromMedicRbfOnly; -import org.highmed.pseudonymization.translation.ResultSetTranslatorFromMedicRbfOnlyImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.env.Environment; - -import com.fasterxml.jackson.databind.ObjectMapper; - -import ca.uhn.fhir.context.FhirContext; - -@Configuration -public class FeasibilityConfig -{ - @Autowired - private FhirWebserviceClientProvider fhirClientProvider; - - @Autowired - private MasterPatientIndexClientFactory masterPatientIndexClientFactory; - - @Autowired - private OpenEhrClientFactory openEhrClientFactory; - - @Autowired - private OrganizationProvider organizationProvider; - - @Autowired - private TaskHelper taskHelper; - - @Autowired - private GroupHelper groupHelper; - - @Autowired - private FhirContext fhirContext; - - @Autowired - private ObjectMapper objectMapper; - - @Autowired - private Environment environment; - - @Value("${org.highmed.dsf.bpe.openehr.subject_external_id.path:/ehr_status/subject/external_ref/id/value}") - private String ehrIdColumnPath; - - // - // process requestFeasibility implementations - // - - @Bean - public DownloadResearchStudyResource downloadResearchStudyResource() - { - return new DownloadResearchStudyResource(organizationProvider, fhirClientProvider, taskHelper); - } - - @Bean - public SelectRequestTargets selectRequestTargets() - { - return new SelectRequestTargets(fhirClientProvider, taskHelper, organizationProvider, bouncyCastleProvider()); - } - - @Bean - public SendTtpRequest sendTtpRequest() - { - return new SendTtpRequest(fhirClientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Bean - public SendMedicRequest sendMedicRequest() - { - return new SendMedicRequest(fhirClientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Bean - public CheckMultiMedicResults checkMultiMedicResults() - { - return new CheckMultiMedicResults(fhirClientProvider, taskHelper); - } - - @Bean - public HandleErrorMultiMedicResults handleErrorMultiMedicResults() - { - return new HandleErrorMultiMedicResults(fhirClientProvider, taskHelper); - } - - // - // process executeFeasibility implementations - // - - @Bean - public DownloadFeasibilityResources downloadFeasibilityResources() - { - return new DownloadFeasibilityResources(organizationProvider, fhirClientProvider, taskHelper); - } - - @Bean - public CheckFeasibilityResources checkFeasibilityResources() - { - return new CheckFeasibilityResources(fhirClientProvider, taskHelper); - } - - @Bean - public CheckQueries checkQueries() - { - return new CheckQueries(fhirClientProvider, taskHelper, groupHelper); - } - - @Bean - public ModifyQueries modifyQueries() - { - return new ModifyQueries(fhirClientProvider, taskHelper, ehrIdColumnPath); - } - - @Bean - public ExecuteQueries executeQueries() - { - return new ExecuteQueries(fhirClientProvider, openEhrClient(), taskHelper, organizationProvider); - } - - @Bean - public FilterQueryResultsByConsent filterQueryResultsByConsent() - { - return new FilterQueryResultsByConsent(fhirClientProvider, taskHelper); - } - - @Bean - public GenerateCountFromIds generateCountFromIds() - { - return new GenerateCountFromIds(fhirClientProvider, taskHelper); - } - - @Bean - public MasterPatientIndexClient masterPatientIndexClient() - { - return masterPatientIndexClientFactory.createClient(environment::getProperty); - } - - @Bean - public OpenEhrClient openEhrClient() - { - return openEhrClientFactory.createClient(environment::getProperty); - } - - @Bean - public GenerateBloomFilters generateBloomFilters() - { - return new GenerateBloomFilters(fhirClientProvider, taskHelper, ehrIdColumnPath, masterPatientIndexClient(), - objectMapper, bouncyCastleProvider()); - } - - @Bean - public BouncyCastleProvider bouncyCastleProvider() - { - return new BouncyCastleProvider(); - } - - @Bean - public CheckSingleMedicResults checkSingleMedicResults() - { - return new CheckSingleMedicResults(fhirClientProvider, taskHelper); - } - - @Bean - public SelectResponseTargetTtp selectResponseTargetTtp() - { - return new SelectResponseTargetTtp(fhirClientProvider, taskHelper, organizationProvider); - } - - @Bean - public SendSingleMedicResults sendSingleMedicResults() - { - return new SendSingleMedicResults(fhirClientProvider, taskHelper, organizationProvider, fhirContext); - } - - // - // process computeFeasibility implementations - // - - @Bean - public StoreCorrelationKeys storeCorrelationKeys() - { - return new StoreCorrelationKeys(fhirClientProvider, taskHelper); - } - - @Bean - public StoreResults storeResults() - { - return new StoreResults(fhirClientProvider, taskHelper, organizationProvider); - } - - @Bean - public DownloadResultSets downloadResultSets() - { - return new DownloadResultSets(fhirClientProvider, taskHelper, objectMapper); - } - - @Bean - public ResultSetTranslatorFromMedicRbfOnly resultSetTranslatorFromMedicRbfOnly() - { - return new ResultSetTranslatorFromMedicRbfOnlyImpl(); - } - - @Bean - public ExecuteRecordLink executeRecordLink() - { - return new ExecuteRecordLink(fhirClientProvider, taskHelper, resultSetTranslatorFromMedicRbfOnly()); - } - - @Bean - public CalculateMultiMedicResults calculateMultiMedicResults() - { - return new CalculateMultiMedicResults(fhirClientProvider, taskHelper); - } - - @Bean - public CheckTtpComputedMultiMedicResults checkTtpComputedMultiMedicResults() - { - return new CheckTtpComputedMultiMedicResults(fhirClientProvider, taskHelper); - } - - @Bean - public SelectResponseTargetMedic selectResponseTargetMedic() - { - return new SelectResponseTargetMedic(fhirClientProvider, taskHelper, organizationProvider); - } - - @Bean - public SendMultiMedicResults sendMultiMedicResults() - { - return new SendMultiMedicResults(fhirClientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Bean - public SendMultiMedicErrors sendMultiMedicErrors() - { - return new SendMultiMedicErrors(fhirClientProvider, taskHelper, organizationProvider, fhirContext); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilitySerializerConfig.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilitySerializerConfig.java deleted file mode 100644 index 05418ecd0..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/spring/config/FeasibilitySerializerConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.highmed.dsf.bpe.variables.BloomFilterConfigSerializer; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultSerializer; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsSerializer; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultSerializer; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsSerializer; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import com.fasterxml.jackson.databind.ObjectMapper; - -@Configuration -public class FeasibilitySerializerConfig -{ - @Autowired - private ObjectMapper objectMapper; - - @Bean - public FeasibilityQueryResultSerializer feasibilityQueryResultSerializer() - { - return new FeasibilityQueryResultSerializer(objectMapper); - } - - @Bean - public FeasibilityQueryResultsSerializer feasibilityQueryResultsSerializer() - { - return new FeasibilityQueryResultsSerializer(objectMapper); - } - - @Bean - public FinalFeasibilityQueryResultSerializer finalFeasibilityQueryResultSerializer() - { - return new FinalFeasibilityQueryResultSerializer(objectMapper); - } - - @Bean - public FinalFeasibilityQueryResultsSerializer finalFeasibilityQueryResultsSerializer() - { - return new FinalFeasibilityQueryResultsSerializer(objectMapper); - } - - @Bean - public BloomFilterConfigSerializer bloomFilterConfigSerializer() - { - return new BloomFilterConfigSerializer(objectMapper); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfig.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfig.java deleted file mode 100644 index bbf4ac18e..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfig.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.security.Key; - -import javax.crypto.spec.SecretKeySpec; - -import org.highmed.dsf.fhir.variables.KeyDeserializer; -import org.highmed.dsf.fhir.variables.KeySerializer; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; - -public class BloomFilterConfig -{ - private static final int SEED_LENGTH = 8; - private static final int HMAC_SHA2_KEY_LENGTH = 32; - private static final int HMAC_SHA3_KEY_LENGTH = 32; - - private final long permutationSeed; - - @JsonDeserialize(using = KeyDeserializer.class) - @JsonSerialize(using = KeySerializer.class) - private final Key hmacSha2Key; - - @JsonDeserialize(using = KeyDeserializer.class) - @JsonSerialize(using = KeySerializer.class) - private final Key hmacSha3Key; - - public static BloomFilterConfig fromBytes(byte[] bytes) - { - if (bytes.length != SEED_LENGTH + HMAC_SHA2_KEY_LENGTH + HMAC_SHA3_KEY_LENGTH) - throw new IllegalArgumentException( - "bytes.length = " + (SEED_LENGTH + HMAC_SHA2_KEY_LENGTH + HMAC_SHA3_KEY_LENGTH) - + " expected, but got " + bytes.length); - - byte[] seed = new byte[SEED_LENGTH]; - byte[] key1 = new byte[HMAC_SHA2_KEY_LENGTH]; - byte[] key2 = new byte[HMAC_SHA3_KEY_LENGTH]; - - System.arraycopy(bytes, 0, seed, 0, seed.length); - System.arraycopy(bytes, seed.length, key1, 0, key1.length); - System.arraycopy(bytes, seed.length + key1.length, key2, 0, key2.length); - - long permutationSeed = bigEndianToLong(seed); - Key hmacSha2Key = new SecretKeySpec(key1, "HmacSHA256"); - Key hmacSha3Key = new SecretKeySpec(key2, "HmacSHA3-256"); - - return new BloomFilterConfig(permutationSeed, hmacSha2Key, hmacSha3Key); - } - - @JsonCreator - public BloomFilterConfig(@JsonProperty("permutationSeed") long permutationSeed, - @JsonProperty("hmacSha2Key") Key hmacSha2Key, @JsonProperty("hmacSha3Key") Key hmacSha3Key) - { - this.permutationSeed = permutationSeed; - this.hmacSha2Key = hmacSha2Key; - this.hmacSha3Key = hmacSha3Key; - } - - public long getPermutationSeed() - { - return permutationSeed; - } - - public Key getHmacSha2Key() - { - return hmacSha2Key; - } - - public Key getHmacSha3Key() - { - return hmacSha3Key; - } - - @JsonIgnore - public byte[] toBytes() - { - byte[] bytes = new byte[SEED_LENGTH + HMAC_SHA2_KEY_LENGTH + HMAC_SHA3_KEY_LENGTH]; - - byte[] seed = longToBigEndian(permutationSeed); - byte[] key1 = hmacSha2Key.getEncoded(); - byte[] key2 = hmacSha3Key.getEncoded(); - - System.arraycopy(seed, 0, bytes, 0, seed.length); - System.arraycopy(key1, 0, bytes, SEED_LENGTH, key1.length); - System.arraycopy(key2, 0, bytes, SEED_LENGTH + HMAC_SHA2_KEY_LENGTH, key2.length); - - return bytes; - } - - private static byte[] longToBigEndian(long l) - { - return new byte[] { (byte) (l >>> 56), (byte) (l >>> 48), (byte) (l >>> 40), (byte) (l >>> 32), - (byte) (l >>> 24), (byte) (l >>> 16), (byte) (l >>> 8), (byte) (l >>> 0) }; - } - - private static long bigEndianToLong(byte[] b) - { - return (((long) b[0] << 56) + ((long) (b[1] & 255) << 48) + ((long) (b[2] & 255) << 40) - + ((long) (b[3] & 255) << 32) + ((long) (b[4] & 255) << 24) + ((b[5] & 255) << 16) + ((b[6] & 255) << 8) - + ((b[7] & 255) << 0)); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfigSerializer.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfigSerializer.java deleted file mode 100644 index b6d6c8cba..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfigSerializer.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.io.IOException; -import java.util.Objects; - -import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer; -import org.camunda.bpm.engine.impl.variable.serializer.ValueFields; -import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl; -import org.highmed.dsf.bpe.variables.BloomFilterConfigValues.BloomFilterConfigValue; -import org.springframework.beans.factory.InitializingBean; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class BloomFilterConfigSerializer extends PrimitiveValueSerializer<BloomFilterConfigValue> - implements InitializingBean -{ - private final ObjectMapper objectMapper; - - public BloomFilterConfigSerializer(ObjectMapper objectMapper) - { - super(BloomFilterConfigValues.VALUE_TYPE); - - this.objectMapper = objectMapper; - } - - @Override - public void afterPropertiesSet() throws Exception - { - Objects.requireNonNull(objectMapper, "objectMapper"); - } - - @Override - public void writeValue(BloomFilterConfigValue value, ValueFields valueFields) - { - BloomFilterConfig target = value.getValue(); - try - { - if (target != null) - valueFields.setByteArrayValue(objectMapper.writeValueAsBytes(target)); - } - catch (JsonProcessingException e) - { - throw new RuntimeException(e); - } - } - - @Override - public BloomFilterConfigValue convertToTypedValue(UntypedValueImpl untypedValue) - { - return BloomFilterConfigValues.create((BloomFilterConfig) untypedValue.getValue()); - } - - @Override - public BloomFilterConfigValue readValue(ValueFields valueFields, boolean asTransientValue) - { - byte[] bytes = valueFields.getByteArrayValue(); - - try - { - BloomFilterConfig target = (bytes == null || bytes.length <= 0) ? null - : objectMapper.readValue(bytes, BloomFilterConfig.class); - return BloomFilterConfigValues.create(target); - } - catch (IOException e) - { - throw new RuntimeException(e); - } - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfigValues.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfigValues.java deleted file mode 100644 index 4640b0b0d..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/BloomFilterConfigValues.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.util.Map; - -import org.camunda.bpm.engine.variable.impl.type.PrimitiveValueTypeImpl; -import org.camunda.bpm.engine.variable.impl.value.PrimitiveTypeValueImpl; -import org.camunda.bpm.engine.variable.type.PrimitiveValueType; -import org.camunda.bpm.engine.variable.value.PrimitiveValue; -import org.camunda.bpm.engine.variable.value.TypedValue; - -public class BloomFilterConfigValues -{ - public static interface BloomFilterConfigValue extends PrimitiveValue<BloomFilterConfig> - { - } - - private static class BloomFilterConfigValueImpl extends PrimitiveTypeValueImpl<BloomFilterConfig> - implements BloomFilterConfigValues.BloomFilterConfigValue - { - private static final long serialVersionUID = 1L; - - public BloomFilterConfigValueImpl(BloomFilterConfig value, PrimitiveValueType type) - { - super(value, type); - } - } - - public static class BloomFilterConfigValueTypeImpl extends PrimitiveValueTypeImpl - { - private static final long serialVersionUID = 1L; - - private BloomFilterConfigValueTypeImpl() - { - super(BloomFilterConfig.class); - } - - @Override - public TypedValue createValue(Object value, Map<String, Object> valueInfo) - { - return new BloomFilterConfigValues.BloomFilterConfigValueImpl((BloomFilterConfig) value, VALUE_TYPE); - } - } - - public static final PrimitiveValueType VALUE_TYPE = new BloomFilterConfigValues.BloomFilterConfigValueTypeImpl(); - - private BloomFilterConfigValues() - { - } - - public static BloomFilterConfigValues.BloomFilterConfigValue create(BloomFilterConfig value) - { - return new BloomFilterConfigValues.BloomFilterConfigValueImpl(value, VALUE_TYPE); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResult.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResult.java deleted file mode 100755 index d168aff74..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResult.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import org.highmed.openehr.model.structure.ResultSet; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class FeasibilityQueryResult -{ - private final String organizationIdentifier; - private final String cohortId; - private final int cohortSize; - private final ResultSet resultSet; - private final String resultSetUrl; - - public static FeasibilityQueryResult countResult(String organizationIdentifier, String cohortId, int cohortSize) - { - if (cohortSize < 0) - throw new IllegalArgumentException("cohortSize >= 0 expected"); - - return new FeasibilityQueryResult(organizationIdentifier, cohortId, cohortSize, null, null); - } - - public static FeasibilityQueryResult idResult(String organizationIdentifier, String cohortId, ResultSet resultSet) - { - return new FeasibilityQueryResult(organizationIdentifier, cohortId, -1, resultSet, null); - } - - public static FeasibilityQueryResult idResult(String organizationIdentifier, String cohortId, String resultSetUrl) - { - return new FeasibilityQueryResult(organizationIdentifier, cohortId, -1, null, resultSetUrl); - } - - @JsonCreator - public FeasibilityQueryResult(@JsonProperty("organizationIdentifier") String organizationIdentifier, - @JsonProperty("cohortId") String cohortId, @JsonProperty("cohortSize") int cohortSize, - @JsonProperty("resultSet") ResultSet resultSet, @JsonProperty("resultSetUrl") String resultSetUrl) - { - this.organizationIdentifier = organizationIdentifier; - this.cohortId = cohortId; - this.cohortSize = cohortSize; - this.resultSet = resultSet; - this.resultSetUrl = resultSetUrl; - } - - public String getOrganizationIdentifier() - { - return organizationIdentifier; - } - - public String getCohortId() - { - return cohortId; - } - - public int getCohortSize() - { - return cohortSize; - } - - public ResultSet getResultSet() - { - return resultSet; - } - - public String getResultSetUrl() - { - return resultSetUrl; - } - - @JsonIgnore - public boolean isCohortSizeResult() - { - return resultSet == null && resultSetUrl == null; - } - - @JsonIgnore - public boolean isIdResultSetResult() - { - return resultSet != null && resultSetUrl == null; - } - - @JsonIgnore - public boolean isIdResultSetUrlResult() - { - return resultSet == null && resultSetUrl != null; - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultSerializer.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultSerializer.java deleted file mode 100644 index a6623face..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultSerializer.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.io.IOException; -import java.util.Objects; - -import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer; -import org.camunda.bpm.engine.impl.variable.serializer.ValueFields; -import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultValues.FeasibilityQueryResultValue; -import org.springframework.beans.factory.InitializingBean; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class FeasibilityQueryResultSerializer extends PrimitiveValueSerializer<FeasibilityQueryResultValue> - implements InitializingBean -{ - private final ObjectMapper objectMapper; - - public FeasibilityQueryResultSerializer(ObjectMapper objectMapper) - { - super(FeasibilityQueryResultValues.VALUE_TYPE); - - this.objectMapper = objectMapper; - } - - @Override - public void afterPropertiesSet() throws Exception - { - Objects.requireNonNull(objectMapper, "objectMapper"); - } - - @Override - public void writeValue(FeasibilityQueryResultValue value, ValueFields valueFields) - { - FeasibilityQueryResult result = value.getValue(); - try - { - if (result != null) - valueFields.setByteArrayValue(objectMapper.writeValueAsBytes(result)); - } - catch (JsonProcessingException e) - { - throw new RuntimeException(e); - } - } - - @Override - public FeasibilityQueryResultValue convertToTypedValue(UntypedValueImpl untypedValue) - { - return FeasibilityQueryResultValues.create((FeasibilityQueryResult) untypedValue.getValue()); - } - - @Override - public FeasibilityQueryResultValue readValue(ValueFields valueFields, boolean asTransientValue) - { - byte[] bytes = valueFields.getByteArrayValue(); - - try - { - FeasibilityQueryResult result = (bytes == null || bytes.length <= 0) ? null - : objectMapper.readValue(bytes, FeasibilityQueryResult.class); - return FeasibilityQueryResultValues.create(result); - } - catch (IOException e) - { - throw new RuntimeException(e); - } - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultValues.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultValues.java deleted file mode 100644 index 5f5c2fe9c..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultValues.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.util.Map; - -import org.camunda.bpm.engine.variable.impl.type.PrimitiveValueTypeImpl; -import org.camunda.bpm.engine.variable.impl.value.PrimitiveTypeValueImpl; -import org.camunda.bpm.engine.variable.type.PrimitiveValueType; -import org.camunda.bpm.engine.variable.value.PrimitiveValue; -import org.camunda.bpm.engine.variable.value.TypedValue; - -public class FeasibilityQueryResultValues -{ - public static interface FeasibilityQueryResultValue extends PrimitiveValue<FeasibilityQueryResult> - { - } - - private static class FeasibilityQueryResultValueImpl extends PrimitiveTypeValueImpl<FeasibilityQueryResult> - implements FeasibilityQueryResultValues.FeasibilityQueryResultValue - { - private static final long serialVersionUID = 1L; - - public FeasibilityQueryResultValueImpl(FeasibilityQueryResult value, PrimitiveValueType type) - { - super(value, type); - } - } - - public static class FeasibilityQueryResultValueTypeImpl extends PrimitiveValueTypeImpl - { - private static final long serialVersionUID = 1L; - - private FeasibilityQueryResultValueTypeImpl() - { - super(FeasibilityQueryResult.class); - } - - @Override - public TypedValue createValue(Object value, Map<String, Object> valueInfo) - { - return new FeasibilityQueryResultValues.FeasibilityQueryResultValueImpl((FeasibilityQueryResult) value, VALUE_TYPE); - } - } - - public static final PrimitiveValueType VALUE_TYPE = new FeasibilityQueryResultValues.FeasibilityQueryResultValueTypeImpl(); - - private FeasibilityQueryResultValues() - { - } - - public static FeasibilityQueryResultValues.FeasibilityQueryResultValue create(FeasibilityQueryResult value) - { - return new FeasibilityQueryResultValues.FeasibilityQueryResultValueImpl(value, VALUE_TYPE); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResults.java deleted file mode 100755 index e999bd24f..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResults.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class FeasibilityQueryResults -{ - private final List<FeasibilityQueryResult> results = new ArrayList<>(); - - @JsonCreator - public FeasibilityQueryResults(@JsonProperty("results") Collection<? extends FeasibilityQueryResult> results) - { - if (results != null) - this.results.addAll(results); - } - - public void add(FeasibilityQueryResult newResult) - { - if (newResult != null) - results.add(newResult); - } - - public void addAll(Collection<FeasibilityQueryResult> results) - { - if (results != null) - this.results.addAll(results); - } - - public List<FeasibilityQueryResult> getResults() - { - return Collections.unmodifiableList(results); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultsSerializer.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultsSerializer.java deleted file mode 100644 index 26022a95c..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultsSerializer.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.io.IOException; -import java.util.Objects; - -import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer; -import org.camunda.bpm.engine.impl.variable.serializer.ValueFields; -import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResultsValues.FeasibilityQueryResultsValue; -import org.springframework.beans.factory.InitializingBean; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class FeasibilityQueryResultsSerializer extends PrimitiveValueSerializer<FeasibilityQueryResultsValue> - implements InitializingBean -{ - private final ObjectMapper objectMapper; - - public FeasibilityQueryResultsSerializer(ObjectMapper objectMapper) - { - super(FeasibilityQueryResultsValues.VALUE_TYPE); - - this.objectMapper = objectMapper; - } - - @Override - public void afterPropertiesSet() throws Exception - { - Objects.requireNonNull(objectMapper, "objectMapper"); - } - - @Override - public void writeValue(FeasibilityQueryResultsValue value, ValueFields valueFields) - { - FeasibilityQueryResults results = value.getValue(); - try - { - if (results != null) - valueFields.setByteArrayValue(objectMapper.writeValueAsBytes(results)); - } - catch (JsonProcessingException e) - { - throw new RuntimeException(e); - } - } - - @Override - public FeasibilityQueryResultsValue convertToTypedValue(UntypedValueImpl untypedValue) - { - return FeasibilityQueryResultsValues.create((FeasibilityQueryResults) untypedValue.getValue()); - } - - @Override - public FeasibilityQueryResultsValue readValue(ValueFields valueFields, boolean asTransientValue) - { - byte[] bytes = valueFields.getByteArrayValue(); - - try - { - FeasibilityQueryResults results = (bytes == null || bytes.length <= 0) ? null - : objectMapper.readValue(bytes, FeasibilityQueryResults.class); - return FeasibilityQueryResultsValues.create(results); - } - catch (IOException e) - { - throw new RuntimeException(e); - } - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultsValues.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultsValues.java deleted file mode 100644 index 7151c4ccb..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FeasibilityQueryResultsValues.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.util.Map; - -import org.camunda.bpm.engine.variable.impl.type.PrimitiveValueTypeImpl; -import org.camunda.bpm.engine.variable.impl.value.PrimitiveTypeValueImpl; -import org.camunda.bpm.engine.variable.type.PrimitiveValueType; -import org.camunda.bpm.engine.variable.value.PrimitiveValue; -import org.camunda.bpm.engine.variable.value.TypedValue; - -public class FeasibilityQueryResultsValues -{ - public static interface FeasibilityQueryResultsValue extends PrimitiveValue<FeasibilityQueryResults> - { - } - - private static class FeasibilityQueryResultsValueImpl extends PrimitiveTypeValueImpl<FeasibilityQueryResults> - implements FeasibilityQueryResultsValues.FeasibilityQueryResultsValue - { - private static final long serialVersionUID = 1L; - - public FeasibilityQueryResultsValueImpl(FeasibilityQueryResults value, PrimitiveValueType type) - { - super(value, type); - } - } - - public static class FeasibilityQueryResultsValueTypeImpl extends PrimitiveValueTypeImpl - { - private static final long serialVersionUID = 1L; - - private FeasibilityQueryResultsValueTypeImpl() - { - super(FeasibilityQueryResults.class); - } - - @Override - public TypedValue createValue(Object value, Map<String, Object> valueInfo) - { - return new FeasibilityQueryResultsValues.FeasibilityQueryResultsValueImpl((FeasibilityQueryResults) value, - VALUE_TYPE); - } - } - - public static final PrimitiveValueType VALUE_TYPE = new FeasibilityQueryResultsValues.FeasibilityQueryResultsValueTypeImpl(); - - private FeasibilityQueryResultsValues() - { - } - - public static FeasibilityQueryResultsValues.FeasibilityQueryResultsValue create(FeasibilityQueryResults value) - { - return new FeasibilityQueryResultsValues.FeasibilityQueryResultsValueImpl(value, VALUE_TYPE); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResult.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResult.java deleted file mode 100644 index 9cbd2324c..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResult.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class FinalFeasibilityQueryResult -{ - private final String cohortId; - private final int participatingMedics; - private final int cohortSize; - - @JsonCreator - public FinalFeasibilityQueryResult(@JsonProperty("cohortId") String cohortId, - @JsonProperty("participatingMedics") int participatingMedics, @JsonProperty("cohortSize") int cohortSize) - { - this.cohortId = cohortId; - this.participatingMedics = participatingMedics; - this.cohortSize = cohortSize; - } - - public String getCohortId() - { - return cohortId; - } - - public int getParticipatingMedics() - { - return participatingMedics; - } - - public int getCohortSize() - { - return cohortSize; - } -} \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultSerializer.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultSerializer.java deleted file mode 100644 index 442ec7fb1..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultSerializer.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.io.IOException; -import java.util.Objects; - -import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer; -import org.camunda.bpm.engine.impl.variable.serializer.ValueFields; -import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultValues.FinalFeasibilityQueryResultValue; -import org.springframework.beans.factory.InitializingBean; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class FinalFeasibilityQueryResultSerializer extends PrimitiveValueSerializer<FinalFeasibilityQueryResultValue> - implements InitializingBean -{ - private final ObjectMapper objectMapper; - - public FinalFeasibilityQueryResultSerializer(ObjectMapper objectMapper) - { - super(FinalFeasibilityQueryResultValues.VALUE_TYPE); - - this.objectMapper = objectMapper; - } - - @Override - public void afterPropertiesSet() throws Exception - { - Objects.requireNonNull(objectMapper, "objectMapper"); - } - - @Override - public void writeValue(FinalFeasibilityQueryResultValue value, ValueFields valueFields) - { - FinalFeasibilityQueryResult result = value.getValue(); - try - { - if (result != null) - valueFields.setByteArrayValue(objectMapper.writeValueAsBytes(result)); - } - catch (JsonProcessingException e) - { - throw new RuntimeException(e); - } - } - - @Override - public FinalFeasibilityQueryResultValue convertToTypedValue(UntypedValueImpl untypedValue) - { - return FinalFeasibilityQueryResultValues.create((FinalFeasibilityQueryResult) untypedValue.getValue()); - } - - @Override - public FinalFeasibilityQueryResultValue readValue(ValueFields valueFields, boolean asTransientValue) - { - byte[] bytes = valueFields.getByteArrayValue(); - - try - { - FinalFeasibilityQueryResult result = (bytes == null || bytes.length <= 0) ? null - : objectMapper.readValue(bytes, FinalFeasibilityQueryResult.class); - return FinalFeasibilityQueryResultValues.create(result); - } - catch (IOException e) - { - throw new RuntimeException(e); - } - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultValues.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultValues.java deleted file mode 100644 index b54eca657..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultValues.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.util.Map; - -import org.camunda.bpm.engine.variable.impl.type.PrimitiveValueTypeImpl; -import org.camunda.bpm.engine.variable.impl.value.PrimitiveTypeValueImpl; -import org.camunda.bpm.engine.variable.type.PrimitiveValueType; -import org.camunda.bpm.engine.variable.value.PrimitiveValue; -import org.camunda.bpm.engine.variable.value.TypedValue; - -public class FinalFeasibilityQueryResultValues -{ - public static interface FinalFeasibilityQueryResultValue extends PrimitiveValue<FinalFeasibilityQueryResult> - { - } - - private static class FinalFeasibilityQueryResultValueImpl - extends PrimitiveTypeValueImpl<FinalFeasibilityQueryResult> - implements FinalFeasibilityQueryResultValues.FinalFeasibilityQueryResultValue - { - private static final long serialVersionUID = 1L; - - public FinalFeasibilityQueryResultValueImpl(FinalFeasibilityQueryResult value, PrimitiveValueType type) - { - super(value, type); - } - } - - public static class FinalFeasibilityQueryResultValueTypeImpl extends PrimitiveValueTypeImpl - { - private static final long serialVersionUID = 1L; - - private FinalFeasibilityQueryResultValueTypeImpl() - { - super(FinalFeasibilityQueryResult.class); - } - - @Override - public TypedValue createValue(Object value, Map<String, Object> valueInfo) - { - return new FinalFeasibilityQueryResultValues.FinalFeasibilityQueryResultValueImpl( - (FinalFeasibilityQueryResult) value, VALUE_TYPE); - } - } - - public static final PrimitiveValueType VALUE_TYPE = new FinalFeasibilityQueryResultValues.FinalFeasibilityQueryResultValueTypeImpl(); - - private FinalFeasibilityQueryResultValues() - { - } - - public static FinalFeasibilityQueryResultValues.FinalFeasibilityQueryResultValue create( - FinalFeasibilityQueryResult value) - { - return new FinalFeasibilityQueryResultValues.FinalFeasibilityQueryResultValueImpl(value, VALUE_TYPE); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java deleted file mode 100644 index a59057598..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResults.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class FinalFeasibilityQueryResults -{ - private final List<FinalFeasibilityQueryResult> results = new ArrayList<>(); - - @JsonCreator - public FinalFeasibilityQueryResults(@JsonProperty("results") Collection<? extends FinalFeasibilityQueryResult> results) - { - if (results != null) - this.results.addAll(results); - } - - public void add(FinalFeasibilityQueryResult newResult) - { - if (newResult != null) - results.add(newResult); - } - - public void addAll(Collection<FinalFeasibilityQueryResult> results) - { - if (results != null) - this.results.addAll(results); - } - - public List<FinalFeasibilityQueryResult> getResults() - { - return Collections.unmodifiableList(results); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsSerializer.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsSerializer.java deleted file mode 100644 index 08a34b4d5..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsSerializer.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.io.IOException; -import java.util.Objects; - -import org.camunda.bpm.engine.impl.variable.serializer.PrimitiveValueSerializer; -import org.camunda.bpm.engine.impl.variable.serializer.ValueFields; -import org.camunda.bpm.engine.variable.impl.value.UntypedValueImpl; -import org.highmed.dsf.bpe.variables.FinalFeasibilityQueryResultsValues.FinalFeasibilityQueryResultsValue; -import org.springframework.beans.factory.InitializingBean; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class FinalFeasibilityQueryResultsSerializer extends PrimitiveValueSerializer<FinalFeasibilityQueryResultsValue> - implements InitializingBean -{ - private final ObjectMapper objectMapper; - - public FinalFeasibilityQueryResultsSerializer(ObjectMapper objectMapper) - { - super(FinalFeasibilityQueryResultsValues.VALUE_TYPE); - - this.objectMapper = objectMapper; - } - - @Override - public void afterPropertiesSet() throws Exception - { - Objects.requireNonNull(objectMapper, "objectMapper"); - } - - @Override - public void writeValue(FinalFeasibilityQueryResultsValue value, ValueFields valueFields) - { - FinalFeasibilityQueryResults results = value.getValue(); - try - { - if (results != null) - valueFields.setByteArrayValue(objectMapper.writeValueAsBytes(results)); - } - catch (JsonProcessingException e) - { - throw new RuntimeException(e); - } - } - - @Override - public FinalFeasibilityQueryResultsValue convertToTypedValue(UntypedValueImpl untypedValue) - { - return FinalFeasibilityQueryResultsValues.create((FinalFeasibilityQueryResults) untypedValue.getValue()); - } - - @Override - public FinalFeasibilityQueryResultsValue readValue(ValueFields valueFields, boolean asTransientValue) - { - byte[] bytes = valueFields.getByteArrayValue(); - - try - { - FinalFeasibilityQueryResults results = (bytes == null || bytes.length <= 0) ? null - : objectMapper.readValue(bytes, FinalFeasibilityQueryResults.class); - return FinalFeasibilityQueryResultsValues.create(results); - } - catch (IOException e) - { - throw new RuntimeException(e); - } - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsValues.java b/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsValues.java deleted file mode 100644 index e71d2ee0d..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/java/org/highmed/dsf/bpe/variables/FinalFeasibilityQueryResultsValues.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import java.util.Map; - -import org.camunda.bpm.engine.variable.impl.type.PrimitiveValueTypeImpl; -import org.camunda.bpm.engine.variable.impl.value.PrimitiveTypeValueImpl; -import org.camunda.bpm.engine.variable.type.PrimitiveValueType; -import org.camunda.bpm.engine.variable.value.PrimitiveValue; -import org.camunda.bpm.engine.variable.value.TypedValue; - -public class FinalFeasibilityQueryResultsValues -{ - public static interface FinalFeasibilityQueryResultsValue extends PrimitiveValue<FinalFeasibilityQueryResults> - { - } - - private static class FinalFeasibilityQueryResultsValueImpl - extends PrimitiveTypeValueImpl<FinalFeasibilityQueryResults> - implements FinalFeasibilityQueryResultsValues.FinalFeasibilityQueryResultsValue - { - private static final long serialVersionUID = 1L; - - public FinalFeasibilityQueryResultsValueImpl(FinalFeasibilityQueryResults value, PrimitiveValueType type) - { - super(value, type); - } - } - - public static class FinalFeasibilityQueryResultsValueTypeImpl extends PrimitiveValueTypeImpl - { - private static final long serialVersionUID = 1L; - - private FinalFeasibilityQueryResultsValueTypeImpl() - { - super(FinalFeasibilityQueryResults.class); - } - - @Override - public TypedValue createValue(Object value, Map<String, Object> valueInfo) - { - return new FinalFeasibilityQueryResultsValues.FinalFeasibilityQueryResultsValueImpl( - (FinalFeasibilityQueryResults) value, VALUE_TYPE); - } - } - - public static final PrimitiveValueType VALUE_TYPE = new FinalFeasibilityQueryResultsValues.FinalFeasibilityQueryResultsValueTypeImpl(); - - private FinalFeasibilityQueryResultsValues() - { - } - - public static FinalFeasibilityQueryResultsValues.FinalFeasibilityQueryResultsValue create( - FinalFeasibilityQueryResults value) - { - return new FinalFeasibilityQueryResultsValues.FinalFeasibilityQueryResultsValueImpl(value, VALUE_TYPE); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition deleted file mode 100644 index 4905d96a0..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition +++ /dev/null @@ -1 +0,0 @@ -org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn deleted file mode 100644 index 753a9f97d..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/computeFeasibility.bpmn +++ /dev/null @@ -1,270 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1yff9tp" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="computeFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:subProcess id="SubProcess_1gopxt4"> - <bpmn:incoming>SequenceFlow_1lfe4wr</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0xxpamp</bpmn:outgoing> - <bpmn:multiInstanceLoopCharacteristics camunda:collection="${targets.entries}" camunda:elementVariable="target" /> - <bpmn:endEvent id="SubEndEvent"> - <bpmn:incoming>SequenceFlow_0mj024w</bpmn:incoming> - </bpmn:endEvent> - <bpmn:serviceTask id="temporarillyStoreQueryResults" name="temporarilly store query results" camunda:class="org.highmed.dsf.bpe.service.StoreResults"> - <bpmn:incoming>SequenceFlow_0by0at7</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0mj024w</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:receiveTask id="receiveQueryResultsFromMeDIC" name="receive query results from MeDIC" messageRef="Message_0a1qxd8"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="correlationKey">${target.correlationKey}</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_0qjt33w</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0by0at7</bpmn:outgoing> - </bpmn:receiveTask> - <bpmn:startEvent id="SubStartEvent"> - <bpmn:outgoing>SequenceFlow_0qjt33w</bpmn:outgoing> - </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_0qjt33w" sourceRef="SubStartEvent" targetRef="receiveQueryResultsFromMeDIC" /> - <bpmn:sequenceFlow id="SequenceFlow_0by0at7" sourceRef="receiveQueryResultsFromMeDIC" targetRef="temporarillyStoreQueryResults" /> - <bpmn:sequenceFlow id="SequenceFlow_0mj024w" sourceRef="temporarillyStoreQueryResults" targetRef="SubEndEvent" /> - </bpmn:subProcess> - <bpmn:serviceTask id="calculateMultimedicCohortSize" name="calculate multimedic cohort size" camunda:class="org.highmed.dsf.bpe.service.CalculateMultiMedicResults"> - <bpmn:incoming>SequenceFlow_0t4lx4v</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_155t66x</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:boundaryEvent id="BoundaryEvent_1g0rcyp" attachedToRef="SubProcess_1gopxt4"> - <bpmn:outgoing>SequenceFlow_0h3to47</bpmn:outgoing> - <bpmn:timerEventDefinition id="TimerEventDefinition_15f74m3"> - <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT5M</bpmn:timeDuration> - </bpmn:timerEventDefinition> - </bpmn:boundaryEvent> - <bpmn:startEvent id="StartEvent" name="start"> - <bpmn:outgoing>SequenceFlow_01pjftq</bpmn:outgoing> - <bpmn:messageEventDefinition messageRef="Message_08676wn" /> - </bpmn:startEvent> - <bpmn:endEvent id="EndEventSuccess" name="send final result to leading MeDIC"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">requestFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">resultMultiMedicFeasibilityMessage</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>Flow_1r6dq8y</bpmn:incoming> - <bpmn:messageEventDefinition messageRef="Message_0ue93sz" camunda:class="org.highmed.dsf.bpe.message.SendMultiMedicResults" /> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_01pjftq" sourceRef="StartEvent" targetRef="storeCorrelationKeys" /> - <bpmn:sequenceFlow id="SequenceFlow_1lfe4wr" sourceRef="storeCorrelationKeys" targetRef="SubProcess_1gopxt4" /> - <bpmn:exclusiveGateway id="ExclusiveGateway_07e71aa"> - <bpmn:incoming>SequenceFlow_0xxpamp</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0h3to47</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0t4lx4v</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0calilw</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0xxpamp" sourceRef="SubProcess_1gopxt4" targetRef="ExclusiveGateway_07e71aa" /> - <bpmn:sequenceFlow id="SequenceFlow_0h3to47" sourceRef="BoundaryEvent_1g0rcyp" targetRef="ExclusiveGateway_07e71aa" /> - <bpmn:sequenceFlow id="SequenceFlow_0t4lx4v" name="else" sourceRef="ExclusiveGateway_07e71aa" targetRef="calculateMultimedicCohortSize"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!needsRecordLinkage}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_0calilw" name="needs record linkage" sourceRef="ExclusiveGateway_07e71aa" targetRef="downloadResultSets"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsRecordLinkage}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:serviceTask id="executeRecordLink" name="execute record link" camunda:class="org.highmed.dsf.bpe.service.ExecuteRecordLink"> - <bpmn:incoming>SequenceFlow_0zp76kj</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_02zmrer</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_02zmrer" sourceRef="executeRecordLink" targetRef="ExclusiveGateway_1r8ow3i" /> - <bpmn:exclusiveGateway id="ExclusiveGateway_1r8ow3i"> - <bpmn:incoming>SequenceFlow_02zmrer</bpmn:incoming> - <bpmn:incoming>SequenceFlow_155t66x</bpmn:incoming> - <bpmn:outgoing>Flow_1ixeke2</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:serviceTask id="storeCorrelationKeys" name="store correlation keys" camunda:class="org.highmed.dsf.bpe.service.StoreCorrelationKeys"> - <bpmn:incoming>SequenceFlow_01pjftq</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1lfe4wr</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="selectResponseTargetMedic" name="select response target MeDIC" camunda:class="org.highmed.dsf.bpe.service.SelectResponseTargetMedic"> - <bpmn:incoming>Flow_1ixeke2</bpmn:incoming> - <bpmn:outgoing>Flow_1k0sqwo</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_0zp76kj" sourceRef="downloadResultSets" targetRef="executeRecordLink" /> - <bpmn:serviceTask id="downloadResultSets" name="download ResultSets" camunda:class="org.highmed.dsf.bpe.service.DownloadResultSets"> - <bpmn:incoming>SequenceFlow_0calilw</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0zp76kj</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_155t66x" sourceRef="calculateMultimedicCohortSize" targetRef="ExclusiveGateway_1r8ow3i" /> - <bpmn:endEvent id="EndEventError" name="send error to leading MeDIC"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">requestFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">errorMultiMedicFeasibilityMessage</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>Flow_1tmnvhl</bpmn:incoming> - <bpmn:messageEventDefinition id="MessageEventDefinition_19y5diw" messageRef="Message_0kix95m" camunda:class="org.highmed.dsf.bpe.message.SendMultiMedicErrors" /> - </bpmn:endEvent> - <bpmn:serviceTask id="checkComputedResults" name="check computed result" camunda:class="org.highmed.dsf.bpe.service.CheckTtpComputedMultiMedicResults"> - <bpmn:incoming>Flow_1k0sqwo</bpmn:incoming> - <bpmn:outgoing>Flow_1r6dq8y</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="Flow_1ixeke2" sourceRef="ExclusiveGateway_1r8ow3i" targetRef="selectResponseTargetMedic" /> - <bpmn:sequenceFlow id="Flow_1k0sqwo" sourceRef="selectResponseTargetMedic" targetRef="checkComputedResults" /> - <bpmn:sequenceFlow id="Flow_1r6dq8y" sourceRef="checkComputedResults" targetRef="EndEventSuccess" /> - <bpmn:boundaryEvent id="Event_1vp5qzs" attachedToRef="checkComputedResults"> - <bpmn:outgoing>Flow_1tmnvhl</bpmn:outgoing> - <bpmn:errorEventDefinition id="ErrorEventDefinition_05kx06m" errorRef="Error_0qub4jc" /> - </bpmn:boundaryEvent> - <bpmn:sequenceFlow id="Flow_1tmnvhl" sourceRef="Event_1vp5qzs" targetRef="EndEventError" /> - </bpmn:process> - <bpmn:message id="Message_0a1qxd8" name="resultSingleMedicFeasibilityMessage" /> - <bpmn:message id="Message_0ue93sz" name="resultMultiMedicFeasibilityMessage" /> - <bpmn:message id="Message_08676wn" name="computeFeasibilityMessage" /> - <bpmn:message id="Message_0kix95m" name="errorMultiMedicFeasibilityMessage" /> - <bpmn:error id="Error_0qub4jc" name="errorMultiMedicFeasibilityResult" errorCode="errorMultiMedicFeasibilityResult" camunda:errorMessage="errorMultiMedicFeasibilityResult" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="computeFeasibility"> - <bpmndi:BPMNEdge id="Flow_1tmnvhl_di" bpmnElement="Flow_1tmnvhl"> - <di:waypoint x="1820" y="300" /> - <di:waypoint x="1820" y="350" /> - <di:waypoint x="1922" y="350" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_1r6dq8y_di" bpmnElement="Flow_1r6dq8y"> - <di:waypoint x="1820" y="242" /> - <di:waypoint x="1922" y="242" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_1k0sqwo_di" bpmnElement="Flow_1k0sqwo"> - <di:waypoint x="1640" y="242" /> - <di:waypoint x="1720" y="242" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_1ixeke2_di" bpmnElement="Flow_1ixeke2"> - <di:waypoint x="1475" y="242" /> - <di:waypoint x="1540" y="242" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_155t66x_di" bpmnElement="SequenceFlow_155t66x"> - <di:waypoint x="1330" y="242" /> - <di:waypoint x="1425" y="242" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0zp76kj_di" bpmnElement="SequenceFlow_0zp76kj"> - <di:waypoint x="1330" y="126" /> - <di:waypoint x="1400" y="126" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_02zmrer_di" bpmnElement="SequenceFlow_02zmrer"> - <di:waypoint x="1450" y="166" /> - <di:waypoint x="1450" y="217" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0calilw_di" bpmnElement="SequenceFlow_0calilw"> - <di:waypoint x="1098" y="217" /> - <di:waypoint x="1098" y="126" /> - <di:waypoint x="1230" y="126" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1116" y="133" width="65" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0t4lx4v_di" bpmnElement="SequenceFlow_0t4lx4v"> - <di:waypoint x="1123" y="242" /> - <di:waypoint x="1230" y="242" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1124" y="224" width="21" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0h3to47_di" bpmnElement="SequenceFlow_0h3to47"> - <di:waypoint x="985" y="309" /> - <di:waypoint x="1098" y="309" /> - <di:waypoint x="1098" y="267" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0xxpamp_di" bpmnElement="SequenceFlow_0xxpamp"> - <di:waypoint x="967" y="242" /> - <di:waypoint x="1073" y="242" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1lfe4wr_di" bpmnElement="SequenceFlow_1lfe4wr"> - <di:waypoint x="379" y="242" /> - <di:waypoint x="469" y="242" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_01pjftq_di" bpmnElement="SequenceFlow_01pjftq"> - <di:waypoint x="195" y="242" /> - <di:waypoint x="279" y="242" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="SubProcess_1gopxt4_di" bpmnElement="SubProcess_1gopxt4" isExpanded="true"> - <dc:Bounds x="469" y="175" width="498" height="134" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0mj024w_di" bpmnElement="SequenceFlow_0mj024w"> - <di:waypoint x="846" y="244" /> - <di:waypoint x="894" y="244" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0by0at7_di" bpmnElement="SequenceFlow_0by0at7"> - <di:waypoint x="683" y="244" /> - <di:waypoint x="746" y="244" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0qjt33w_di" bpmnElement="SequenceFlow_0qjt33w"> - <di:waypoint x="529" y="244" /> - <di:waypoint x="583" y="244" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_01cb50v_di" bpmnElement="SubEndEvent"> - <dc:Bounds x="894" y="226" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0yjis46_di" bpmnElement="temporarillyStoreQueryResults"> - <dc:Bounds x="746" y="204" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ReceiveTask_0533fm9_di" bpmnElement="receiveQueryResultsFromMeDIC"> - <dc:Bounds x="583" y="204" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_17r90ez_di" bpmnElement="SubStartEvent"> - <dc:Bounds x="493" y="226" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="320" y="159" width="22" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_1ae0fdh_di" bpmnElement="calculateMultimedicCohortSize"> - <dc:Bounds x="1230" y="202" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_1skbvzb_di" bpmnElement="StartEvent"> - <dc:Bounds x="159" y="224" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="166" y="267" width="23" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_0xh5o35_di" bpmnElement="EndEventSuccess"> - <dc:Bounds x="1922" y="224" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1898" y="267" width="85" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_07e71aa_di" bpmnElement="ExclusiveGateway_07e71aa" isMarkerVisible="true"> - <dc:Bounds x="1073" y="217" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_093hq2s_di" bpmnElement="executeRecordLink"> - <dc:Bounds x="1400" y="86" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_1r8ow3i_di" bpmnElement="ExclusiveGateway_1r8ow3i" isMarkerVisible="true"> - <dc:Bounds x="1425" y="217" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0bw310g_di" bpmnElement="storeCorrelationKeys"> - <dc:Bounds x="279" y="202" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0uk3eyz_di" bpmnElement="selectResponseTargetMedic"> - <dc:Bounds x="1540" y="202" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_09wyp6g_di" bpmnElement="downloadResultSets"> - <dc:Bounds x="1230" y="86" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Event_1hmug5i_di" bpmnElement="EndEventError"> - <dc:Bounds x="1922" y="332" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1904" y="375" width="73" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Activity_13j8ce9_di" bpmnElement="checkComputedResults"> - <dc:Bounds x="1720" y="202" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Event_155cxa9_di" bpmnElement="Event_1vp5qzs"> - <dc:Bounds x="1802" y="264" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="BoundaryEvent_1g0rcyp_di" bpmnElement="BoundaryEvent_1g0rcyp"> - <dc:Bounds x="949" y="291" width="36" height="36" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn deleted file mode 100755 index bbb01ebe9..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/executeFeasibility.bpmn +++ /dev/null @@ -1,314 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0drkcb5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="executeFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:serviceTask id="checkResults" name="check results" camunda:class="org.highmed.dsf.bpe.service.CheckSingleMedicResults"> - <bpmn:incoming>SequenceFlow_0q803rh</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_04ouilq</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="checkFeasibilityResources" name="check feasibility resources" camunda:class="org.highmed.dsf.bpe.service.CheckFeasibilityResources"> - <bpmn:incoming>SequenceFlow_1etju4m</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1wwn9pl</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:startEvent id="StartEvent" name="start"> - <bpmn:outgoing>SequenceFlow_14cn0vs</bpmn:outgoing> - <bpmn:messageEventDefinition id="MessageEventDefinition_0sjtzj6" messageRef="Message_1yz2a31" /> - </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_1rmqv20" sourceRef="executeQueries" targetRef="ExclusiveGateway_0bq7zdz" /> - <bpmn:sequenceFlow id="SequenceFlow_1wwn9pl" sourceRef="checkFeasibilityResources" targetRef="checkQueries" /> - <bpmn:sequenceFlow id="SequenceFlow_14cn0vs" sourceRef="StartEvent" targetRef="downloadFeasibilityResources" /> - <bpmn:sequenceFlow id="SequenceFlow_1etju4m" sourceRef="downloadFeasibilityResources" targetRef="checkFeasibilityResources" /> - <bpmn:serviceTask id="downloadFeasibilityResources" name="download feasibility resources" camunda:class="org.highmed.dsf.bpe.service.DownloadFeasibilityResources"> - <bpmn:incoming>SequenceFlow_14cn0vs</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1etju4m</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:endEvent id="EndEvent" name="send result to TTP"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="messageName">resultSingleMedicFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="processDefinitionKey">computeFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_0ascyjc</bpmn:incoming> - <bpmn:messageEventDefinition id="MessageEventDefinition_13swtie" messageRef="Message_1dr71re" camunda:class="org.highmed.dsf.bpe.message.SendSingleMedicResults" /> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_04ouilq" sourceRef="checkResults" targetRef="selectResponseTargetTtp" /> - <bpmn:sequenceFlow id="SequenceFlow_07wtgee" sourceRef="checkQueries" targetRef="ExclusiveGateway_1dln3in" /> - <bpmn:serviceTask id="checkQueries" name="check queries" camunda:class="org.highmed.dsf.bpe.service.CheckQueries"> - <bpmn:incoming>SequenceFlow_1wwn9pl</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_07wtgee</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:exclusiveGateway id="ExclusiveGateway_1dln3in"> - <bpmn:incoming>SequenceFlow_07wtgee</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0zlq6j4</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0yqpkri</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0zlq6j4" name="else" sourceRef="ExclusiveGateway_1dln3in" targetRef="ExclusiveGateway_1r4c9fx"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!needsRecordLinkage && !needsConsentCheck}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_0yqpkri" name="needs consent check and/or record linkage" sourceRef="ExclusiveGateway_1dln3in" targetRef="replaceCountpartWithIdSelection"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsRecordLinkage || needsConsentCheck}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:serviceTask id="replaceCountpartWithIdSelection" name="replace countpart with id selection" camunda:class="org.highmed.dsf.bpe.service.ModifyQueries"> - <bpmn:incoming>SequenceFlow_0yqpkri</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1u1p9j2</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:exclusiveGateway id="ExclusiveGateway_1r4c9fx"> - <bpmn:incoming>SequenceFlow_0zlq6j4</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1u1p9j2</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0bwn08k</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0bwn08k" sourceRef="ExclusiveGateway_1r4c9fx" targetRef="executeQueries" /> - <bpmn:sequenceFlow id="SequenceFlow_1u1p9j2" sourceRef="replaceCountpartWithIdSelection" targetRef="ExclusiveGateway_1r4c9fx" /> - <bpmn:exclusiveGateway id="ExclusiveGateway_0bq7zdz"> - <bpmn:incoming>SequenceFlow_1rmqv20</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_05r9whd</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0isxkuy</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_05r9whd" name="else" sourceRef="ExclusiveGateway_0bq7zdz" targetRef="ExclusiveGateway_0lecmy5"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!needsConsentCheck}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_0isxkuy" name="needs consent check" sourceRef="ExclusiveGateway_0bq7zdz" targetRef="filterByConsent"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsConsentCheck}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:serviceTask id="filterByConsent" name="filter by consent" camunda:class="org.highmed.dsf.bpe.service.FilterQueryResultsByConsent"> - <bpmn:incoming>SequenceFlow_0isxkuy</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0kzp6tl</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:exclusiveGateway id="ExclusiveGateway_0lecmy5"> - <bpmn:incoming>SequenceFlow_05r9whd</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0kzp6tl</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1b4h5qz</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_1b4h5qz" sourceRef="ExclusiveGateway_0lecmy5" targetRef="ExclusiveGateway_0sff9xb" /> - <bpmn:sequenceFlow id="SequenceFlow_0kzp6tl" sourceRef="filterByConsent" targetRef="ExclusiveGateway_0lecmy5" /> - <bpmn:exclusiveGateway id="ExclusiveGateway_0sff9xb"> - <bpmn:incoming>SequenceFlow_1b4h5qz</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_17otl7p</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_1futlo2</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0kfeekm</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_17otl7p" name="else" sourceRef="ExclusiveGateway_0sff9xb" targetRef="ExclusiveGateway_002t87f"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${!needsRecordLinkage && !needsConsentCheck}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_1futlo2" name="needs record linkage" sourceRef="ExclusiveGateway_0sff9xb" targetRef="generateBloomFilters"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsRecordLinkage}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:serviceTask id="generateBloomFilters" name="generate bloom filters" camunda:class="org.highmed.dsf.bpe.service.GenerateBloomFilters"> - <bpmn:incoming>SequenceFlow_1futlo2</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1ug2kru</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:exclusiveGateway id="ExclusiveGateway_002t87f"> - <bpmn:incoming>SequenceFlow_17otl7p</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1ug2kru</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1kpvsx9</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0q803rh</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0q803rh" sourceRef="ExclusiveGateway_002t87f" targetRef="checkResults" /> - <bpmn:sequenceFlow id="SequenceFlow_1ug2kru" sourceRef="generateBloomFilters" targetRef="ExclusiveGateway_002t87f" /> - <bpmn:sequenceFlow id="SequenceFlow_0kfeekm" name="needs consent check and no record linkage" sourceRef="ExclusiveGateway_0sff9xb" targetRef="countIds"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsConsentCheck && !needsRecordLinkage}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_1kpvsx9" sourceRef="countIds" targetRef="ExclusiveGateway_002t87f" /> - <bpmn:serviceTask id="countIds" name="count id's" camunda:class="org.highmed.dsf.bpe.service.GenerateCountFromIds"> - <bpmn:incoming>SequenceFlow_0kfeekm</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1kpvsx9</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_0ascyjc" sourceRef="selectResponseTargetTtp" targetRef="EndEvent" /> - <bpmn:serviceTask id="selectResponseTargetTtp" name="select response target TTP" camunda:class="org.highmed.dsf.bpe.service.SelectResponseTargetTtp"> - <bpmn:incoming>SequenceFlow_04ouilq</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0ascyjc</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="executeQueries" name="execute queries" camunda:class="org.highmed.dsf.bpe.service.ExecuteQueries"> - <bpmn:incoming>SequenceFlow_0bwn08k</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1rmqv20</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:textAnnotation id="TextAnnotation_0euut3n"> - <bpmn:text>uac check, study definiton validity, type of cohort, ethics commitee vote, included medics, user authentication, rate limit, etc.</bpmn:text> - </bpmn:textAnnotation> - <bpmn:association id="Association_1ncewqu" sourceRef="checkFeasibilityResources" targetRef="TextAnnotation_0euut3n" /> - </bpmn:process> - <bpmn:message id="Message_1yz2a31" name="executeFeasibilityMessage" /> - <bpmn:message id="Message_1dr71re" name="resultSingleMedicFeasibilityMessage" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="executeFeasibility"> - <bpmndi:BPMNEdge id="SequenceFlow_0ascyjc_di" bpmnElement="SequenceFlow_0ascyjc"> - <di:waypoint x="2106" y="272" /> - <di:waypoint x="2201" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1kpvsx9_di" bpmnElement="SequenceFlow_1kpvsx9"> - <di:waypoint x="1711" y="160" /> - <di:waypoint x="1711" y="247" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0kfeekm_di" bpmnElement="SequenceFlow_0kfeekm"> - <di:waypoint x="1558" y="247" /> - <di:waypoint x="1558" y="120" /> - <di:waypoint x="1661" y="120" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1564" y="125" width="73" height="40" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1ug2kru_di" bpmnElement="SequenceFlow_1ug2kru"> - <di:waypoint x="1711" y="375" /> - <di:waypoint x="1711" y="297" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0q803rh_di" bpmnElement="SequenceFlow_0q803rh"> - <di:waypoint x="1736" y="272" /> - <di:waypoint x="1820" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1futlo2_di" bpmnElement="SequenceFlow_1futlo2"> - <di:waypoint x="1558" y="297" /> - <di:waypoint x="1558" y="415" /> - <di:waypoint x="1661" y="415" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1565" y="380" width="65" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_17otl7p_di" bpmnElement="SequenceFlow_17otl7p"> - <di:waypoint x="1583" y="272" /> - <di:waypoint x="1686" y="272" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1585" y="254" width="21" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0kzp6tl_di" bpmnElement="SequenceFlow_0kzp6tl"> - <di:waypoint x="1424" y="375" /> - <di:waypoint x="1424" y="297" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1b4h5qz_di" bpmnElement="SequenceFlow_1b4h5qz"> - <di:waypoint x="1449" y="272" /> - <di:waypoint x="1533" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0isxkuy_di" bpmnElement="SequenceFlow_0isxkuy"> - <di:waypoint x="1273" y="297" /> - <di:waypoint x="1273" y="415" /> - <di:waypoint x="1374" y="415" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1282" y="383" width="73" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_05r9whd_di" bpmnElement="SequenceFlow_05r9whd"> - <di:waypoint x="1298" y="272" /> - <di:waypoint x="1399" y="272" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1302" y="255" width="21" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1u1p9j2_di" bpmnElement="SequenceFlow_1u1p9j2"> - <di:waypoint x="1008" y="181" /> - <di:waypoint x="1008" y="247" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0bwn08k_di" bpmnElement="SequenceFlow_0bwn08k"> - <di:waypoint x="1033" y="272" /> - <di:waypoint x="1096" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0yqpkri_di" bpmnElement="SequenceFlow_0yqpkri"> - <di:waypoint x="852" y="247" /> - <di:waypoint x="852" y="141" /> - <di:waypoint x="958" y="141" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="862" y="146" width="73" height="40" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0zlq6j4_di" bpmnElement="SequenceFlow_0zlq6j4"> - <di:waypoint x="877" y="272" /> - <di:waypoint x="983" y="272" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="882" y="254" width="21" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_07wtgee_di" bpmnElement="SequenceFlow_07wtgee"> - <di:waypoint x="759" y="272" /> - <di:waypoint x="827" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_04ouilq_di" bpmnElement="SequenceFlow_04ouilq"> - <di:waypoint x="1920" y="272" /> - <di:waypoint x="2006" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1etju4m_di" bpmnElement="SequenceFlow_1etju4m"> - <di:waypoint x="390" y="272" /> - <di:waypoint x="470" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_14cn0vs_di" bpmnElement="SequenceFlow_14cn0vs"> - <di:waypoint x="197" y="272" /> - <di:waypoint x="290" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1wwn9pl_di" bpmnElement="SequenceFlow_1wwn9pl"> - <di:waypoint x="570" y="272" /> - <di:waypoint x="659" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1rmqv20_di" bpmnElement="SequenceFlow_1rmqv20"> - <di:waypoint x="1196" y="272" /> - <di:waypoint x="1248" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0t2s0v7_di" bpmnElement="checkResults"> - <dc:Bounds x="1820" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0jna5l2_di" bpmnElement="checkFeasibilityResources"> - <dc:Bounds x="470" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_1fzso6r_di" bpmnElement="StartEvent"> - <dc:Bounds x="161" y="254" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="168" y="297" width="23" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0b8j3ka_di" bpmnElement="downloadFeasibilityResources"> - <dc:Bounds x="290" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_10xdh63_di" bpmnElement="EndEvent"> - <dc:Bounds x="2201" y="254" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="2186" y="297" width="67" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_1pt9xhp_di" bpmnElement="checkQueries"> - <dc:Bounds x="659" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_1dln3in_di" bpmnElement="ExclusiveGateway_1dln3in" isMarkerVisible="true"> - <dc:Bounds x="827" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_02nwn9u_di" bpmnElement="replaceCountpartWithIdSelection"> - <dc:Bounds x="958" y="101" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_1r4c9fx_di" bpmnElement="ExclusiveGateway_1r4c9fx" isMarkerVisible="true"> - <dc:Bounds x="983" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_0bq7zdz_di" bpmnElement="ExclusiveGateway_0bq7zdz" isMarkerVisible="true"> - <dc:Bounds x="1248" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0l3b9as_di" bpmnElement="filterByConsent"> - <dc:Bounds x="1374" y="375" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_0lecmy5_di" bpmnElement="ExclusiveGateway_0lecmy5" isMarkerVisible="true"> - <dc:Bounds x="1399" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_0sff9xb_di" bpmnElement="ExclusiveGateway_0sff9xb" isMarkerVisible="true"> - <dc:Bounds x="1533" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0akkess_di" bpmnElement="generateBloomFilters"> - <dc:Bounds x="1661" y="375" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_002t87f_di" bpmnElement="ExclusiveGateway_002t87f" isMarkerVisible="true"> - <dc:Bounds x="1686" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_17kpyle_di" bpmnElement="countIds"> - <dc:Bounds x="1661" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_15aifhd_di" bpmnElement="selectResponseTargetTtp"> - <dc:Bounds x="2006" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0u5pb4i_di" bpmnElement="executeQueries"> - <dc:Bounds x="1096" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="TextAnnotation_0euut3n_di" bpmnElement="TextAnnotation_0euut3n"> - <dc:Bounds x="386" y="152" width="267" height="56" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Association_1ncewqu_di" bpmnElement="Association_1ncewqu"> - <di:waypoint x="520" y="232" /> - <di:waypoint x="520" y="208" /> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn deleted file mode 100755 index 884b99ca1..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/bpe/requestFeasibility.bpmn +++ /dev/null @@ -1,206 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0inb4ax" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="requestFeasibility" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:startEvent id="StartEvent" name="start"> - <bpmn:outgoing>SequenceFlow_11k77gx</bpmn:outgoing> - <bpmn:messageEventDefinition id="MessageEventDefinition_10c2suu" messageRef="Message_1pq9qxp" /> - </bpmn:startEvent> - <bpmn:serviceTask id="selectRequestTargetsAndGenerateKeys" name="select request targets and generate keys" camunda:class="org.highmed.dsf.bpe.service.SelectRequestTargets"> - <bpmn:incoming>SequenceFlow_18ajfnh</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0b5s4ef</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sendTask id="sendRequestToMedics" name="send request to medics" camunda:class="org.highmed.dsf.bpe.message.SendMedicRequest"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">executeFeasibility</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">executeFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-feasibility</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_035oihl</bpmn:incoming> - <bpmn:outgoing>Flow_0c15t3c</bpmn:outgoing> - <bpmn:multiInstanceLoopCharacteristics camunda:collection="${targets.entries}" camunda:elementVariable="target" /> - </bpmn:sendTask> - <bpmn:sequenceFlow id="SequenceFlow_11k77gx" sourceRef="StartEvent" targetRef="downloadResearchStudyResource" /> - <bpmn:sequenceFlow id="SequenceFlow_0b5s4ef" sourceRef="selectRequestTargetsAndGenerateKeys" targetRef="sendCorreltationKeysToTTP" /> - <bpmn:serviceTask id="downloadResearchStudyResource" name="download research study resource" camunda:class="org.highmed.dsf.bpe.service.DownloadResearchStudyResource"> - <bpmn:incoming>SequenceFlow_11k77gx</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_18ajfnh</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_18ajfnh" sourceRef="downloadResearchStudyResource" targetRef="selectRequestTargetsAndGenerateKeys" /> - <bpmn:sequenceFlow id="SequenceFlow_035oihl" sourceRef="sendCorreltationKeysToTTP" targetRef="sendRequestToMedics" /> - <bpmn:intermediateThrowEvent id="sendCorreltationKeysToTTP" name="send correlation keys to TTP"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">computeFeasibility</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">computeFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-compute-feasibility</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_0b5s4ef</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_035oihl</bpmn:outgoing> - <bpmn:messageEventDefinition messageRef="Message_0gifb86" camunda:class="org.highmed.dsf.bpe.message.SendTtpRequest" /> - </bpmn:intermediateThrowEvent> - <bpmn:endEvent id="EndEvent" name="success"> - <bpmn:incoming>Flow_15k4oa2</bpmn:incoming> - </bpmn:endEvent> - <bpmn:serviceTask id="checkFinalResult" name="check final result" camunda:class="org.highmed.dsf.bpe.service.CheckMultiMedicResults"> - <bpmn:incoming>Flow_0fd2zcr</bpmn:incoming> - <bpmn:outgoing>Flow_0pn3dsm</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="handelError" name="handle error" camunda:class="org.highmed.dsf.bpe.service.HandleErrorMultiMedicResults"> - <bpmn:incoming>Flow_0xgrywb</bpmn:incoming> - <bpmn:outgoing>Flow_0rkdr4f</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="Flow_0c15t3c" sourceRef="sendRequestToMedics" targetRef="Gateway_1elix41" /> - <bpmn:eventBasedGateway id="Gateway_1elix41"> - <bpmn:incoming>Flow_0c15t3c</bpmn:incoming> - <bpmn:outgoing>Flow_05n1ipx</bpmn:outgoing> - <bpmn:outgoing>Flow_113qgvb</bpmn:outgoing> - </bpmn:eventBasedGateway> - <bpmn:intermediateCatchEvent id="receiveErrorFromTTP" name="receive error from TTP"> - <bpmn:incoming>Flow_05n1ipx</bpmn:incoming> - <bpmn:outgoing>Flow_0xgrywb</bpmn:outgoing> - <bpmn:messageEventDefinition id="MessageEventDefinition_0c47pf9" messageRef="Message_10vqhu0" /> - </bpmn:intermediateCatchEvent> - <bpmn:sequenceFlow id="Flow_05n1ipx" sourceRef="Gateway_1elix41" targetRef="receiveErrorFromTTP" /> - <bpmn:intermediateCatchEvent id="receiveFinalResultFromTTP" name="receive final result from TTP"> - <bpmn:incoming>Flow_113qgvb</bpmn:incoming> - <bpmn:outgoing>Flow_0fd2zcr</bpmn:outgoing> - <bpmn:messageEventDefinition id="MessageEventDefinition_07z0ktw" messageRef="Message_1vrxfsk" /> - </bpmn:intermediateCatchEvent> - <bpmn:sequenceFlow id="Flow_113qgvb" sourceRef="Gateway_1elix41" targetRef="receiveFinalResultFromTTP" /> - <bpmn:sequenceFlow id="Flow_0fd2zcr" sourceRef="receiveFinalResultFromTTP" targetRef="checkFinalResult" /> - <bpmn:sequenceFlow id="Flow_0xgrywb" sourceRef="receiveErrorFromTTP" targetRef="handelError" /> - <bpmn:exclusiveGateway id="Gateway_12ly33g"> - <bpmn:incoming>Flow_0pn3dsm</bpmn:incoming> - <bpmn:incoming>Flow_0rkdr4f</bpmn:incoming> - <bpmn:outgoing>Flow_15k4oa2</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="Flow_0pn3dsm" sourceRef="checkFinalResult" targetRef="Gateway_12ly33g" /> - <bpmn:sequenceFlow id="Flow_0rkdr4f" sourceRef="handelError" targetRef="Gateway_12ly33g" /> - <bpmn:sequenceFlow id="Flow_15k4oa2" sourceRef="Gateway_12ly33g" targetRef="EndEvent" /> - </bpmn:process> - <bpmn:message id="Message_1pq9qxp" name="requestFeasibilityMessage" /> - <bpmn:message id="Message_07ayhv1" name="resultFeasibilityMessage" /> - <bpmn:message id="Message_0gifb86" name="computeFeasibilityMessage" /> - <bpmn:error id="Error_0dl03kn" /> - <bpmn:error id="Error_07exqe7" /> - <bpmn:error id="Error_1jhmarr" /> - <bpmn:message id="Message_0qfng3q" name="receiveMultiMedicCohortSizeResultMessage" /> - <bpmn:message id="Message_0srg3vv" name="resultMultiMedicFeasibilityMessage" /> - <bpmn:message id="Message_0nmxozg" name="errorFeasibilityMessage" /> - <bpmn:message id="Message_1y0yxv0" name="resultMultiMedicFeasibilityMessage" /> - <bpmn:message id="Message_0v1bo0o" name="errorFeasibilityMessage" /> - <bpmn:message id="Message_10vqhu0" name="errorMultiMedicFeasibilityMessage" /> - <bpmn:message id="Message_1vrxfsk" name="resultMultiMedicFeasibilityMessage" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="requestFeasibility"> - <bpmndi:BPMNEdge id="Flow_15k4oa2_di" bpmnElement="Flow_15k4oa2"> - <di:waypoint x="1385" y="220" /> - <di:waypoint x="1452" y="220" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0rkdr4f_di" bpmnElement="Flow_0rkdr4f"> - <di:waypoint x="1290" y="300" /> - <di:waypoint x="1360" y="300" /> - <di:waypoint x="1360" y="245" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0pn3dsm_di" bpmnElement="Flow_0pn3dsm"> - <di:waypoint x="1290" y="140" /> - <di:waypoint x="1360" y="140" /> - <di:waypoint x="1360" y="195" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0xgrywb_di" bpmnElement="Flow_0xgrywb"> - <di:waypoint x="1098" y="300" /> - <di:waypoint x="1190" y="300" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0fd2zcr_di" bpmnElement="Flow_0fd2zcr"> - <di:waypoint x="1098" y="140" /> - <di:waypoint x="1190" y="140" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_113qgvb_di" bpmnElement="Flow_113qgvb"> - <di:waypoint x="1000" y="200" /> - <di:waypoint x="1000" y="140" /> - <di:waypoint x="1062" y="140" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_05n1ipx_di" bpmnElement="Flow_05n1ipx"> - <di:waypoint x="1000" y="250" /> - <di:waypoint x="1000" y="300" /> - <di:waypoint x="1062" y="300" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0c15t3c_di" bpmnElement="Flow_0c15t3c"> - <di:waypoint x="895" y="225" /> - <di:waypoint x="975" y="225" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_035oihl_di" bpmnElement="SequenceFlow_035oihl"> - <di:waypoint x="701" y="225" /> - <di:waypoint x="795" y="225" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_18ajfnh_di" bpmnElement="SequenceFlow_18ajfnh"> - <di:waypoint x="391" y="225" /> - <di:waypoint x="481" y="225" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0b5s4ef_di" bpmnElement="SequenceFlow_0b5s4ef"> - <di:waypoint x="581" y="225" /> - <di:waypoint x="665" y="225" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_11k77gx_di" bpmnElement="SequenceFlow_11k77gx"> - <di:waypoint x="188" y="225" /> - <di:waypoint x="291" y="225" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="StartEvent_1ozsjmr_di" bpmnElement="StartEvent"> - <dc:Bounds x="152" y="207" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="160" y="250" width="22" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0vfud44_di" bpmnElement="selectRequestTargetsAndGenerateKeys"> - <dc:Bounds x="481" y="185" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="SendTask_1pu8i9n_di" bpmnElement="sendRequestToMedics"> - <dc:Bounds x="795" y="185" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_052xqjx_di" bpmnElement="downloadResearchStudyResource"> - <dc:Bounds x="291" y="185" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="IntermediateThrowEvent_1yqfh9l_di" bpmnElement="sendCorreltationKeysToTTP"> - <dc:Bounds x="665" y="207" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="644" y="250" width="79" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_18syky8_di" bpmnElement="EndEvent"> - <dc:Bounds x="1452" y="202" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1450" y="245" width="40" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_00phx5l_di" bpmnElement="checkFinalResult"> - <dc:Bounds x="1190" y="100" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Activity_0g5gqtl_di" bpmnElement="handelError"> - <dc:Bounds x="1190" y="260" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Gateway_14rekv0_di" bpmnElement="Gateway_1elix41"> - <dc:Bounds x="975" y="200" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Event_0lw0zl5_di" bpmnElement="receiveErrorFromTTP"> - <dc:Bounds x="1062" y="282" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1049" y="325" width="62" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Event_0xm470l_di" bpmnElement="receiveFinalResultFromTTP"> - <dc:Bounds x="1062" y="122" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1042" y="86" width="76" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Gateway_12ly33g_di" bpmnElement="Gateway_12ly33g" isMarkerVisible="true"> - <dc:Bounds x="1335" y="195" width="50" height="50" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml deleted file mode 100644 index 9c04a616a..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-computeFeasibility.xml +++ /dev/null @@ -1,92 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="computeFeasibilityMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility" /> - </extension> - </extension> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="resultSingleMedicFeasibilityMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility" /> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/computeFeasibility" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="computeFeasibility" /> - <title value="Compute Feasibility" /> - <subtitle value="Process to compute feasibility result" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <publisher value="HiGHmed" /> - <contact> - <name value="HiGHmed" /> - <telecom> - <system value="email" /> - <value value="pmo@highmed.org" /> - </telecom> - </contact> - <description value="Process to compute a fesibility result and to send the result back to the requesting organization" /> - <kind value="Task" /> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml deleted file mode 100644 index 6cd870cb6..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-executeFeasibility.xml +++ /dev/null @@ -1,66 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="executeFeasibilityMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/executeFeasibility" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="executeFeasibility" /> - <title value="Execute a Feasibility" /> - <subtitle value="Process to execute a feasibility query" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <publisher value="HiGHmed" /> - <contact> - <name value="HiGHmed" /> - <telecom> - <system value="email" /> - <value value="pmo@highmed.org" /> - </telecom> - </contact> - <description value="Process to execute a feasibility query received from a MeDIC and to send result to a TTP" /> - <kind value="Task" /> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml deleted file mode 100644 index e5e709526..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ActivityDefinition/highmed-requestFeasibility.xml +++ /dev/null @@ -1,124 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="requestFeasibilityMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/highmed-task-request-feasibility" /> - </extension> - </extension> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="resultMultiMedicFeasibilityMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility" /> - </extension> - </extension> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="errorMultiMedicFeasibilityMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility" /> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/requestFeasibility" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="requestFeasibility" /> - <title value="Request feasibility" /> - <subtitle value="Feasibility Request Process" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <publisher value="HiGHmed" /> - <contact> - <name value="HiGHmed" /> - <telecom> - <system value="email" /> - <value value="pmo@highmed.org" /> - </telecom> - </contact> - <description value="Process to start a feasibility, process sends messages to all MeDICs and a TTP, receives result from TTP" /> - <kind value="Task" /> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml deleted file mode 100644 index b8b9f218e..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/CodeSystem/highmed-feasibility.xml +++ /dev/null @@ -1,68 +0,0 @@ -<CodeSystem xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> - </meta> - <url value="http://highmed.org/fhir/CodeSystem/feasibility"/> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="HiGHmed_Feasibility"/> - <title value="HiGHmed Feasibility"/> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false"/> - <date value="2020-11-23"/> - <publisher value="HiGHmed"/> - <description value="CodeSystem with standard values for feasibility processes"/> - <caseSensitive value="true"/> - <hierarchyMeaning value="grouped-by"/> - <versionNeeded value="false"/> - <content value="complete"/> - <concept> - <code value="research-study-reference"/> - <display value="Research Study Reference"/> - <definition value="HiGHmed Research Study Reference to define what data is requested from which MeDICs and for what purpose"/> - </concept> - <concept> - <code value="needs-record-linkage"/> - <display value="Needs Record Linkage"/> - <definition value="Boolean indicating if a data analysis needs record linkage"/> - </concept> - <concept> - <code value="needs-consent-check"/> - <display value="Needs Consent Check"/> - <definition value="Boolean indicating if a data analysis needs consent check"/> - </concept> - <concept> - <code value="bloom-filter-configuration"/> - <display value="Bloom Filter Cconfiguration"/> - <definition value="Base64 binary encoded bloom filter configuration"/> - </concept> - <concept> - <code value="medic-correlation-key"/> - <display value="MeDIC Correlation Key"/> - <definition value="MeDIC Correlation Key transfered to TTP for correlating incoming medic results"/> - </concept> - <concept> - <code value="single-medic-result"/> - <display value="Single MeDIC Result"/> - <definition value="Result of a single feasibility query execution"/> - </concept> - <concept> - <code value="single-medic-result-reference"/> - <display value="Single MeDIC Result Reference"/> - <definition value="Reference to an openEHR ResultSet as a result of a single feasibility query execution"/> - </concept> - <concept> - <code value="participating-medics"/> - <display value="Participating MeDICs"/> - <definition value="Count of all MeDICs who participated in a feasibility query"/> - </concept> - <concept> - <code value="multi-medic-result"/> - <display value="Multi MeDIC Result"/> - <definition value="Aggregated result of all single medic results"/> - </concept> -</CodeSystem> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml deleted file mode 100644 index 3a6f2904c..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-compute-feasibility.xml +++ /dev/null @@ -1,142 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-compute-feasibility" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskComputeFeasibility" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/${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" /> - <min value="4" /> - </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="computeFeasibilityMessage" /> - </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" /> - <min value="1" /> - </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" /> - <min value="0" /> - <max value="0" /> - </element> - <element id="Task.input:medic-correlation-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="medic-correlation-key" /> - <min value="1" /> - </element> - <element id="Task.input:medic-correlation-key.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:medic-correlation-key.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:medic-correlation-key.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:medic-correlation-key.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="medic-correlation-key" /> - </element> - <element id="Task.input:medic-correlation-key.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="string" /> - </type> - </element> - <element id="Task.input:needs-record-linkage"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="needs-record-linkage" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-record-linkage.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:needs-record-linkage.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-record-linkage.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:needs-record-linkage.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="needs-record-linkage" /> - </element> - <element id="Task.input:needs-record-linkage.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="boolean" /> - </type> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml deleted file mode 100644 index 09e592fd0..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-error-feasibility.xml +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-error-feasibility" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskErrorFeasibility" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/${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" /> - <min value="3" /> - </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="errorMultiMedicFeasibilityMessage" /> - </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" /> - <min value="1" /> - </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" /> - <min value="0" /> - <max value="0" /> - </element> - <element id="Task.input:error"> - <path value="Task.input" /> - <sliceName value="error" /> - <min value="1" /> - </element> - <element id="Task.input:error.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/bpmn-message" /> - </binding> - </element> - <element id="Task.input:error.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:error.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/bpmn-message" /> - </element> - <element id="Task.input:error.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="error" /> - </element> - <element id="Task.input:error.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="string" /> - </type> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml deleted file mode 100644 index 03472fe64..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-execute-feasibility.xml +++ /dev/null @@ -1,224 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-execute-feasibility" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskExecuteFeasibility" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeFeasibility/${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" /> - <min value="6" /> - <max value="7" /> - </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="executeFeasibilityMessage" /> - </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" /> - <min value="1" /> - </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" /> - <min value="1" /> - </element> - <element id="Task.input:research-study"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="research-study" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:research-study.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:research-study.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:research-study.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:research-study.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="research-study-reference" /> - </element> - <element id="Task.input:research-study.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/research-study" /> - </type> - </element> - <element id="Task.input:needs-record-linkage"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="needs-record-linkage" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-record-linkage.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:needs-record-linkage.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-record-linkage.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:needs-record-linkage.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="needs-record-linkage" /> - </element> - <element id="Task.input:needs-record-linkage.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="boolean" /> - </type> - </element> - <element id="Task.input:needs-consent-check"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="needs-consent-check" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-consent-check.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:needs-consent-check.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-consent-check.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:needs-consent-check.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="needs-consent-check" /> - </element> - <element id="Task.input:needs-consent-check.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="boolean" /> - </type> - </element> - <element id="Task.input:bloom-filter-configuration"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="bloom-filter-configuration" /> - <min value="0" /> - <max value="1" /> - </element> - <element id="Task.input:bloom-filter-configuration.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:bloom-filter-configuration.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:bloom-filter-configuration.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:bloom-filter-configuration.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="bloom-filter-configuration" /> - </element> - <element id="Task.input:bloom-filter-configuration.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="base64Binary" /> - </type> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml deleted file mode 100644 index c38a106c6..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-multi-medic-result-feasibility.xml +++ /dev/null @@ -1,215 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-multi-medic-result-feasibility" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskMultiMedicResultFeasibility" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/${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" /> - <min value="4" /> - </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="resultMultiMedicFeasibilityMessage" /> - </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" /> - <min value="1" /> - </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" /> - <min value="0" /> - <max value="0" /> - </element> - <element id="Task.input:participating-medics"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="participating-medics" /> - <min value="1" /> - </element> - <element id="Task.input:participating-medics.extension"> - <path value="Task.input.extension" /> - <slicing> - <discriminator> - <type value="value" /> - <path value="url" /> - </discriminator> - <rules value="open" /> - </slicing> - </element> - <element id="Task.input:participating-medics.extension:group-id"> - <path value="Task.input.extension" /> - <sliceName value="group-id" /> - <min value="1" /> - <type> - <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> - </type> - </element> - <element id="Task.input:participating-medics.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:participating-medics.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:participating-medics.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:participating-medics.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="participating-medics" /> - </element> - <element id="Task.input:participating-medics.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="unsignedInt" /> - </type> - </element> - <element id="Task.input:multi-medic-result"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="multi-medic-result" /> - <min value="1" /> - </element> - <element id="Task.input:multi-medic-result.extension"> - <path value="Task.input.extension" /> - <slicing> - <discriminator> - <type value="value" /> - <path value="url" /> - </discriminator> - <rules value="open" /> - </slicing> - </element> - <element id="Task.input:multi-medic-result.extension:group-id"> - <path value="Task.input.extension" /> - <sliceName value="group-id" /> - <min value="1" /> - <type> - <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> - </type> - </element> - <element id="Task.input:multi-medic-result.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:multi-medic-result.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:multi-medic-result.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:multi-medic-result.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="multi-medic-result" /> - </element> - <element id="Task.input:multi-medic-result.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="unsignedInt" /> - </type> - </element> - <element id="Task.input:error"> - <path value="Task.input" /> - <sliceName value="error" /> - <min value="0" /> - </element> - <element id="Task.input:error.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/bpmn-message" /> - </binding> - </element> - <element id="Task.input:error.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:error.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/bpmn-message" /> - </element> - <element id="Task.input:error.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="error" /> - </element> - <element id="Task.input:error.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="string" /> - </type> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml deleted file mode 100644 index 09b12a4ee..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-request-feasibility.xml +++ /dev/null @@ -1,300 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-request-feasibility" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskRequestFeasibility" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestFeasibility/${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" /> - <min value="4" /> - <max value="4" /> - </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="requestFeasibilityMessage" /> - </element> - <element id="Task.input:business-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="business-key" /> - <max value="0" /> - </element> - <element id="Task.input:correlation-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="correlation-key" /> - <max value="0" /> - </element> - <element id="Task.input:research-study-reference"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="research-study-reference" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:research-study-reference.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:research-study-reference.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:research-study-reference.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:research-study-reference.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="research-study-reference" /> - </element> - <element id="Task.input:research-study-reference.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="Reference" /> - <targetProfile value="http://highmed.org/fhir/StructureDefinition/research-study" /> - </type> - </element> - <element id="Task.input:research-study-reference.value[x].reference"> - <path value="Task.input.value[x].reference" /> - <min value="1" /> - </element> - <element id="Task.input:research-study-reference.value[x].identifier"> - <path value="Task.input.value[x].identifier" /> - <max value="0" /> - </element> - <element id="Task.input:needs-record-linkage"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="needs-record-linkage" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-record-linkage.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:needs-record-linkage.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-record-linkage.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:needs-record-linkage.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="needs-record-linkage" /> - </element> - <element id="Task.input:needs-record-linkage.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="boolean" /> - </type> - </element> - <element id="Task.input:needs-consent-check"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="needs-consent-check" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-consent-check.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:needs-consent-check.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-consent-check.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:needs-consent-check.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="needs-consent-check" /> - </element> - <element id="Task.input:needs-consent-check.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="boolean" /> - </type> - </element> - <element id="Task.output:participating-medics"> - <path value="Task.output" /> - <sliceName value="participating-medics" /> - </element> - <element id="Task.output:participating-medics.extension"> - <path value="Task.output.extension" /> - <slicing> - <discriminator> - <type value="value" /> - <path value="url" /> - </discriminator> - <rules value="open" /> - </slicing> - </element> - <element id="Task.output:participating-medics.extension:group-id"> - <path value="Task.output.extension" /> - <sliceName value="group-id" /> - <min value="1" /> - <type> - <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> - </type> - </element> - <element id="Task.output:participating-medics.type"> - <path value="Task.output.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskOutputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.output:participating-medics.type.coding"> - <path value="Task.output.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.output:participating-medics.type.coding.system"> - <path value="Task.output.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.output:participating-medics.type.coding.code"> - <path value="Task.output.type.coding.code" /> - <min value="1" /> - <fixedCode value="participating-medics" /> - </element> - <element id="Task.output:participating-medics.value[x]"> - <path value="Task.output.value[x]" /> - <type> - <code value="unsignedInt" /> - </type> - </element> - <element id="Task.output:multi-medic-result"> - <path value="Task.output" /> - <sliceName value="multi-medic-result" /> - </element> - <element id="Task.output:multi-medic-result.extension"> - <path value="Task.output.extension" /> - <slicing> - <discriminator> - <type value="value" /> - <path value="url" /> - </discriminator> - <rules value="open" /> - </slicing> - </element> - <element id="Task.output:multi-medic-result.extension:group-id"> - <path value="Task.output.extension" /> - <sliceName value="group-id" /> - <min value="1" /> - <type> - <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> - </type> - </element> - <element id="Task.output:multi-medic-result.type"> - <path value="Task.output.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskOutputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.output:multi-medic-result.type.coding"> - <path value="Task.output.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.output:multi-medic-result.type.coding.system"> - <path value="Task.output.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.output:multi-medic-result.type.coding.code"> - <path value="Task.output.type.coding.code" /> - <min value="1" /> - <fixedCode value="multi-medic-result" /> - </element> - <element id="Task.output:multi-medic-result.value[x]"> - <path value="Task.output.value[x]" /> - <type> - <code value="unsignedInt" /> - </type> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml deleted file mode 100644 index fe30a2b4e..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/StructureDefinition/highmed-task-single-medic-result-feasibility.xml +++ /dev/null @@ -1,189 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskSingleMedicResultFeasibility" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/computeFeasibility/${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" /> - <min value="4" /> - </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="resultSingleMedicFeasibilityMessage" /> - </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" /> - <min value="1" /> - </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" /> - <min value="1" /> - </element> - <element id="Task.input:single-medic-result"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="single-medic-result" /> - <min value="0" /> - <max value="*" /> - </element> - <element id="Task.input:single-medic-result.extension"> - <path value="Task.input.extension" /> - <slicing> - <discriminator> - <type value="value" /> - <path value="url" /> - </discriminator> - <rules value="open" /> - </slicing> - </element> - <element id="Task.input:single-medic-result.extension:group-id"> - <path value="Task.input.extension" /> - <sliceName value="group-id" /> - <min value="1" /> - <type> - <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> - </type> - </element> - <element id="Task.input:single-medic-result.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:single-medic-result.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:single-medic-result.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:single-medic-result.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="single-medic-result" /> - </element> - <element id="Task.input:single-medic-result.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="unsignedInt" /> - </type> - </element> - <element id="Task.input:single-medic-result-reference"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="single-medic-result-reference" /> - <min value="0" /> - <max value="*" /> - </element> - <element id="Task.input:single-medic-result-reference.extension"> - <path value="Task.input.extension" /> - <slicing> - <discriminator> - <type value="value" /> - <path value="url" /> - </discriminator> - <rules value="open" /> - </slicing> - </element> - <element id="Task.input:single-medic-result-reference.extension:group-id"> - <path value="Task.input.extension" /> - <sliceName value="group-id" /> - <min value="1" /> - <type> - <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> - </type> - </element> - <element id="Task.input:single-medic-result-reference.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:single-medic-result-reference.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:single-medic-result-reference.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:single-medic-result-reference.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="single-medic-result-reference" /> - </element> - <element id="Task.input:single-medic-result-reference.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="Reference" /> - <targetProfile value="http://hl7.org/fhir/StructureDefinition/Binary" /> - </type> - </element> - <element id="Task.input:single-medic-result-reference.value[x].reference"> - <path value="Task.input.value[x].reference" /> - <min value="1" /> - </element> - <element id="Task.input:single-medic-result-reference.value[x].identifier"> - <path value="Task.input.value[x].identifier" /> - <max value="0" /> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml deleted file mode 100644 index eab1079f6..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/main/resources/fhir/ValueSet/highmed-feasibility.xml +++ /dev/null @@ -1,25 +0,0 @@ -<ValueSet xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> - </meta> - <url value="http://highmed.org/fhir/ValueSet/feasibility"/> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="HiGHmed_Feasibility"/> - <title value="HiGHmed Feasibility"/> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false"/> - <date value="2020-11-23"/> - <publisher value="HiGHmed"/> - <description value="ValueSet with standard values for feasibility processes"/> - <immutable value="true"/> - <compose> - <include> - <system value="http://highmed.org/fhir/CodeSystem/feasibility"/> - </include> - </compose> -</ValueSet> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java deleted file mode 100644 index f400ae3ed..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/start/RequestFeasibilityFromMedicsViaMedic1ExampleStarter.java +++ /dev/null @@ -1,161 +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.CODE_TYPE_AQL_QUERY; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_MEDIC; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_PARTICIPATING_TTP; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHEMD_RESEARCH_STUDY; -import static org.highmed.dsf.bpe.ConstantsBase.PROFILE_HIGHMED_GROUP; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; - -import java.util.Date; -import java.util.UUID; - -import org.hl7.fhir.r4.model.BooleanType; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Bundle.BundleType; -import org.hl7.fhir.r4.model.Bundle.HTTPVerb; -import org.hl7.fhir.r4.model.Expression; -import org.hl7.fhir.r4.model.Group; -import org.hl7.fhir.r4.model.Group.GroupType; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Narrative; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResearchStudy; -import org.hl7.fhir.r4.model.ResearchStudy.ResearchStudyStatus; -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.TaskIntent; -import org.hl7.fhir.r4.model.Task.TaskStatus; - -public class RequestFeasibilityFromMedicsViaMedic1ExampleStarter -{ - // 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 - { - Bundle bundle = createStartResource(); - ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL).startWith(bundle); - } - - private static Bundle createStartResource() - { - Group group1 = createGroup("Group 1"); - Group group2 = createGroup("Group 2"); - ResearchStudy researchStudy = createResearchStudy(group1, group2); - Task task = createTask(researchStudy); - - Bundle bundle = new Bundle(); - bundle.setType(BundleType.TRANSACTION); - bundle.addEntry().setResource(group1).setFullUrl(group1.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); - bundle.addEntry().setResource(group2).setFullUrl(group2.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.Group.name()); - bundle.addEntry().setResource(researchStudy).setFullUrl(researchStudy.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.ResearchStudy.name()); - bundle.addEntry().setResource(task).setFullUrl(task.getIdElement().getIdPart()).getRequest() - .setMethod(HTTPVerb.POST).setUrl(ResourceType.Task.name()); - - return bundle; - } - - private static Group createGroup(String name) - { - Group group = new Group(); - group.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - - group.getMeta().addProfile(PROFILE_HIGHMED_GROUP); - group.getText().getDiv().addText("This is the description"); - group.getText().setStatus(Narrative.NarrativeStatus.ADDITIONAL); - group.setType(GroupType.PERSON); - group.setActual(false); - group.setActive(true); - group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY).setValue( - new Expression().setLanguageElement(CODE_TYPE_AQL_QUERY).setExpression("SELECT COUNT(e) FROM EHR e")); - group.setName(name); - - return group; - } - - private static ResearchStudy createResearchStudy(Group group1, Group group2) - { - ResearchStudy researchStudy = new ResearchStudy(); - researchStudy.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - - researchStudy.getMeta().addProfile(PROFILE_HIGHEMD_RESEARCH_STUDY); - researchStudy.addIdentifier().setSystem(NAMINGSYSTEM_HIGHMED_RESEARCH_STUDY_IDENTIFIER) - .setValue(UUID.randomUUID().toString()); - researchStudy.setStatus(ResearchStudyStatus.ACTIVE); - researchStudy.addEnrollment().setReference(group1.getIdElement().getIdPart()); - researchStudy.addEnrollment().setReference(group2.getIdElement().getIdPart()); - - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1))); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_2))); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_MEDIC).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_3))); - researchStudy.addExtension().setUrl(EXTENSION_HIGHMED_PARTICIPATING_TTP).setValue( - new Reference().setType(ResourceType.Organization.name()).setIdentifier( - new Identifier().setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP))); - - return researchStudy; - } - - private static Task createTask(ResearchStudy researchStudy) - { - Task task = new Task(); - task.setIdElement(new IdType("urn:uuid:" + UUID.randomUUID().toString())); - - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new Reference().setReference(researchStudy.getIdElement().getIdPart()) - .setType(ResourceType.ResearchStudy.name())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); - task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); - - return task; - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigTest.java deleted file mode 100644 index db543402d..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/bpe/variables/BloomFilterConfigTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.highmed.dsf.bpe.variables; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.Base64; - -import javax.crypto.spec.SecretKeySpec; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.databind.ObjectMapper; - -public class BloomFilterConfigTest -{ - private static final Logger logger = LoggerFactory.getLogger(BloomFilterConfigTest.class); - - private static final byte[] b1 = Base64.getDecoder().decode("KLhuuy3lDSmo8A/mcYBBZJ+Xu+ok30qDGM4L0magwyY="); - private static final byte[] b2 = Base64.getDecoder().decode("VALdwRisuEsUBIXaqJ01L9lk0jJUSGm5ZBE+Ha5bm8c="); - private static final long l = -9139328758761390867L; - - @Test - public void testReadWriteJson() throws Exception - { - ObjectMapper objectMapper = new ObjectMapper(); - - BloomFilterConfig bfc = new BloomFilterConfig(l, new SecretKeySpec(b1, "HmacSHA256"), - new SecretKeySpec(b2, "HmacSHA3-256")); - - String value = objectMapper.writeValueAsString(bfc); - - logger.debug("BloomFilterConfig: {}", value); - - BloomFilterConfig readBfc = objectMapper.readValue(value, BloomFilterConfig.class); - - assertNotNull(readBfc); - assertEquals(bfc.getPermutationSeed(), readBfc.getPermutationSeed()); - assertEquals(bfc.getHmacSha2Key(), readBfc.getHmacSha2Key()); - assertEquals(bfc.getHmacSha3Key(), readBfc.getHmacSha3Key()); - } - - @Test - public void testReadWriteBytes() throws Exception - { - BloomFilterConfig bfc = new BloomFilterConfig(l, new SecretKeySpec(b1, "HmacSHA256"), - new SecretKeySpec(b2, "HmacSHA3-256")); - - byte[] bytes = bfc.toBytes(); - - logger.debug("BloomFilterConfig: {}", Base64.getEncoder().encodeToString(bytes)); - - BloomFilterConfig fromBytes = BloomFilterConfig.fromBytes(bytes); - - assertNotNull(fromBytes); - assertEquals(bfc.getPermutationSeed(), fromBytes.getPermutationSeed()); - assertEquals(bfc.getHmacSha2Key(), fromBytes.getHmacSha2Key()); - assertEquals(bfc.getHmacSha3Key(), fromBytes.getHmacSha3Key()); - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java deleted file mode 100755 index eb808a9e3..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ /dev/null @@ -1,446 +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_BUSINESS_KEY; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME; -import static org.highmed.dsf.bpe.FeasibilityProcessPluginDefinition.VERSION; -import static org.junit.Assert.assertEquals; - -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.Date; -import java.util.UUID; - -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.Base64BinaryType; -import org.hl7.fhir.r4.model.BooleanType; -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.ParameterComponent; -import org.hl7.fhir.r4.model.Task.TaskIntent; -import org.hl7.fhir.r4.model.Task.TaskOutputComponent; -import org.hl7.fhir.r4.model.Task.TaskStatus; -import org.hl7.fhir.r4.model.UnsignedIntType; -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, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group-0.4.0.xml", - "highmed-extension-group-id-0.4.0.xml", "highmed-research-study-0.4.0.xml", - "highmed-task-request-feasibility.xml", "highmed-task-execute-feasibility.xml", - "highmed-task-single-medic-result-feasibility.xml", "highmed-task-compute-feasibility.xml", - "highmed-task-multi-medic-result-feasibility.xml", "highmed-task-error-feasibility.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-feasibility.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-feasibility.xml")); - - private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), - validationRule.getValidationSupport()); - - @Test - public void testTaskRequestFeasibilityValid() throws Exception - { - Task task = createValidTaskRequestFeasibility(); - - 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 testTaskRequestFeasibilityValidWithOutput() throws Exception - { - String groupId1 = "Group/" + UUID.randomUUID().toString(); - String groupId2 = "Group/" + UUID.randomUUID().toString(); - - Task task = createValidTaskRequestFeasibility(); - - TaskOutputComponent outParticipatingMedics1 = task.addOutput(); - outParticipatingMedics1.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); - outParticipatingMedics1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); - TaskOutputComponent outMultiMedicResult1 = task.addOutput(); - outMultiMedicResult1.setValue(new UnsignedIntType(25)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY).setCode("multi-medic-result"); - outMultiMedicResult1.addExtension("http://highmed.org/fhir/StructureDefinition/extension-group-id", - new Reference(groupId1)); - - TaskOutputComponent outParticipatingMedics2 = task.addOutput(); - outParticipatingMedics2.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); - outParticipatingMedics2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); - TaskOutputComponent outMultiMedicResult2 = task.addOutput(); - outMultiMedicResult2.setValue(new UnsignedIntType(25)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT); - outMultiMedicResult2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); - - 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 createValidTaskRequestFeasibility() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("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_REQUEST_FEASIBILITY_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new Reference("ResearchStudy/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); - task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); - - return task; - } - - @Test - public void testTaskExecuteFeasibilityValid() throws Exception - { - Task task = createValidTaskExecuteFeasibility(); - - 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 testTaskExecuteFeasibilityValidWithBloomFilterConfig() throws Exception - { - Task task = createValidTaskExecuteFeasibility(); - task.addInput().setValue(new Base64BinaryType("TEST".getBytes(StandardCharsets.UTF_8))).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); - - 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 createValidTaskExecuteFeasibility() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 2"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_EXECUTE_FEASIBILITY_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY); - - task.addInput().setValue(new Reference("ResearchStudy/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_RESEARCH_STUDY_REFERENCE); - task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); - - return task; - } - - @Test - public void testTaskSingleMedicResultFeasibilityUnsignedIntResultValid() throws Exception - { - Task task = createValidTaskSingleMedicResultFeasibilityUnsignedIntResult(); - - 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 testTaskSingleMedicResultFeasibilityReferenceResultValid() throws Exception - { - Task task = createValidTaskSingleMedicResultFeasibilityReferenceResult(); - - 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 createValidTaskSingleMedicResultFeasibility() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 2"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_SINGLE_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME)) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN) - .setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY); - - return task; - } - - private Task createValidTaskSingleMedicResultFeasibilityUnsignedIntResult() - { - Task task = createValidTaskSingleMedicResultFeasibility(); - - String groupId1 = "Group/" + UUID.randomUUID().toString(); - String groupId2 = "Group/" + UUID.randomUUID().toString(); - - ParameterComponent inSingleMedicResult1 = task.addInput(); - inSingleMedicResult1.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT); - inSingleMedicResult1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); - ParameterComponent inSingleMedicResult2 = task.addInput(); - inSingleMedicResult2.setValue(new UnsignedIntType(10)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT); - inSingleMedicResult2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); - - return task; - } - - private Task createValidTaskSingleMedicResultFeasibilityReferenceResult() - { - Task task = createValidTaskSingleMedicResultFeasibility(); - - String groupId1 = "Group/" + UUID.randomUUID().toString(); - String groupId2 = "Group/" + UUID.randomUUID().toString(); - - ParameterComponent inSingleMedicResult1 = task.addInput(); - inSingleMedicResult1.setValue(new Reference("Binary/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE); - inSingleMedicResult1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); - ParameterComponent inSingleMedicResult2 = task.addInput(); - inSingleMedicResult2.setValue(new Reference("Binary/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE); - inSingleMedicResult2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); - - return task; - } - - @Test - public void testTaskComputeFeasibilityValid() throws Exception - { - Task task = createValidTaskComputeFeasibility(); - - 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 createValidTaskComputeFeasibility() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_COMPUTE_FEASIBILITY_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); - - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDIC_CORRELATION_KEY); - - task.addInput().setValue(new BooleanType(false)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - - return task; - } - - @Test - public void testTaskMultiMedicResultFeasibilityValid() throws Exception - { - Task task = createValidTaskMultiMedicResultFeasibility(); - - 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 createValidTaskMultiMedicResultFeasibility() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_MULTI_MEDIC_RESULT_FEASIBILITY_MESSAGE_NAME)) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN) - .setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); - - String groupId1 = "Group/" + UUID.randomUUID().toString(); - String groupId2 = "Group/" + UUID.randomUUID().toString(); - - ParameterComponent inParticipatingMedics1 = task.addInput(); - inParticipatingMedics1.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); - inParticipatingMedics1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); - ParameterComponent inMultiMedicResult1 = task.addInput(); - inMultiMedicResult1.setValue(new UnsignedIntType(25)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT); - inMultiMedicResult1.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId1)); - - ParameterComponent inParticipatingMedics2 = task.addInput(); - inParticipatingMedics2.setValue(new UnsignedIntType(5)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_PARTICIPATING_MEDICS_COUNT); - inParticipatingMedics2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); - ParameterComponent inMultiMedicResult2 = task.addInput(); - inMultiMedicResult2.setValue(new UnsignedIntType(25)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_MULTI_MEDIC_RESULT); - inMultiMedicResult2.addExtension(EXTENSION_HIGHMED_GROUP_ID, new Reference(groupId2)); - - return task; - } - - @Test - public void testTaskErrorFeasibilityValid() throws Exception - { - Task task = createValidTaskErrorFeasibility(); - - 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 createValidTaskErrorFeasibility() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_FEASIBILITY_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_ERROR_FEASIBILITY_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); - - ParameterComponent error = task.addInput(); - error.setValue(new StringType( - "An error occurred while calculating the multi medic feasibility result for all defined cohorts")) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_ERROR); - - return task; - } -} diff --git a/dsf-bpe/dsf-bpe-process-feasibility/src/test/resources/log4j2.xml b/dsf-bpe/dsf-bpe-process-feasibility/src/test/resources/log4j2.xml deleted file mode 100644 index f1afe81dc..000000000 --- a/dsf-bpe/dsf-bpe-process-feasibility/src/test/resources/log4j2.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?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> - <!-- <RollingFile name="FILE" fileName="log/adt_db.log" - filePattern="log/adt_db_%d{MM-dd-yyyy}_%i.log.gz" - ignoreExceptions="false"> - <PatternLayout> - <Pattern>%d [%t] %-5p %c - %m%n</Pattern> - </PatternLayout> - <Policies> - <OnStartupTriggeringPolicy /> - <TimeBasedTriggeringPolicy /> - </Policies> - </RollingFile> --> - - <!-- <SMTP name="MAIL" subject="Production RWH LAB Gateway Error" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="50"> - </SMTP> - <SMTP name="MAIL_CERTIFICATE" subject="Production RWH LAB Gateway Certificate Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> - <SMTP name="MAIL_HL7" subject="Production RWH ADT Gateway HL7 Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> --> - </Appenders> - - <Loggers> - <Logger name="de.rwh" level="TRACE"/> - <Logger name="org.highmed" 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"/> - - <!-- <Logger name="certificate-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_CERTIFICATE" /> - </Logger> - <Logger name="async-message-handler-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_HL7" /> - </Logger> --> - - <Root level="WARN"> - <AppenderRef ref="CONSOLE"/> - <!-- <AppenderRef ref="FILE" /> --> - <!-- <AppenderRef ref="MAIL" /> --> - </Root> - </Loggers> -</Configuration> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-local-services/pom.xml b/dsf-bpe/dsf-bpe-process-local-services/pom.xml deleted file mode 100644 index 07744ae1e..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/pom.xml +++ /dev/null @@ -1,183 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <artifactId>dsf-bpe-process-local-services</artifactId> - - <parent> - <artifactId>dsf-bpe-pom</artifactId> - <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> - </parent> - - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-feasibility</artifactId> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>de.hs-heilbronn.mi</groupId> - <artifactId>log4j2-utils</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-fhir-validation</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>test</scope> - <type>test-jar</type> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-process-plugin-to-docker-test-setup</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clean-plugin</artifactId> - <configuration> - <filesets> - <fileset> - <directory>../../dsf-docker-test-setup/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - </filesets> - </configuration> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java deleted file mode 100644 index 7dba08561..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/ConstantsLocalServices.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.highmed.dsf.bpe; - -import static org.highmed.dsf.bpe.ConstantsFeasibility.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI; -import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.VERSION; - -public interface ConstantsLocalServices -{ - String PROFILE_HIGHMED_TASK_LOCAL_SERVICES = "http://highmed.org/fhir/StructureDefinition/task-local-services-integration"; - String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME = "localServicesIntegrationMessage"; -} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java deleted file mode 100644 index 7b173372b..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/LocalServicesProcessPluginDefinition.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.highmed.dsf.bpe; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -import org.highmed.dsf.bpe.spring.config.FeasibilitySerializerConfig; -import org.highmed.dsf.bpe.spring.config.LocalServicesConfig; -import org.highmed.dsf.fhir.resources.AbstractResource; -import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; -import org.highmed.dsf.fhir.resources.CodeSystemResource; -import org.highmed.dsf.fhir.resources.ResourceProvider; -import org.highmed.dsf.fhir.resources.StructureDefinitionResource; -import org.highmed.dsf.fhir.resources.ValueSetResource; - -import ca.uhn.fhir.context.FhirContext; - -public class LocalServicesProcessPluginDefinition implements ProcessPluginDefinition -{ - public static final String VERSION = "0.4.0"; - - private static final String DEPENDENCY_FEASIBILITY_VERSION = "0.4.0"; - private static final String DEPENDENCY_FEASIBILITY_NAME_AND_VERSION = "dsf-bpe-process-feasibility-0.4.0"; - - @Override - public String getName() - { - return "dsf-bpe-process-local-services"; - } - - @Override - public String getVersion() - { - return VERSION; - } - - @Override - public Stream<String> getBpmnFiles() - { - return Stream.of("bpe/localServicesIntegration.bpmn"); - } - - @Override - public Stream<Class<?>> getSpringConfigClasses() - { - return Stream.of(LocalServicesConfig.class, FeasibilitySerializerConfig.class); - } - - @Override - public List<String> getDependencyNamesAndVersions() - { - return Arrays.asList(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION); - } - - @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) - { - var aL = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-localServicesIntegration.xml"); - var sTL = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-local-services-integration.xml"); - - var vF = ValueSetResource - .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/ValueSet/feasibility", - DEPENDENCY_FEASIBILITY_VERSION); - var cF = CodeSystemResource - .dependency(DEPENDENCY_FEASIBILITY_NAME_AND_VERSION, "http://highmed.org/fhir/CodeSystem/feasibility", - DEPENDENCY_FEASIBILITY_VERSION); - - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map - .of("localServicesIntegration/" + VERSION, Arrays.asList(aL, sTL, vF, cF)); - - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); - } -} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java deleted file mode 100644 index 6a020529b..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/ExtractInputValues.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_QUERY_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; -import static org.highmed.dsf.bpe.ConstantsBase.CODE_TYPE_AQL_QUERY; -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_QUERY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_COHORTS; -import static org.highmed.dsf.bpe.ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK; - -import java.util.List; -import java.util.UUID; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.BloomFilterConfig; -import org.highmed.dsf.bpe.variables.BloomFilterConfigValues; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.FhirResourcesListValues; -import org.hl7.fhir.r4.model.Expression; -import org.hl7.fhir.r4.model.Group; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Task; -import org.springframework.beans.factory.InitializingBean; - -public class ExtractInputValues extends AbstractServiceDelegate implements InitializingBean -{ - public ExtractInputValues(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - - Stream<String> queries = getQueries(task); - List<Group> cohortDefinitions = getCohortDefinitions(queries); - execution.setVariable(BPMN_EXECUTION_VARIABLE_COHORTS, FhirResourcesListValues.create(cohortDefinitions)); - - boolean needsConsentCheck = getNeedsConsentCheck(task); - execution.setVariable(BPMN_EXECUTION_VARIABLE_NEEDS_CONSENT_CHECK, needsConsentCheck); - - boolean needsRecordLinkage = getNeedsRecordLinkageCheck(task); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_NEEDS_RECORD_LINKAGE, needsRecordLinkage); - - if (needsRecordLinkage) - { - BloomFilterConfig bloomFilterConfig = getBloomFilterConfig(task); - execution.setVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_BLOOM_FILTER_CONFIG, - BloomFilterConfigValues.create(bloomFilterConfig)); - } - } - - private Stream<String> getQueries(Task task) - { - return getTaskHelper().getInputParameterStringValues(task, CODESYSTEM_HIGHMED_QUERY_TYPE, - CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); - } - - private List<Group> getCohortDefinitions(Stream<String> queries) - { - return queries.map(q -> { - Group group = new Group(); - group.setIdElement(new IdType(UUID.randomUUID().toString())); - group.addExtension().setUrl(EXTENSION_HIGHMED_QUERY) - .setValue(new Expression().setLanguageElement(CODE_TYPE_AQL_QUERY).setExpression(q)); - return group; - }).collect(Collectors.toList()); - } - - private boolean getNeedsConsentCheck(Task task) - { - return getTaskHelper() - .getFirstInputParameterBooleanValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK).orElseThrow( - () -> new IllegalArgumentException( - "NeedsConsentCheck boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); - } - - private boolean getNeedsRecordLinkageCheck(Task task) - { - return getTaskHelper() - .getFirstInputParameterBooleanValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE).orElseThrow( - () -> new IllegalArgumentException( - "NeedsRecordLinkage boolean is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation")); - } - - private BloomFilterConfig getBloomFilterConfig(Task task) - { - return BloomFilterConfig.fromBytes(getTaskHelper() - .getFirstInputParameterByteValue(task, ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG).orElseThrow( - () -> new IllegalArgumentException( - "BloomFilterConfig byte[] is not set in task with id='" + task.getId() - + "', this error should " + "have been caught by resource validation"))); - } -} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java deleted file mode 100644 index da4623b06..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/service/StoreResult.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.EXTENSION_HIGHMED_GROUP_ID; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.ConstantsFeasibility; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResult; -import org.highmed.dsf.bpe.variables.FeasibilityQueryResults; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.Extension; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.InitializingBean; - -public class StoreResult extends AbstractServiceDelegate implements InitializingBean -{ - private static final Logger logger = LoggerFactory.getLogger(StoreResult.class); - - public StoreResult(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - FeasibilityQueryResults results = (FeasibilityQueryResults) execution - .getVariable(ConstantsFeasibility.BPMN_EXECUTION_VARIABLE_QUERY_RESULTS); - - addOutputs(task, results); - } - - private void addOutputs(Task task, FeasibilityQueryResults results) - { - results.getResults().forEach(result -> addOutput(task, result)); - } - - private void addOutput(Task task, FeasibilityQueryResult result) - { - if (result.isCohortSizeResult()) - { - Task.TaskOutputComponent output = getTaskHelper() - .createOutputUnsignedInt(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT, - result.getCohortSize()); - output.addExtension(createCohortIdExtension(result.getCohortId())); - task.addOutput(output); - } - else if (result.isIdResultSetUrlResult()) - { - Task.TaskOutputComponent output = getTaskHelper() - .createOutput(ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY, - ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_SINGLE_MEDIC_RESULT_REFERENCE, - new Reference(result.getResultSetUrl())); - output.addExtension(createCohortIdExtension(result.getCohortId())); - task.addOutput(output); - } - else - { - logger.warn("Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result - .getCohortId()); - throw new RuntimeException( - "Unexpected result (not a cohort-size or ResultSet URL result) for cohort with ID " + result - .getCohortId()); - } - } - - private Extension createCohortIdExtension(String cohortId) - { - return new Extension(EXTENSION_HIGHMED_GROUP_ID, new Reference(cohortId)); - } -} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java b/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java deleted file mode 100644 index c351806a0..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/java/org/highmed/dsf/bpe/spring/config/LocalServicesConfig.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.highmed.dsf.bpe.service.CheckQueries; -import org.highmed.dsf.bpe.service.CheckSingleMedicResults; -import org.highmed.dsf.bpe.service.ExecuteQueries; -import org.highmed.dsf.bpe.service.ExtractInputValues; -import org.highmed.dsf.bpe.service.FilterQueryResultsByConsent; -import org.highmed.dsf.bpe.service.GenerateBloomFilters; -import org.highmed.dsf.bpe.service.GenerateCountFromIds; -import org.highmed.dsf.bpe.service.ModifyQueries; -import org.highmed.dsf.bpe.service.StoreResult; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.group.GroupHelper; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.mpi.client.MasterPatientIndexClient; -import org.highmed.mpi.client.MasterPatientIndexClientFactory; -import org.highmed.openehr.client.OpenEhrClient; -import org.highmed.openehr.client.OpenEhrClientFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.env.Environment; - -import com.fasterxml.jackson.databind.ObjectMapper; - -@Configuration -public class LocalServicesConfig -{ - @Autowired - private FhirWebserviceClientProvider fhirClientProvider; - - @Autowired - private MasterPatientIndexClientFactory masterPatientIndexClientFactory; - - @Autowired - private OpenEhrClientFactory openEhrClientFactory; - - @Autowired - private OrganizationProvider organizationProvider; - - @Autowired - private TaskHelper taskHelper; - - @Autowired - private GroupHelper groupHelper; - - @Autowired - private ObjectMapper objectMapper; - - @Autowired - private Environment environment; - - @Value("${org.highmed.dsf.bpe.openehr.subject_external_id.path:/ehr_status/subject/external_ref/id/value}") - private String ehrIdColumnPath; - - @Bean - public ExtractInputValues extractInputValues() - { - return new ExtractInputValues(fhirClientProvider, taskHelper); - } - - @Bean - public StoreResult storeResult() - { - return new StoreResult(fhirClientProvider, taskHelper); - } - - @Bean - public CheckSingleMedicResults checkSingleMedicResults() - { - return new CheckSingleMedicResults(fhirClientProvider, taskHelper); - } - - @Bean - public ModifyQueries modifyQueries() - { - return new ModifyQueries(fhirClientProvider, taskHelper, ehrIdColumnPath); - } - - @Bean - public FilterQueryResultsByConsent filterQueryResultsByConsent() - { - return new FilterQueryResultsByConsent(fhirClientProvider, taskHelper); - } - - @Bean - public GenerateBloomFilters generateBloomFilters() - { - return new GenerateBloomFilters(fhirClientProvider, taskHelper, ehrIdColumnPath, masterPatientIndexClient(), - objectMapper, bouncyCastleProvider()); - } - - @Bean - public MasterPatientIndexClient masterPatientIndexClient() - { - return masterPatientIndexClientFactory.createClient(environment::getProperty); - } - - @Bean - public BouncyCastleProvider bouncyCastleProvider() - { - return new BouncyCastleProvider(); - } - - @Bean - public GenerateCountFromIds generateCountFromIds() - { - return new GenerateCountFromIds(fhirClientProvider, taskHelper); - } - - @Bean - public ExecuteQueries executeQueries() - { - return new ExecuteQueries(fhirClientProvider, openEhrClient(), taskHelper, organizationProvider); - } - - @Bean - public OpenEhrClient openEhrClient() - { - return openEhrClientFactory.createClient(environment::getProperty); - } - - @Bean - public CheckQueries checkQueries() - { - return new CheckQueries(fhirClientProvider, taskHelper, groupHelper); - } -} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition deleted file mode 100644 index 215b62c5b..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition +++ /dev/null @@ -1 +0,0 @@ -org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn deleted file mode 100755 index 6228d6d87..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/bpe/localServicesIntegration.bpmn +++ /dev/null @@ -1,287 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0drkcb5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="localServicesIntegration" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:serviceTask id="checkResults" name="check results" camunda:class="org.highmed.dsf.bpe.service.CheckSingleMedicResults"> - <bpmn:incoming>SequenceFlow_0q803rh</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_04ouilq</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:startEvent id="StartEvent" name="start"> - <bpmn:outgoing>Flow_1yjkp7k</bpmn:outgoing> - <bpmn:messageEventDefinition id="MessageEventDefinition_0sjtzj6" messageRef="Message_1yz2a31" /> - </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_1rmqv20" sourceRef="executeQueries" targetRef="ExclusiveGateway_0bq7zdz" /> - <bpmn:sequenceFlow id="SequenceFlow_04ouilq" sourceRef="checkResults" targetRef="storeResult" /> - <bpmn:exclusiveGateway id="ExclusiveGateway_1dln3in"> - <bpmn:incoming>SequenceFlow_07wtgee</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0zlq6j4</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0yqpkri</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0zlq6j4" name="else" sourceRef="ExclusiveGateway_1dln3in" targetRef="ExclusiveGateway_1r4c9fx"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsRecordLinkage == false && needsConsentCheck == false}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_0yqpkri" name="needs consent check and/or record linkage" sourceRef="ExclusiveGateway_1dln3in" targetRef="replaceCountpartWithIdSelection"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsRecordLinkage == true || needsConsentCheck == true}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:serviceTask id="replaceCountpartWithIdSelection" name="replace countpart with id selection" camunda:class="org.highmed.dsf.bpe.service.ModifyQueries"> - <bpmn:incoming>SequenceFlow_0yqpkri</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1u1p9j2</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:exclusiveGateway id="ExclusiveGateway_1r4c9fx"> - <bpmn:incoming>SequenceFlow_0zlq6j4</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1u1p9j2</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0bwn08k</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0bwn08k" sourceRef="ExclusiveGateway_1r4c9fx" targetRef="executeQueries" /> - <bpmn:sequenceFlow id="SequenceFlow_1u1p9j2" sourceRef="replaceCountpartWithIdSelection" targetRef="ExclusiveGateway_1r4c9fx" /> - <bpmn:exclusiveGateway id="ExclusiveGateway_0bq7zdz"> - <bpmn:incoming>SequenceFlow_1rmqv20</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_05r9whd</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0isxkuy</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_05r9whd" name="else" sourceRef="ExclusiveGateway_0bq7zdz" targetRef="ExclusiveGateway_0lecmy5"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsConsentCheck == false}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_0isxkuy" name="needs consent check" sourceRef="ExclusiveGateway_0bq7zdz" targetRef="filterByConsent"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsConsentCheck == true}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:serviceTask id="filterByConsent" name="filter by consent" camunda:class="org.highmed.dsf.bpe.service.FilterQueryResultsByConsent"> - <bpmn:incoming>SequenceFlow_0isxkuy</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0kzp6tl</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:exclusiveGateway id="ExclusiveGateway_0lecmy5"> - <bpmn:incoming>SequenceFlow_05r9whd</bpmn:incoming> - <bpmn:incoming>SequenceFlow_0kzp6tl</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1b4h5qz</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_1b4h5qz" sourceRef="ExclusiveGateway_0lecmy5" targetRef="ExclusiveGateway_0sff9xb" /> - <bpmn:sequenceFlow id="SequenceFlow_0kzp6tl" sourceRef="filterByConsent" targetRef="ExclusiveGateway_0lecmy5" /> - <bpmn:exclusiveGateway id="ExclusiveGateway_0sff9xb"> - <bpmn:incoming>SequenceFlow_1b4h5qz</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_17otl7p</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_1futlo2</bpmn:outgoing> - <bpmn:outgoing>SequenceFlow_0kfeekm</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_17otl7p" name="else" sourceRef="ExclusiveGateway_0sff9xb" targetRef="ExclusiveGateway_002t87f"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsRecordLinkage == false && needsConsentCheck == false}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_1futlo2" name="needs record linkage" sourceRef="ExclusiveGateway_0sff9xb" targetRef="generateBloomFilters"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsRecordLinkage == true}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:serviceTask id="generateBloomFilters" name="generate bloom filters" camunda:class="org.highmed.dsf.bpe.service.GenerateBloomFilters"> - <bpmn:incoming>SequenceFlow_1futlo2</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1ug2kru</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:exclusiveGateway id="ExclusiveGateway_002t87f"> - <bpmn:incoming>SequenceFlow_17otl7p</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1ug2kru</bpmn:incoming> - <bpmn:incoming>SequenceFlow_1kpvsx9</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0q803rh</bpmn:outgoing> - </bpmn:exclusiveGateway> - <bpmn:sequenceFlow id="SequenceFlow_0q803rh" sourceRef="ExclusiveGateway_002t87f" targetRef="checkResults" /> - <bpmn:sequenceFlow id="SequenceFlow_1ug2kru" sourceRef="generateBloomFilters" targetRef="ExclusiveGateway_002t87f" /> - <bpmn:sequenceFlow id="SequenceFlow_0kfeekm" name="needs consent check and no record linkage" sourceRef="ExclusiveGateway_0sff9xb" targetRef="countIds"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${needsConsentCheck == true && needsRecordLinkage == false}</bpmn:conditionExpression> - </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_1kpvsx9" sourceRef="countIds" targetRef="ExclusiveGateway_002t87f" /> - <bpmn:serviceTask id="countIds" name="count id's" camunda:class="org.highmed.dsf.bpe.service.GenerateCountFromIds"> - <bpmn:incoming>SequenceFlow_0kfeekm</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1kpvsx9</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="executeQueries" name="execute queries" camunda:class="org.highmed.dsf.bpe.service.ExecuteQueries"> - <bpmn:incoming>SequenceFlow_0bwn08k</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1rmqv20</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:endEvent id="EndEvent"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="messageName">resultSingleMedicFeasibilityMessage</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="processDefinitionKey">computeFeasibility</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-single-medic-result-feasibility</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>Flow_0m4rhl9</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="Flow_0m4rhl9" sourceRef="storeResult" targetRef="EndEvent" /> - <bpmn:sequenceFlow id="Flow_1yjkp7k" sourceRef="StartEvent" targetRef="extractInputValues" /> - <bpmn:sequenceFlow id="Flow_125i149" sourceRef="extractInputValues" targetRef="checkQueries" /> - <bpmn:serviceTask id="extractInputValues" name="extract input values" camunda:class="org.highmed.dsf.bpe.service.ExtractInputValues"> - <bpmn:incoming>Flow_1yjkp7k</bpmn:incoming> - <bpmn:outgoing>Flow_125i149</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="storeResult" name="store result" camunda:class="org.highmed.dsf.bpe.service.StoreResult"> - <bpmn:incoming>SequenceFlow_04ouilq</bpmn:incoming> - <bpmn:outgoing>Flow_0m4rhl9</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="checkQueries" name="check queries" camunda:class="org.highmed.dsf.bpe.service.CheckQueries"> - <bpmn:incoming>Flow_125i149</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_07wtgee</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_07wtgee" sourceRef="checkQueries" targetRef="ExclusiveGateway_1dln3in" /> - </bpmn:process> - <bpmn:message id="Message_1yz2a31" name="localServicesIntegrationMessage" /> - <bpmn:message id="Message_1dr71re" name="resultSingleMedicFeasibilityMessage" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="localServicesIntegration"> - <bpmndi:BPMNEdge id="Flow_125i149_di" bpmnElement="Flow_125i149"> - <di:waypoint x="400" y="272" /> - <di:waypoint x="499" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_1yjkp7k_di" bpmnElement="Flow_1yjkp7k"> - <di:waypoint x="208" y="272" /> - <di:waypoint x="300" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0m4rhl9_di" bpmnElement="Flow_0m4rhl9"> - <di:waypoint x="1960" y="272" /> - <di:waypoint x="2042" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1kpvsx9_di" bpmnElement="SequenceFlow_1kpvsx9"> - <di:waypoint x="1551" y="160" /> - <di:waypoint x="1551" y="247" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0kfeekm_di" bpmnElement="SequenceFlow_0kfeekm"> - <di:waypoint x="1398" y="247" /> - <di:waypoint x="1398" y="120" /> - <di:waypoint x="1501" y="120" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1405" y="125" width="72" height="40" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1ug2kru_di" bpmnElement="SequenceFlow_1ug2kru"> - <di:waypoint x="1551" y="375" /> - <di:waypoint x="1551" y="297" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0q803rh_di" bpmnElement="SequenceFlow_0q803rh"> - <di:waypoint x="1576" y="272" /> - <di:waypoint x="1660" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1futlo2_di" bpmnElement="SequenceFlow_1futlo2"> - <di:waypoint x="1398" y="297" /> - <di:waypoint x="1398" y="415" /> - <di:waypoint x="1501" y="415" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1405" y="380" width="65" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_17otl7p_di" bpmnElement="SequenceFlow_17otl7p"> - <di:waypoint x="1423" y="272" /> - <di:waypoint x="1526" y="272" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1425" y="254" width="21" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0kzp6tl_di" bpmnElement="SequenceFlow_0kzp6tl"> - <di:waypoint x="1264" y="375" /> - <di:waypoint x="1264" y="297" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1b4h5qz_di" bpmnElement="SequenceFlow_1b4h5qz"> - <di:waypoint x="1289" y="272" /> - <di:waypoint x="1373" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0isxkuy_di" bpmnElement="SequenceFlow_0isxkuy"> - <di:waypoint x="1113" y="297" /> - <di:waypoint x="1113" y="415" /> - <di:waypoint x="1214" y="415" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1123" y="383" width="72" height="27" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_05r9whd_di" bpmnElement="SequenceFlow_05r9whd"> - <di:waypoint x="1138" y="272" /> - <di:waypoint x="1239" y="272" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1142" y="255" width="21" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1u1p9j2_di" bpmnElement="SequenceFlow_1u1p9j2"> - <di:waypoint x="848" y="181" /> - <di:waypoint x="848" y="247" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0bwn08k_di" bpmnElement="SequenceFlow_0bwn08k"> - <di:waypoint x="873" y="272" /> - <di:waypoint x="936" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0yqpkri_di" bpmnElement="SequenceFlow_0yqpkri"> - <di:waypoint x="692" y="247" /> - <di:waypoint x="692" y="141" /> - <di:waypoint x="798" y="141" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="703" y="146" width="72" height="40" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0zlq6j4_di" bpmnElement="SequenceFlow_0zlq6j4"> - <di:waypoint x="717" y="272" /> - <di:waypoint x="823" y="272" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="722" y="254" width="21" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_07wtgee_di" bpmnElement="SequenceFlow_07wtgee"> - <di:waypoint x="599" y="272" /> - <di:waypoint x="667" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_04ouilq_di" bpmnElement="SequenceFlow_04ouilq"> - <di:waypoint x="1760" y="272" /> - <di:waypoint x="1860" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1rmqv20_di" bpmnElement="SequenceFlow_1rmqv20"> - <di:waypoint x="1036" y="272" /> - <di:waypoint x="1088" y="272" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0t2s0v7_di" bpmnElement="checkResults"> - <dc:Bounds x="1660" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_1fzso6r_di" bpmnElement="StartEvent"> - <dc:Bounds x="172" y="254" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="180" y="297" width="22" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_1pt9xhp_di" bpmnElement="checkQueries"> - <dc:Bounds x="499" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_1dln3in_di" bpmnElement="ExclusiveGateway_1dln3in" isMarkerVisible="true"> - <dc:Bounds x="667" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_02nwn9u_di" bpmnElement="replaceCountpartWithIdSelection"> - <dc:Bounds x="798" y="101" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_1r4c9fx_di" bpmnElement="ExclusiveGateway_1r4c9fx" isMarkerVisible="true"> - <dc:Bounds x="823" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_0bq7zdz_di" bpmnElement="ExclusiveGateway_0bq7zdz" isMarkerVisible="true"> - <dc:Bounds x="1088" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0l3b9as_di" bpmnElement="filterByConsent"> - <dc:Bounds x="1214" y="375" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_0lecmy5_di" bpmnElement="ExclusiveGateway_0lecmy5" isMarkerVisible="true"> - <dc:Bounds x="1239" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_0sff9xb_di" bpmnElement="ExclusiveGateway_0sff9xb" isMarkerVisible="true"> - <dc:Bounds x="1373" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0akkess_di" bpmnElement="generateBloomFilters"> - <dc:Bounds x="1501" y="375" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_002t87f_di" bpmnElement="ExclusiveGateway_002t87f" isMarkerVisible="true"> - <dc:Bounds x="1526" y="247" width="50" height="50" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_17kpyle_di" bpmnElement="countIds"> - <dc:Bounds x="1501" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0u5pb4i_di" bpmnElement="executeQueries"> - <dc:Bounds x="936" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Event_0jhwlfj_di" bpmnElement="EndEvent"> - <dc:Bounds x="2042" y="254" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Activity_1py5pie_di" bpmnElement="extractInputValues"> - <dc:Bounds x="300" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="Activity_1y9z4ut_di" bpmnElement="storeResult"> - <dc:Bounds x="1860" y="232" width="100" height="80" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml deleted file mode 100644 index 85ce0a72c..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/ActivityDefinition/highmed-localServicesIntegration.xml +++ /dev/null @@ -1,62 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="localServicesIntegrationMessage"/> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="LOCAL"/> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type"/> - <code value="MeDIC"/> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type"/> - <code value="MeDIC"/> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical - value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration"/> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/localServicesIntegration"/> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="localServicesIntegration"/> - <title value="Local services integration"/> - <subtitle value="Service integration process"/> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false"/> - <date value="2020-11-23"/> - <publisher value="HiGHmed"/> - <contact> - <name value="HiGHmed"/> - <telecom> - <system value="email"/> - <value value="pmo@highmed.org"/> - </telecom> - </contact> - <description - value="Process to test the integration of local external services like the MPI, the openEHR repository or the PEP."/> - <kind value="Task"/> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml b/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml deleted file mode 100644 index 89fae40e2..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/main/resources/fhir/StructureDefinition/highmed-task-local-services-integration.xml +++ /dev/null @@ -1,339 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-local-services-integration" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskLocalServicesIntegration" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/localServicesIntegration/${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" /> - <min value="4" /> - </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="localServicesIntegrationMessage" /> - </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" /> - <min value="0" /> - </element> - <element id="Task.input:correlation-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="correlation-key" /> - <min value="0" /> - </element> - <element id="Task.input:needs-record-linkage"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="needs-record-linkage" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-record-linkage.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:needs-record-linkage.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-record-linkage.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:needs-record-linkage.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="needs-record-linkage" /> - </element> - <element id="Task.input:needs-record-linkage.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="boolean" /> - </type> - </element> - <element id="Task.input:needs-consent-check"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="needs-consent-check" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-consent-check.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:needs-consent-check.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:needs-consent-check.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:needs-consent-check.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="needs-consent-check" /> - </element> - <element id="Task.input:needs-consent-check.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="boolean" /> - </type> - </element> - <element id="Task.input:bloom-filter-configuration"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="bloom-filter-configuration" /> - <min value="0" /> - <max value="1" /> - </element> - <element id="Task.input:bloom-filter-configuration.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.input:bloom-filter-configuration.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:bloom-filter-configuration.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.input:bloom-filter-configuration.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="bloom-filter-configuration" /> - </element> - <element id="Task.input:bloom-filter-configuration.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="base64Binary" /> - </type> - </element> - <element id="Task.input:query"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="query" /> - <min value="1" /> - </element> - <element id="Task.input:query.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/query-type" /> - </binding> - </element> - <element id="Task.input:query.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:query.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/query-type" /> - </element> - <element id="Task.input:query.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="string" /> - </type> - </element> - <element id="Task.output:single-medic-result"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.output" /> - <sliceName value="single-medic-result" /> - </element> - <element id="Task.output:single-medic-result.extension"> - <path value="Task.output.extension" /> - <slicing> - <discriminator> - <type value="value" /> - <path value="url" /> - </discriminator> - <rules value="open" /> - </slicing> - </element> - <element id="Task.output:single-medic-result.extension:group-id"> - <path value="Task.output.extension" /> - <sliceName value="group-id" /> - <min value="1" /> - <type> - <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> - </type> - </element> - <element id="Task.output:single-medic-result.type"> - <path value="Task.output.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskOutputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.output:single-medic-result.type.coding"> - <path value="Task.output.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.output:single-medic-result.type.coding.system"> - <path value="Task.output.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.output:single-medic-result.type.coding.code"> - <path value="Task.output.type.coding.code" /> - <min value="1" /> - <fixedCode value="single-medic-result" /> - </element> - <element id="Task.output:single-medic-result.value[x]"> - <path value="Task.output.value[x]" /> - <type> - <code value="unsignedInt" /> - </type> - </element> - <element id="Task.output:single-medic-result-reference"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.output" /> - <sliceName value="single-medic-result-reference" /> - </element> - <element id="Task.output:single-medic-result-reference.extension"> - <path value="Task.output.extension" /> - <slicing> - <discriminator> - <type value="value" /> - <path value="url" /> - </discriminator> - <rules value="open" /> - </slicing> - </element> - <element id="Task.output:single-medic-result-reference.extension:group-id"> - <path value="Task.output.extension" /> - <sliceName value="group-id" /> - <min value="1" /> - <type> - <code value="Extension" /> - <profile value="http://highmed.org/fhir/StructureDefinition/extension-group-id" /> - </type> - </element> - <element id="Task.output:single-medic-result-reference.type"> - <path value="Task.output.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskOutputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/feasibility" /> - </binding> - </element> - <element id="Task.output:single-medic-result-reference.type.coding"> - <path value="Task.output.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.output:single-medic-result-reference.type.coding.system"> - <path value="Task.output.type.coding.system" /> - <min value="0" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/feasibility" /> - </element> - <element id="Task.output:single-medic-result-reference.type.coding.code"> - <path value="Task.output.type.coding.code" /> - <min value="0" /> - <fixedCode value="single-medic-result-reference" /> - </element> - <element id="Task.output:single-medic-result-reference.value[x]"> - <path value="Task.output.value[x]" /> - <type> - <code value="Reference" /> - <targetProfile value="http://hl7.org/fhir/StructureDefinition/Binary" /> - </type> - </element> - <element id="Task.output:single-medic-result-reference.value[x].reference"> - <path value="Task.output.value[x].reference" /> - <min value="0" /> - </element> - <element id="Task.output:single-medic-result-reference.value[x].identifier"> - <path value="Task.output.value[x].identifier" /> - <max value="0" /> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java deleted file mode 100644 index c7cee546f..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/bpe/start/LocalServicesMedic1ExampleStarter.java +++ /dev/null @@ -1,96 +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.CODESYSTEM_HIGHMED_QUERY_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES; -import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; - -import java.util.Date; -import java.util.Random; - -import javax.crypto.KeyGenerator; - -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.highmed.dsf.bpe.variables.BloomFilterConfig; -import org.hl7.fhir.r4.model.Base64BinaryType; -import org.hl7.fhir.r4.model.BooleanType; -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; - -public class LocalServicesMedic1ExampleStarter -{ - private static boolean NEEDS_CONSENT_CHECK = true; - private static boolean NEEDS_RECORD_LINKAGE = true; - - // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate - // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 - // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate - // password - public static void main(String[] args) throws Exception - { - Task task = createStartResource(); - ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL).startWith(task); - } - - private static Task createStartResource() - { - Task task = new Task(); - - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_LOCAL_SERVICES); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(Task.TaskStatus.REQUESTED); - task.setIntent(Task.TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE).setCode(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); - task.addInput().setValue(new BooleanType(NEEDS_CONSENT_CHECK)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); - task.addInput().setValue(new BooleanType(NEEDS_RECORD_LINKAGE)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - - if (NEEDS_RECORD_LINKAGE) - { - try - { - BouncyCastleProvider bouncyCastleProvider = new BouncyCastleProvider(); - BloomFilterConfig bloomFilterConfig = new BloomFilterConfig(new Random().nextLong(), - KeyGenerator.getInstance("HmacSHA256", bouncyCastleProvider).generateKey(), - KeyGenerator.getInstance("HmacSHA3-256", bouncyCastleProvider).generateKey()); - - task.addInput().setValue(new Base64BinaryType(bloomFilterConfig.toBytes())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); - } - catch (Exception exception) - { - throw new RuntimeException("Could not create BloomFilterConfig", exception); - } - } - - return task; - } -} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java deleted file mode 100644 index 364a3b7ce..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ /dev/null @@ -1,101 +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.CODESYSTEM_HIGHMED_QUERY_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK; -import static org.highmed.dsf.bpe.ConstantsFeasibility.CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE; -import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES; -import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsLocalServices.PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.LocalServicesProcessPluginDefinition.VERSION; -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.Base64; -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.Base64BinaryType; -import org.hl7.fhir.r4.model.BooleanType; -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; -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, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-group-0.4.0.xml", - "highmed-extension-group-id-0.4.0.xml", "highmed-extension-query-0.4.0.xml", - "highmed-task-local-services-integration.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-feasibility.xml", "highmed-query-type-0.4.0.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-feasibility.xml", "highmed-query-type-0.4.0.xml")); - - private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), - validationRule.getValidationSupport()); - - @Test - public void testTaskLocalServiceIntegrationValid() throws Exception - { - Task task = createValidTaskLocalServiceIntegration(); - - 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 createValidTaskLocalServiceIntegration() - { - Task task = new Task(); - - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_LOCAL_SERVICES); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(Task.TaskStatus.REQUESTED); - task.setIntent(Task.TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_LOCAL_SERVICES_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - task.addInput().setValue(new StringType("SELECT COUNT(e) FROM EHR e;")).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_QUERY_TYPE).setCode(CODESYSTEM_HIGMED_QUERY_TYPE_VALUE_AQL); - task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_CONSENT_CHECK); - task.addInput().setValue(new BooleanType(true)).getType().addCoding().setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_NEEDS_RECORD_LINKAGE); - - byte[] bloomFilterConfig = Base64.getDecoder().decode( - "CIw/x19d3Oj+GLOKgYAX5KrFAl11q6qMi0qkDiyUOCvMXuF2KffVvSnjUjkTvqh4z8Xs+MuQdK6FqTedM5FY9t4qm+k92A+P"); - - task.addInput().setValue(new Base64BinaryType(bloomFilterConfig)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_FEASIBILITY) - .setCode(CODESYSTEM_HIGHMED_FEASIBILITY_VALUE_BLOOM_FILTER_CONFIG); - - return task; - } -} diff --git a/dsf-bpe/dsf-bpe-process-local-services/src/test/resources/log4j2.xml b/dsf-bpe/dsf-bpe-process-local-services/src/test/resources/log4j2.xml deleted file mode 100644 index f1afe81dc..000000000 --- a/dsf-bpe/dsf-bpe-process-local-services/src/test/resources/log4j2.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?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> - <!-- <RollingFile name="FILE" fileName="log/adt_db.log" - filePattern="log/adt_db_%d{MM-dd-yyyy}_%i.log.gz" - ignoreExceptions="false"> - <PatternLayout> - <Pattern>%d [%t] %-5p %c - %m%n</Pattern> - </PatternLayout> - <Policies> - <OnStartupTriggeringPolicy /> - <TimeBasedTriggeringPolicy /> - </Policies> - </RollingFile> --> - - <!-- <SMTP name="MAIL" subject="Production RWH LAB Gateway Error" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="50"> - </SMTP> - <SMTP name="MAIL_CERTIFICATE" subject="Production RWH LAB Gateway Certificate Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> - <SMTP name="MAIL_HL7" subject="Production RWH ADT Gateway HL7 Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> --> - </Appenders> - - <Loggers> - <Logger name="de.rwh" level="TRACE"/> - <Logger name="org.highmed" 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"/> - - <!-- <Logger name="certificate-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_CERTIFICATE" /> - </Logger> - <Logger name="async-message-handler-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_HL7" /> - </Logger> --> - - <Root level="WARN"> - <AppenderRef ref="CONSOLE"/> - <!-- <AppenderRef ref="FILE" /> --> - <!-- <AppenderRef ref="MAIL" /> --> - </Root> - </Loggers> -</Configuration> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/pom.xml b/dsf-bpe/dsf-bpe-process-ping/pom.xml deleted file mode 100755 index 84b576124..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/pom.xml +++ /dev/null @@ -1,176 +0,0 @@ -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <artifactId>dsf-bpe-process-ping</artifactId> - - <parent> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> - </parent> - - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>de.hs-heilbronn.mi</groupId> - <artifactId>log4j2-utils</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-fhir-validation</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>test</scope> - <type>test-jar</type> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-process-plugin-to-docker-test-setup</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clean-plugin</artifactId> - <configuration> - <filesets> - <fileset> - <directory>../../dsf-docker-test-setup/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - </filesets> - </configuration> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java deleted file mode 100644 index f3c80bb2e..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/ConstantsPing.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.highmed.dsf.bpe; - -import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; -import static org.highmed.dsf.bpe.PingProcessPluginDefinition.VERSION; - -public interface ConstantsPing -{ - String PROFILE_HIGHMED_TASK_START_PING = "http://highmed.org/fhir/StructureDefinition/task-start-ping-process"; - String PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME = "startPingProcessMessage"; - - String PROFILE_HIGHMED_TASK_PING = "http://highmed.org/fhir/StructureDefinition/task-ping"; - String PROFILE_HIGHMED_TASK_PING_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "ping/"; - String PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_PING_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_PING_MESSAGE_NAME = "pingMessage"; - - String PROFILE_HIGHMED_TASK_PONG_TASK = "http://highmed.org/fhir/StructureDefinition/task-pong"; - String PROFILE_HIGHMED_TASK_PONG_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "pong/"; - String PROFILE_HIGHMED_TASK_PONG_PROCESS_URI_AND_LATEST_VERSION = PROFILE_HIGHMED_TASK_PONG_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_PONG_MESSAGE_NAME = "pongMessage"; -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java deleted file mode 100644 index a0ebf7197..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/PingProcessPluginDefinition.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.highmed.dsf.bpe; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -import org.highmed.dsf.bpe.spring.config.PingConfig; -import org.highmed.dsf.fhir.resources.AbstractResource; -import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; -import org.highmed.dsf.fhir.resources.ResourceProvider; -import org.highmed.dsf.fhir.resources.StructureDefinitionResource; - -import ca.uhn.fhir.context.FhirContext; - -public class PingProcessPluginDefinition implements ProcessPluginDefinition -{ - public static final String VERSION = "0.4.0"; - - @Override - public String getName() - { - return "dsf-bpe-process-ping"; - } - - @Override - public String getVersion() - { - return VERSION; - } - - @Override - public Stream<String> getBpmnFiles() - { - return Stream.of("bpe/ping.bpmn", "bpe/pong.bpmn"); - } - - @Override - public Stream<Class<?>> getSpringConfigClasses() - { - return Stream.of(PingConfig.class); - } - - @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) - { - var aPing = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-ping.xml"); - var aPong = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-pong.xml"); - var tPing = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-pong.xml"); - var tStartPing = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-start-ping-process.xml"); - var tPong = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-ping.xml"); - - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map - .of("ping/" + VERSION, Arrays.asList(aPing, tPong, tStartPing), "pong/" + VERSION, - Arrays.asList(aPong, tPing)); - - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPing.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPing.java deleted file mode 100755 index 13205a496..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPing.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.highmed.dsf.bpe.message; - -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; -import org.highmed.dsf.fhir.task.TaskHelper; - -import ca.uhn.fhir.context.FhirContext; - -public class SendPing extends AbstractTaskMessageSend -{ - public SendPing(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) - { - super(clientProvider, taskHelper, organizationProvider, fhirContext); - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPong.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPong.java deleted file mode 100755 index 1d98a3c5e..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/message/SendPong.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.highmed.dsf.bpe.message; - -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; -import org.highmed.dsf.fhir.task.TaskHelper; - -import ca.uhn.fhir.context.FhirContext; - -public class SendPong extends AbstractTaskMessageSend -{ - public SendPong(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) - { - super(clientProvider, taskHelper, organizationProvider, fhirContext); - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPing.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPing.java deleted file mode 100755 index 41de14348..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPing.java +++ /dev/null @@ -1,27 +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.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 LogPing extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(LogPing.class); - - public LogPing(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - public void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - - logger.info("PING from {}", task.getRequester().getIdentifier().getValue()); - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPong.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPong.java deleted file mode 100755 index 97a79692b..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/LogPong.java +++ /dev/null @@ -1,27 +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.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 LogPong extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(LogPong.class); - - public LogPong(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - public void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - - logger.info("PONG from {}", task.getRequester().getIdentifier().getValue()); - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java deleted file mode 100755 index bb91420f9..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPingTargets.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS; - -import java.util.List; -import java.util.Objects; -import java.util.UUID; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.Target; -import org.highmed.dsf.fhir.variables.Targets; -import org.highmed.dsf.fhir.variables.TargetsValues; -import org.springframework.beans.factory.InitializingBean; - -public class SelectPingTargets extends AbstractServiceDelegate implements InitializingBean -{ - private final OrganizationProvider organizationProvider; - - public SelectPingTargets(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) - { - super(clientProvider, taskHelper); - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - public void doExecute(DelegateExecution execution) throws Exception - { - List<Target> targets = organizationProvider.getRemoteIdentifiers().stream().map(identifier -> Target - .createBiDirectionalTarget(identifier.getValue(), UUID.randomUUID().toString())) - .collect(Collectors.toList()); - - execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java deleted file mode 100755 index f0d0cb0ad..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/service/SelectPongTarget.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGET; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.Target; -import org.highmed.dsf.fhir.variables.TargetValues; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Task; -import org.springframework.beans.factory.InitializingBean; - -public class SelectPongTarget extends AbstractServiceDelegate implements InitializingBean -{ - public SelectPongTarget(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - } - - @Override - public void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - - String correlationKey = getTaskHelper().getFirstInputParameterStringValue(task, CODESYSTEM_HIGHMED_BPMN, - CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY).get(); - Identifier targetOrganizationIdentifier = task.getRequester().getIdentifier(); - - execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGET, TargetValues - .create(Target.createBiDirectionalTarget(targetOrganizationIdentifier.getValue(), correlationKey))); - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java b/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java deleted file mode 100755 index b1dd4a666..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/java/org/highmed/dsf/bpe/spring/config/PingConfig.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.highmed.dsf.bpe.message.SendPing; -import org.highmed.dsf.bpe.message.SendPong; -import org.highmed.dsf.bpe.service.LogPing; -import org.highmed.dsf.bpe.service.LogPong; -import org.highmed.dsf.bpe.service.SelectPingTargets; -import org.highmed.dsf.bpe.service.SelectPongTarget; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import ca.uhn.fhir.context.FhirContext; - -@Configuration -public class PingConfig -{ - @Autowired - private FhirWebserviceClientProvider clientProvider; - - @Autowired - private OrganizationProvider organizationProvider; - - @Autowired - private TaskHelper taskHelper; - - @Autowired - private FhirContext fhirContext; - - @Bean - public SendPing sendPing() - { - return new SendPing(clientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Bean - public SendPong sendPong() - { - return new SendPong(clientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Bean - public LogPing logPing() - { - return new LogPing(clientProvider, taskHelper); - } - - @Bean - public LogPong logPong() - { - return new LogPong(clientProvider, taskHelper); - } - - @Bean - public SelectPingTargets selectPingTargets() - { - return new SelectPingTargets(clientProvider, taskHelper, organizationProvider); - } - - @Bean - public SelectPongTarget selectPongTarget() - { - return new SelectPongTarget(clientProvider, taskHelper); - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition deleted file mode 100644 index a74d5aa92..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition +++ /dev/null @@ -1 +0,0 @@ -org.highmed.dsf.bpe.PingProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn deleted file mode 100755 index 6bf868a04..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/ping.bpmn +++ /dev/null @@ -1,137 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0azvmx1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="ping" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:sequenceFlow id="SequenceFlow_0k1j79c" sourceRef="StartEvent_1" targetRef="selectTargets" /> - <bpmn:sequenceFlow id="SequenceFlow_05ia6lz" sourceRef="selectTargets" targetRef="sendPing" /> - <bpmn:serviceTask id="selectTargets" name="selectTargets" camunda:class="org.highmed.dsf.bpe.service.SelectPingTargets"> - <bpmn:incoming>SequenceFlow_0k1j79c</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_05ia6lz</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sendTask id="sendPing" name="sendPing" camunda:class="org.highmed.dsf.bpe.message.SendPing"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">pong</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">pingMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-ping</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_05ia6lz</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1vng5zz</bpmn:outgoing> - <bpmn:multiInstanceLoopCharacteristics camunda:collection="${targets.entries}" camunda:elementVariable="target" /> - </bpmn:sendTask> - <bpmn:subProcess id="SubProcess_0szmntn"> - <bpmn:incoming>SequenceFlow_1vng5zz</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_10d3jfk</bpmn:outgoing> - <bpmn:multiInstanceLoopCharacteristics camunda:collection="${targets.entries}" camunda:elementVariable="target" /> - <bpmn:startEvent id="StartEvent_18et3pb"> - <bpmn:outgoing>SequenceFlow_1jv4kfm</bpmn:outgoing> - </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_1jv4kfm" sourceRef="StartEvent_18et3pb" targetRef="receivePong" /> - <bpmn:endEvent id="EndEvent_1yf8pjt"> - <bpmn:incoming>SequenceFlow_0vxiwg9</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0vxiwg9" sourceRef="logPong" targetRef="EndEvent_1yf8pjt" /> - <bpmn:serviceTask id="logPong" name="logPong" camunda:class="org.highmed.dsf.bpe.service.LogPong"> - <bpmn:incoming>SequenceFlow_0r89tc0</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0vxiwg9</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:receiveTask id="receivePong" name="receivePong" messageRef="Message_10o3b8y"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="correlationKey">${target.correlationKey}</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_1jv4kfm</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0r89tc0</bpmn:outgoing> - </bpmn:receiveTask> - <bpmn:sequenceFlow id="SequenceFlow_0r89tc0" sourceRef="receivePong" targetRef="logPong" /> - </bpmn:subProcess> - <bpmn:boundaryEvent id="BoundaryEvent_0s1l6j2" attachedToRef="SubProcess_0szmntn"> - <bpmn:outgoing>SequenceFlow_01v9yzp</bpmn:outgoing> - <bpmn:timerEventDefinition> - <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT5M</bpmn:timeDuration> - </bpmn:timerEventDefinition> - </bpmn:boundaryEvent> - <bpmn:endEvent id="EndEvent_1rdxonv"> - <bpmn:incoming>SequenceFlow_10d3jfk</bpmn:incoming> - <bpmn:incoming>SequenceFlow_01v9yzp</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_10d3jfk" sourceRef="SubProcess_0szmntn" targetRef="EndEvent_1rdxonv" /> - <bpmn:sequenceFlow id="SequenceFlow_01v9yzp" sourceRef="BoundaryEvent_0s1l6j2" targetRef="EndEvent_1rdxonv" /> - <bpmn:sequenceFlow id="SequenceFlow_1vng5zz" sourceRef="sendPing" targetRef="SubProcess_0szmntn" /> - <bpmn:startEvent id="StartEvent_1"> - <bpmn:outgoing>SequenceFlow_0k1j79c</bpmn:outgoing> - <bpmn:messageEventDefinition messageRef="Message_1pklz6t" /> - </bpmn:startEvent> - </bpmn:process> - <bpmn:message id="Message_10o3b8y" name="pongMessage" /> - <bpmn:message id="Message_1pklz6t" name="startPingProcessMessage" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ping"> - <bpmndi:BPMNEdge id="SequenceFlow_1vng5zz_di" bpmnElement="SequenceFlow_1vng5zz"> - <di:waypoint x="530" y="120" /> - <di:waypoint x="606" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_01v9yzp_di" bpmnElement="SequenceFlow_01v9yzp"> - <di:waypoint x="1082" y="180" /> - <di:waypoint x="1172" y="180" /> - <di:waypoint x="1172" y="138" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_10d3jfk_di" bpmnElement="SequenceFlow_10d3jfk"> - <di:waypoint x="1064" y="120" /> - <di:waypoint x="1154" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_05ia6lz_di" bpmnElement="SequenceFlow_05ia6lz"> - <di:waypoint x="359" y="120" /> - <di:waypoint x="430" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0k1j79c_di" bpmnElement="SequenceFlow_0k1j79c"> - <di:waypoint x="209" y="120" /> - <di:waypoint x="259" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1cxtndb_di" bpmnElement="selectTargets"> - <dc:Bounds x="259" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="SendTask_01t32b2_di" bpmnElement="sendPing"> - <dc:Bounds x="430" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="SubProcess_0szmntn_di" bpmnElement="SubProcess_0szmntn" isExpanded="true"> - <dc:Bounds x="606" y="60" width="458" height="120" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0r89tc0_di" bpmnElement="SequenceFlow_0r89tc0"> - <di:waypoint x="808" y="120" /> - <di:waypoint x="858" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0vxiwg9_di" bpmnElement="SequenceFlow_0vxiwg9"> - <di:waypoint x="958" y="120" /> - <di:waypoint x="1008" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1jv4kfm_di" bpmnElement="SequenceFlow_1jv4kfm"> - <di:waypoint x="662" y="120" /> - <di:waypoint x="708" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="StartEvent_18et3pb_di" bpmnElement="StartEvent_18et3pb"> - <dc:Bounds x="626" y="102" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_1yf8pjt_di" bpmnElement="EndEvent_1yf8pjt"> - <dc:Bounds x="1008" y="102" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_1tf139x_di" bpmnElement="logPong"> - <dc:Bounds x="858" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ReceiveTask_1n4t6gv_di" bpmnElement="receivePong"> - <dc:Bounds x="708" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_1rdxonv_di" bpmnElement="EndEvent_1rdxonv"> - <dc:Bounds x="1154" y="102" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_1dlqln5_di" bpmnElement="StartEvent_1"> - <dc:Bounds x="173" y="102" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="BoundaryEvent_0nix4ox_di" bpmnElement="BoundaryEvent_0s1l6j2"> - <dc:Bounds x="1046" y="162" width="36" height="36" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn deleted file mode 100755 index 4d207a6a5..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/bpe/pong.bpmn +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_15v05m6" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0"> - <bpmn:process id="pong" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:startEvent id="StartEvent_1"> - <bpmn:outgoing>SequenceFlow_07w11cw</bpmn:outgoing> - <bpmn:messageEventDefinition messageRef="Message_0u91abp" /> - </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_07w11cw" sourceRef="StartEvent_1" targetRef="logPing" /> - <bpmn:endEvent id="EndEvent_1ivxrjg"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="messageName">pongMessage</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="processDefinitionKey">ping</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-pong</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_1ism9wt</bpmn:incoming> - <bpmn:messageEventDefinition messageRef="Message_1h0kvyq" camunda:class="org.highmed.dsf.bpe.message.SendPong" /> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_09i9zb8" sourceRef="logPing" targetRef="selectTarget" /> - <bpmn:serviceTask id="logPing" name="logPing" camunda:class="org.highmed.dsf.bpe.service.LogPing"> - <bpmn:incoming>SequenceFlow_07w11cw</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_09i9zb8</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:serviceTask id="selectTarget" name="selectTarget" camunda:class="org.highmed.dsf.bpe.service.SelectPongTarget"> - <bpmn:incoming>SequenceFlow_09i9zb8</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1ism9wt</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_1ism9wt" sourceRef="selectTarget" targetRef="EndEvent_1ivxrjg" /> - </bpmn:process> - <bpmn:message id="Message_0u91abp" name="pingMessage" /> - <bpmn:message id="Message_1h0kvyq" name="pong" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="pong"> - <bpmndi:BPMNShape id="StartEvent_1qh431z_di" bpmnElement="StartEvent_1"> - <dc:Bounds x="173" y="102" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_07w11cw_di" bpmnElement="SequenceFlow_07w11cw"> - <di:waypoint x="209" y="120" /> - <di:waypoint x="262" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_108jj6g_di" bpmnElement="EndEvent_1ivxrjg"> - <dc:Bounds x="580" y="102" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_09i9zb8_di" bpmnElement="SequenceFlow_09i9zb8"> - <di:waypoint x="362" y="120" /> - <di:waypoint x="428" y="120" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1uea92o_di" bpmnElement="logPing"> - <dc:Bounds x="262" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0ko681m_di" bpmnElement="selectTarget"> - <dc:Bounds x="428" y="80" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1ism9wt_di" bpmnElement="SequenceFlow_1ism9wt"> - <di:waypoint x="528" y="120" /> - <di:waypoint x="580" y="120" /> - </bpmndi:BPMNEdge> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml deleted file mode 100644 index a2f36cd07..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-ping.xml +++ /dev/null @@ -1,116 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="startPingProcessMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process" /> - </extension> - </extension> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="pongMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-pong" /> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/ping" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="ping" /> - <title value="PING process" /> - <subtitle value="Communication Testing Process" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <publisher value="HiGHmed" /> - <contact> - <name value="HiGHmed" /> - <telecom> - <system value="email" /> - <value value="pmo@highmed.org" /> - </telecom> - </contact> - <description value="Process to send PING messages to remote Organizations and to receive corresponding PONG message" /> - <kind value="Task" /> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml deleted file mode 100644 index 77c5cc099..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/ActivityDefinition/highmed-pong.xml +++ /dev/null @@ -1,72 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="pingMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-ping" /> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/pong" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="pong" /> - <title value="PONG process" /> - <subtitle value="Communication Testing Process" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <publisher value="HiGHmed" /> - <contact> - <name value="HiGHmed" /> - <telecom> - <system value="email" /> - <value value="pmo@highmed.org" /> - </telecom> - </contact> - <description value="Process startet by PING messages and to send corresponding PONG messages back remote Organizations" /> - <kind value="Task" /> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml deleted file mode 100644 index 9e4c3db4d..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-ping.xml +++ /dev/null @@ -1,63 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-ping" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskPing" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/pong/${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" /> - <min value="3" /> - <max value="3" /> - </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="pingMessage" /> - </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" /> - <min value="1" /> - </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" /> - <min value="1" /> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml deleted file mode 100644 index 435d27165..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-pong.xml +++ /dev/null @@ -1,63 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-pong" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskPong" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/ping/${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" /> - <min value="3" /> - <max value="3" /> - </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="pongMessage" /> - </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" /> - <min value="1" /> - </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" /> - <min value="1" /> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml b/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml deleted file mode 100644 index 2d470832d..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/main/resources/fhir/StructureDefinition/highmed-task-start-ping-process.xml +++ /dev/null @@ -1,62 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-start-ping-process" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskStartProcess" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/ping/${version}" /> - </element> - <element id="Task.input"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <max value="1" /> - </element> - <element id="Task.input:message-name"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="message-name" /> - </element> - <element id="Task.input:message-name.value[x]"> - <path value="Task.input.value[x]" /> - <fixedString value="startPingProcessMessage" /> - </element> - <element id="Task.input:business-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="business-key" /> - <max value="0" /> - </element> - <element id="Task.input:correlation-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="correlation-key" /> - <max value="0" /> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java deleted file mode 100644 index a782ab525..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/bpe/start/Ping3MedicFromTtpExampleStarter.java +++ /dev/null @@ -1,52 +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.ConstantsPing.PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; - -import java.util.Date; - -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.TaskIntent; -import org.hl7.fhir.r4.model.Task.TaskStatus; - -public class Ping3MedicFromTtpExampleStarter -{ - // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate - // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 - // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate - // password - public static void main(String[] args) throws Exception - { - Task task = createStartResource(); - ExampleStarter.forServer(args, TTP_FHIR_BASE_URL).startWith(task); - } - - private static Task createStartResource() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_START_PING); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - return task; - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java deleted file mode 100644 index 04b3a75b3..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/java/org/highmed/dsf/fhir/profiles/TaskProfileTest.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.highmed.dsf.fhir.profiles; - -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PING; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PONG_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PONG_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_PONG_TASK; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING; -import static org.highmed.dsf.bpe.ConstantsPing.PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME; -import static org.highmed.dsf.bpe.PingProcessPluginDefinition.VERSION; -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.Date; -import java.util.UUID; - -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, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-start-ping-process.xml", "highmed-task-ping.xml", - "highmed-task-pong.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml")); - - private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), - validationRule.getValidationSupport()); - - @Test - public void testTaskStartPingProcessProfileValid() throws Exception - { - Task task = createValidTaskStartPingProcess(); - - 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 testTaskStartPingProcessProfileNotValid1() throws Exception - { - Task task = createValidTaskStartPingProcess(); - task.setInstantiatesUri("http://highmed.org/bpe/Process/ping/0.1.0"); // not valid - - ValidationResult result = resourceValidator.validate(task); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - } - - @Test - public void testTaskStartPingProcessProfileNotValid2() throws Exception - { - Task task = createValidTaskStartPingProcess(); - task.setIntent(TaskIntent.FILLERORDER); - - ValidationResult result = resourceValidator.validate(task); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - } - - @Test - public void testTaskStartPingProcessProfileNotValid3() throws Exception - { - Task task = createValidTaskStartPingProcess(); - task.setAuthoredOn(null); - - ValidationResult result = resourceValidator.validate(task); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(1, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - } - - private Task createValidTaskStartPingProcess() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_START_PING); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_START_PING_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - return task; - } - - @Test - public void testTaskPingValid() throws Exception - { - Task task = createValidTaskPing(); - - 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 createValidTaskPing() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_PING); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PONG_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("TTP"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_PING_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY); - - return task; - } - - @Test - public void testTaskPongValid() throws Exception - { - Task task = createValidTaskPong(); - - 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 createValidTaskPong() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_PONG_TASK); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_PING_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_PONG_MESSAGE_NAME)).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_CORRELATION_KEY); - - return task; - } -} diff --git a/dsf-bpe/dsf-bpe-process-ping/src/test/resources/log4j2.xml b/dsf-bpe/dsf-bpe-process-ping/src/test/resources/log4j2.xml deleted file mode 100644 index f1afe81dc..000000000 --- a/dsf-bpe/dsf-bpe-process-ping/src/test/resources/log4j2.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?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> - <!-- <RollingFile name="FILE" fileName="log/adt_db.log" - filePattern="log/adt_db_%d{MM-dd-yyyy}_%i.log.gz" - ignoreExceptions="false"> - <PatternLayout> - <Pattern>%d [%t] %-5p %c - %m%n</Pattern> - </PatternLayout> - <Policies> - <OnStartupTriggeringPolicy /> - <TimeBasedTriggeringPolicy /> - </Policies> - </RollingFile> --> - - <!-- <SMTP name="MAIL" subject="Production RWH LAB Gateway Error" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="50"> - </SMTP> - <SMTP name="MAIL_CERTIFICATE" subject="Production RWH LAB Gateway Certificate Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> - <SMTP name="MAIL_HL7" subject="Production RWH ADT Gateway HL7 Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> --> - </Appenders> - - <Loggers> - <Logger name="de.rwh" level="TRACE"/> - <Logger name="org.highmed" 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"/> - - <!-- <Logger name="certificate-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_CERTIFICATE" /> - </Logger> - <Logger name="async-message-handler-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_HL7" /> - </Logger> --> - - <Root level="WARN"> - <AppenderRef ref="CONSOLE"/> - <!-- <AppenderRef ref="FILE" /> --> - <!-- <AppenderRef ref="MAIL" /> --> - </Root> - </Loggers> -</Configuration> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml deleted file mode 100755 index 72d268256..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/pom.xml +++ /dev/null @@ -1,176 +0,0 @@ -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <artifactId>dsf-bpe-process-update-allow-list</artifactId> - - <parent> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> - </parent> - - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>de.hs-heilbronn.mi</groupId> - <artifactId>log4j2-utils</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-fhir-validation</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>test</scope> - <type>test-jar</type> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-process-plugin-to-docker-test-setup</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clean-plugin</artifactId> - <configuration> - <filesets> - <fileset> - <directory>../../dsf-docker-test-setup/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - </filesets> - </configuration> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java deleted file mode 100644 index 920befdd0..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateAllowList.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.highmed.dsf.bpe; - -import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; -import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.VERSION; - -public interface ConstantsUpdateAllowList -{ - String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST = "http://highmed.org/fhir/CodeSystem/update-allow-list"; - String CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST = "highmed_allow_list"; - - String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST = "http://highmed.org/fhir/StructureDefinition/task-download-allow-list"; - String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "downloadAllowList/"; - String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME = "downloadAllowListMessage"; - - String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST = "http://highmed.org/fhir/StructureDefinition/task-update-allow-list"; - String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI = PROCESS_HIGHMED_URI_BASE + "updateAllowList/"; - String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME = "updateAllowListMessage"; -} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java deleted file mode 100644 index 3790c8231..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/UpdateAllowListProcessPluginDefinition.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.highmed.dsf.bpe; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -import org.highmed.dsf.bpe.spring.config.UpdateAllowListConfig; -import org.highmed.dsf.fhir.resources.AbstractResource; -import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; -import org.highmed.dsf.fhir.resources.CodeSystemResource; -import org.highmed.dsf.fhir.resources.ResourceProvider; -import org.highmed.dsf.fhir.resources.StructureDefinitionResource; -import org.highmed.dsf.fhir.resources.ValueSetResource; - -import ca.uhn.fhir.context.FhirContext; - -public class UpdateAllowListProcessPluginDefinition implements ProcessPluginDefinition -{ - public static final String VERSION = "0.4.0"; - - @Override - public String getName() - { - return "dsf-bpe-process-update-allow-list"; - } - - @Override - public String getVersion() - { - return VERSION; - } - - @Override - public Stream<String> getBpmnFiles() - { - return Stream.of("bpe/updateAllowList.bpmn", "bpe/downloadAllowList.bpmn"); - } - - @Override - public Stream<Class<?>> getSpringConfigClasses() - { - return Stream.of(UpdateAllowListConfig.class); - } - - @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) - { - var aDown = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-downloadAllowList.xml"); - var aUp = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-updateAllowList.xml"); - var c = CodeSystemResource.file("fhir/CodeSystem/highmed-update-allow-list.xml"); - var sDown = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-download-allow-list.xml"); - var sUp = StructureDefinitionResource.file("fhir/StructureDefinition/highmed-task-update-allow-list.xml"); - var v = ValueSetResource.file("fhir/ValueSet/highmed-update-allow-list.xml"); - - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map - .of("downloadAllowList/" + VERSION, Arrays.asList(aDown, c, sDown, v), "updateAllowList/" + VERSION, - Arrays.asList(aUp, c, sUp, v)); - - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java deleted file mode 100644 index dda7f7a42..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/DownloadAllowList.java +++ /dev/null @@ -1,117 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; - -import java.util.EnumSet; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import javax.ws.rs.WebApplicationException; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Bundle.BundleType; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import ca.uhn.fhir.context.FhirContext; - -public class DownloadAllowList extends AbstractServiceDelegate -{ - private static final Logger logger = LoggerFactory.getLogger(DownloadAllowList.class); - - private final FhirContext context; - - public DownloadAllowList(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, FhirContext context) - { - super(clientProvider, taskHelper); - this.context = context; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - Objects.requireNonNull(context, "fhirContext"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - IdType bundleId = getBundleId(task); - FhirWebserviceClient requesterClient = getFhirWebserviceClientProvider() - .getRemoteWebserviceClient(bundleId.getBaseUrl()); - - Bundle bundle; - try - { - if (bundleId.hasVersionIdPart()) - bundle = requesterClient.read(Bundle.class, bundleId.getIdPart(), bundleId.getVersionIdPart()); - else - bundle = requesterClient.read(Bundle.class, bundleId.getIdPart()); - } - catch (WebApplicationException e) - { - logger.error("Error while reading Bundle with id {} from organization {}: {}", bundleId.getValue(), - task.getRequester().getReference(), e.getMessage()); - throw new RuntimeException( - "Error while reading Bundle with id " + bundleId.getValue() + " from organization " + task - .getRequester().getReference() + ", " + e.getMessage(), e); - } - - if (!EnumSet.of(BundleType.TRANSACTION, BundleType.BATCH).contains(bundle.getType())) - { - logger.error("Bundle type TRANSACTION or BATCH expected, but got {}", bundle.getType()); - throw new RuntimeException("Bundle type TRANSACTION or BATCH expected, but got " + bundle.getType()); - } - - try - { - logger.debug("Posting bundle to local endpoint: {}", context.newXmlParser().encodeResourceToString(bundle)); - getFhirWebserviceClientProvider().getLocalWebserviceClient().withMinimalReturn().postBundle(bundle); - } - catch (Exception e) - { - logger.error("Error while executing Bundle with id {} from organization {} locally: {}", - bundleId.getValue(), task.getRequester().getReference(), e.getMessage()); - throw new RuntimeException( - "Error while executing Bundle with id " + bundleId.getValue() + " from organization " + task - .getRequester().getReference() + " locally, " + e.getMessage(), e); - } - } - - private IdType getBundleId(Task task) - { - List<Reference> bundleReferences = getTaskHelper() - .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST, - CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST).collect(Collectors.toList()); - - if (bundleReferences.size() != 1) - { - logger.error("Task input parameter {} contains unexpected number of Bundle IDs, expected 1, got {}", - CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST, bundleReferences.size()); - throw new RuntimeException("Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST - + " contains unexpected number of Bundle IDs, expected 1, got " + bundleReferences.size()); - } - else if (!bundleReferences.get(0).hasReference() || !bundleReferences.get(0).getReference() - .contains("/Bundle/")) - { - logger.error("Task input parameter {} has no Bundle reference", - CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); - throw new RuntimeException("Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST - + " has no Bundle reference"); - } - - return new IdType(bundleReferences.get(0).getReference()); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java deleted file mode 100644 index 68f38815b..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/service/UpdateAllowList.java +++ /dev/null @@ -1,154 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; - -import java.util.Collections; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.UUID; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; -import org.hl7.fhir.r4.model.Bundle.BundleType; -import org.hl7.fhir.r4.model.Bundle.HTTPVerb; -import org.hl7.fhir.r4.model.Bundle.SearchEntryMode; -import org.hl7.fhir.r4.model.Endpoint; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Organization; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.InitializingBean; - -import ca.uhn.fhir.context.FhirContext; - -public class UpdateAllowList extends AbstractServiceDelegate implements InitializingBean -{ - private static final Logger logger = LoggerFactory.getLogger(UpdateAllowList.class); - - private final OrganizationProvider organizationProvider; - - public UpdateAllowList(OrganizationProvider organizationProvider, FhirWebserviceClientProvider clientProvider, - TaskHelper taskHelper) - { - super(clientProvider, taskHelper); - - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - public void doExecute(DelegateExecution execution) throws Exception - { - FhirWebserviceClient client = getFhirWebserviceClientProvider().getLocalWebserviceClient(); - - Bundle searchSet = client.searchWithStrictHandling(Organization.class, - Map.of("active", Collections.singletonList("true"), "identifier", - Collections.singletonList(organizationProvider.getDefaultIdentifierSystem() + "|"), "_include", - Collections.singletonList("Organization:endpoint"))); - - Bundle transaction = new Bundle().setType(BundleType.TRANSACTION); - transaction.getMeta().addTag().setSystem("http://highmed.org/fhir/CodeSystem/authorization-role") - .setCode("REMOTE"); - transaction.getIdentifier().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) - .setValue(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); - searchSet.getEntry().stream() - .filter(e -> e.hasSearch() && SearchEntryMode.MATCH.equals(e.getSearch().getMode()) && e.hasResource() - && e.getResource() instanceof Organization).map(e -> (Organization) e.getResource()) - .forEach(addAllowListEntry(transaction, searchSet)); - - logger.debug("Uploading new allow list transaction bundle: {}", - FhirContext.forR4().newJsonParser().encodeResourceToString(transaction)); - - IdType result = client.withMinimalReturn().updateConditionaly(transaction, Map.of("identifier", Collections - .singletonList(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST + "|" - + CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST))); - - Task task = getLeadingTaskFromExecutionVariables(); - task.addOutput().setValue(new Reference(new IdType("Bundle", result.getIdPart(), result.getVersionIdPart()))) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) - .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); - } - - private Consumer<? super Organization> addAllowListEntry(Bundle transaction, Bundle searchSet) - { - return organization -> { - Identifier identifier = getDefaultIdentifier(organization).get(); - - BundleEntryComponent organizationEntry = transaction.addEntry(); - String organizationId = "urn:uuid:" + UUID.randomUUID(); - organizationEntry.setFullUrl(organizationId); - organizationEntry.getRequest().setMethod(HTTPVerb.PUT) - .setUrl("Organization?identifier=" + identifier.getSystem() + "|" + identifier.getValue()); - - organization.setIdElement(new IdType(organizationId)); - organization.getMeta().setVersionIdElement(null).setLastUpdatedElement(null); - organizationEntry.setResource(organization); - - organization.setEndpoint(organization.getEndpoint().stream() - .map(addAllowListEntryReturnReference(transaction, organizationId, searchSet)) - .filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList())); - }; - } - - private Function<Reference, Optional<Reference>> addAllowListEntryReturnReference(Bundle transaction, - String organizationId, Bundle searchSet) - { - return endpointRef -> getEndpoint(endpointRef, searchSet).map(endpoint -> { - Identifier identifier = getDefaultIdentifier(endpoint).get(); - - BundleEntryComponent endpointEntry = transaction.addEntry(); - String endpointId = "urn:uuid:" + UUID.randomUUID(); - endpointEntry.setFullUrl(endpointId); - endpointEntry.getRequest().setMethod(HTTPVerb.PUT) - .setUrl("Endpoint?identifier=" + identifier.getSystem() + "|" + identifier.getValue()); - - endpoint.setIdElement(new IdType(endpointId)); - endpoint.getMeta().setVersionIdElement(null).setLastUpdatedElement(null); - endpoint.setManagingOrganization(new Reference().setReference(organizationId).setType("Organization")); - endpointEntry.setResource(endpoint); - - return new Reference().setReference(endpointId).setType("Endpoint"); - }); - } - - private Optional<Identifier> getDefaultIdentifier(Organization org) - { - return org.getIdentifier().stream() - .filter(i -> organizationProvider.getDefaultIdentifierSystem().equals(i.getSystem())).findFirst(); - } - - private Optional<Identifier> getDefaultIdentifier(Endpoint ept) - { - return ept.getIdentifier().stream().filter(i -> NAMINGSYSTEM_HIGHMED_ENDPOINT_IDENTIFIER.equals(i.getSystem())) - .findFirst(); - } - - private Optional<Endpoint> getEndpoint(Reference endpoint, Bundle searchSet) - { - return searchSet.getEntry().stream() - .filter(e -> e.hasResource() && e.getResource() instanceof Endpoint && e.getFullUrl() - .endsWith(endpoint.getReference())).map(e -> (Endpoint) e.getResource()).findFirst(); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java deleted file mode 100755 index 55702ba92..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateAllowListConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.highmed.dsf.bpe.service.DownloadAllowList; -import org.highmed.dsf.bpe.service.UpdateAllowList; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -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 UpdateAllowListConfig -{ - @Autowired - private FhirWebserviceClientProvider clientProvider; - - @Autowired - private OrganizationProvider organizationProvider; - - @Autowired - private TaskHelper taskHelper; - - @Autowired - private FhirContext fhirContext; - - @Bean - public UpdateAllowList updateAllowList() - { - return new UpdateAllowList(organizationProvider, clientProvider, taskHelper); - } - - @Bean - public DownloadAllowList downloadAllowList() - { - return new DownloadAllowList(clientProvider, taskHelper, fhirContext); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition deleted file mode 100644 index cd27d36b4..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition +++ /dev/null @@ -1 +0,0 @@ -org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn deleted file mode 100644 index d3b32105f..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/downloadAllowList.bpmn +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1yb5vw3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.2.0"> - <bpmn:process id="downloadAllowList" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="downloadAllowListTask" /> - <bpmn:endEvent id="EndEvent_0xd0x8k"> - <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0oyvmcd" sourceRef="downloadAllowListTask" targetRef="EndEvent_0xd0x8k" /> - <bpmn:serviceTask id="downloadAllowListTask" name="downloadAllowList" camunda:class="org.highmed.dsf.bpe.service.DownloadAllowList"> - <bpmn:incoming>SequenceFlow_0bbhq2r</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0oyvmcd</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:startEvent id="StartEvent_1"> - <bpmn:outgoing>SequenceFlow_0bbhq2r</bpmn:outgoing> - <bpmn:messageEventDefinition messageRef="Message_1nn2wdw" /> - </bpmn:startEvent> - </bpmn:process> - <bpmn:message id="Message_1nn2wdw" name="downloadAllowListMessage" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="downloadAllowList"> - <bpmndi:BPMNEdge id="SequenceFlow_0oyvmcd_di" bpmnElement="SequenceFlow_0oyvmcd"> - <di:waypoint x="365" y="121" /> - <di:waypoint x="415" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0bbhq2r_di" bpmnElement="SequenceFlow_0bbhq2r"> - <di:waypoint x="215" y="121" /> - <di:waypoint x="265" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_0xd0x8k_di" bpmnElement="EndEvent_0xd0x8k"> - <dc:Bounds x="415" y="103" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0um3ad2_di" bpmnElement="downloadAllowListTask"> - <dc:Bounds x="265" y="81" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_0x5gijn_di" bpmnElement="StartEvent_1"> - <dc:Bounds x="179" y="103" width="36" height="36" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn deleted file mode 100755 index a4f877446..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/bpe/updateAllowList.bpmn +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1yb5vw3" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0"> - <bpmn:process id="updateAllowList" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:sequenceFlow id="SequenceFlow_0bbhq2r" sourceRef="StartEvent_1" targetRef="updateAllowListTask" /> - <bpmn:endEvent id="EndEvent_0xd0x8k"> - <bpmn:incoming>SequenceFlow_0oyvmcd</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0oyvmcd" sourceRef="updateAllowListTask" targetRef="EndEvent_0xd0x8k" /> - <bpmn:serviceTask id="updateAllowListTask" name="updateAllowList" camunda:class="org.highmed.dsf.bpe.service.UpdateAllowList"> - <bpmn:incoming>SequenceFlow_0bbhq2r</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0oyvmcd</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:startEvent id="StartEvent_1"> - <bpmn:outgoing>SequenceFlow_0bbhq2r</bpmn:outgoing> - <bpmn:messageEventDefinition messageRef="Message_1nn2wdw" /> - </bpmn:startEvent> - </bpmn:process> - <bpmn:message id="Message_1nn2wdw" name="updateAllowListMessage" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="updateAllowList"> - <bpmndi:BPMNEdge id="SequenceFlow_0bbhq2r_di" bpmnElement="SequenceFlow_0bbhq2r"> - <di:waypoint x="215" y="121" /> - <di:waypoint x="265" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_0xd0x8k_di" bpmnElement="EndEvent_0xd0x8k"> - <dc:Bounds x="415" y="103" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0oyvmcd_di" bpmnElement="SequenceFlow_0oyvmcd"> - <di:waypoint x="365" y="121" /> - <di:waypoint x="415" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0um3ad2_di" bpmnElement="updateAllowListTask"> - <dc:Bounds x="265" y="81" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_0x5gijn_di" bpmnElement="StartEvent_1"> - <dc:Bounds x="179" y="103" width="36" height="36" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml deleted file mode 100644 index 7cc21051d..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-downloadAllowList.xml +++ /dev/null @@ -1,72 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="downloadAllowListMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list" /> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/downloadAllowList" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="downloadAllowList" /> - <title value="Download Allow List" /> - <subtitle value="Download Allow List Bundle Process" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <publisher value="HiGHmed" /> - <contact> - <name value="HiGHmed" /> - <telecom> - <system value="email" /> - <value value="pmo@highmed.org" /> - </telecom> - </contact> - <description value="Process to download the allow list FHIR bundle" /> - <kind value="Task" /> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml deleted file mode 100644 index bc4a69048..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ActivityDefinition/highmed-updateAllowList.xml +++ /dev/null @@ -1,60 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="updateAllowListMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list" /> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/updateAllowList" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="updateAllowList" /> - <title value="Update Allow List" /> - <subtitle value="Update Allow List Bundle Process" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <publisher value="HiGHmed" /> - <contact> - <name value="HiGHmed" /> - <telecom> - <system value="email" /> - <value value="pmo@highmed.org" /> - </telecom> - </contact> - <description value="Process to update the allow list FHIR bundle" /> - <kind value="Task" /> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml deleted file mode 100644 index 3f1e93ac0..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/CodeSystem/highmed-update-allow-list.xml +++ /dev/null @@ -1,28 +0,0 @@ -<CodeSystem xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> - </meta> - <url value="http://highmed.org/fhir/CodeSystem/update-allow-list"/> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="HiGHmed_Update_Allow_List"/> - <title value="HiGHmed Update Allow List"/> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false"/> - <date value="2020-11-23"/> - <publisher value="HiGHmed"/> - <description value="CodeSystem with standard values for the processes update and download allow list"/> - <caseSensitive value="true"/> - <hierarchyMeaning value="grouped-by"/> - <versionNeeded value="false"/> - <content value="complete"/> - <concept> - <code value="highmed_allow_list"/> - <display value="HiGHmed Allow List"/> - <definition value="Allow list identifying organizations as part of HiGHmed"/> - </concept> -</CodeSystem> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml deleted file mode 100644 index b42d542fe..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-download-allow-list.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-download-allow-list" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskDownloadAllowList" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/downloadAllowList/${version}" /> - </element> - <element id="Task.input"> - <path value="Task.input" /> - <min value="2" /> - <max value="2" /> - </element> - <element id="Task.input:message-name"> - <path value="Task.input" /> - <sliceName value="message-name" /> - </element> - <element id="Task.input:message-name.value[x]"> - <path value="Task.input.value[x]" /> - <fixedString value="downloadAllowListMessage" /> - </element> - <element id="Task.input:business-key"> - <path value="Task.input" /> - <sliceName value="business-key" /> - <max value="0" /> - </element> - <element id="Task.input:correlation-key"> - <path value="Task.input" /> - <sliceName value="correlation-key" /> - <max value="0" /> - </element> - <element id="Task.input:bundle-reference"> - <path value="Task.input" /> - <sliceName value="bundle-reference" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:bundle-reference.type"> - <path value="Task.input.type" /> - <binding> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/update-allow-list" /> - </binding> - </element> - <element id="Task.input:bundle-reference.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:bundle-reference.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/update-allow-list" /> - </element> - <element id="Task.input:bundle-reference.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="highmed_allow_list" /> - </element> - <element id="Task.input:bundle-reference.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="Reference" /> - </type> - </element> - <element id="Task.input:bundle-reference.value[x].reference"> - <path value="Task.input.value[x].reference" /> - <min value="1" /> - </element> - <element id="Task.input:bundle-reference.value[x].identifier"> - <path value="Task.input.value[x].identifier" /> - <max value="0" /> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml deleted file mode 100644 index 2566f824d..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/StructureDefinition/highmed-task-update-allow-list.xml +++ /dev/null @@ -1,106 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-update-allow-list" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskUpdateAllowList" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/updateAllowList/${version}" /> - </element> - <element id="Task.input"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <max value="1" /> - </element> - <element id="Task.input:message-name"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="message-name" /> - </element> - <element id="Task.input:message-name.value[x]"> - <path value="Task.input.value[x]" /> - <fixedString value="updateAllowListMessage" /> - </element> - <element id="Task.input:business-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="business-key" /> - <max value="0" /> - </element> - <element id="Task.input:correlation-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="correlation-key" /> - <max value="0" /> - </element> - <element id="Task.output:allowList"> - <path value="Task.output" /> - <sliceName value="allowList" /> - <max value="1" /> - </element> - <element id="Task.output:allowList.type"> - <path value="Task.output.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskOutputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/update-allow-list" /> - </binding> - </element> - <element id="Task.output:allowList.type.coding"> - <path value="Task.output.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.output:allowList.type.coding.system"> - <path value="Task.output.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/update-allow-list" /> - </element> - <element id="Task.output:allowList.type.coding.code"> - <path value="Task.output.type.coding.code" /> - <min value="1" /> - <fixedCode value="highmed_allow_list" /> - </element> - <element id="Task.output:allowList.value[x]"> - <path value="Task.output.value[x]" /> - <type> - <code value="Reference" /> - </type> - </element> - <element id="Task.output:allowList.value[x].reference"> - <path value="Task.output.value[x].reference" /> - <min value="1" /> - </element> - <element id="Task.output:allowList.value[x].identifier"> - <path value="Task.output.value[x].identifier" /> - <max value="0" /> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml deleted file mode 100644 index 915c8ef5a..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/main/resources/fhir/ValueSet/highmed-update-allow-list.xml +++ /dev/null @@ -1,26 +0,0 @@ -<ValueSet xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> - </meta> - <url value="http://highmed.org/fhir/ValueSet/update-allow-list"/> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="HiGHmed_Update_Allow_List"/> - <title value="HiGHmed Update Allow List"/> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false"/> - <date value="2020-11-23"/> - <publisher value="HiGHmed"/> - <description - value="ValueSet with standard values for the process update allow list"/> - <immutable value="true"/> - <compose> - <include> - <system value="http://highmed.org/fhir/CodeSystem/update-allow-list"/> - </include> - </compose> -</ValueSet> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java deleted file mode 100644 index 5e729dba6..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/DownloadAllowListFromTtpViaMedic1ExampleStarter.java +++ /dev/null @@ -1,81 +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.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.MEDIC_1_FHIR_BASE_URL; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; - -import java.util.Collections; -import java.util.Date; -import java.util.Map; - -import org.highmed.fhir.client.FhirWebserviceClient; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.TaskIntent; -import org.hl7.fhir.r4.model.Task.TaskStatus; - -public class DownloadAllowListFromTtpViaMedic1ExampleStarter -{ - // 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 - { - ExampleStarter starter = ExampleStarter.forServer(args, MEDIC_1_FHIR_BASE_URL); - Task task = createStartResource(starter); - starter.startWith(task); - } - - private static Task createStartResource(ExampleStarter starter) throws Exception - { - Bundle allowList = getAllowList(starter); - - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_MEDIC_1); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new Reference( - new IdType(TTP_FHIR_BASE_URL, ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), - allowList.getIdElement().getVersionIdPart()))).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) - .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); - - return task; - } - - private static Bundle getAllowList(ExampleStarter starter) throws Exception - { - FhirWebserviceClient client = starter.createClient(TTP_FHIR_BASE_URL); - Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", - Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); - - if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) - throw new IllegalStateException("Expected a single allow list Bundle"); - - return (Bundle) searchResult.getEntryFirstRep().getResource(); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java deleted file mode 100644 index 6d08e8ba6..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/bpe/start/UpdateAllowList3MedicTtpExampleStarter.java +++ /dev/null @@ -1,52 +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.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; - -import java.util.Date; - -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.TaskIntent; -import org.hl7.fhir.r4.model.Task.TaskStatus; - -public class UpdateAllowList3MedicTtpExampleStarter -{ - // Environment variable "DSF_CLIENT_CERTIFICATE_PATH" or args[0]: the path to the client-certificate - // highmed-dsf/dsf-tools/dsf-tools-test-data-generator/cert/Webbrowser_Test_User/Webbrowser_Test_User_certificate.p12 - // Environment variable "DSF_CLIENT_CERTIFICATE_PASSWORD" or args[1]: the password of the client-certificate - // password - public static void main(String[] args) throws Exception - { - Task task = createStartResource(); - ExampleStarter.forServer(args, TTP_FHIR_BASE_URL).startWith(task); - } - - private static Task createStartResource() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - return task; - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java deleted file mode 100644 index a2e17f819..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ /dev/null @@ -1,136 +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.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateAllowList.PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.UpdateAllowListProcessPluginDefinition.VERSION; -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.Date; -import java.util.UUID; - -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.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.TaskIntent; -import org.hl7.fhir.r4.model.Task.TaskStatus; -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, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-update-allow-list.xml", - "highmed-task-download-allow-list.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-update-allow-list.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-update-allow-list.xml")); - - private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), - validationRule.getValidationSupport()); - - @Test - public void testTaskUpdateAllowListValid() throws Exception - { - Task task = createValidTaskUpdateAllowList(); - - 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 testTaskUpdateAllowlistValidWithOutput() throws Exception - { - Task task = createValidTaskUpdateAllowList(); - task.addOutput().setValue(new Reference(new IdType("Bundle", UUID.randomUUID().toString(), "1"))).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) - .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); - - 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 createValidTaskUpdateAllowList() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_UPDATE_ALLOW_LIST_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - return task; - } - - @Test - public void testTaskDownloadAllowListValid() throws Exception - { - Task task = createValidTaskDownloadAllowList(); - - ValidationResult result = resourceValidator.validate(task); - ValidationSupportRule.logValidationMessages(logger, result); - - assertEquals(0, result.getMessages().stream().filter(m -> ResultSeverityEnum.ERROR.equals(m.getSeverity()) - || ResultSeverityEnum.FATAL.equals(m.getSeverity())).count()); - } - - private Task createValidTaskDownloadAllowList() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_DOWNLOAD_ALLOW_LIST_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("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_DOWNLOAD_ALLOW_LIST_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput() - .setValue( - new Reference(new IdType("https://foo.bar/fhir", "Bundle", UUID.randomUUID().toString(), "1"))) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST) - .setCode(CODESYSTEM_HIGHMED_UPDATE_ALLOW_LIST_VALUE_ALLOW_LIST); - - return task; - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/resources/log4j2.xml b/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/resources/log4j2.xml deleted file mode 100644 index f1afe81dc..000000000 --- a/dsf-bpe/dsf-bpe-process-update-allow-list/src/test/resources/log4j2.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?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> - <!-- <RollingFile name="FILE" fileName="log/adt_db.log" - filePattern="log/adt_db_%d{MM-dd-yyyy}_%i.log.gz" - ignoreExceptions="false"> - <PatternLayout> - <Pattern>%d [%t] %-5p %c - %m%n</Pattern> - </PatternLayout> - <Policies> - <OnStartupTriggeringPolicy /> - <TimeBasedTriggeringPolicy /> - </Policies> - </RollingFile> --> - - <!-- <SMTP name="MAIL" subject="Production RWH LAB Gateway Error" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="50"> - </SMTP> - <SMTP name="MAIL_CERTIFICATE" subject="Production RWH LAB Gateway Certificate Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> - <SMTP name="MAIL_HL7" subject="Production RWH ADT Gateway HL7 Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> --> - </Appenders> - - <Loggers> - <Logger name="de.rwh" level="TRACE"/> - <Logger name="org.highmed" 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"/> - - <!-- <Logger name="certificate-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_CERTIFICATE" /> - </Logger> - <Logger name="async-message-handler-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_HL7" /> - </Logger> --> - - <Root level="WARN"> - <AppenderRef ref="CONSOLE"/> - <!-- <AppenderRef ref="FILE" /> --> - <!-- <AppenderRef ref="MAIL" /> --> - </Root> - </Loggers> -</Configuration> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml b/dsf-bpe/dsf-bpe-process-update-resources/pom.xml deleted file mode 100755 index c0036c02d..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/pom.xml +++ /dev/null @@ -1,177 +0,0 @@ -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <artifactId>dsf-bpe-process-update-resources</artifactId> - - <parent> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> - </parent> - - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>provided</scope> - </dependency> - - - <dependency> - <groupId>de.hs-heilbronn.mi</groupId> - <artifactId>log4j2-utils</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-fhir-validation</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-base</artifactId> - <scope>test</scope> - <type>test-jar</type> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-process-plugin-to-docker-test-setup</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic1</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic2</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/medic3</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</outputDirectory> - </configuration> - </execution> - <execution> - <id>copy-process-plugin-to-docker-test-setup-3medic-ttp/ttp</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clean-plugin</artifactId> - <configuration> - <filesets> - <fileset> - <directory>../../dsf-docker-test-setup/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic1/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic2/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/medic3/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - <fileset> - <directory>../../dsf-docker-test-setup-3medic-ttp/ttp/bpe/app/process</directory> - <includes> - <include>${project.artifactId}-${project.version}.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - </filesets> - </configuration> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java deleted file mode 100644 index d9ab66f31..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/ConstantsUpdateResources.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.highmed.dsf.bpe; - -import static org.highmed.dsf.bpe.ConstantsBase.PROCESS_HIGHMED_URI_BASE; -import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.VERSION; - -public interface ConstantsUpdateResources -{ - String CODESYSTEM_HIGHMED_UPDATE_RESOURCE = "http://highmed.org/fhir/CodeSystem/update-resources"; - String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE = "bundle-reference"; - String CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER = "organization-identifier-search-parameter"; - - String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES = "http://highmed.org/fhir/StructureDefinition/task-request-update-resources"; - String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI = - PROCESS_HIGHMED_URI_BASE + "requestUpdateResources/"; - String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME = "requestUpdateResourcesMessage"; - - String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES = "http://highmed.org/fhir/StructureDefinition/task-execute-update-resources"; - String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI = - PROCESS_HIGHMED_URI_BASE + "executeUpdateResources/"; - String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION = - PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI + VERSION; - String PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME = "executeUpdateResourcesMessage"; -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java deleted file mode 100644 index 6807af084..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/UpdateResourcesProcessPluginDefinition.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.highmed.dsf.bpe; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -import org.highmed.dsf.bpe.spring.config.UpdateResourcesConfig; -import org.highmed.dsf.fhir.resources.AbstractResource; -import org.highmed.dsf.fhir.resources.ActivityDefinitionResource; -import org.highmed.dsf.fhir.resources.CodeSystemResource; -import org.highmed.dsf.fhir.resources.ResourceProvider; -import org.highmed.dsf.fhir.resources.StructureDefinitionResource; -import org.highmed.dsf.fhir.resources.ValueSetResource; - -import ca.uhn.fhir.context.FhirContext; - -public class UpdateResourcesProcessPluginDefinition implements ProcessPluginDefinition -{ - public static final String VERSION = "0.4.0"; - - @Override - public String getName() - { - return "dsf-bpe-process-update-resources"; - } - - @Override - public String getVersion() - { - return VERSION; - } - - @Override - public Stream<String> getBpmnFiles() - { - return Stream.of("bpe/executeUpdateResources.bpmn", "bpe/requestUpdateResources.bpmn"); - } - - @Override - public Stream<Class<?>> getSpringConfigClasses() - { - return Stream.of(UpdateResourcesConfig.class); - } - - @Override - public ResourceProvider getResourceProvider(FhirContext fhirContext, ClassLoader classLoader) - { - var aExec = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-executeUpdateResources.xml"); - var aReq = ActivityDefinitionResource.file("fhir/ActivityDefinition/highmed-requestUpdateResources.xml"); - var c = CodeSystemResource.file("fhir/CodeSystem/highmed-update-resources.xml"); - var sExec = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-execute-update-resources.xml"); - var sReq = StructureDefinitionResource - .file("fhir/StructureDefinition/highmed-task-request-update-resources.xml"); - var v = ValueSetResource.file("fhir/ValueSet/highmed-update-resources.xml"); - - Map<String, List<AbstractResource>> resourcesByProcessKeyAndVersion = Map - .of("executeUpdateResources/" + VERSION, Arrays.asList(aExec, c, sExec, v), - "requestUpdateResources/" + VERSION, Arrays.asList(aReq, c, sReq, v)); - - return ResourceProvider - .read(VERSION, () -> fhirContext.newXmlParser().setStripVersionsFromReferences(false), classLoader, - resourcesByProcessKeyAndVersion); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java deleted file mode 100755 index 9ff3a6a74..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/message/SendRequest.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.highmed.dsf.bpe.message; - -import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_BUNDLE_ID; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; - -import java.util.stream.Stream; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.AbstractTaskMessageSend; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.CodeableConcept; -import org.hl7.fhir.r4.model.Coding; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task.ParameterComponent; - -import ca.uhn.fhir.context.FhirContext; - -public class SendRequest extends AbstractTaskMessageSend -{ - public SendRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider, FhirContext fhirContext) - { - super(clientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Override - protected Stream<ParameterComponent> getAdditionalInputParameters(DelegateExecution execution) - { - String bundleId = (String) execution.getVariable(BPMN_EXECUTION_VARIABLE_BUNDLE_ID); - return Stream - .of(toInputParameterBundleReference(getFhirWebserviceClientProvider().getLocalBaseUrl(), bundleId)); - } - - private ParameterComponent toInputParameterBundleReference(String localBaseUrl, String bundleId) - { - if (bundleId == null || bundleId.isEmpty()) - throw new IllegalArgumentException("bundleId null or empty"); - - return new ParameterComponent(new CodeableConcept(new Coding(CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, null)), - new Reference().setReference(localBaseUrl + (localBaseUrl.endsWith("/") ? "" : "/") + bundleId)); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java deleted file mode 100644 index dd45cb078..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/CheckRequest.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP; - -import java.util.Objects; -import java.util.Optional; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Organization; -import org.hl7.fhir.r4.model.Task; -import org.springframework.beans.factory.InitializingBean; - -public class CheckRequest extends AbstractServiceDelegate implements InitializingBean -{ - private final OrganizationProvider organizationProvider; - - public CheckRequest(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) - { - super(clientProvider, taskHelper); - - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - protected void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - - if (requesterIsNotOfTypeTtp(task.getRequester().getIdentifier())) - { - throw new RuntimeException( - "Request check failed: process can only be started by requesting organization of type='" - + CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP + "'"); - } - } - - private boolean requesterIsNotOfTypeTtp(Identifier requester) - { - Optional<Organization> organization = organizationProvider - .getOrganization(requester.getSystem(), requester.getValue()); - - return !organization.map(value -> value.getType().stream().anyMatch(type -> type.getCoding().stream().anyMatch( - coding -> coding.getSystem().equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE) && coding.getCode() - .equals(CODESYSTEM_HIGHMED_ORGANIZATION_TYPE_VALUE_TTP)))).orElse(false); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java deleted file mode 100755 index a0f13f770..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/SelectResourceAndTargets.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_BUNDLE_ID; -import static org.highmed.dsf.bpe.ConstantsBase.BPMN_EXECUTION_VARIABLE_TARGETS; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; - -import java.util.List; -import java.util.Objects; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.dsf.fhir.variables.Target; -import org.highmed.dsf.fhir.variables.Targets; -import org.highmed.dsf.fhir.variables.TargetsValues; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.InitializingBean; - -public class SelectResourceAndTargets extends AbstractServiceDelegate implements InitializingBean -{ - private static final Logger logger = LoggerFactory.getLogger(SelectResourceAndTargets.class); - - private static final String BUNDLE_ID_PATTERN_STRING = "Bundle/.+"; - private static final Pattern BUNDLE_ID_PATTERN = Pattern.compile(BUNDLE_ID_PATTERN_STRING); - - private final OrganizationProvider organizationProvider; - - public SelectResourceAndTargets(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, - OrganizationProvider organizationProvider) - { - super(clientProvider, taskHelper); - - this.organizationProvider = organizationProvider; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - - Objects.requireNonNull(organizationProvider, "organizationProvider"); - } - - @Override - public void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - List<Reference> references = getTaskHelper() - .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE).collect(Collectors.toList()); - - if (references.size() != 1) - { - logger.error("Task input contains unexpected number of Bundle IDs, expected 1, got {}", references.size()); - throw new RuntimeException( - "Task input contains unexpected number of Bundle IDs, expected 1, got " + references.size()); - } - else if (!BUNDLE_ID_PATTERN.matcher(references.get(0).getReference()).matches()) - { - logger.error("Task input contains unexpected ids not matching {}", BUNDLE_ID_PATTERN_STRING); - throw new RuntimeException("Task input contains unexpected ids not matching " + BUNDLE_ID_PATTERN_STRING); - } - - String bundleId = references.get(0).getReference(); - execution.setVariable(BPMN_EXECUTION_VARIABLE_BUNDLE_ID, bundleId); - - List<String> targetIdentifierSearchParameters = getTaskHelper() - .getInputParameterStringValues(task, CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER) - .collect(Collectors.toList()); - - List<Target> targets = targetIdentifierSearchParameters.stream() - .flatMap(organizationProvider::searchRemoteOrganizationsIdentifiers) - .map(identifier -> Target.createUniDirectionalTarget(identifier.getValue())) - .collect(Collectors.toList()); - execution.setVariable(BPMN_EXECUTION_VARIABLE_TARGETS, TargetsValues.create(new Targets(targets))); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java deleted file mode 100755 index 1f984efc2..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/service/UpdateResources.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.highmed.dsf.bpe.service; - -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; - -import java.util.EnumSet; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import javax.ws.rs.WebApplicationException; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.highmed.dsf.bpe.delegate.AbstractServiceDelegate; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.highmed.fhir.client.FhirWebserviceClient; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Bundle.BundleType; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.Task; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.InitializingBean; - -import ca.uhn.fhir.context.FhirContext; - -public class UpdateResources extends AbstractServiceDelegate implements InitializingBean -{ - private static final Logger logger = LoggerFactory.getLogger(UpdateResources.class); - - private final FhirContext context; - - public UpdateResources(FhirWebserviceClientProvider clientProvider, TaskHelper taskHelper, FhirContext context) - { - super(clientProvider, taskHelper); - this.context = context; - } - - @Override - public void afterPropertiesSet() throws Exception - { - super.afterPropertiesSet(); - Objects.requireNonNull(context, "fhirContext"); - } - - @Override - public void doExecute(DelegateExecution execution) throws Exception - { - Task task = getCurrentTaskFromExecutionVariables(); - IdType bundleId = getBundleId(task); - FhirWebserviceClient requesterClient = getFhirWebserviceClientProvider() - .getRemoteWebserviceClient(bundleId.getBaseUrl()); - - Bundle bundle; - try - { - if (bundleId.hasVersionIdPart()) - bundle = requesterClient.read(Bundle.class, bundleId.getIdPart(), bundleId.getVersionIdPart()); - else - bundle = requesterClient.read(Bundle.class, bundleId.getIdPart()); - } - catch (WebApplicationException e) - { - logger.error("Error while reading Bundle with id {} from organization {}: {}", bundleId.getValue(), - task.getRequester().getReference(), e.getMessage()); - throw new RuntimeException( - "Error while reading Bundle with id " + bundleId.getValue() + " from organization " + task - .getRequester().getReference() + ", " + e.getMessage(), e); - } - - if (!EnumSet.of(BundleType.TRANSACTION, BundleType.BATCH).contains(bundle.getType())) - { - logger.error("Bundle type TRANSACTION or BATCH expected, but got {}", bundle.getType()); - throw new RuntimeException("Bundle type TRANSACTION or BATCH expected, but got " + bundle.getType()); - } - - try - { - logger.debug("Posting bundle to local endpoint: {}", context.newXmlParser().encodeResourceToString(bundle)); - getFhirWebserviceClientProvider().getLocalWebserviceClient().withMinimalReturn().postBundle(bundle); - } - catch (Exception e) - { - logger.error("Error while executing Bundle with id {} from organization {} locally: {}", - bundleId.getValue(), task.getRequester().getReference(), e.getMessage()); - throw new RuntimeException( - "Error while executing Bundle with id " + bundleId.getValue() + " from organization " + task - .getRequester().getReference() + " locally, " + e.getMessage(), e); - } - } - - private IdType getBundleId(Task task) - { - List<Reference> bundleReferences = getTaskHelper() - .getInputParameterReferenceValues(task, CODESYSTEM_HIGHMED_UPDATE_RESOURCE, - CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE).collect(Collectors.toList()); - - if (bundleReferences.size() != 1) - { - logger.error("Task input parameter {} contains unexpected number of Bundle IDs, expected 1, got {}", - CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE, bundleReferences.size()); - throw new RuntimeException( - "Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE - + " contains unexpected number of Bundle IDs, expected 1, got " + bundleReferences.size()); - } - else if (!bundleReferences.get(0).hasReference() || !bundleReferences.get(0).getReference() - .contains("/Bundle/")) - { - logger.error("Task input parameter {} has no Bundle reference", - CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); - throw new RuntimeException( - "Task input parameter " + CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE - + " has no Bundle reference"); - } - - return new IdType(bundleReferences.get(0).getReference()); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java b/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java deleted file mode 100755 index 8625f6f6f..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/java/org/highmed/dsf/bpe/spring/config/UpdateResourcesConfig.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.highmed.dsf.bpe.spring.config; - -import org.highmed.dsf.bpe.message.SendRequest; -import org.highmed.dsf.bpe.service.CheckRequest; -import org.highmed.dsf.bpe.service.SelectResourceAndTargets; -import org.highmed.dsf.bpe.service.UpdateResources; -import org.highmed.dsf.fhir.client.FhirWebserviceClientProvider; -import org.highmed.dsf.fhir.organization.OrganizationProvider; -import org.highmed.dsf.fhir.task.TaskHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import ca.uhn.fhir.context.FhirContext; - -@Configuration -public class UpdateResourcesConfig -{ - @Autowired - private FhirWebserviceClientProvider clientProvider; - - @Autowired - private OrganizationProvider organizationProvider; - - @Autowired - private TaskHelper taskHelper; - - @Autowired - private FhirContext fhirContext; - - @Bean - public SendRequest sendRequest() - { - return new SendRequest(clientProvider, taskHelper, organizationProvider, fhirContext); - } - - @Bean - public SelectResourceAndTargets selectUpdateResourcesTargets() - { - return new SelectResourceAndTargets(clientProvider, taskHelper, organizationProvider); - } - - @Bean - public UpdateResources updateResources() - { - return new UpdateResources(clientProvider, taskHelper, fhirContext); - } - - @Bean - public CheckRequest checkRequest() - { - return new CheckRequest(clientProvider, taskHelper, organizationProvider); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition deleted file mode 100644 index b6dca76c2..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/META-INF/services/org.highmed.dsf.bpe.ProcessPluginDefinition +++ /dev/null @@ -1 +0,0 @@ -org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn deleted file mode 100755 index 389057631..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/executeUpdateResources.bpmn +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0k0v4i2" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0"> - <bpmn:process id="executeUpdateResources" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:startEvent id="StartEvent_1"> - <bpmn:outgoing>SequenceFlow_0djh0eg</bpmn:outgoing> - <bpmn:messageEventDefinition messageRef="Message_1r6vnvn" /> - </bpmn:startEvent> - <bpmn:sequenceFlow id="SequenceFlow_0djh0eg" sourceRef="StartEvent_1" targetRef="checkRequest" /> - <bpmn:serviceTask id="updateResources" name="updateResources" camunda:class="org.highmed.dsf.bpe.service.UpdateResources"> - <bpmn:incoming>SequenceFlow_141lpsf</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_0eygcor</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:endEvent id="EndEvent_1i1w8yx"> - <bpmn:incoming>SequenceFlow_0eygcor</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_0eygcor" sourceRef="updateResources" targetRef="EndEvent_1i1w8yx" /> - <bpmn:sequenceFlow id="SequenceFlow_141lpsf" sourceRef="checkRequest" targetRef="updateResources" /> - <bpmn:serviceTask id="checkRequest" name="checkRequest" camunda:class="org.highmed.dsf.bpe.service.CheckRequest"> - <bpmn:incoming>SequenceFlow_0djh0eg</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_141lpsf</bpmn:outgoing> - </bpmn:serviceTask> - </bpmn:process> - <bpmn:message id="Message_1r6vnvn" name="executeUpdateResourcesMessage" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="executeUpdateResources"> - <bpmndi:BPMNShape id="StartEvent_1orek60_di" bpmnElement="StartEvent_1"> - <dc:Bounds x="179" y="103" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0djh0eg_di" bpmnElement="SequenceFlow_0djh0eg"> - <di:waypoint x="215" y="121" /> - <di:waypoint x="270" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1t3955f_di" bpmnElement="updateResources"> - <dc:Bounds x="433" y="81" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_1i1w8yx_di" bpmnElement="EndEvent_1i1w8yx"> - <dc:Bounds x="622" y="103" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0eygcor_di" bpmnElement="SequenceFlow_0eygcor"> - <di:waypoint x="533" y="121" /> - <di:waypoint x="622" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_141lpsf_di" bpmnElement="SequenceFlow_141lpsf"> - <di:waypoint x="370" y="121" /> - <di:waypoint x="433" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1aaurev_di" bpmnElement="checkRequest"> - <dc:Bounds x="270" y="81" width="100" height="80" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn deleted file mode 100755 index 13825c359..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/bpe/requestUpdateResources.bpmn +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0os0n0z" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.1"> - <bpmn:process id="requestUpdateResources" isExecutable="true" camunda:versionTag="0.4.0"> - <bpmn:sequenceFlow id="SequenceFlow_1ryplwc" sourceRef="StartEvent_1" targetRef="selectResourceAndTargets" /> - <bpmn:sequenceFlow id="SequenceFlow_1u4zxix" sourceRef="selectResourceAndTargets" targetRef="sendRequest" /> - <bpmn:endEvent id="EndEvent_1f9cjs7"> - <bpmn:incoming>SequenceFlow_1xwki6k</bpmn:incoming> - </bpmn:endEvent> - <bpmn:sequenceFlow id="SequenceFlow_1xwki6k" sourceRef="sendRequest" targetRef="EndEvent_1f9cjs7" /> - <bpmn:sendTask id="sendRequest" name="sendRequest" camunda:class="org.highmed.dsf.bpe.message.SendRequest"> - <bpmn:extensionElements> - <camunda:inputOutput> - <camunda:inputParameter name="processDefinitionKey">executeUpdateResources</camunda:inputParameter> - <camunda:inputParameter name="versionTag">0.4.0</camunda:inputParameter> - <camunda:inputParameter name="messageName">executeUpdateResourcesMessage</camunda:inputParameter> - <camunda:inputParameter name="profile">http://highmed.org/fhir/StructureDefinition/task-execute-update-resources</camunda:inputParameter> - </camunda:inputOutput> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_1u4zxix</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1xwki6k</bpmn:outgoing> - <bpmn:multiInstanceLoopCharacteristics camunda:collection="${targets.entries}" camunda:elementVariable="target" /> - </bpmn:sendTask> - <bpmn:serviceTask id="selectResourceAndTargets" name="selectResourceAndTargets" camunda:class="org.highmed.dsf.bpe.service.SelectResourceAndTargets"> - <bpmn:incoming>SequenceFlow_1ryplwc</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1u4zxix</bpmn:outgoing> - </bpmn:serviceTask> - <bpmn:startEvent id="StartEvent_1"> - <bpmn:outgoing>SequenceFlow_1ryplwc</bpmn:outgoing> - <bpmn:messageEventDefinition messageRef="Message_1buqzgq" /> - </bpmn:startEvent> - </bpmn:process> - <bpmn:message id="Message_1buqzgq" name="requestUpdateResourcesMessage" /> - <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="requestUpdateResources"> - <bpmndi:BPMNEdge id="SequenceFlow_1xwki6k_di" bpmnElement="SequenceFlow_1xwki6k"> - <di:waypoint x="515" y="121" /> - <di:waypoint x="565" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1u4zxix_di" bpmnElement="SequenceFlow_1u4zxix"> - <di:waypoint x="365" y="121" /> - <di:waypoint x="415" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1ryplwc_di" bpmnElement="SequenceFlow_1ryplwc"> - <di:waypoint x="215" y="121" /> - <di:waypoint x="265" y="121" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_1f9cjs7_di" bpmnElement="EndEvent_1f9cjs7"> - <dc:Bounds x="565" y="103" width="36" height="36" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="SendTask_1ysnf4s_di" bpmnElement="sendRequest"> - <dc:Bounds x="415" y="81" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_1hnhp7x_di" bpmnElement="selectResourceAndTargets"> - <dc:Bounds x="265" y="81" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="StartEvent_026bsfi_di" bpmnElement="StartEvent_1"> - <dc:Bounds x="179" y="103" width="36" height="36" /> - </bpmndi:BPMNShape> - </bpmndi:BPMNPlane> - </bpmndi:BPMNDiagram> -</bpmn:definitions> diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml deleted file mode 100644 index 8d1a2c559..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-executeUpdateResources.xml +++ /dev/null @@ -1,66 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="executeUpdateResourcesMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="MeDIC" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources" /> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/executeUpdateResources" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="executeUpdateResources" /> - <title value="Execute Update of Resources" /> - <subtitle value="Process to Download and Execute FHIR Bundle" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <publisher value="HiGHmed" /> - <contact> - <name value="HiGHmed" /> - <telecom> - <system value="email" /> - <value value="pmo@highmed.org" /> - </telecom> - </contact> - <description value="Process to download and execute a FHIR bundle" /> - <kind value="Task" /> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml deleted file mode 100644 index 71cb25cb0..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ActivityDefinition/highmed-requestUpdateResources.xml +++ /dev/null @@ -1,60 +0,0 @@ -<ActivityDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <extension url="http://highmed.org/fhir/StructureDefinition/extension-process-authorization"> - <extension url="message-name"> - <valueString value="requestUpdateResourcesMessage" /> - </extension> - <extension url="authorization-roles"> - <extension url="authorization-role"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="LOCAL" /> - </valueCoding> - </extension> - </extension> - <extension url="requester-organization-types"> - <extension url="requester-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="recipient-organization-types"> - <extension url="recipient-organization-type"> - <valueCoding> - <system value="http://highmed.org/fhir/CodeSystem/organization-type" /> - <code value="TTP" /> - </valueCoding> - </extension> - </extension> - <extension url="task-profile"> - <valueCanonical value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources" /> - </extension> - </extension> - <url value="http://highmed.org/bpe/Process/requestUpdateResources" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="requestUpdateResources" /> - <title value="Request Update of Resources" /> - <subtitle value="Process to Request a Bundle Download" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <publisher value="HiGHmed" /> - <contact> - <name value="HiGHmed" /> - <telecom> - <system value="email" /> - <value value="pmo@highmed.org" /> - </telecom> - </contact> - <description value="Process to request the download of a bundle to update FHIR resources" /> - <kind value="Task" /> -</ActivityDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml deleted file mode 100644 index 3f1c4a727..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/CodeSystem/highmed-update-resources.xml +++ /dev/null @@ -1,33 +0,0 @@ -<CodeSystem xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> - </meta> - <url value="http://highmed.org/fhir/CodeSystem/update-resources"/> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="HiGHmed_Update_Resources"/> - <title value="HiGHmed Update Resources"/> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false"/> - <date value="2020-11-23"/> - <publisher value="HiGHmed"/> - <description value="CodeSystem with standard values for the process update resources"/> - <caseSensitive value="true"/> - <hierarchyMeaning value="grouped-by"/> - <versionNeeded value="false"/> - <content value="complete"/> - <concept> - <code value="bundle-reference"/> - <display value="Bundle Reference"/> - <definition value="Bundle reference to be downloaded to update local resources"/> - </concept> - <concept> - <code value="organization-identifier-search-parameter"/> - <display value="Organization Identifier Search Parameter"/> - <definition value="Organization system identifier as search parameter to define which organization are targets"/> - </concept> -</CodeSystem> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml deleted file mode 100644 index b07ef3233..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-execute-update-resources.xml +++ /dev/null @@ -1,112 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-execute-update-resources" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskExecuteUpdateResources" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/executeUpdateResources/${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" /> - <min value="3" /> - <max value="3" /> - </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="executeUpdateResourcesMessage" /> - </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" /> - <min value="1" /> - </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" /> - <min value="0" /> - <max value="0" /> - </element> - <element id="Task.input:bundle-reference"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="bundle-reference" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:bundle-reference.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/update-resources" /> - </binding> - </element> - <element id="Task.input:bundle-reference.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:bundle-reference.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/update-resources" /> - </element> - <element id="Task.input:bundle-reference.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="bundle-reference" /> - </element> - <element id="Task.input:bundle-reference.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="Reference" /> - </type> - </element> - <element id="Task.input:bundle-reference.value[x].reference"> - <path value="Task.input.value[x].reference" /> - <min value="1" /> - </element> - <element id="Task.input:bundle-reference.value[x].identifier"> - <path value="Task.input.value[x].identifier" /> - <max value="0" /> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml deleted file mode 100644 index 60f4bcf14..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/StructureDefinition/highmed-task-request-update-resources.xml +++ /dev/null @@ -1,152 +0,0 @@ -<StructureDefinition xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role" /> - <code value="REMOTE" /> - </tag> - </meta> - <url value="http://highmed.org/fhir/StructureDefinition/task-request-update-resources" /> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="TaskRequestUpdateResources" /> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false" /> - <date value="2020-11-23" /> - <fhirVersion value="4.0.1" /> - <kind value="resource" /> - <abstract value="false" /> - <type value="Task" /> - <baseDefinition value="http://highmed.org/fhir/StructureDefinition/task-base" /> - <derivation value="constraint" /> - <differential> - <element id="Task.instantiatesUri"> - <path value="Task.instantiatesUri" /> - <fixedUri value="http://highmed.org/bpe/Process/requestUpdateResources/${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" /> - <min value="3" /> - <max value="3" /> - </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="requestUpdateResourcesMessage" /> - </element> - <element id="Task.input:business-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="business-key" /> - <max value="0" /> - </element> - <element id="Task.input:correlation-key"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="correlation-key" /> - <max value="0" /> - </element> - <element id="Task.input:bundle-reference"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="bundle-reference" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:bundle-reference.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/update-resources" /> - </binding> - </element> - <element id="Task.input:bundle-reference.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:bundle-reference.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/update-resources" /> - </element> - <element id="Task.input:bundle-reference.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="bundle-reference" /> - </element> - <element id="Task.input:bundle-reference.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="Reference" /> - <targetProfile value="http://hl7.org/fhir/StructureDefinition/Bundle" /> - </type> - </element> - <element id="Task.input:bundle-reference.value[x].reference"> - <path value="Task.input.value[x].reference" /> - <min value="1" /> - </element> - <element id="Task.input:bundle-reference.value[x].identifier"> - <path value="Task.input.value[x].identifier" /> - <max value="0" /> - </element> - <element id="Task.input:organization-identifier-search-parameter"> - <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> - <valueString value="Parameter" /> - </extension> - <path value="Task.input" /> - <sliceName value="organization-identifier-search-parameter" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:organization-identifier-search-parameter.type"> - <path value="Task.input.type" /> - <binding> - <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"> - <valueString value="TaskInputParameterType" /> - </extension> - <strength value="required" /> - <valueSet value="http://highmed.org/fhir/ValueSet/update-resources" /> - </binding> - </element> - <element id="Task.input:organization-identifier-search-parameter.type.coding"> - <path value="Task.input.type.coding" /> - <min value="1" /> - <max value="1" /> - </element> - <element id="Task.input:organization-identifier-search-parameter.type.coding.system"> - <path value="Task.input.type.coding.system" /> - <min value="1" /> - <fixedUri value="http://highmed.org/fhir/CodeSystem/update-resources" /> - </element> - <element id="Task.input:organization-identifier-search-parameter.type.coding.code"> - <path value="Task.input.type.coding.code" /> - <min value="1" /> - <fixedCode value="organization-identifier-search-parameter" /> - </element> - <element id="Task.input:organization-identifier-search-parameter.value[x]"> - <path value="Task.input.value[x]" /> - <type> - <code value="string" /> - </type> - </element> - </differential> -</StructureDefinition> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml deleted file mode 100644 index db4f9de4c..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/main/resources/fhir/ValueSet/highmed-update-resources.xml +++ /dev/null @@ -1,26 +0,0 @@ -<ValueSet xmlns="http://hl7.org/fhir"> - <meta> - <tag> - <system value="http://highmed.org/fhir/CodeSystem/authorization-role"/> - <code value="REMOTE"/> - </tag> - </meta> - <url value="http://highmed.org/fhir/ValueSet/update-resources"/> - <!-- version managed by bpe --> - <version value="${version}" /> - <name value="HiGHmed_Update_Resources"/> - <title value="HiGHmed Update Resources"/> - <!-- status managed by bpe --> - <status value="unknown" /> - <experimental value="false"/> - <date value="2020-11-23"/> - <publisher value="HiGHmed"/> - <description - value="ValueSet with standard values for the process update resources"/> - <immutable value="true"/> - <compose> - <include> - <system value="http://highmed.org/fhir/CodeSystem/update-resources"/> - </include> - </compose> -</ValueSet> \ No newline at end of file diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java deleted file mode 100644 index 3cc79c9d3..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/bpe/start/UpdateResource3MedicTtpExampleStarter.java +++ /dev/null @@ -1,86 +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.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP; -import static org.highmed.dsf.bpe.start.ConstantsExampleStarters.TTP_FHIR_BASE_URL; - -import java.util.Collections; -import java.util.Date; -import java.util.Map; - -import org.highmed.fhir.client.FhirWebserviceClient; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.IdType; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.ResourceType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Task; -import org.hl7.fhir.r4.model.Task.TaskIntent; -import org.hl7.fhir.r4.model.Task.TaskStatus; - -public class UpdateResource3MedicTtpExampleStarter -{ - // 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 - { - ExampleStarter starter = ExampleStarter.forServer(args, TTP_FHIR_BASE_URL); - Task task = createStartResource(starter); - starter.startWith(task); - } - - private static Task createStartResource(ExampleStarter starter) throws Exception - { - Bundle allowList = getAllowList(starter); - - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER) - .setValue(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER_VALUE_TTP); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - task.addInput().setValue(new Reference( - new IdType(ResourceType.Bundle.name(), allowList.getIdElement().getIdPart(), - allowList.getIdElement().getVersionIdPart()))).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) - .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); - - task.addInput().setValue(new StringType("http://highmed.org/fhir/NamingSystem/organization-identifier|")) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) - .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER); - - return task; - } - - private static Bundle getAllowList(ExampleStarter starter) throws Exception - { - FhirWebserviceClient client = starter.createClient(TTP_FHIR_BASE_URL); - Bundle searchResult = client.searchWithStrictHandling(Bundle.class, Map.of("identifier", - Collections.singletonList("http://highmed.org/fhir/CodeSystem/update-allow-list|highmed_allow_list"))); - - if (searchResult.getTotal() != 1 && searchResult.getEntryFirstRep().getResource() instanceof Bundle) - throw new IllegalStateException("Expected a single allow list Bundle"); - - return (Bundle) searchResult.getEntryFirstRep().getResource(); - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java b/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java deleted file mode 100644 index addcc80f3..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/java/org/highmed/dsf/fhir/profile/TaskProfileTest.java +++ /dev/null @@ -1,159 +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_BUSINESS_KEY; -import static org.highmed.dsf.bpe.ConstantsBase.CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsBase.NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME; -import static org.highmed.dsf.bpe.ConstantsUpdateResources.PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION; -import static org.highmed.dsf.bpe.UpdateResourcesProcessPluginDefinition.VERSION; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; - -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.UUID; - -import org.highmed.dsf.fhir.validation.ResourceValidator; -import org.highmed.dsf.fhir.validation.ResourceValidatorImpl; -import org.highmed.dsf.fhir.validation.SnapshotGenerator.SnapshotWithValidationMessages; -import org.highmed.dsf.fhir.validation.SnapshotGeneratorImpl; -import org.highmed.dsf.fhir.validation.StructureDefinitionReader; -import org.highmed.dsf.fhir.validation.ValidationSupportRule; -import org.highmed.dsf.fhir.validation.ValidationSupportWithCustomResources; -import org.hl7.fhir.common.hapi.validation.support.InMemoryTerminologyServerValidationSupport; -import org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain; -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.StructureDefinition; -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.context.support.DefaultProfileValidationSupport; -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, - Arrays.asList("highmed-task-base-0.4.0.xml", "highmed-task-request-update-resources.xml", - "highmed-task-execute-update-resources.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-update-resources.xml"), - Arrays.asList("highmed-authorization-role-0.4.0.xml", "highmed-bpmn-message-0.4.0.xml", - "highmed-update-resources.xml")); - - private ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), - validationRule.getValidationSupport()); - - @Test - public void testGenerateSnapshotNotWorkingWithoutBaseSnapshot() throws Exception - { - var reader = new StructureDefinitionReader(validationRule.getFhirContext()); - - StructureDefinition base = reader.readXml("/fhir/StructureDefinition/highmed-task-base-0.4.0.xml"); - StructureDefinition differential = reader - .readXml("/fhir/StructureDefinition/highmed-task-execute-update-resources.xml"); - - var validationSupport = new ValidationSupportChain( - new InMemoryTerminologyServerValidationSupport(validationRule.getFhirContext()), - new ValidationSupportWithCustomResources(validationRule.getFhirContext(), Arrays.asList(base), - Collections.emptyList(), Collections.emptyList()), - new DefaultProfileValidationSupport(validationRule.getFhirContext())); - var snapshotGenerator = new SnapshotGeneratorImpl(validationRule.getFhirContext(), validationSupport); - - SnapshotWithValidationMessages messages = snapshotGenerator.generateSnapshot(differential); - assertFalse(messages.getMessages().isEmpty()); - } - - @Test - public void testTaskRequestUpdateResourcesValid() throws Exception - { - Task task = createValidTaskRequestUpdateResources(); - - 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 createValidTaskRequestUpdateResources() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("TTP"); - task.getRestriction().addRecipient().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("MeDIC 1"); - - task.addInput().setValue(new StringType(PROFILE_HIGHMED_TASK_REQUEST_UPDATE_RESOURCES_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - - task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) - .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); - task.addInput().setValue(new StringType("http://highmed.org/fhir/NamingSystem/organization-identifier|")) - .getType().addCoding().setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) - .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_ORGANIZATION_IDENTIFIER_SEARCH_PARAMETER); - - return task; - } - - @Test - public void testTaskExecuteUpdateResourcesValid() throws Exception - { - Task task = createValidTaskExecuteUpdateResources(); - - 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 createValidTaskExecuteUpdateResources() - { - Task task = new Task(); - task.getMeta().addProfile(PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES); - task.setInstantiatesUri(PROFILE_HIGHMED_TASK_EXECUTE_UPDATE_RESOURCES_PROCESS_URI_AND_LATEST_VERSION); - task.setStatus(TaskStatus.REQUESTED); - task.setIntent(TaskIntent.ORDER); - task.setAuthoredOn(new Date()); - task.getRequester().setType(ResourceType.Organization.name()).getIdentifier() - .setSystem(NAMINGSYSTEM_HIGHMED_ORGANIZATION_IDENTIFIER).setValue("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_EXECUTE_UPDATE_RESOURCES_MESSAGE_NAME)).getType() - .addCoding().setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_MESSAGE_NAME); - task.addInput().setValue(new StringType(UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_BPMN).setCode(CODESYSTEM_HIGHMED_BPMN_VALUE_BUSINESS_KEY); - task.addInput().setValue(new Reference("Bundle/" + UUID.randomUUID().toString())).getType().addCoding() - .setSystem(CODESYSTEM_HIGHMED_UPDATE_RESOURCE) - .setCode(CODESYSTEM_HIGHMED_UPDATE_RESOURCE_VALUE_BUNDLE_REFERENCE); - - return task; - } -} diff --git a/dsf-bpe/dsf-bpe-process-update-resources/src/test/resources/log4j2.xml b/dsf-bpe/dsf-bpe-process-update-resources/src/test/resources/log4j2.xml deleted file mode 100644 index f1afe81dc..000000000 --- a/dsf-bpe/dsf-bpe-process-update-resources/src/test/resources/log4j2.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?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> - <!-- <RollingFile name="FILE" fileName="log/adt_db.log" - filePattern="log/adt_db_%d{MM-dd-yyyy}_%i.log.gz" - ignoreExceptions="false"> - <PatternLayout> - <Pattern>%d [%t] %-5p %c - %m%n</Pattern> - </PatternLayout> - <Policies> - <OnStartupTriggeringPolicy /> - <TimeBasedTriggeringPolicy /> - </Policies> - </RollingFile> --> - - <!-- <SMTP name="MAIL" subject="Production RWH LAB Gateway Error" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="50"> - </SMTP> - <SMTP name="MAIL_CERTIFICATE" subject="Production RWH LAB Gateway Certificate Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> - <SMTP name="MAIL_HL7" subject="Production RWH ADT Gateway HL7 Warning" - to="hauke.hund@med.uni-heidelberg.de, thomas.hilbel@med.uni-heidelberg.de" - from="med3-kvm15@med.uni-heidelberg.de" - replyTo="hauke.hund@med.uni-heidelberg.de" smtpHost="localhost" - smtpPort="25" bufferSize="1"> - <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/> - </SMTP> --> - </Appenders> - - <Loggers> - <Logger name="de.rwh" level="TRACE"/> - <Logger name="org.highmed" 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"/> - - <!-- <Logger name="certificate-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_CERTIFICATE" /> - </Logger> - <Logger name="async-message-handler-warning-logger" level="INFO"> - <AppenderRef ref="MAIL_HL7" /> - </Logger> --> - - <Root level="WARN"> - <AppenderRef ref="CONSOLE"/> - <!-- <AppenderRef ref="FILE" /> --> - <!-- <AppenderRef ref="MAIL" /> --> - </Root> - </Loggers> -</Configuration> \ No newline at end of file diff --git a/dsf-bpe/pom.xml b/dsf-bpe/pom.xml index c886be649..68cc583da 100755 --- a/dsf-bpe/pom.xml +++ b/dsf-bpe/pom.xml @@ -13,14 +13,9 @@ <modules> <module>dsf-bpe-process-base</module> - <module>dsf-bpe-process-feasibility</module> - <module>dsf-bpe-process-ping</module> - <module>dsf-bpe-process-update-resources</module> - <module>dsf-bpe-process-update-allow-list</module> <module>dsf-bpe-server</module> <module>dsf-bpe-server-jetty</module> <module>dsf-bpe-webservice-client</module> - <module>dsf-bpe-process-local-services</module> </modules> <properties> From c60c6026d4960f11dc667dc038298edb712790cd Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Sun, 24 Jan 2021 20:29:45 +0100 Subject: [PATCH 74/75] copy of highmed processes now via profile copy-highmed-processes --- dsf-bpe/dsf-bpe-server-jetty/pom.xml | 120 ++++++++++++--------------- 1 file changed, 54 insertions(+), 66 deletions(-) diff --git a/dsf-bpe/dsf-bpe-server-jetty/pom.xml b/dsf-bpe/dsf-bpe-server-jetty/pom.xml index 35dc2779f..602a67ed5 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/pom.xml +++ b/dsf-bpe/dsf-bpe-server-jetty/pom.xml @@ -42,7 +42,7 @@ <groupId>javax.mail</groupId> <artifactId>mail</artifactId> </dependency> - + <dependency> <groupId>org.slf4j</groupId> <artifactId>jul-to-slf4j</artifactId> @@ -114,72 +114,7 @@ <outputDirectory>docker</outputDirectory> </configuration> </execution> - <execution> - <id>copy-process-plugins-for-testing</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-ping</artifactId> - <version>${project.version}</version> - </artifactItem> - <artifactItem> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-update-allow-list</artifactId> - <version>${project.version}</version> - </artifactItem> - <artifactItem> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-update-resources</artifactId> - <version>${project.version}</version> - </artifactItem> - <artifactItem> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-feasibility</artifactId> - <version>${project.version}</version> - </artifactItem> - <artifactItem> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-local-services</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - <outputDirectory>process</outputDirectory> - </configuration> - </execution> </executions> - <!-- Making sure process definition plugins are build before we copy them --> - <dependencies> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-ping</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-update-allow-list</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-update-resources</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-feasibility</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.highmed.dsf</groupId> - <artifactId>dsf-bpe-process-local-services</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -206,4 +141,57 @@ </plugin> </plugins> </build> + + <profiles> + <profile> + <id>copy-highmed-processes</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-process-plugins-for-testing</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <artifactItems> + <artifactItem> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-ping</artifactId> + <version>${project.version}</version> + </artifactItem> + <artifactItem> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-update-allow-list</artifactId> + <version>${project.version}</version> + </artifactItem> + <artifactItem> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-update-resources</artifactId> + <version>${project.version}</version> + </artifactItem> + <artifactItem> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-feasibility</artifactId> + <version>${project.version}</version> + </artifactItem> + <artifactItem> + <groupId>org.highmed.dsf</groupId> + <artifactId>dsf-bpe-process-local-services</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> + <outputDirectory>process</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project> \ No newline at end of file From 302d82841d771b1acc90a7b2437f8460583e1ca1 Mon Sep 17 00:00:00 2001 From: Hauke Hund <hauke.hund@hs-heilbronn.de> Date: Tue, 26 Jan 2021 12:50:21 +0100 Subject: [PATCH 75/75] 0.4.0 release --- dsf-bpe/dsf-bpe-process-base/pom.xml | 2 +- dsf-bpe/dsf-bpe-server-jetty/pom.xml | 2 +- dsf-bpe/dsf-bpe-server/pom.xml | 2 +- dsf-bpe/dsf-bpe-webservice-client/pom.xml | 2 +- dsf-bpe/pom.xml | 2 +- dsf-fhir/dsf-fhir-rest-adapter/pom.xml | 2 +- dsf-fhir/dsf-fhir-server-jetty/pom.xml | 2 +- dsf-fhir/dsf-fhir-server/pom.xml | 2 +- dsf-fhir/dsf-fhir-validation/pom.xml | 4 ++-- .../fhir/CodeSystem/highmed-authorization-role-0.4.0.xml | 2 +- .../resources/fhir/CodeSystem/highmed-bpmn-message-0.4.0.xml | 2 +- .../fhir/CodeSystem/highmed-organization-type-0.4.0.xml | 2 +- .../resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml | 2 +- .../src/main/resources/fhir/NamingSystem/highmed-endpoint.xml | 2 +- .../main/resources/fhir/NamingSystem/highmed-organization.xml | 2 +- .../fhir/NamingSystem/highmed-research-study-identifier.xml | 2 +- .../fhir/StructureDefinition/highmed-endpoint-0.4.0.xml | 2 +- .../highmed-extension-certificate-thumbprint-0.4.0.xml | 2 +- .../StructureDefinition/highmed-extension-group-id-0.4.0.xml | 2 +- .../highmed-extension-participating-medic-0.4.0.xml | 2 +- .../highmed-extension-participating-ttp-0.4.0.xml | 2 +- .../highmed-extension-process-authorization-0.4.0.xml | 2 +- .../StructureDefinition/highmed-extension-query-0.4.0.xml | 2 +- .../fhir/StructureDefinition/highmed-group-0.4.0.xml | 2 +- .../fhir/StructureDefinition/highmed-organization-0.4.0.xml | 2 +- .../fhir/StructureDefinition/highmed-research-study-0.4.0.xml | 2 +- .../fhir/StructureDefinition/highmed-task-base-0.4.0.xml | 2 +- .../fhir/ValueSet/highmed-authorization-role-0.4.0.xml | 2 +- .../resources/fhir/ValueSet/highmed-bpmn-message-0.4.0.xml | 2 +- .../fhir/ValueSet/highmed-organization-type-0.4.0.xml | 2 +- .../main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml | 2 +- dsf-fhir/dsf-fhir-webservice-client/pom.xml | 2 +- dsf-fhir/dsf-fhir-websocket-client/pom.xml | 2 +- dsf-fhir/pom.xml | 2 +- dsf-mpi/dsf-mpi-client-pdq/pom.xml | 2 +- dsf-mpi/dsf-mpi-client-stub/pom.xml | 2 +- dsf-mpi/dsf-mpi-client/pom.xml | 2 +- dsf-mpi/pom.xml | 2 +- dsf-openehr/dsf-openehr-client-impl/pom.xml | 2 +- dsf-openehr/dsf-openehr-client-stub/pom.xml | 2 +- dsf-openehr/dsf-openehr-client/pom.xml | 2 +- dsf-openehr/dsf-openehr-model/pom.xml | 3 ++- dsf-openehr/pom.xml | 2 +- dsf-pseudonymization/dsf-pseudonymization-base/pom.xml | 2 +- dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml | 2 +- dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml | 2 +- dsf-pseudonymization/pom.xml | 2 +- dsf-tools/dsf-tools-build-info-reader/pom.xml | 2 +- dsf-tools/dsf-tools-bundle-generator/pom.xml | 2 +- dsf-tools/dsf-tools-db-migration/pom.xml | 2 +- dsf-tools/dsf-tools-proxy-test/pom.xml | 2 +- dsf-tools/dsf-tools-test-data-generator/pom.xml | 2 +- dsf-tools/pom.xml | 2 +- pom.xml | 2 +- 54 files changed, 56 insertions(+), 55 deletions(-) diff --git a/dsf-bpe/dsf-bpe-process-base/pom.xml b/dsf-bpe/dsf-bpe-process-base/pom.xml index e759643fe..6d1eec2b6 100755 --- a/dsf-bpe/dsf-bpe-process-base/pom.xml +++ b/dsf-bpe/dsf-bpe-process-base/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-bpe/dsf-bpe-server-jetty/pom.xml b/dsf-bpe/dsf-bpe-server-jetty/pom.xml index 602a67ed5..c2d9e1957 100755 --- a/dsf-bpe/dsf-bpe-server-jetty/pom.xml +++ b/dsf-bpe/dsf-bpe-server-jetty/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-bpe/dsf-bpe-server/pom.xml b/dsf-bpe/dsf-bpe-server/pom.xml index c8119f07c..d03bf8cdc 100755 --- a/dsf-bpe/dsf-bpe-server/pom.xml +++ b/dsf-bpe/dsf-bpe-server/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-bpe/dsf-bpe-webservice-client/pom.xml b/dsf-bpe/dsf-bpe-webservice-client/pom.xml index ccd73afbc..1fbd0afcc 100755 --- a/dsf-bpe/dsf-bpe-webservice-client/pom.xml +++ b/dsf-bpe/dsf-bpe-webservice-client/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-bpe-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-bpe/pom.xml b/dsf-bpe/pom.xml index 68cc583da..9f7f049bf 100755 --- a/dsf-bpe/pom.xml +++ b/dsf-bpe/pom.xml @@ -8,7 +8,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <modules> diff --git a/dsf-fhir/dsf-fhir-rest-adapter/pom.xml b/dsf-fhir/dsf-fhir-rest-adapter/pom.xml index 7cb3e758c..0e159c0d7 100755 --- a/dsf-fhir/dsf-fhir-rest-adapter/pom.xml +++ b/dsf-fhir/dsf-fhir-rest-adapter/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-fhir-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-fhir/dsf-fhir-server-jetty/pom.xml b/dsf-fhir/dsf-fhir-server-jetty/pom.xml index 546893d1f..3cd3febe9 100755 --- a/dsf-fhir/dsf-fhir-server-jetty/pom.xml +++ b/dsf-fhir/dsf-fhir-server-jetty/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-fhir-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-fhir/dsf-fhir-server/pom.xml b/dsf-fhir/dsf-fhir-server/pom.xml index c4841047c..836fc3260 100755 --- a/dsf-fhir/dsf-fhir-server/pom.xml +++ b/dsf-fhir/dsf-fhir-server/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-fhir-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-fhir/dsf-fhir-validation/pom.xml b/dsf-fhir/dsf-fhir-validation/pom.xml index c23a8e033..4df6b5b4f 100644 --- a/dsf-fhir/dsf-fhir-validation/pom.xml +++ b/dsf-fhir/dsf-fhir-validation/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-fhir-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> @@ -89,7 +89,7 @@ </configuration> <!-- Workaround for exec maven plugin issue --> <!-- https://github.com/mojohaus/exec-maven-plugin/issues/76 --> - <!-- <dependencies> <dependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-bundle-generator</artifactId> <version>0.4.0-SNAPSHOT</version> </dependency> + <!-- <dependencies> <dependency> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-bundle-generator</artifactId> <version>0.4.0</version> </dependency> </dependencies> --> </plugin> </plugins> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-authorization-role-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-authorization-role-0.4.0.xml index 7b8038110..f448ad34a 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-authorization-role-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-authorization-role-0.4.0.xml @@ -11,7 +11,7 @@ <title value="HiGHmed Authorization Role"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <description value="CodeSystem with authorization roles"/> <caseSensitive value="true"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-bpmn-message-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-bpmn-message-0.4.0.xml index ba804b054..af744060b 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-bpmn-message-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-bpmn-message-0.4.0.xml @@ -11,7 +11,7 @@ <title value="HiGHmed BPMN message values"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <description value="CodeSystem with standard BPMN message values for Task resources"/> <caseSensitive value="true"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-organization-type-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-organization-type-0.4.0.xml index 334507d18..c710895d3 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-organization-type-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-organization-type-0.4.0.xml @@ -11,7 +11,7 @@ <title value="HiGHmed Organization Type"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <description value="CodeSystem with HiGHmed organization roles used in Organization resources"/> <caseSensitive value="true"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml index 9a9020e65..87aaf85e1 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/CodeSystem/highmed-query-type-0.4.0.xml @@ -11,7 +11,7 @@ <title value="HiGHmed Query Type"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <description value="CodeSystem with HiGHmed query types for medical data stored in the data lake repositories"/> <caseSensitive value="true"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml index 04989ed7b..4811d5ea5 100755 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-endpoint.xml @@ -8,7 +8,7 @@ <name value="HiGHmed_Endpoint_Identifier"/> <status value="active"/> <kind value="identifier"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <responsible value="HiGHmed, TTP Heilbronn"/> <description value="Shortest DNS that resolves the endpoint typically the DNS used in endpoint.address"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml index 31eb60997..f591dc3f8 100755 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-organization.xml @@ -8,7 +8,7 @@ <name value="HiGHmed_Organization_Identifier"/> <status value="active"/> <kind value="identifier"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <responsible value="HiGHmed, TPP Heilbronn"/> <description diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml index 44a43bac6..55d3f5f77 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/NamingSystem/highmed-research-study-identifier.xml @@ -8,7 +8,7 @@ <name value="HiGHmed_ResearchStudy_Identifier"/> <status value="active" /> <kind value="identifier"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <responsible value="HiGHmed"/> <description diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml index a3100834f..ec44233e9 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-endpoint-0.4.0.xml @@ -10,7 +10,7 @@ <name value="Endpoint" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml index 5a02c11df..995f1d610 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-certificate-thumbprint-0.4.0.xml @@ -10,7 +10,7 @@ <name value="CertificateThumbprint" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml index 59ba8c88f..54309a774 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-group-id-0.4.0.xml @@ -10,7 +10,7 @@ <name value="GroupId" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <mapping> <identity value="rim" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml index 8eb41f218..6a15151a4 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-medic-0.4.0.xml @@ -10,7 +10,7 @@ <name value="ParticipatingMedic" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml index b4cee3acc..7a47fc2c0 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-participating-ttp-0.4.0.xml @@ -10,7 +10,7 @@ <name value="ParticipatingTtp" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml index 029b2ab83..9bee5ebf8 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-process-authorization-0.4.0.xml @@ -10,7 +10,7 @@ <name value="ProcessAuthorization" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.0" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml index 32b501a45..d94779c6c 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-extension-query-0.4.0.xml @@ -10,7 +10,7 @@ <name value="Query" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <kind value="complex-type" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml index 18747716b..c5a00045d 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-group-0.4.0.xml @@ -10,7 +10,7 @@ <name value="Group" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml index 76ea5304a..d709c0ff9 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-organization-0.4.0.xml @@ -10,7 +10,7 @@ <name value="Organization" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml index 6e22c8129..5aa99c041 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-research-study-0.4.0.xml @@ -10,7 +10,7 @@ <name value="ResearchStudy" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="false" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml index dfe995620..bbd4c0a92 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/StructureDefinition/highmed-task-base-0.4.0.xml @@ -10,7 +10,7 @@ <name value="TaskBase" /> <status value="active" /> <experimental value="false" /> - <date value="2020-11-23" /> + <date value="2021-01-26" /> <fhirVersion value="4.0.1" /> <kind value="resource" /> <abstract value="true" /> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-authorization-role-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-authorization-role-0.4.0.xml index 307e3529a..7e329d80a 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-authorization-role-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-authorization-role-0.4.0.xml @@ -11,7 +11,7 @@ <title value="HiGHmed Authorization Role"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <description value="ValueSet with authorization roles"/> <immutable value="true"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-bpmn-message-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-bpmn-message-0.4.0.xml index 42febdcb1..20c468066 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-bpmn-message-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-bpmn-message-0.4.0.xml @@ -11,7 +11,7 @@ <title value="HiGHmed BPMN message values"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <description value="ValueSet with standard BPMN message values for Task resources"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-organization-type-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-organization-type-0.4.0.xml index b6f8c0d1a..703e5425f 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-organization-type-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-organization-type-0.4.0.xml @@ -11,7 +11,7 @@ <title value="HiGHmed Organization Type"/> <status value="active"/> <experimental value="false"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <description value="ValueSet with HiGHmed organization types used in Organization resources"/> diff --git a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml index 91c0d6770..2817f553a 100644 --- a/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml +++ b/dsf-fhir/dsf-fhir-validation/src/main/resources/fhir/ValueSet/highmed-query-type-0.4.0.xml @@ -11,7 +11,7 @@ <title value="HiGHmed Query Type"/> <status value="active" /> <experimental value="false"/> - <date value="2020-11-23"/> + <date value="2021-01-26"/> <publisher value="HiGHmed"/> <description value="ValueSet with HiGHmed query types used in Group resources query extension of the expression datatype"/> diff --git a/dsf-fhir/dsf-fhir-webservice-client/pom.xml b/dsf-fhir/dsf-fhir-webservice-client/pom.xml index 7f66e85ad..7d3310c0d 100755 --- a/dsf-fhir/dsf-fhir-webservice-client/pom.xml +++ b/dsf-fhir/dsf-fhir-webservice-client/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-fhir-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-fhir/dsf-fhir-websocket-client/pom.xml b/dsf-fhir/dsf-fhir-websocket-client/pom.xml index a846d5066..2c9307ae0 100755 --- a/dsf-fhir/dsf-fhir-websocket-client/pom.xml +++ b/dsf-fhir/dsf-fhir-websocket-client/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-fhir-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-fhir/pom.xml b/dsf-fhir/pom.xml index c476ed371..272f3d61b 100755 --- a/dsf-fhir/pom.xml +++ b/dsf-fhir/pom.xml @@ -8,7 +8,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <modules> diff --git a/dsf-mpi/dsf-mpi-client-pdq/pom.xml b/dsf-mpi/dsf-mpi-client-pdq/pom.xml index e5edbb3b9..786d52b50 100644 --- a/dsf-mpi/dsf-mpi-client-pdq/pom.xml +++ b/dsf-mpi/dsf-mpi-client-pdq/pom.xml @@ -9,7 +9,7 @@ <parent> <artifactId>dsf-mpi-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-mpi/dsf-mpi-client-stub/pom.xml b/dsf-mpi/dsf-mpi-client-stub/pom.xml index d89bc04cf..22c575464 100644 --- a/dsf-mpi/dsf-mpi-client-stub/pom.xml +++ b/dsf-mpi/dsf-mpi-client-stub/pom.xml @@ -9,7 +9,7 @@ <parent> <artifactId>dsf-mpi-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-mpi/dsf-mpi-client/pom.xml b/dsf-mpi/dsf-mpi-client/pom.xml index 2171cf110..8f5f7b1b3 100644 --- a/dsf-mpi/dsf-mpi-client/pom.xml +++ b/dsf-mpi/dsf-mpi-client/pom.xml @@ -9,6 +9,6 @@ <parent> <artifactId>dsf-mpi-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> </project> \ No newline at end of file diff --git a/dsf-mpi/pom.xml b/dsf-mpi/pom.xml index 253cbc042..153c8a38b 100644 --- a/dsf-mpi/pom.xml +++ b/dsf-mpi/pom.xml @@ -10,7 +10,7 @@ <parent> <artifactId>dsf-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <modules> diff --git a/dsf-openehr/dsf-openehr-client-impl/pom.xml b/dsf-openehr/dsf-openehr-client-impl/pom.xml index b66f4d902..416617c5b 100644 --- a/dsf-openehr/dsf-openehr-client-impl/pom.xml +++ b/dsf-openehr/dsf-openehr-client-impl/pom.xml @@ -9,7 +9,7 @@ <parent> <artifactId>dsf-openehr-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-openehr/dsf-openehr-client-stub/pom.xml b/dsf-openehr/dsf-openehr-client-stub/pom.xml index 49ee75728..912983f47 100644 --- a/dsf-openehr/dsf-openehr-client-stub/pom.xml +++ b/dsf-openehr/dsf-openehr-client-stub/pom.xml @@ -8,7 +8,7 @@ <parent> <artifactId>dsf-openehr-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-openehr/dsf-openehr-client/pom.xml b/dsf-openehr/dsf-openehr-client/pom.xml index acf20b18d..fbfe33d55 100644 --- a/dsf-openehr/dsf-openehr-client/pom.xml +++ b/dsf-openehr/dsf-openehr-client/pom.xml @@ -8,7 +8,7 @@ <parent> <artifactId>dsf-openehr-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-openehr/dsf-openehr-model/pom.xml b/dsf-openehr/dsf-openehr-model/pom.xml index 857a9156d..de548c9d7 100644 --- a/dsf-openehr/dsf-openehr-model/pom.xml +++ b/dsf-openehr/dsf-openehr-model/pom.xml @@ -4,10 +4,11 @@ <modelVersion>4.0.0</modelVersion> <artifactId>dsf-openehr-model</artifactId> + <parent> <artifactId>dsf-openehr-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-openehr/pom.xml b/dsf-openehr/pom.xml index b327177d3..0a4b28efa 100755 --- a/dsf-openehr/pom.xml +++ b/dsf-openehr/pom.xml @@ -10,7 +10,7 @@ <parent> <artifactId>dsf-pom</artifactId> <groupId>org.highmed.dsf</groupId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <modules> diff --git a/dsf-pseudonymization/dsf-pseudonymization-base/pom.xml b/dsf-pseudonymization/dsf-pseudonymization-base/pom.xml index ba12fd7e9..b1f076cda 100644 --- a/dsf-pseudonymization/dsf-pseudonymization-base/pom.xml +++ b/dsf-pseudonymization/dsf-pseudonymization-base/pom.xml @@ -7,6 +7,6 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-pseudonymization-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> </project> \ No newline at end of file diff --git a/dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml b/dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml index 9444ad572..77a6de985 100644 --- a/dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml +++ b/dsf-pseudonymization/dsf-pseudonymization-medic/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-pseudonymization-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml b/dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml index ce69128d4..2444940dc 100644 --- a/dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml +++ b/dsf-pseudonymization/dsf-pseudonymization-ttp/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-pseudonymization-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-pseudonymization/pom.xml b/dsf-pseudonymization/pom.xml index 72a20f854..28789dab8 100644 --- a/dsf-pseudonymization/pom.xml +++ b/dsf-pseudonymization/pom.xml @@ -8,7 +8,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <modules> diff --git a/dsf-tools/dsf-tools-build-info-reader/pom.xml b/dsf-tools/dsf-tools-build-info-reader/pom.xml index aa7a8ecdc..d719d0781 100644 --- a/dsf-tools/dsf-tools-build-info-reader/pom.xml +++ b/dsf-tools/dsf-tools-build-info-reader/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-tools/dsf-tools-bundle-generator/pom.xml b/dsf-tools/dsf-tools-bundle-generator/pom.xml index 398eb66be..29673bd30 100755 --- a/dsf-tools/dsf-tools-bundle-generator/pom.xml +++ b/dsf-tools/dsf-tools-bundle-generator/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-tools/dsf-tools-db-migration/pom.xml b/dsf-tools/dsf-tools-db-migration/pom.xml index 8cddc6df7..a4c1cf243 100755 --- a/dsf-tools/dsf-tools-db-migration/pom.xml +++ b/dsf-tools/dsf-tools-db-migration/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-tools/dsf-tools-proxy-test/pom.xml b/dsf-tools/dsf-tools-proxy-test/pom.xml index 2ec1520ae..b9bf86845 100755 --- a/dsf-tools/dsf-tools-proxy-test/pom.xml +++ b/dsf-tools/dsf-tools-proxy-test/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-tools/dsf-tools-test-data-generator/pom.xml b/dsf-tools/dsf-tools-test-data-generator/pom.xml index 02084a27e..13fdce359 100755 --- a/dsf-tools/dsf-tools-test-data-generator/pom.xml +++ b/dsf-tools/dsf-tools-test-data-generator/pom.xml @@ -7,7 +7,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-tools-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <dependencies> diff --git a/dsf-tools/pom.xml b/dsf-tools/pom.xml index b1f2f1e4d..45f9cf4de 100755 --- a/dsf-tools/pom.xml +++ b/dsf-tools/pom.xml @@ -8,7 +8,7 @@ <parent> <groupId>org.highmed.dsf</groupId> <artifactId>dsf-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> </parent> <modules> diff --git a/pom.xml b/pom.xml index 139ec33f1..e7973f2ad 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ <groupId>org.highmed.dsf</groupId> <artifactId>dsf-pom</artifactId> - <version>0.4.0-SNAPSHOT</version> + <version>0.4.0</version> <packaging>pom</packaging> <modules>