Details
-
Change Request
-
Resolution: Persuasive with Modification
-
Very High
-
FHIR Core (FHIR)
-
STU3
-
FHIR Infrastructure
-
operations
-
-
Rick Geimer/Eric Haas: 20-0-0
-
Enhancement
-
Compatible, substantive
-
R5
Description
_include and _revinclude implies that you know what resource types (and their search parameters) might be referencing a given resource.
I would like a way to blindly search for any resource and/or resource type that references a given resource. For example:
https://hapi.fhir.org/baseR4/$reference-search?target=Patient/pat1
In this case, the server could respond with everything that references Patient/pat1, which may be one or many different resource types.
It would be even better if the response could enumerate where the reference lies within each of the resources that reference Patient/pat1.
If an application allows the user to delete resources on the FHIR server, the application should be able to find everything that references the resource the user wants to delete so that it can prompt the user and say "the following resources reference the resource you're wanting to delete: A, B, C. Are you sure you want to continue." With the information from the $reference-search operation (such as the location of the references within each of the resources that reference it), the application could then delete the references prior to deleting the resource, with the ultimate goal of ensuring referential integrity.