Skip to content

Commit 67b2966

Browse files
authored
Merge branch 'dev' into CU-86bznypcf_Notifications-End-To-End-Testing
2 parents d547f89 + ca5b193 commit 67b2966

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/backend/LinkerDWH.java

+19-5
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ private static boolean helperUpdateGoldenRecordField(
9393
return changed;
9494
}
9595

96+
private static String patientName(final Interaction interaction) {
97+
var patientRecord = interaction.demographicData();
98+
String givenName = patientRecord.fields.stream()
99+
.filter(field -> "given_name".equals(field.ccTag()))
100+
.map(DemographicData.DemographicField::value)
101+
.findFirst()
102+
.orElse("");
103+
String familyName = patientRecord.fields.stream()
104+
.filter(field -> "family_name".equals(field.ccTag()))
105+
.map(DemographicData.DemographicField::value)
106+
.findFirst()
107+
.orElse("");
108+
return (givenName + " " + familyName).trim();
109+
}
110+
96111
/**
97112
* Helper update interactions score.
98113
*
@@ -126,7 +141,7 @@ static void helperUpdateInteractionsScore(
126141
if (score <= threshold) {
127142
sendNotification(Notification.NotificationType.UPDATE,
128143
interaction.interactionId(),
129-
DemographicData.getAliases(),
144+
patientName(interaction),
130145
new Notification.MatchData(expandedGoldenRecord.goldenRecord().goldenId(), score),
131146
List.of());
132147
}
@@ -325,14 +340,13 @@ static Either<List<ExternalLinkCandidate>, LinkInfo> linkInteraction(
325340
aboveThresholdNotifications.add(new Notification.MatchData(v.goldenRecord().goldenId(), v.score()));
326341
}
327342
}).filter(v -> v.score() >= matchThreshold).collect(Collectors.toCollection(ArrayList::new));
328-
329343
if (candidatesAboveMatchThreshold.isEmpty()) {
330344
if (candidatesInExternalLinkRange.isEmpty()) {
331345
linkInfo = libMPI.createInteractionAndLinkToClonedGoldenRecord(interaction, 1.0F);
332346
if (!belowThresholdNotifications.isEmpty()) {
333347
sendNotification(Notification.NotificationType.BELOW_THRESHOLD,
334348
linkInfo.interactionUID(),
335-
DemographicData.getAliases(),
349+
patientName(interaction),
336350
new Notification.MatchData(linkInfo.goldenUID(), linkInfo.score()),
337351
belowThresholdNotifications);
338352
}
@@ -359,7 +373,7 @@ static Either<List<ExternalLinkCandidate>, LinkInfo> linkInteraction(
359373
if (linkToGoldenId.score() <= matchThreshold + 0.1) {
360374
sendNotification(Notification.NotificationType.ABOVE_THRESHOLD,
361375
linkInfo.interactionUID(),
362-
DemographicData.getAliases(),
376+
patientName(interaction),
363377
new Notification.MatchData(linkInfo.goldenUID(), linkInfo.score()),
364378
aboveThresholdNotifications.stream()
365379
.filter(m -> !Objects.equals(m.gID(),
@@ -385,7 +399,7 @@ static Either<List<ExternalLinkCandidate>, LinkInfo> linkInteraction(
385399
if (!marginCandidates.isEmpty()) {
386400
sendNotification(Notification.NotificationType.MARGIN,
387401
linkInfo.interactionUID(),
388-
DemographicData.getAliases(),
402+
patientName(interaction),
389403
new Notification.MatchData(linkInfo.goldenUID(), linkInfo.score()),
390404
marginCandidates);
391405
}

devops/linux/docker/data-config/config-reference-link-dp-api.json

+2
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
"/record-details/:uid",
226226
"/browse-records"
227227
],
228+
"readOnly": true,
228229
"accessLevel": []
229230
},
230231
{
@@ -255,6 +256,7 @@
255256
"/record-details/:uid",
256257
"/browse-records"
257258
],
259+
"readOnly": true,
258260
"accessLevel": []
259261
},
260262
{

devops/linux/docker/deployment/deploy-local.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "9. Destroy JeMPI (This process will wipe all data and Volumes)."
2121

2222

2323
# Prompt user for choice
24-
read -p "Enter your choice (1-8): " choice
24+
read -p "Enter your choice (1-9): " choice
2525

2626
# Function to ask for confirmation
2727
confirm() {
@@ -249,6 +249,6 @@ case $choice in
249249
exit 0
250250
;;
251251
*)
252-
echo "Invalid choice. Please enter a number."
252+
echo "Invalid choice. Please enter a number between 1-9."
253253
;;
254254
esac

0 commit comments

Comments
 (0)