FHIR Chat · Search on non-existent resource type · implementers

Stream: implementers

Topic: Search on non-existent resource type


view this post on Zulip Jorge de la Garza (Jan 26 2017 at 18:24):

Is there a correct way to respond to a search on a non-existent resource type? Something like:
... /fhir/Foobar?_id=...

I've seen different servers respond differently. 500, 404, usually with an OperationOutcome. Would it be valid to respond with status code 200 and an empty Bundle with a "self" URL of the original URL (http://.../fhir/Foobar?_id=...)?

view this post on Zulip Mirjam Baltus (Jan 27 2017 at 10:25):

I would say no, the specs say: If the search fails (cannot be executed, not that there is no matches), the return value is a status code 4xx or 5xx with an OperationOutcome.
In the case of a non-existent type, the search cannot succeed, so you should return an error.

view this post on Zulip Pascal Pfiffner (Jan 27 2017 at 12:25):

Could one even argue that a 400 would also be correct, since the requested resource type is (probably) not listed in the capability statement and hence the request is invalid?

view this post on Zulip Ewout Kramer (Jan 30 2017 at 14:43):

That's what our Spark and Vonk servers do....right, @Christiaan Knaap ?

view this post on Zulip Christiaan Knaap (Jan 31 2017 at 15:41):

Yes indeed, they return a 404 and an OperationOutcome stating that 'Foo' is not supported.


Last updated: Apr 12 2022 at 19:14 UTC