FHIR Chat · Search for deleted resources · implementers

Stream: implementers

Topic: Search for deleted resources


view this post on Zulip Sean McIlvenna (Apr 11 2019 at 05:07):

Is there a way to search for deleted resources? For example, to return a list of all StructureDefinition resources that have been deleted?

view this post on Zulip Lloyd McKenzie (Apr 11 2019 at 05:39):

No

view this post on Zulip John Moehrke (Apr 11 2019 at 12:25):

if there is an audit log, then one could find the delete events. - AuditEvent

view this post on Zulip John Moehrke (Apr 11 2019 at 12:26):

if there is a Provenance following the recommendation for Provenance-of-Delete, then one could find them -- http://build.fhir.org/provenance.html#removal

view this post on Zulip John Moehrke (Apr 11 2019 at 12:26):

so the answer depends on the policy of the server in question

view this post on Zulip nicola (RIO/SS) (Apr 20 2019 at 08:45):

In aidbox we keep all deleted resources in history table

view this post on Zulip Sean McIlvenna (Sep 10 2021 at 21:23):

Is it possible to search for all deleted resources? I know I can see the history of a deleted resource using /fhir/<resourceType>/<id>/_history, but is it possible to see a list of resources that have been deleted? i.e. /fhir/<resourceType>?_deleted=true or /fhir?_deleted=true

view this post on Zulip Craig McClendon (Sep 10 2021 at 21:49):

I don't believe such an option exists. It would be defined here if it did: http://hl7.org/fhir/search.html

view this post on Zulip Sean McIlvenna (Sep 13 2021 at 13:47):

Yah I have no doubt _deleted isn't a real thing.. But, wondering if there is something to search for deleted resources that is a real thing :)

view this post on Zulip Daniel Venton (Sep 13 2021 at 13:58):

From my experience, nothing is ever deleted. In the case of clinical resources the status would be marked with "entered-in-error" or perhaps corrected.

view this post on Zulip Sean McIlvenna (Sep 13 2021 at 14:06):

soft deleted though

view this post on Zulip Daniel Venton (Sep 13 2021 at 14:13):

In my dictionary "entered-in-error" status == soft deleted. Everything real should ignore it, unless you are specifically looking for it.

view this post on Zulip Sean McIlvenna (Sep 13 2021 at 14:21):

in my case, soft deletes are things that have been DELETE'd... you can see the history of that deleted item with /fhir/<type>/<id>/_history, but I need a way of seeing all of the resources that have been DELETE'd

view this post on Zulip Daniel Venton (Sep 13 2021 at 14:24):

I don't think things in the history are considered deleted, they are old versions. Under that definition of deleted, that would mean you could do a _history search on every item and every version that wasn't the current, is your deleted list.

view this post on Zulip Notification Bot (Sep 13 2021 at 14:43):

Sean McIlvenna has marked this topic as resolved.

view this post on Zulip Notification Bot (Sep 13 2021 at 14:43):

Sean McIlvenna has marked this topic as unresolved.

view this post on Zulip Sean McIlvenna (Sep 13 2021 at 14:43):

ooops... didn't mean to click "resolved"

view this post on Zulip Sean McIlvenna (Sep 13 2021 at 14:44):

@Daniel Venton, bottom line for me, is FHIR servers commonly allow for a resource to be deleted (not show up in searches) using the DELETE REST method, and I need a way of getting a list of resources that have been deleted

view this post on Zulip Sean McIlvenna (Sep 13 2021 at 14:45):

regardless of business logic on soft deletes

view this post on Zulip Lloyd McKenzie (Sep 13 2021 at 16:54):

Right now, there's no mechanism for searching history. Searching deleted resources is essentially searching history.

view this post on Zulip John Silva (Sep 14 2021 at 01:20):

I suppose the 'backend' (DB or otherwise) knows about this but there isn't a FHIR standard way of asking for it. Not sure but it seems like HAPI has a way of dealing with these DELETE'd resources to "fully expunge' them; not sure if they also have a way of "seeing "these DELETE'd resources. Aren't there certain countries (in EU) that have patient privacy requirements that require knowing about and "fully deleting" patient records if the patient requests it? How would this be accomplished? (of course right now it would probably have to be done in a proprietary way.)

view this post on Zulip Lloyd McKenzie (Sep 14 2021 at 04:15):

HAPI has a 'purge' operation for full deletion to satisfy EU needs to make something totally go away. It's regular 'delete' mechanism still preserves history.

view this post on Zulip Grahame Grieve (Sep 14 2021 at 05:51):

yes we explicitly decided to not support searching deleted resources, or historical versions

view this post on Zulip Sean McIlvenna (Sep 14 2021 at 14:44):

so, any plans do this in the future? seems pretty important to me...

view this post on Zulip Sean McIlvenna (Sep 14 2021 at 14:44):

R5?

view this post on Zulip Grahame Grieve (Sep 14 2021 at 17:08):

no plans, no. Why is it important? Deleted data is no longer current

view this post on Zulip Lloyd McKenzie (Sep 14 2021 at 22:13):

Deleting effectively says "Don't allow search for this anymore"...

view this post on Zulip Sean McIlvenna (Sep 15 2021 at 14:21):

It's important for a use-case I'm dealing with... Maybe not a common use-case. Surprised this hasn't come up more, though.

view this post on Zulip Sean McIlvenna (Sep 15 2021 at 14:22):

I'll plan to modify a fork of HAPI to use AuditEvent to track deletions and search the audit events

view this post on Zulip John Moehrke (Sep 15 2021 at 20:49):

Sean McIlvenna said:

I'll plan to modify a fork of HAPI to use AuditEvent to track deletions and search the audit events

presuming there are AuditEvents being recorded... would love to hear that there are.

view this post on Zulip John Moehrke (Sep 15 2021 at 20:50):

I would be even happier to know the AuditEvents conform to the IG I am working on, and if not to help me improve my IG. -- http://build.fhir.org/ig/JohnMoehrke/BasicAudit/branches/main/index.html

view this post on Zulip John Moehrke (Sep 15 2021 at 20:50):

but I have generally been ignored by all the platforms when I ask (except for Grahame)

view this post on Zulip John Moehrke (Sep 15 2021 at 20:52):

I do have firely audit spec, but it is very different.

view this post on Zulip John Moehrke (Sep 15 2021 at 20:59):

Theory is that a Provenance of the delete could be recorded too.. but I have never actually made one of those.

view this post on Zulip Sean McIlvenna (Sep 15 2021 at 21:53):

@John Moehrke , there aren't currently. But I'm planning to create an interceptor on CREATE/UPDATE/DELETE that automatically creates AuditEvent records for non-AuditEvent CUD requests.

view this post on Zulip Sean McIlvenna (Sep 15 2021 at 21:56):

Taking a look at your IG wrt AuditEvent creation, the biggest problem I see is the requirement of a Patient being involved. In my case, it's organization management... nothing to do with a patient

view this post on Zulip John Moehrke (Sep 15 2021 at 22:40):

if there is no patient involved, then there is no patient

view this post on Zulip John Moehrke (Sep 15 2021 at 22:40):

I said that in the narrative that the IG only covers cases where patient is involved.

view this post on Zulip John Moehrke (Sep 15 2021 at 22:41):

but the profiles could be easy to adjust to remove the patient and use.. let me know how well it goes. Glad to adjust my spec.. also glad to point at an open-source implementation.


Last updated: Apr 12 2022 at 19:14 UTC