Stream: implementers
Topic: Search with OR operator
Amiel Matrix (Feb 26 2020 at 13:10):
Hi!!
What is the right way to search in the Fhir REST API with OR operator?
For example I want to find patient with phone 1234 OR identifier 1234. What do the right syntax in the URL?
René Spronk (Feb 26 2020 at 14:07):
The RESTFul search option in FHIR doesn't support such queries. You'd need a named query, an operation or one of the alternative query languages to accomplish this.
Amiel Matrix (Feb 26 2020 at 18:26):
Ok, Thanks
Jeffrey Taylor (Feb 26 2020 at 20:10):
FHIR does support ORs and ANDs within the same FHIR search parameter (&
for AND ,
for OR). See Composite Search Parameter docs here: https://www.hl7.org/fhir/search.html#combining.
But as Rene said, not an OR between two different search parameters (as far as I'm aware). Another alternative additional to what Rene mentioned is to simply execute two queries and combine the results.
Last updated: Apr 12 2022 at 19:14 UTC