Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

$delete-expunge not working on hapi-fhir-jpaserver-starter

683 views
Skip to first unread message

Sean McIlvenna

unread,
Mar 9, 2022, 10:51:08 AM3/9/22
to HAPI FHIR
We're using 5.5+ of HAPI, and see that there is a config option for `delete_expunge_enabled`. We've enabled it. We've also ensured `expunge_enabled: true` and `allow_multiple_delete: true`.

Despite that, though, we're not able to run $delete-expunge. For example;

POST /fhir/$delete-expunge
{
   "resourceType": "Parameters",
   ...
}

We're getting the following error:

```
{
    "resourceType""OperationOutcome",
    "text": {
        "status""generated",
        "div""<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[$delete-expunge] with parameters [[]]</pre></td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
    },
    "issue": [
        {
            "severity""error",
            "code""not-supported",
            "diagnostics""Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[$delete-expunge] with parameters [[]]"
        }
    ]
}
```

Can someone help? Seems like we've enabled everything necessary for this to function... but it's not working.

Kevin Dougan

unread,
Mar 10, 2022, 8:14:13 AM3/10/22
to HAPI FHIR
Hi Sean,

If you want to DELETE ALL Patient resources, you can try this:

HTTP DELETE /fhir/Patient?_expunge=true      { WITH NO BODY }

Alternatively, you can try this:

HTTP POST /fhir/Patient/$expunge
{
"resourceType": "Parameters",
"parameter": [
{
"name": "expungeDeletedResources",
"valueBoolean": true
},{
"name": "expungePreviousVersions",
"valueBoolean": true
},{
"name": "expungeEverything",
"valueBoolean": true
},{
"name": "limit",
"valueInteger": 1000
}
]
}


Sean McIlvenna

unread,
Mar 10, 2022, 9:59:42 AM3/10/22
to HAPI FHIR
Hi Kevin,

I was trying to use the $delete-expunge functionality described here: https://smilecdr.com/docs/fhir_repository/deleting_data.html
Is that not available in open-source HAPI?

Thanks

Sahas Subramanian

unread,
Nov 27, 2023, 9:09:26 AM11/27/23
to HAPI FHIR
I'm running `docker pull hapiproject/hapi:latest` and seeing the same behavior. Is $expunge available on the open source version?

Kevin Dougan

unread,
Nov 28, 2023, 8:55:34 AM11/28/23
to HAPI FHIR

Sean McIlvenna

unread,
Apr 10, 2025, 1:52:32 PMApr 10
to HAPI FHIR
On the `latest` image, I have the following:
- hapi.fhir.expunge_enabled=true
- hapi.fhir.delete_expunge_enabled=true
Yet, I get the following error:
{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "not-supported",
            "diagnostics": "Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[$delete-expunge] with parameters [[]]"
        }
    ]
}
Any ideas?

James Agnew

unread,
Apr 10, 2025, 1:58:57 PMApr 10
to Sean McIlvenna, HAPI FHIR
I believe only the "DELETE with _expunge=true" version of the operation is currently enabled in the JPA Starter currently: https://smilecdr.com/docs/fhir_repository/deleting_data.html#delete-expunge-delete-with-expungetrue

We should probably also be registering the DeleteExpungeProvider (which provides the $delete-expunge operation) when that flag is enabled in the starter (PRs welcome) but I don't see it being registered in there currently.

Cheers,
James


--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hapi-fhir/b6f52ac1-a5e9-435c-a548-5831c48dac14n%40googlegroups.com.

Sean McIlvenna

unread,
Apr 10, 2025, 3:08:16 PMApr 10
to HAPI FHIR
Thanks James! I didn't consider the possibility that "delete_expunge_enabled" could only be referring to the "_expunge" query parameter, and not the $delete-expunge operation as a whole. Good thought!
Reply all
Reply to author
Forward
0 new messages