diff options
| author | Paul-Christian Volkmer | 2025-12-04 20:05:04 +0100 |
|---|---|---|
| committer | GitHub | 2025-12-04 19:05:04 +0000 |
| commit | 088cc43c2cdb541ee9b9a3edb2ef39990f0b6c1e (patch) | |
| tree | e14a29a10e20d8ab9fe0fa59c361758b22f61be7 /src/main/java | |
| parent | 77b5a3b0df48ef46604b8cacdc8e4b1a2b51b378 (diff) | |
chore: return proper response on any evaluation error (#215)
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/dev/dnpm/etl/processor/consent/AbstractConsentService.java | 20 | ||||
| -rw-r--r-- | src/main/java/dev/dnpm/etl/processor/consent/MiiBroadConsentEvaluator.java | 29 |
2 files changed, 46 insertions, 3 deletions
diff --git a/src/main/java/dev/dnpm/etl/processor/consent/AbstractConsentService.java b/src/main/java/dev/dnpm/etl/processor/consent/AbstractConsentService.java index 10330a4..5c9878c 100644 --- a/src/main/java/dev/dnpm/etl/processor/consent/AbstractConsentService.java +++ b/src/main/java/dev/dnpm/etl/processor/consent/AbstractConsentService.java @@ -1,3 +1,23 @@ +/* + * This file is part of ETL-Processor + * + * Copyright (c) 2023 Comprehensive Cancer Center Mainfranken + * Copyright (c) 2023-2025 Paul-Christian Volkmer, Datenintegrationszentrum Philipps-Universität Marburg and Contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + package dev.dnpm.etl.processor.consent; import ca.uhn.fhir.context.FhirContext; diff --git a/src/main/java/dev/dnpm/etl/processor/consent/MiiBroadConsentEvaluator.java b/src/main/java/dev/dnpm/etl/processor/consent/MiiBroadConsentEvaluator.java index 0640142..c815f7a 100644 --- a/src/main/java/dev/dnpm/etl/processor/consent/MiiBroadConsentEvaluator.java +++ b/src/main/java/dev/dnpm/etl/processor/consent/MiiBroadConsentEvaluator.java @@ -1,7 +1,26 @@ +/* + * This file is part of ETL-Processor + * + * Copyright (c) 2023 Comprehensive Cancer Center Mainfranken + * Copyright (c) 2023-2025 Paul-Christian Volkmer, Datenintegrationszentrum Philipps-Universität Marburg and Contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + package dev.dnpm.etl.processor.consent; import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.parser.DataFormatException; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Consent; import org.jspecify.annotations.NullMarked; @@ -19,6 +38,10 @@ public class MiiBroadConsentEvaluator { private static final Logger log = LoggerFactory.getLogger(MiiBroadConsentEvaluator.class); + private MiiBroadConsentEvaluator() { + // No content + } + /** * Evaluates MII Broad Consent * @@ -70,8 +93,8 @@ public class MiiBroadConsentEvaluator { } return TtpConsentStatus.BROAD_CONSENT_MISSING_OR_REJECTED; } - } catch (DataFormatException dfe) { - log.error("failed to parse response to FHIR R4 resource.", dfe); + } catch (Exception e) { + log.error("failed to parse and analyze response as MII Broad Consent.", e); } return TtpConsentStatus.FAILED_TO_ASK; } |
