Support for DELETing resources via batch operations
Currently, "Only update requests are supported for use within the batch operation" (https://github.com/aehrc/pathling/blob/main/fhir-server/src/main/java/au/csiro/pathling/update/BatchProvider.java#L109-L110). It would be great if resources could also be deleted.
For an initial version of this feature, it might be sufficient to only support batch bundles that exclusively contain either DELETE or PUT requests.
Looking at the logic in https://github.com/aehrc/pathling/blob/main/fhir-server/src/main/java/au/csiro/pathling/update/BatchProvider.java it doesn't seem too difficult to implement, so I'd definitely be interested in contributing - unless its already on the roadmap anyways :)
Hi @chgl,
Sure, we'd be happy to accept your contributions!
It would be good to implement both the DELETE operation for individual resources, and DELETE within batch.
Probably the best way to do it would be to add a couple of methods to au.csiro.pathling.io.Database, something like:
public void delete(@Nonnull final ResourceType resourceType, @Nonnull final IBaseResource resource)public void delete(@Nonnull final ResourceType resourceType, @Nonnull final List<IBaseResource> resources)
And then update au.csiro.pathling.update.BatchProvider and also create a new au.csiro.pathling.update.DeleteProvider (which will be similar to au.csiro.pathling.update.UpdateProvider).
@johngrimes We ended up implementing: https://github.com/bzkf/fhir-to-lakehouse which is using the Pathling libraries instead of the server to do upserts and deletes - it turned out to be easier for our streaming use case. I'm OK with closing this issue, especially looking at the change of scope for the server (https://github.com/aehrc/pathling/pull/2072)