-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fTTP BF fix, added support for lab values, reworked FHIR store clients
fTTP BF resolution was missing the source/ prefix for the pseudonym. Adds support for lab values with profile https://www.medizininformatik-initiative.de/fhir/core/modul-labor/StructureDefinition/ObservationLab Uses the loinc code in the update condition for lab values as discussed in #4. Adds an initial FHIR store implementation for the fhir-bridge.
- Loading branch information
Showing
17 changed files
with
1,176 additions
and
519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
.../de/netzwerk_universitaetsmedizin/codex/processes/data_transfer/client/OutcomeLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package de.netzwerk_universitaetsmedizin.codex.processes.data_transfer.client; | ||
|
||
import java.util.function.BiConsumer; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
import org.hl7.fhir.r4.model.OperationOutcome; | ||
import org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity; | ||
import org.slf4j.Logger; | ||
|
||
public class OutcomeLogger | ||
{ | ||
private final Logger logger; | ||
|
||
public OutcomeLogger(Logger logger) | ||
{ | ||
this.logger = logger; | ||
} | ||
|
||
public void logOutcome(OperationOutcome outcome) | ||
{ | ||
outcome.getIssue().forEach(issue -> | ||
{ | ||
String display = issue.getCode() == null ? null : issue.getCode().getDisplay(); | ||
String details = issue.getDetails() == null ? null : issue.getDetails().getText(); | ||
String diagnostics = issue.getDiagnostics(); | ||
|
||
String message = Stream.of(display, details, diagnostics).filter(s -> s != null && !s.isBlank()) | ||
.collect(Collectors.joining(" ")); | ||
|
||
getLoggerForSeverity(issue.getSeverity(), logger).accept("Issue: {}", message); | ||
}); | ||
} | ||
|
||
private BiConsumer<String, Object> getLoggerForSeverity(IssueSeverity severity, Logger logger) | ||
{ | ||
if (severity != null) | ||
{ | ||
switch (severity) | ||
{ | ||
case ERROR: | ||
case FATAL: | ||
return logger::error; | ||
case WARNING: | ||
return logger::warn; | ||
case NULL: | ||
case INFORMATION: | ||
default: | ||
return logger::info; | ||
} | ||
} | ||
|
||
return logger::info; | ||
} | ||
} |
Oops, something went wrong.