Stream: implementers
Topic: FHIR System level search
Swathy Parameswaran (Dec 21 2018 at 11:10):
Hello,
What are the HTTP Verbs supporting for FHIR system level search? I have seen only a GET URL in FHIR website for system level search. Is there any option for POST?
John Moehrke (Dec 21 2018 at 13:44):
It is right there in the introduction for search... http://build.fhir.org/search.html#Introduction
Swathy Parameswaran (Dec 21 2018 at 14:24):
It is right there in the introduction for search... http://build.fhir.org/search.html#Introduction
but it is type level search, not system level right? System-level search only supports GET
method, Am I correct?
Lloyd McKenzie (Dec 21 2018 at 14:28):
All levels require support for GET and permit the use of POST.
Lloyd McKenzie (Dec 21 2018 at 14:28):
It's fine to do a system-level search of GET [base]?identifier=foo
Swathy Parameswaran (Dec 21 2018 at 14:38):
It's fine to do a system-level search of
GET [base]?identifier=foo
suppose I have a create resource api with below url
POST : base/{type}
and I have one system-level search operation with POST: base/_search?identifier=foo
is these URLs are valid. it will create conflict right? because if I call a post api for search, it may go to create a resource by taking _search as a resource type.
John Moehrke (Dec 21 2018 at 14:45):
It is possible that your server implementer didn't recognize _search as a reserved word... but it is certainly not a type of resource. So it either will work, or you will get a failure to create.
Lloyd McKenzie (Dec 21 2018 at 14:51):
If you're using POST for search, you have to use x-www-form-urlencoded submission. You can't put the parameters on the URL
Richard Ettema (Dec 21 2018 at 17:57):
@Lloyd McKenzie, the specification here, http://build.fhir.org/http.html#search, states:
POST [base]/[type]/_search{?[parameters]{&_format=[mime-type]}} Content-Type: application/x-www-form-urlencoded param1=value¶m2=value
This has exactly the same semantics as the equivalent GET command. Note that in the POST variant, parameters may appear in both the URL and the body. Parameters have the same meaning in either place. Since parameters can repeat, putting them in both places is the same as repeating them (which is valid for some parameters and not for others).
Lloyd McKenzie (Dec 21 2018 at 18:10):
Thanks Richard - I missed that nuance.
Last updated: Apr 12 2022 at 19:14 UTC