-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delete resource doesn't work #71
Comments
Hi, @danielcoam What FHIR server implementation do you use? P.S. |
Hi @ir4y I use FHIR-R4 on Google Cloud Healthcare API It looks (http://hl7.org/fhir/http.html#3.1.0.7.1 ) that in very rare cases when there is no support in a Conditional delete there might be an OperationOutcome response. But the majority of DELETE operations won't support that. What I did in our project meanwhile is that: class CustomizedFHIRAsyncClient(AsyncFHIRClient):
"""
There is a bug in the library see :https://github.com/beda-software/fhir-py/issues/71
The only thing we are changing in the `AsyncFHIRClient` is removing the _format=json from DELETE operation
"""
async def _do_request(self, method, path, data=None, params=None):
headers = self._build_request_headers()
url = self._build_request_url(path, params)
if method.lower() == 'delete': # The change from the original function
url = url.split('_format=json')[0][:-1]
async with aiohttp.request(
method, url, json=data, headers=headers
) as r:
if 200 <= r.status < 300:
data = await r.text()
return json.loads(data, object_hook=AttrDict)
if r.status == 404 or r.status == 410:
raise ResourceNotFound(await r.text())
raise OperationOutcome(await r.text()) But it means we are on a fixed version(1.2.0) of the It's a major blocking that I think should be fixed in the library (the only thing that's weird for me is that there isn't an open bug already) |
@danielcoam Now it should work. Please upgrade to 1.2.1 |
I can't make the
delete()
resource function workThis is my remove-patient function
The Error I get from the FHIR server:
It looks like the problem is here : https://github.com/beda-software/fhir-py/blob/master/fhirpy/base/lib.py#L90
When adding the
_format=json
to theDELETE
requestWhen I remove this line it works as expected.
Any help? Couldn't find an open issue for that
The text was updated successfully, but these errors were encountered: