Simple search URL for FHIR resources

638 Views Asked by At

In the Query part of the documentation, http://www.hl7.org/implement/standards/fhir/query.htm, the search request is defined like this

GET .../[resourcetype]/(?parameters)

Then we find (without the / before the ?)

GET .../patient?_id=23

We find the search keyword too

GET [baseurl]/diagnosticreport/search?subject.name="peter"

I made 3 requests to the Grahame's test server

http://hl7connect.healthintersections.com.au/svc/fhir/practitioner/?given=Henry
http://hl7connect.healthintersections.com.au/svc/fhir/practitioner?given=Henry
http://hl7connect.healthintersections.com.au/svc/fhir/practitioner/search?given=Henry

All worked. All gave the same href (for the link) form (with the search keyword)

<link href="http://hl7connect.healthintersections.com.au/svc/fhir/practitioner/search?_format=text/xml+fhir&amp;search-id=c7d9338a-b64a-41db-875d-d3c68a12c6&amp;given=Henry&amp;search-sort=_id" rel="self" xmlns="http://www.w3.org/2005/Atom" />

I made these 3 requests to Ewout's test server /

http://fhir.furore.com/fhir/practitioner/search?given=Henry
http://fhir.furore.com/fhir/practitioner?given=Henry
http://fhir.furore.com/fhir/practitioner/?given=Henry

The first two requests worked, and return the same link

<link rel="self" href="http://fhir.furore.com/fhir/practitioner/search?given=Henry" />

the third failed : the resource/?param.

So what is the good syntax ? All of them are all right ?

3

There are 3 best solutions below

0
On

This is most probably a mistake in the specification. The trailing slash should not be in the specification, and Ewout's server is not wrong. I have noted this as an issue in a ballot comment

I'm not sure that my server is wrong either - I don't think there's a reason to ban the slash there, but it's certainly not the intent. Probably my mistake copying and pasting from my implemmentation

0
On

Given that we are going to fix the search specification I won't try to support the third syntax. Also, my server is using the default behavior of the .NET WCF REST framework, trying to force the other syntax will also force other .NET WCF REST developer to take that extra step. Which I'd like to avoid if at all possible!

0
On

"/search" is the default command, so omitting it gives the same result. Thus both of the two options accepted by Ewout's server are considered correct.