0

Is it possible to search for a parameter in all the resources on a FHIR based server (currently using HAPI)?

{{url}}/Basic?_id=1

Returns the correct Basic resource but I want to be able to search through all resource types (Basic, Patient, Observation, etc.). I was hoping that there would be a way to do something like this:

{{url}}/ALL?_id=1

Thanks, Stephen

StephenL
  • 122
  • 1
  • 11

1 Answers1

1

You can search system wide by performing a search with this syntax

  GET [base]?[parameters]{&_format=[mime-type]}

so in your case that would be

  GET [base]?_id=1

Note that this only works for parameters defined on all resources, like _id. See http://hl7.org/fhir/DSTU2/search.html for more search syntax and explanation/examples.

Mirjam Baltus
  • 2,035
  • 9
  • 13
  • So what would [base] be for my requirement? – StephenL Apr 26 '17 at 16:10
  • That would be the endpoint your server is running on, so for example if you wanted to use the public DSTU2 HAPI server it would be http://fhirtest.uhn.ca/baseDstu2. – Mirjam Baltus Apr 28 '17 at 07:45
  • Thanks for the extra information, however I have "http://localhost:5634/fhir/baseDstu3" as my base and "http://localhost:5634/fhir/baseDstu3?_id=1" as my GET request. This results in a response of "ERROR [] This is the base URL of FHIR server. Unable to handle this request, as it does not contain a resource type or operation name." This response was the same as when we were using Dstu2 as well. – StephenL May 03 '17 at 10:01
  • 1
    Looking at the metadata of the HAPI server, I can see that they don't support this interaction on the system level (yet). So in this case if you want to use it, unfortunately you'll have to implement the system wide search functionality first. – Mirjam Baltus May 04 '17 at 11:21
  • Thanks for the information and effort, at least it confirms what I was finding. – StephenL May 05 '17 at 13:42