I have been trying to implement a REST API for a .NET client and I am not sure about how to get all the references for organizations to be able to remove them and finally be able to delete the organization from our server.
I know theres a $everthing for patients but there’s not much documentation for organization references and $everything does not work…
Even $everything for Patient wouldn’t be guaranteed to find all references. What it returns is server-specific. There’s currently no standard mechanism to find all resources that reference a given resource. Even if such an operation were defined, it would only identify resources stored on that server - there’d be no way to know whether references also existed on other servers. References to resources are sort of like hyperlinks to a web page. There’s no way to be certain that there isn’t some page out there that points to your page. For that reason, deletes are often ‘soft’ deletes, where the historical record is retained, but simply no longer retrievable by regular searches. You can still access it by version-specific reads or by looking at history.