beda-software / fhir-py

FHIR Client for python
MIT License
177 stars 33 forks source link

Delete via reference currently requires download first #103

Closed BSVogler closed 4 months ago

BSVogler commented 1 year ago

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 commented 1 year ago

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

ruscoder commented 1 year ago

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

ruscoder commented 4 months ago

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

ruscoder commented 4 months ago

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