diff --git a/JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/backend/LinkerDWH.java b/JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/backend/LinkerDWH.java index 7b52ffafb..da9b206a7 100644 --- a/JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/backend/LinkerDWH.java +++ b/JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/backend/LinkerDWH.java @@ -93,6 +93,21 @@ private static boolean helperUpdateGoldenRecordField( return changed; } + private static String patientName(final Interaction interaction) { + var patientRecord = interaction.demographicData(); + String givenName = patientRecord.fields.stream() + .filter(field -> "given_name".equals(field.ccTag())) + .map(DemographicData.DemographicField::value) + .findFirst() + .orElse(""); + String familyName = patientRecord.fields.stream() + .filter(field -> "family_name".equals(field.ccTag())) + .map(DemographicData.DemographicField::value) + .findFirst() + .orElse(""); + return (givenName + " " + familyName).trim(); + } + /** * Helper update interactions score. * @@ -126,7 +141,7 @@ static void helperUpdateInteractionsScore( if (score <= threshold) { sendNotification(Notification.NotificationType.UPDATE, interaction.interactionId(), - DemographicData.getAliases(), + patientName(interaction), new Notification.MatchData(expandedGoldenRecord.goldenRecord().goldenId(), score), List.of()); } @@ -325,14 +340,13 @@ static Either, LinkInfo> linkInteraction( aboveThresholdNotifications.add(new Notification.MatchData(v.goldenRecord().goldenId(), v.score())); } }).filter(v -> v.score() >= matchThreshold).collect(Collectors.toCollection(ArrayList::new)); - if (candidatesAboveMatchThreshold.isEmpty()) { if (candidatesInExternalLinkRange.isEmpty()) { linkInfo = libMPI.createInteractionAndLinkToClonedGoldenRecord(interaction, 1.0F); if (!belowThresholdNotifications.isEmpty()) { sendNotification(Notification.NotificationType.BELOW_THRESHOLD, linkInfo.interactionUID(), - DemographicData.getAliases(), + patientName(interaction), new Notification.MatchData(linkInfo.goldenUID(), linkInfo.score()), belowThresholdNotifications); } @@ -359,7 +373,7 @@ static Either, LinkInfo> linkInteraction( if (linkToGoldenId.score() <= matchThreshold + 0.1) { sendNotification(Notification.NotificationType.ABOVE_THRESHOLD, linkInfo.interactionUID(), - DemographicData.getAliases(), + patientName(interaction), new Notification.MatchData(linkInfo.goldenUID(), linkInfo.score()), aboveThresholdNotifications.stream() .filter(m -> !Objects.equals(m.gID(), @@ -385,7 +399,7 @@ static Either, LinkInfo> linkInteraction( if (!marginCandidates.isEmpty()) { sendNotification(Notification.NotificationType.MARGIN, linkInfo.interactionUID(), - DemographicData.getAliases(), + patientName(interaction), new Notification.MatchData(linkInfo.goldenUID(), linkInfo.score()), marginCandidates); } diff --git a/devops/linux/docker/data-config/config-reference-link-dp-api.json b/devops/linux/docker/data-config/config-reference-link-dp-api.json index 89d3a75b1..41eb30b75 100644 --- a/devops/linux/docker/data-config/config-reference-link-dp-api.json +++ b/devops/linux/docker/data-config/config-reference-link-dp-api.json @@ -225,6 +225,7 @@ "/record-details/:uid", "/browse-records" ], + "readOnly": true, "accessLevel": [] }, { @@ -255,6 +256,7 @@ "/record-details/:uid", "/browse-records" ], + "readOnly": true, "accessLevel": [] }, { diff --git a/devops/linux/docker/deployment/deploy-local.sh b/devops/linux/docker/deployment/deploy-local.sh index 89071da7c..ff4ca60a1 100755 --- a/devops/linux/docker/deployment/deploy-local.sh +++ b/devops/linux/docker/deployment/deploy-local.sh @@ -21,7 +21,7 @@ echo "9. Destroy JeMPI (This process will wipe all data and Volumes)." # Prompt user for choice -read -p "Enter your choice (1-8): " choice +read -p "Enter your choice (1-9): " choice # Function to ask for confirmation confirm() { @@ -249,6 +249,6 @@ case $choice in exit 0 ;; *) - echo "Invalid choice. Please enter a number." + echo "Invalid choice. Please enter a number between 1-9." ;; esac \ No newline at end of file