From 83610e20ecf7c7ad46dcc254722143d129345933 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 31 Oct 2023 19:21:30 +0100 Subject: [PATCH 01/12] start development cycle 1.0.1.0 --- pom.xml | 2 +- .../process/report/ReportProcessPluginDefinition.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index caffb08..ff82a89 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.medizininformatik-initiative mii-process-report - 1.0.0.0 + 1.0.1.0-SNAPSHOT UTF-8 diff --git a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java index 56ea038..353cf81 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java @@ -11,7 +11,7 @@ public class ReportProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "1.0.0.0"; + public static final String VERSION = "1.0.1.0"; public static final LocalDate RELEASE_DATE = LocalDate.of(2023, 10, 31); @Override From 2b63d5171fea42e333f18b23ebcc171ecc9db6b9 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Mon, 6 Nov 2023 14:07:47 +0100 Subject: [PATCH 02/12] update search bundle response example --- src/test/resources/fhir/Bundle/search-bundle-response.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/resources/fhir/Bundle/search-bundle-response.xml b/src/test/resources/fhir/Bundle/search-bundle-response.xml index d44e224..6c0413b 100644 --- a/src/test/resources/fhir/Bundle/search-bundle-response.xml +++ b/src/test/resources/fhir/Bundle/search-bundle-response.xml @@ -20,7 +20,7 @@ - + From 9169335c976f6ed237c7c9647733a71e190c803e Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Fri, 15 Dec 2023 10:51:01 +0100 Subject: [PATCH 03/12] run workflows only once on pull-request, update actions --- .github/workflows/maven-build.yml | 14 ++++++-------- .github/workflows/maven-publish.yml | 19 +++++++------------ pom.xml | 6 +++--- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 119b493..896a601 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -1,9 +1,6 @@ -# 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 Build with Maven -on: [push, pull_request] +on: [push] jobs: build: @@ -11,12 +8,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: 'temurin' + distribution: 'zulu' java-version: 17 + cache: 'maven' - uses: s4u/maven-settings-action@v2.8.0 with: servers: | @@ -24,4 +22,4 @@ jobs: - name: Build with Maven env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: mvn -B verify -fae --file pom.xml + run: mvn --batch-mode --fail-at-end --threads 1C -DforkCount=2 -Dgpg.skip clean verify diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 7acd425..ac15e62 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -1,31 +1,26 @@ -# 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: [develop] - release: - types: [published] jobs: publish: - # 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 || github.event.action == 'published' + # 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@v3 + - uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: 'temurin' + distribution: 'zulu' java-version: 17 + cache: 'maven' - uses: s4u/maven-settings-action@v2.8.0 with: servers: | @@ -33,4 +28,4 @@ jobs: - name: Publish with Maven env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: mvn -B deploy --file pom.xml \ No newline at end of file + run: mvn --batch-mode --fail-at-end --threads 1C -DforkCount=2 -Dgpg.skip clean deploy \ No newline at end of file diff --git a/pom.xml b/pom.xml index ff82a89..0582d3a 100644 --- a/pom.xml +++ b/pom.xml @@ -375,21 +375,21 @@ ${testSetup.location}/docker/dic1/bpe/process - ${project.artifactId}-${project.version}.jar + ${project.artifactId}-*.jar false ${testSetup.location}/docker/dic2/bpe/process - ${project.artifactId}-${project.version}.jar + ${project.artifactId}-*.jar false ${testSetup.location}/docker/hrp/bpe/process - ${project.artifactId}-${project.version}.jar + ${project.artifactId}-*.jar false From d4ab24e9c9e2d7e8bb58663790aebfedba3f06ab Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Fri, 15 Dec 2023 10:56:48 +0100 Subject: [PATCH 04/12] remove not needed options --- .github/workflows/maven-build.yml | 2 +- .github/workflows/maven-publish.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 896a601..477f60e 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -22,4 +22,4 @@ jobs: - name: Build with Maven env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: mvn --batch-mode --fail-at-end --threads 1C -DforkCount=2 -Dgpg.skip clean verify + run: mvn --batch-mode --fail-at-end clean verify diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index ac15e62..741a2b6 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -28,4 +28,4 @@ jobs: - name: Publish with Maven env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: mvn --batch-mode --fail-at-end --threads 1C -DforkCount=2 -Dgpg.skip clean deploy \ No newline at end of file + run: mvn --batch-mode --fail-at-end clean deploy \ No newline at end of file From 99b51df02f1bd2b728d3218eb81cd23910a505db Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Fri, 15 Dec 2023 11:42:34 +0100 Subject: [PATCH 05/12] add reporting and fix reported code improvements where possible --- pom.xml | 45 +++++++++++++++++++ .../process/report/message/SendReceipt.java | 8 ++-- .../process/report/message/SendReport.java | 10 ++--- 3 files changed, 52 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 0582d3a..ec0c794 100644 --- a/pom.xml +++ b/pom.xml @@ -213,6 +213,26 @@ + + org.apache.maven.plugins + maven-site-plugin + 3.12.1 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.5.0 + + + com.github.spotbugs + spotbugs-maven-plugin + 4.8.2.0 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.21.2 + @@ -225,6 +245,9 @@ GitHub Packages https://maven.pkg.github.com/medizininformatik-initiative/mii-process-report + + ${project.artifactId}-site + @@ -400,4 +423,26 @@ + + + + + org.apache.maven.plugins + maven-pmd-plugin + + + com.github.spotbugs + spotbugs-maven-plugin + + + + jp.skypencil.findbugs.slf4j + bug-pattern + 1.5.0 + + + + + + \ No newline at end of file diff --git a/src/main/java/de/medizininformatik_initiative/process/report/message/SendReceipt.java b/src/main/java/de/medizininformatik_initiative/process/report/message/SendReceipt.java index c1ea06b..230b1d5 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/message/SendReceipt.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/message/SendReceipt.java @@ -51,12 +51,10 @@ private Stream createReceiptError(Variables variables) private Task.ParameterComponent receiveToReceiptStatus(Task.ParameterComponent parameterComponent) { Type value = parameterComponent.getValue(); - if (value instanceof Coding coding) + if (value instanceof Coding coding + && ConstantsReport.CODESYSTEM_REPORT_STATUS_VALUE_RECEIVE_ERROR.equals(coding.getCode())) { - if (ConstantsReport.CODESYSTEM_REPORT_STATUS_VALUE_RECEIVE_ERROR.equals(coding.getCode())) - { - coding.setCode(ConstantsReport.CODESYSTEM_REPORT_STATUS_VALUE_RECEIPT_ERROR); - } + coding.setCode(ConstantsReport.CODESYSTEM_REPORT_STATUS_VALUE_RECEIPT_ERROR); } return parameterComponent; diff --git a/src/main/java/de/medizininformatik_initiative/process/report/message/SendReport.java b/src/main/java/de/medizininformatik_initiative/process/report/message/SendReport.java index 29bb167..37977de 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/message/SendReport.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/message/SendReport.java @@ -69,13 +69,11 @@ protected void handleIntermediateThrowEventError(DelegateExecution execution, Va if (task != null) { String statusCode = ConstantsReport.CODESYSTEM_REPORT_STATUS_VALUE_NOT_REACHABLE; - if (exception instanceof WebApplicationException webApplicationException) + if (exception instanceof WebApplicationException webApplicationException + && webApplicationException.getResponse() != null + && webApplicationException.getResponse().getStatus() == Response.Status.FORBIDDEN.getStatusCode()) { - if (webApplicationException.getResponse() != null && webApplicationException.getResponse() - .getStatus() == Response.Status.FORBIDDEN.getStatusCode()) - { - statusCode = ConstantsReport.CODESYSTEM_REPORT_STATUS_VALUE_NOT_ALLOWED; - } + statusCode = ConstantsReport.CODESYSTEM_REPORT_STATUS_VALUE_NOT_ALLOWED; } task.addOutput(statusGenerator.createReportStatusOutput(statusCode, "Send report failed")); From 9023e34a612eaae28eaed6b57e502179b8b550be Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Mon, 4 Mar 2024 14:42:20 +0100 Subject: [PATCH 06/12] update dependecies --- pom.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index ec0c794..e59bdb4 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 17 17 - 1.3.1 + 1.5.0 ../mii-processes-test-setup @@ -45,19 +45,19 @@ de.medizininformatik-initiative mii-processes-common - 1.0.0.0 + 1.0.1.0-SNAPSHOT org.springframework spring-web - 6.0.13 + 6.1.4 provided org.slf4j slf4j-api - 2.0.9 + 2.0.12 provided @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.1 ${compileSource} ${compileTarget} @@ -103,7 +103,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.1 + 3.2.5 org.apache.maven.plugins @@ -125,7 +125,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.1 + 3.5.2 package @@ -226,7 +226,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.8.2.0 + 4.8.3.1 org.apache.maven.plugins From 8fb67f884e91a892e3f5c73bd1d3f9314bd57604 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Mon, 25 Mar 2024 16:48:03 +0100 Subject: [PATCH 07/12] allow code system searches --- pom.xml | 2 +- .../process/report/ConstantsReport.java | 3 + .../report/ReportProcessPluginDefinition.java | 2 +- .../report/service/CheckSearchBundle.java | 25 +- .../report/service/DownloadSearchBundle.java | 2 +- src/main/resources/fhir/CodeSystem/report.xml | 9 +- .../search-bundle-report.xml | 2 +- .../bpe/CheckSearchBundleServiceTest.java | 18 + ...arch-bundle-v2-invalid-code-ingredient.xml | 22 + .../Bundle/search-bundle-v2-invalid-code.xml | 22 + .../fhir/Bundle/search-bundle-v2.xml | 634 ++++++++++++++++++ 11 files changed, 734 insertions(+), 7 deletions(-) create mode 100644 src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code-ingredient.xml create mode 100644 src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code.xml create mode 100644 src/test/resources/fhir/Bundle/search-bundle-v2.xml diff --git a/pom.xml b/pom.xml index e59bdb4..064408f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.medizininformatik-initiative mii-process-report - 1.0.1.0-SNAPSHOT + 1.1.0.0-SNAPSHOT UTF-8 diff --git a/src/main/java/de/medizininformatik_initiative/process/report/ConstantsReport.java b/src/main/java/de/medizininformatik_initiative/process/report/ConstantsReport.java index 86e4995..38ca04d 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/ConstantsReport.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/ConstantsReport.java @@ -43,7 +43,10 @@ public interface ConstantsReport String BPMN_EXECUTION_VARIABLE_REPORT_RECEIVE_ERROR_MESSAGE = "reportReceiveErrorMessage"; String CODESYSTEM_REPORT = "http://medizininformatik-initiative.de/fhir/CodeSystem/report"; + + @Deprecated String CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE = "search-bundle"; + String CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE_V2 = "search-bundle-v2"; String CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE_RESPONSE_REFERENCE = "search-bundle-response-reference"; String CODESYSTEM_REPORT_VALUE_REPORT_STATUS = "report-status"; String CODESYSTEM_REPORT_VALUE_TIMER_INTERVAL = "timer-interval"; diff --git a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java index 353cf81..d9fb633 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java @@ -11,7 +11,7 @@ public class ReportProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "1.0.1.0"; + public static final String VERSION = "1.1.0.0"; public static final LocalDate RELEASE_DATE = LocalDate.of(2023, 10, 31); @Override diff --git a/src/main/java/de/medizininformatik_initiative/process/report/service/CheckSearchBundle.java b/src/main/java/de/medizininformatik_initiative/process/report/service/CheckSearchBundle.java index c7deae4..fd81a1f 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/service/CheckSearchBundle.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/service/CheckSearchBundle.java @@ -35,10 +35,12 @@ public class CheckSearchBundle extends AbstractServiceDelegate private static final List DATE_SEARCH_PARAMS = List.of("date", "recorded-date", "onset-date", "effective", "effective-time", "authored", "collected", "issued", "period", "location-period", "occurrence"); + private static final List CODE_SEARCH_PARAMS = List.of("code", "ingredient-code"); private static final List OTHER_SEARCH_PARAMS = List.of("_profile", "type", SUMMARY_SEARCH_PARAM); private static final List VALID_SEARCH_PARAMS = Stream - .concat(DATE_SEARCH_PARAMS.stream(), OTHER_SEARCH_PARAMS.stream()).toList(); + .of(DATE_SEARCH_PARAMS.stream(), CODE_SEARCH_PARAMS.stream(), OTHER_SEARCH_PARAMS.stream()).flatMap(s -> s) + .toList(); public CheckSearchBundle(ProcessPluginApi api) { @@ -114,6 +116,7 @@ private void testRequestUrls(List searches) testContainsSummaryCount(uriComponents); testContainsValidSearchParams(uriComponents); testContainsValidDateSearchParams(uriComponents); + testContainsValidCodeSearchParams(uriComponents); } private void testContainsSummaryCount(List uriComponents) @@ -169,4 +172,24 @@ private void testSearchParamDateValues(Map queryParams) "Search Bundle contains date search params not limited to a year - [" + erroneousDateValues.stream() .map(e -> e.getKey() + ":" + e.getValue()).collect(Collectors.joining(",")) + "]"); } + + private void testContainsValidCodeSearchParams(List uriComponents) + { + uriComponents.stream().filter(u -> !CAPABILITY_STATEMENT_PATH.equals(u.getPath())) + .map(u -> u.getQueryParams().toSingleValueMap()).forEach(this::testSearchParamCodeValues); + } + + private void testSearchParamCodeValues(Map queryParams) + { + List> codeParams = queryParams.entrySet().stream() + .filter(e -> CODE_SEARCH_PARAMS.contains(MODIFIERS.matcher(e.getKey()).replaceAll(""))).toList(); + + List> erroneousCodeValues = codeParams.stream() + .filter(e -> !e.getValue().endsWith("|")).toList(); + + if (erroneousCodeValues.size() > 0) + throw new RuntimeException( + "Search Bundle contains code search params not limited to system - [" + erroneousCodeValues.stream() + .map(e -> e.getKey() + ":" + e.getValue()).collect(Collectors.joining(",")) + "]"); + } } diff --git a/src/main/java/de/medizininformatik_initiative/process/report/service/DownloadSearchBundle.java b/src/main/java/de/medizininformatik_initiative/process/report/service/DownloadSearchBundle.java index 0726dc9..4d6820d 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/service/DownloadSearchBundle.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/service/DownloadSearchBundle.java @@ -53,7 +53,7 @@ protected void doExecute(DelegateExecution execution, Variables variables) Task task = variables.getStartTask(); Target target = variables.getTarget(); String searchBundleIdentifier = ConstantsReport.CODESYSTEM_REPORT + "|" - + ConstantsReport.CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE; + + ConstantsReport.CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE_V2; logger.info("Downloading search Bundle '{}' from HRP '{}' for Task with id '{}'", searchBundleIdentifier, target.getOrganizationIdentifierValue(), task.getId()); diff --git a/src/main/resources/fhir/CodeSystem/report.xml b/src/main/resources/fhir/CodeSystem/report.xml index 0aa67de..09d8e02 100644 --- a/src/main/resources/fhir/CodeSystem/report.xml +++ b/src/main/resources/fhir/CodeSystem/report.xml @@ -28,8 +28,13 @@ - - + + + + + + + diff --git a/src/main/resources/fhir/StructureDefinition/search-bundle-report.xml b/src/main/resources/fhir/StructureDefinition/search-bundle-report.xml index 3d42e56..95add24 100644 --- a/src/main/resources/fhir/StructureDefinition/search-bundle-report.xml +++ b/src/main/resources/fhir/StructureDefinition/search-bundle-report.xml @@ -33,7 +33,7 @@ - + diff --git a/src/test/java/de/medizininformatik_initiative/process/report/bpe/CheckSearchBundleServiceTest.java b/src/test/java/de/medizininformatik_initiative/process/report/bpe/CheckSearchBundleServiceTest.java index e8382ab..a240e42 100644 --- a/src/test/java/de/medizininformatik_initiative/process/report/bpe/CheckSearchBundleServiceTest.java +++ b/src/test/java/de/medizininformatik_initiative/process/report/bpe/CheckSearchBundleServiceTest.java @@ -120,6 +120,24 @@ public void testInvalidDateValue() testInvalid("/fhir/Bundle/search-bundle-invalid-date-value.xml", "not limited to a year"); } + @Test + public void testValidV2() + { + testValid("/fhir/Bundle/search-bundle-v2.xml"); + } + + @Test + public void testInvalidV2Code() + { + testInvalid("/fhir/Bundle/search-bundle-v2-invalid-code.xml", "not limited to system"); + } + + @Test + public void testInvalidV2CodeIngredient() + { + testInvalid("/fhir/Bundle/search-bundle-v2-invalid-code-ingredient.xml", "not limited to system"); + } + private void testValid(String pathToBundle) { try (InputStream in = getClass().getResourceAsStream(pathToBundle)) diff --git a/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code-ingredient.xml b/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code-ingredient.xml new file mode 100644 index 0000000..f235346 --- /dev/null +++ b/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code-ingredient.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code.xml b/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code.xml new file mode 100644 index 0000000..f244e67 --- /dev/null +++ b/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/fhir/Bundle/search-bundle-v2.xml b/src/test/resources/fhir/Bundle/search-bundle-v2.xml new file mode 100644 index 0000000..1731434 --- /dev/null +++ b/src/test/resources/fhir/Bundle/search-bundle-v2.xml @@ -0,0 +1,634 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 221e39c57f6990e06332d902232fea97edaa9f36 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Mon, 25 Mar 2024 17:56:32 +0100 Subject: [PATCH 08/12] use commit hash instead of version tag for third-party actions, only build on pull_request --- .github/workflows/maven-build.yml | 4 ++-- .github/workflows/maven-publish.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 477f60e..e677bcc 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -1,6 +1,6 @@ name: Java CI Build with Maven -on: [push] +on: [pull_request] jobs: build: @@ -15,7 +15,7 @@ jobs: distribution: 'zulu' java-version: 17 cache: 'maven' - - uses: s4u/maven-settings-action@v2.8.0 + - uses: s4u/maven-settings-action@7802f6aec16c9098b4798ad1f1d8ac75198194bd #3.0.0 with: servers: | [ {"id": "github-mii", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}] diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 741a2b6..639a40c 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -21,7 +21,7 @@ jobs: distribution: 'zulu' java-version: 17 cache: 'maven' - - uses: s4u/maven-settings-action@v2.8.0 + - uses: s4u/maven-settings-action@7802f6aec16c9098b4798ad1f1d8ac75198194bd #3.0.0 with: servers: | [ {"id": "github-mii", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}] From dd46ec24ed70e8b27b0dfb5a3cbd54f4e26e6c90 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 26 Mar 2024 19:09:08 +0100 Subject: [PATCH 09/12] use process resource version as search-bundle version --- .../process/report/ConstantsReport.java | 4 +--- .../process/report/service/DownloadSearchBundle.java | 9 +++++++-- .../process/report/spring/config/ReportConfig.java | 3 ++- src/main/resources/fhir/CodeSystem/report.xml | 11 +++-------- .../fhir/StructureDefinition/search-bundle-report.xml | 2 +- .../report/bpe/CheckSearchBundleServiceTest.java | 6 +++--- ...=> search-bundle-v1.1-invalid-code-ingredient.xml} | 2 +- ...d-code.xml => search-bundle-v1.1-invalid-code.xml} | 2 +- .../{search-bundle-v2.xml => search-bundle-v1.1.xml} | 2 +- 9 files changed, 20 insertions(+), 21 deletions(-) rename src/test/resources/fhir/Bundle/{search-bundle-v2-invalid-code-ingredient.xml => search-bundle-v1.1-invalid-code-ingredient.xml} (95%) rename src/test/resources/fhir/Bundle/{search-bundle-v2-invalid-code.xml => search-bundle-v1.1-invalid-code.xml} (95%) rename src/test/resources/fhir/Bundle/{search-bundle-v2.xml => search-bundle-v1.1.xml} (99%) diff --git a/src/main/java/de/medizininformatik_initiative/process/report/ConstantsReport.java b/src/main/java/de/medizininformatik_initiative/process/report/ConstantsReport.java index 38ca04d..857e272 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/ConstantsReport.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/ConstantsReport.java @@ -44,9 +44,7 @@ public interface ConstantsReport String CODESYSTEM_REPORT = "http://medizininformatik-initiative.de/fhir/CodeSystem/report"; - @Deprecated - String CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE = "search-bundle"; - String CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE_V2 = "search-bundle-v2"; + String CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE = "search-bundle-v"; String CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE_RESPONSE_REFERENCE = "search-bundle-response-reference"; String CODESYSTEM_REPORT_VALUE_REPORT_STATUS = "report-status"; String CODESYSTEM_REPORT_VALUE_TIMER_INTERVAL = "timer-interval"; diff --git a/src/main/java/de/medizininformatik_initiative/process/report/service/DownloadSearchBundle.java b/src/main/java/de/medizininformatik_initiative/process/report/service/DownloadSearchBundle.java index 4d6820d..28ac968 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/service/DownloadSearchBundle.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/service/DownloadSearchBundle.java @@ -30,12 +30,16 @@ public class DownloadSearchBundle extends AbstractServiceDelegate implements Ini private final ReportStatusGenerator statusGenerator; private final DataLogger dataLogger; - public DownloadSearchBundle(ProcessPluginApi api, ReportStatusGenerator statusGenerator, DataLogger dataLogger) + private final String processVersion; + + public DownloadSearchBundle(ProcessPluginApi api, ReportStatusGenerator statusGenerator, DataLogger dataLogger, + String processVersion) { super(api); this.statusGenerator = statusGenerator; this.dataLogger = dataLogger; + this.processVersion = processVersion; } @Override @@ -45,6 +49,7 @@ public void afterPropertiesSet() throws Exception Objects.requireNonNull(statusGenerator, "statusGenerator"); Objects.requireNonNull(dataLogger, "dataLogger"); + Objects.requireNonNull(processVersion, "processVersion"); } @Override @@ -53,7 +58,7 @@ protected void doExecute(DelegateExecution execution, Variables variables) Task task = variables.getStartTask(); Target target = variables.getTarget(); String searchBundleIdentifier = ConstantsReport.CODESYSTEM_REPORT + "|" - + ConstantsReport.CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE_V2; + + ConstantsReport.CODESYSTEM_REPORT_VALUE_SEARCH_BUNDLE + processVersion; logger.info("Downloading search Bundle '{}' from HRP '{}' for Task with id '{}'", searchBundleIdentifier, target.getOrganizationIdentifierValue(), task.getId()); diff --git a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/ReportConfig.java b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/ReportConfig.java index 2886a29..6af8a90 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/spring/config/ReportConfig.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/spring/config/ReportConfig.java @@ -86,7 +86,8 @@ public SelectTargetHrp selectTargetHrp() @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) public DownloadSearchBundle downloadSearchBundle() { - return new DownloadSearchBundle(api, reportStatusGenerator(), fhirClientConfig.dataLogger()); + String processVersion = new ReportProcessPluginDefinition().getResourceVersion(); + return new DownloadSearchBundle(api, reportStatusGenerator(), fhirClientConfig.dataLogger(), processVersion); } @Bean diff --git a/src/main/resources/fhir/CodeSystem/report.xml b/src/main/resources/fhir/CodeSystem/report.xml index 09d8e02..c4942ff 100644 --- a/src/main/resources/fhir/CodeSystem/report.xml +++ b/src/main/resources/fhir/CodeSystem/report.xml @@ -27,14 +27,9 @@ - - - - - - - - + + + diff --git a/src/main/resources/fhir/StructureDefinition/search-bundle-report.xml b/src/main/resources/fhir/StructureDefinition/search-bundle-report.xml index 95add24..f9bf423 100644 --- a/src/main/resources/fhir/StructureDefinition/search-bundle-report.xml +++ b/src/main/resources/fhir/StructureDefinition/search-bundle-report.xml @@ -33,7 +33,7 @@ - + diff --git a/src/test/java/de/medizininformatik_initiative/process/report/bpe/CheckSearchBundleServiceTest.java b/src/test/java/de/medizininformatik_initiative/process/report/bpe/CheckSearchBundleServiceTest.java index a240e42..2ffbf73 100644 --- a/src/test/java/de/medizininformatik_initiative/process/report/bpe/CheckSearchBundleServiceTest.java +++ b/src/test/java/de/medizininformatik_initiative/process/report/bpe/CheckSearchBundleServiceTest.java @@ -123,19 +123,19 @@ public void testInvalidDateValue() @Test public void testValidV2() { - testValid("/fhir/Bundle/search-bundle-v2.xml"); + testValid("/fhir/Bundle/search-bundle-v1.1.xml"); } @Test public void testInvalidV2Code() { - testInvalid("/fhir/Bundle/search-bundle-v2-invalid-code.xml", "not limited to system"); + testInvalid("/fhir/Bundle/search-bundle-v1.1-invalid-code.xml", "not limited to system"); } @Test public void testInvalidV2CodeIngredient() { - testInvalid("/fhir/Bundle/search-bundle-v2-invalid-code-ingredient.xml", "not limited to system"); + testInvalid("/fhir/Bundle/search-bundle-v1.1-invalid-code-ingredient.xml", "not limited to system"); } private void testValid(String pathToBundle) diff --git a/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code-ingredient.xml b/src/test/resources/fhir/Bundle/search-bundle-v1.1-invalid-code-ingredient.xml similarity index 95% rename from src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code-ingredient.xml rename to src/test/resources/fhir/Bundle/search-bundle-v1.1-invalid-code-ingredient.xml index f235346..dc922f0 100644 --- a/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code-ingredient.xml +++ b/src/test/resources/fhir/Bundle/search-bundle-v1.1-invalid-code-ingredient.xml @@ -10,7 +10,7 @@ - + diff --git a/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code.xml b/src/test/resources/fhir/Bundle/search-bundle-v1.1-invalid-code.xml similarity index 95% rename from src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code.xml rename to src/test/resources/fhir/Bundle/search-bundle-v1.1-invalid-code.xml index f244e67..844776f 100644 --- a/src/test/resources/fhir/Bundle/search-bundle-v2-invalid-code.xml +++ b/src/test/resources/fhir/Bundle/search-bundle-v1.1-invalid-code.xml @@ -10,7 +10,7 @@ - + diff --git a/src/test/resources/fhir/Bundle/search-bundle-v2.xml b/src/test/resources/fhir/Bundle/search-bundle-v1.1.xml similarity index 99% rename from src/test/resources/fhir/Bundle/search-bundle-v2.xml rename to src/test/resources/fhir/Bundle/search-bundle-v1.1.xml index 1731434..41d153a 100644 --- a/src/test/resources/fhir/Bundle/search-bundle-v2.xml +++ b/src/test/resources/fhir/Bundle/search-bundle-v1.1.xml @@ -10,7 +10,7 @@ - + From d09ef495fc68cc4e5733119c641b07482812c406 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Mon, 27 May 2024 10:16:23 +0200 Subject: [PATCH 10/12] upgrade dependencies, fix publish github actions, use List.of instead of Arrays.asList --- .github/workflows/maven-publish.yml | 2 ++ pom.xml | 18 +++++++++--------- .../report/ReportProcessPluginDefinition.java | 8 +++----- .../profile/ActivityDefinitionProfileTest.java | 8 ++++---- .../report/fhir/profile/TaskProfileTest.java | 9 ++++----- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 639a40c..a699954 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -4,6 +4,8 @@ on: pull_request: types: [closed] branches: [develop] + release: + types: [published] jobs: publish: diff --git a/pom.xml b/pom.xml index 064408f..b833bc7 100644 --- a/pom.xml +++ b/pom.xml @@ -45,19 +45,19 @@ de.medizininformatik-initiative mii-processes-common - 1.0.1.0-SNAPSHOT + 1.0.1.0 org.springframework spring-web - 6.1.4 + 6.1.6 provided org.slf4j slf4j-api - 2.0.12 + 2.0.13 provided @@ -78,7 +78,7 @@ org.mockito mockito-core - 3.12.4 + 5.12.0 test @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + 3.13.0 ${compileSource} ${compileTarget} @@ -108,7 +108,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.3.0 + 3.4.1 @@ -125,7 +125,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.2 + 3.5.3 package @@ -226,12 +226,12 @@ com.github.spotbugs spotbugs-maven-plugin - 4.8.3.1 + 4.8.5.0 org.apache.maven.plugins maven-pmd-plugin - 3.21.2 + 3.22.0 diff --git a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java index d9fb633..14a4cea 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java @@ -1,7 +1,6 @@ package de.medizininformatik_initiative.process.report; import java.time.LocalDate; -import java.util.Arrays; import java.util.List; import java.util.Map; @@ -74,13 +73,12 @@ public Map> getFhirResourcesByProcessId() var vReportStatusSend = "fhir/ValueSet/report-status-send.xml"; return Map.of(ConstantsReport.PROCESS_NAME_FULL_REPORT_AUTOSTART, - Arrays.asList( - aAutostart, cReport, sAutostartStart, sAutostartStop, tAutostartStart, tAutostartStop, vReport), + List.of(aAutostart, cReport, sAutostartStart, sAutostartStop, tAutostartStart, tAutostartStop, vReport), ConstantsReport.PROCESS_NAME_FULL_REPORT_RECEIVE, - Arrays.asList(aReceive, cReport, cReportStatus, eReportStatusError, nReportIdent, sSearchBundle, + List.of(aReceive, cReport, cReportStatus, eReportStatusError, nReportIdent, sSearchBundle, sSearchBundleResponse, sSend, vReport, vReportStatusReceive), ConstantsReport.PROCESS_NAME_FULL_REPORT_SEND, - Arrays.asList(aSend, cReport, cReportStatus, eReportStatusError, nReportIdent, sReceive, sSearchBundle, + List.of(aSend, cReport, cReportStatus, eReportStatusError, nReportIdent, sReceive, sSearchBundle, sSearchBundleResponse, sSendStart, tSendStart, vReport, vReportStatusSend)); } } diff --git a/src/test/java/de/medizininformatik_initiative/process/report/fhir/profile/ActivityDefinitionProfileTest.java b/src/test/java/de/medizininformatik_initiative/process/report/fhir/profile/ActivityDefinitionProfileTest.java index caf7af1..93a7453 100644 --- a/src/test/java/de/medizininformatik_initiative/process/report/fhir/profile/ActivityDefinitionProfileTest.java +++ b/src/test/java/de/medizininformatik_initiative/process/report/fhir/profile/ActivityDefinitionProfileTest.java @@ -4,7 +4,7 @@ import static org.junit.Assert.assertTrue; import java.nio.file.Paths; -import java.util.Arrays; +import java.util.List; import org.hl7.fhir.r4.model.ActivityDefinition; import org.junit.ClassRule; @@ -28,7 +28,7 @@ public class ActivityDefinitionProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule( ReportProcessPluginDefinition.VERSION, ReportProcessPluginDefinition.RELEASE_DATE, - Arrays.asList("dsf-activity-definition-1.0.0.xml", "dsf-extension-process-authorization-1.0.0.xml", + List.of("dsf-activity-definition-1.0.0.xml", "dsf-extension-process-authorization-1.0.0.xml", "dsf-extension-process-authorization-organization-1.0.0.xml", "dsf-extension-process-authorization-organization-practitioner-1.0.0.xml", "dsf-extension-process-authorization-parent-organization-role-1.0.0.xml", @@ -43,9 +43,9 @@ public class ActivityDefinitionProfileTest "dsf-coding-process-authorization-remote-all-1.0.0.xml", "dsf-coding-process-authorization-remote-parent-organization-role-1.0.0.xml", "dsf-coding-process-authorization-remote-organization-1.0.0.xml"), - Arrays.asList("dsf-organization-role-1.0.0.xml", "dsf-practitioner-role-1.0.0.xml", + List.of("dsf-organization-role-1.0.0.xml", "dsf-practitioner-role-1.0.0.xml", "dsf-process-authorization-1.0.0.xml", "dsf-read-access-tag-1.0.0.xml"), - Arrays.asList("dsf-organization-role-1.0.0.xml", "dsf-practitioner-role-1.0.0.xml", + List.of("dsf-organization-role-1.0.0.xml", "dsf-practitioner-role-1.0.0.xml", "dsf-process-authorization-recipient-1.0.0.xml", "dsf-process-authorization-requester-1.0.0.xml", "dsf-read-access-tag-1.0.0.xml")); diff --git a/src/test/java/de/medizininformatik_initiative/process/report/fhir/profile/TaskProfileTest.java b/src/test/java/de/medizininformatik_initiative/process/report/fhir/profile/TaskProfileTest.java index 86aad64..6777269 100644 --- a/src/test/java/de/medizininformatik_initiative/process/report/fhir/profile/TaskProfileTest.java +++ b/src/test/java/de/medizininformatik_initiative/process/report/fhir/profile/TaskProfileTest.java @@ -2,8 +2,8 @@ import static org.junit.Assert.assertEquals; -import java.util.Arrays; import java.util.Date; +import java.util.List; import java.util.UUID; import org.hl7.fhir.r4.model.Reference; @@ -36,13 +36,12 @@ public class TaskProfileTest @ClassRule public static final ValidationSupportRule validationRule = new ValidationSupportRule(def.getResourceVersion(), def.getResourceReleaseDate(), - Arrays.asList("dsf-task-base-1.0.0.xml", "extension-report-status-error.xml", "search-bundle-report.xml", + List.of("dsf-task-base-1.0.0.xml", "extension-report-status-error.xml", "search-bundle-report.xml", "search-bundle-response-report.xml", "task-report-autostart-start.xml", "task-report-autostart-stop.xml", "task-report-receive.xml", "task-report-send.xml", "task-report-send-start.xml"), - Arrays.asList("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "report.xml", - "report-status.xml"), - Arrays.asList("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "report.xml", + List.of("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "report.xml", "report-status.xml"), + List.of("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "report.xml", "report-status-receive.xml", "report-status-send.xml")); private final ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(), From fd3b7d81475fd3b3649ac5b46b59ece85cd47369 Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Mon, 27 May 2024 10:36:54 +0200 Subject: [PATCH 11/12] update dsf version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b833bc7..4d420e3 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 17 17 - 1.5.0 + 1.5.1 ../mii-processes-test-setup From 092f9a85f48910526d7a85efa550f9be0857f8bb Mon Sep 17 00:00:00 2001 From: Reto Wettstein Date: Tue, 11 Jun 2024 09:53:09 +0200 Subject: [PATCH 12/12] release 1.1.0.0 --- pom.xml | 2 +- .../process/report/ReportProcessPluginDefinition.java | 2 +- src/test/resources/fhir/Bundle/search-bundle-v1.1.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 4d420e3..072790d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.medizininformatik-initiative mii-process-report - 1.1.0.0-SNAPSHOT + 1.1.0.0 UTF-8 diff --git a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java index 14a4cea..5d94e18 100644 --- a/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java +++ b/src/main/java/de/medizininformatik_initiative/process/report/ReportProcessPluginDefinition.java @@ -11,7 +11,7 @@ public class ReportProcessPluginDefinition implements ProcessPluginDefinition { public static final String VERSION = "1.1.0.0"; - public static final LocalDate RELEASE_DATE = LocalDate.of(2023, 10, 31); + public static final LocalDate RELEASE_DATE = LocalDate.of(2024, 06, 11); @Override public String getName() diff --git a/src/test/resources/fhir/Bundle/search-bundle-v1.1.xml b/src/test/resources/fhir/Bundle/search-bundle-v1.1.xml index 41d153a..68e27b2 100644 --- a/src/test/resources/fhir/Bundle/search-bundle-v1.1.xml +++ b/src/test/resources/fhir/Bundle/search-bundle-v1.1.xml @@ -1,7 +1,7 @@ - +