From b44ae49dd288af7bb42484bbdb3b99c6a88825ed Mon Sep 17 00:00:00 2001 From: Nick Goupinets Date: Thu, 19 Nov 2020 13:37:45 -0500 Subject: [PATCH] Removed hardcoded references to the supported MDM types --- .../fhir/jpa/mdm/interceptor/MdmStorageInterceptor.java | 2 +- .../src/main/java/ca/uhn/fhir/mdm/util/MdmUtil.java | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/interceptor/MdmStorageInterceptor.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/interceptor/MdmStorageInterceptor.java index d2311f0aa42..b30a4408fda 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/interceptor/MdmStorageInterceptor.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/interceptor/MdmStorageInterceptor.java @@ -107,7 +107,7 @@ public class MdmStorageInterceptor implements IMdmStorageInterceptor { @Hook(Pointcut.STORAGE_PRESTORAGE_RESOURCE_DELETED) public void deleteMdmLinks(RequestDetails theRequest, IBaseResource theResource) { - if (!MdmUtil.isMdmResourceType(myFhirContext, theResource)) { + if (!myMdmSettings.isSupportedMdmType(myFhirContext.getResourceType(theResource))) { return; } myMdmLinkDeleteSvc.deleteWithAnyReferenceTo(theResource); diff --git a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmUtil.java b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmUtil.java index 31e5ad8f0b3..b0c5c7817c5 100644 --- a/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmUtil.java +++ b/hapi-fhir-server-mdm/src/main/java/ca/uhn/fhir/mdm/util/MdmUtil.java @@ -31,14 +31,6 @@ import java.util.Optional; public final class MdmUtil { private MdmUtil() {} - - public static boolean isMdmResourceType(FhirContext theFhirContext, IBaseResource theResource) { - String resourceType = theFhirContext.getResourceType(theResource); - return ("Patient".equals(resourceType) || - "Practitioner".equals(resourceType)) || - "Person".equals(resourceType); - } - /** * If the resource is tagged as not managed by empi, return false. Otherwise true. * @param theBaseResource The Patient/Practitioner that is potentially managed by EMPI.