fhir-py icon indicating copy to clipboard operation
fhir-py copied to clipboard

Delete via reference currently requires download first

Open BSVogler opened this issue 2 years ago • 2 comments

given a Patient id I want to delete it from the server. This code is required to make it work.

client.reference('Patient', str(userid)).to_resource().delete()

The code above downloads the resource first, although it is not necessary. It would be good to have

client.reference('Patient', str(userid)).delete()

instead.

BSVogler avatar Apr 17 '23 09:04 BSVogler

Might be related with this https://github.com/beda-software/fhir-py/issues/101

BSVogler avatar Apr 17 '23 20:04 BSVogler

@pavlushkin please take a look, it's related to refactoring you're making for conditional operations

ruscoder avatar Aug 19 '23 12:08 ruscoder

Will be fixed in 2.0.0 using client.delete('Patient', 'id') or client.delete('Patient/id')

ruscoder avatar Aug 03 '24 19:08 ruscoder

Also added helpers for BaseReference to use reference.delete() and reference.patch(**kwargs) as it was requested in the issue

ruscoder avatar Aug 03 '24 20:08 ruscoder