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.