Added RequestDetails as part of the parameters to cleaning up possible matches to enable interceptors to MdmStorageInterceptor.cleanUpPossibleMatches (#5257)

access it
This commit is contained in:
TynerGjs 2023-09-01 13:22:43 -04:00 committed by GitHub
parent 5f5b3db4a1
commit 33be707238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
type: fix
issue: 5256
title: "Added RequestDetails as part of the parameters when cleaning up possible matches to enable interceptors to
access it."

View File

@ -219,7 +219,7 @@ public class MdmStorageInterceptor implements IMdmStorageInterceptor {
IFhirResourceDao<?> dao = myDaoRegistry.getResourceDao(theResource);
IResourcePersistentId goldenPid = extractGoldenPid(theResource, matches.get(0));
cleanUpPossibleMatches(possibleMatches, dao, goldenPid);
cleanUpPossibleMatches(possibleMatches, dao, goldenPid, theRequest);
IAnyResource goldenResource = (IAnyResource) dao.readByPid(goldenPid);
myMdmLinkDeleteSvc.deleteWithAnyReferenceTo(goldenResource);
@ -261,7 +261,10 @@ public class MdmStorageInterceptor implements IMdmStorageInterceptor {
* Possible match resources are resubmitted for matching
*/
private void cleanUpPossibleMatches(
List<IMdmLink> possibleMatches, IFhirResourceDao<?> theDao, IResourcePersistentId theGoldenPid) {
List<IMdmLink> possibleMatches,
IFhirResourceDao<?> theDao,
IResourcePersistentId theGoldenPid,
RequestDetails theRequestDetails) {
IAnyResource goldenResource = (IAnyResource) theDao.readByPid(theGoldenPid);
for (IMdmLink possibleMatch : possibleMatches) {
if (possibleMatch.getGoldenResourcePersistenceId().equals(theGoldenPid)) {
@ -273,6 +276,7 @@ public class MdmStorageInterceptor implements IMdmStorageInterceptor {
MdmTransactionContext mdmContext =
createMdmContext(MdmTransactionContext.OperationType.UPDATE_LINK, sourceResource.fhirType());
params.setMdmContext(mdmContext);
params.setRequestDetails(theRequestDetails);
mdmLinkUpdaterSvc.updateLink(params);
}