From 4be3334f6ff29f13629d65e67957475547de0c46 Mon Sep 17 00:00:00 2001 From: Nick Goupinets Date: Wed, 4 Aug 2021 16:33:59 -0400 Subject: [PATCH] WIP after persistence checked --- .../dao/r4/FhirResourceDaoCodeSystemR4.java | 2 +- .../jpa/mdm/broker/MdmMessageHandler.java | 30 ++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java index 6a01ab94c70..5f2aa32a2ec 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoCodeSystemR4.java @@ -138,7 +138,7 @@ public class FhirResourceDaoCodeSystemR4 extends BaseHapiFhirResourceDao mdmLinkBySource = myMdmLinkDaoSvc.findMdmLinkBySource(targetResource); + if (!mdmLinkBySource.isPresent()) { + ourLog.warn("Unable to find link by source for {}", targetResource.getIdElement()); + } + + mdmLinkBySource.ifPresent(link -> { + linkChangeEvent.setMdmMatchResult(link.getMatchResult()); + linkChangeEvent.setMdmLinkSource(link.getLinkSource()); + linkChangeEvent.setEidMatch(link.isEidMatchPresent()); + linkChangeEvent.setNewGoldenResource(link.getHadToCreateNewGoldenResource()); + linkChangeEvent.setScore(link.getScore()); + linkChangeEvent.setRuleCount(link.getRuleCount()); + }); + HookParams params = new HookParams() .add(ResourceOperationMessage.class, outgoingMsg) .add(TransactionLogMessages.class, mdmContext.getTransactionLogMessages())