diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 119b493..59e3413 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: [pull_request] jobs: build: @@ -11,17 +8,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 17 - - uses: s4u/maven-settings-action@v2.8.0 - with: - servers: | - [ {"id": "github-mii", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}] - - name: Build with Maven - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: mvn -B verify -fae --file pom.xml + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: 17 + cache: 'maven' + - uses: s4u/maven-settings-action@7802f6aec16c9098b4798ad1f1d8ac75198194bd #3.0.0 + with: + servers: | + [ {"id": "github-mii", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}] + - name: Build with Maven + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: mvn --batch-mode --fail-at-end clean verify diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 7acd425..a699954 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -1,6 +1,3 @@ -# 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: @@ -13,24 +10,24 @@ on: 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 - - uses: s4u/maven-settings-action@v2.8.0 + cache: 'maven' + - uses: s4u/maven-settings-action@7802f6aec16c9098b4798ad1f1d8ac75198194bd #3.0.0 with: servers: | [ {"id": "github-mii", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}] - 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 clean deploy \ No newline at end of file diff --git a/pom.xml b/pom.xml index 97220f2..d6a73b5 100644 --- a/pom.xml +++ b/pom.xml @@ -1,19 +1,19 @@ 4.0.0 de.medizininformatik-initiative mii-process-data-transfer - 1.0.0.0 + 1.0.1.0 UTF-8 17 17 - 1.3.1 + 1.5.1 ../mii-processes-test-setup @@ -45,13 +45,13 @@ de.medizininformatik-initiative mii-processes-common - 1.0.0.0 + 1.0.1.0 org.slf4j slf4j-api - 2.0.9 + 2.0.13 provided @@ -82,7 +82,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.13.0 ${compileSource} ${compileTarget} @@ -91,12 +91,12 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.1 + 3.2.5 org.apache.maven.plugins maven-jar-plugin - 3.3.0 + 3.4.1 @@ -113,7 +113,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.1 + 3.5.3 package @@ -201,6 +201,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.5.0 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.22.0 + @@ -213,6 +233,9 @@ GitHub Packages https://maven.pkg.github.com/medizininformatik-initiative/mii-process-data-transfer + + ${project.artifactId}-site + @@ -363,21 +386,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/dms/bpe/process - ${project.artifactId}-${project.version}.jar + ${project.artifactId}-*.jar false @@ -388,4 +411,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/data_transfer/DataTransferProcessPluginDefinition.java b/src/main/java/de/medizininformatik_initiative/process/data_transfer/DataTransferProcessPluginDefinition.java index df270e8..c20f9c5 100644 --- a/src/main/java/de/medizininformatik_initiative/process/data_transfer/DataTransferProcessPluginDefinition.java +++ b/src/main/java/de/medizininformatik_initiative/process/data_transfer/DataTransferProcessPluginDefinition.java @@ -1,7 +1,6 @@ package de.medizininformatik_initiative.process.data_transfer; import java.time.LocalDate; -import java.util.Arrays; import java.util.List; import java.util.Map; @@ -12,8 +11,8 @@ public class DataTransferProcessPluginDefinition implements ProcessPluginDefinition { - public static final String VERSION = "1.0.0.0"; - public static final LocalDate RELEASE_DATE = LocalDate.of(2023, 12, 14); + public static final String VERSION = "1.0.1.0"; + public static final LocalDate RELEASE_DATE = LocalDate.of(2024, 6, 11); @Override public String getName() @@ -72,9 +71,8 @@ public Map> getFhirResourcesByProcessId() return Map.of( // ConstantsDataTransfer.PROCESS_NAME_FULL_DATA_RECEIVE, // - Arrays.asList(aReceive, cCrypto, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sSend, vCrypto, vDaSeStRe, vDaTr), // + List.of(aReceive, cCrypto, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sSend, vCrypto, vDaSeStRe, vDaTr), // ConstantsDataTransfer.PROCESS_NAME_FULL_DATA_SEND, // - Arrays.asList(aSend, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sStatus, sSendStart, tSendStart, vDaSeStSe, - vDaTr)); + List.of(aSend, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sStatus, sSendStart, tSendStart, vDaSeStSe, vDaTr)); } } diff --git a/src/main/java/de/medizininformatik_initiative/process/data_transfer/message/SendData.java b/src/main/java/de/medizininformatik_initiative/process/data_transfer/message/SendData.java index f3e774e..240e3bb 100644 --- a/src/main/java/de/medizininformatik_initiative/process/data_transfer/message/SendData.java +++ b/src/main/java/de/medizininformatik_initiative/process/data_transfer/message/SendData.java @@ -81,13 +81,11 @@ protected void handleSendTaskError(DelegateExecution execution, Variables variab Task task = variables.getStartTask(); String statusCode = ConstantsBase.CODESYSTEM_DATA_SET_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 = ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_ALLOWED; - } + statusCode = ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_ALLOWED; } task.setStatus(Task.TaskStatus.FAILED); diff --git a/src/main/java/de/medizininformatik_initiative/process/data_transfer/message/SendReceipt.java b/src/main/java/de/medizininformatik_initiative/process/data_transfer/message/SendReceipt.java index 1540dd1..8a04d5a 100644 --- a/src/main/java/de/medizininformatik_initiative/process/data_transfer/message/SendReceipt.java +++ b/src/main/java/de/medizininformatik_initiative/process/data_transfer/message/SendReceipt.java @@ -65,12 +65,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 + && ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR.equals(coding.getCode())) { - if (ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR.equals(coding.getCode())) - { - coding.setCode(ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_ERROR); - } + coding.setCode(ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_ERROR); } return parameterComponent; diff --git a/src/main/java/de/medizininformatik_initiative/process/data_transfer/service/EncryptData.java b/src/main/java/de/medizininformatik_initiative/process/data_transfer/service/EncryptData.java index 542bc4c..cc5dc91 100644 --- a/src/main/java/de/medizininformatik_initiative/process/data_transfer/service/EncryptData.java +++ b/src/main/java/de/medizininformatik_initiative/process/data_transfer/service/EncryptData.java @@ -118,7 +118,7 @@ private DocumentReference getDocumentReference(Bundle bundle) { List documentReferences = bundle.getEntry().stream() .map(Bundle.BundleEntryComponent::getResource).filter(r -> r instanceof DocumentReference) - .map(r -> ((DocumentReference) r)).toList(); + .map(r -> (DocumentReference) r).toList(); if (documentReferences.size() < 1) throw new IllegalArgumentException("Could not find any DocumentReference in PublicKey Bundle"); @@ -132,7 +132,7 @@ private DocumentReference getDocumentReference(Bundle bundle) private Binary getBinary(Bundle bundle) { List binaries = bundle.getEntry().stream().map(Bundle.BundleEntryComponent::getResource) - .filter(r -> r instanceof Binary).map(b -> ((Binary) b)).toList(); + .filter(r -> r instanceof Binary).map(b -> (Binary) b).toList(); if (binaries.size() < 1) throw new IllegalArgumentException("Could not find any Binary in PublicKey Bundle"); diff --git a/src/main/java/de/medizininformatik_initiative/process/data_transfer/service/ReadData.java b/src/main/java/de/medizininformatik_initiative/process/data_transfer/service/ReadData.java index afc48f7..25c91ed 100644 --- a/src/main/java/de/medizininformatik_initiative/process/data_transfer/service/ReadData.java +++ b/src/main/java/de/medizininformatik_initiative/process/data_transfer/service/ReadData.java @@ -114,7 +114,7 @@ private DocumentReference readDocumentReference(FhirClient fhirClient, String pr List documentReferences = fhirClient .searchDocumentReferences(ConstantsBase.NAMINGSYSTEM_MII_PROJECT_IDENTIFIER, projectIdentifier) .getEntry().stream().map(Bundle.BundleEntryComponent::getResource) - .filter(r -> r instanceof DocumentReference).map(r -> ((DocumentReference) r)).toList(); + .filter(r -> r instanceof DocumentReference).map(r -> (DocumentReference) r).toList(); if (documentReferences.size() < 1) throw new IllegalArgumentException("Could not find any DocumentReference for project-identifier '" diff --git a/src/main/resources/bpe/receive.bpmn b/src/main/resources/bpe/receive.bpmn index 032b012..529f9e8 100644 --- a/src/main/resources/bpe/receive.bpmn +++ b/src/main/resources/bpe/receive.bpmn @@ -1,5 +1,5 @@ - + Flow_1gyqorb @@ -31,11 +31,11 @@ - Flow_1rx301b + Flow_1a3apuy - Flow_1w37net + Flow_17wdowl @@ -44,8 +44,6 @@ Flow_1w6vljw - Flow_1rx301b - Flow_1w37net Flow_1ynmh47 Flow_1p2po17 @@ -55,8 +53,6 @@ Flow_0sa0z7s - - Flow_0sa0z7s @@ -78,69 +74,18 @@ Flow_1o874e3 Flow_1iwqqfr + Flow_1a3apuy + Flow_17wdowl Flow_1ynmh47 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -187,6 +132,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/java/de/medizininformatik_initiative/process/data_transfer/fhir/profile/ActivityDefinitionProfileTest.java b/src/test/java/de/medizininformatik_initiative/process/data_transfer/fhir/profile/ActivityDefinitionProfileTest.java index 586fb3e..7f46fa7 100644 --- a/src/test/java/de/medizininformatik_initiative/process/data_transfer/fhir/profile/ActivityDefinitionProfileTest.java +++ b/src/test/java/de/medizininformatik_initiative/process/data_transfer/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( DataTransferProcessPluginDefinition.VERSION, DataTransferProcessPluginDefinition.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/data_transfer/fhir/profile/TaskProfileTest.java b/src/test/java/de/medizininformatik_initiative/process/data_transfer/fhir/profile/TaskProfileTest.java index 8926706..b7fc5e4 100644 --- a/src/test/java/de/medizininformatik_initiative/process/data_transfer/fhir/profile/TaskProfileTest.java +++ b/src/test/java/de/medizininformatik_initiative/process/data_transfer/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.Identifier; @@ -38,11 +38,11 @@ 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-data-set-status-error.xml", "task-data-send-start.xml", + List.of("dsf-task-base-1.0.0.xml", "extension-data-set-status-error.xml", "task-data-send-start.xml", "task-data-send.xml", "task-data-status.xml"), - Arrays.asList("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "data-transfer.xml", + List.of("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "data-transfer.xml", "mii-cryptography.xml", "mii-data-set-status.xml"), - Arrays.asList("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "data-transfer.xml", + List.of("dsf-read-access-tag-1.0.0.xml", "dsf-bpmn-message-1.0.0.xml", "data-transfer.xml", "mii-cryptography.xml", "mii-data-set-status-receive.xml", "mii-data-set-status-send.xml")); private final ResourceValidator resourceValidator = new ResourceValidatorImpl(validationRule.getFhirContext(),