Stream: implementers
Topic: Search with OR parameters
Shamil Nizamov (Dec 06 2019 at 16:06):
All samples that I've seen assumes that search criteria are piled up with &.
What if I have a set of parameters and I'd like to search for any of them, i.e. applying logical OR , for example:
name.first=John OR name.last=Smith OR gender=M
In a practical sense this may be required when I have a set of data (business identifier, name, etc.) but do not know which of them was used in a resource instance.
Jean Duteau (Dec 06 2019 at 16:15):
You can't do that with the simple search mechanism: http://hl7.org/implement/standards/fhir/search.html#combining
The resource would need to have defined a composite search parameter (talked about in the bottom of the section I linked) to allow you to do something like that.
Jean Duteau (Dec 06 2019 at 16:16):
When I'm teaching, I tell my students that you have to convert OR searches into multiple searches - one for each OR.
Shamil Nizamov (Dec 06 2019 at 16:28):
It's not clear how "a resource may also specify composite parameters".
I'm also looking at _filter but it's not supported in Vonk as far as I can tell.
Jean Duteau (Dec 06 2019 at 16:33):
the resource actually has to specify the parameters or you have to create a profile that lists the parameters and then implement that in your server. Unless the server has implemented these composite parameters, you are unable to do OR searches like that. Many simple OR searches are best done as individual searches.
Yunwei Wang (Dec 09 2019 at 18:18):
If you are on server side, you can support _filter.
If you are on client side, you can hope server supports _filter or send separate search queries.
Alex Goel (Feb 10 2020 at 17:00):
Hi All,
How do we do a search for an either or code e.g. /Observation?subject:Patient/{id}/&value-concept=http://radlex.org|RID50136, value-concept=http://radlex.org|RID50137"?
We want to look for RadLex RID50136 or RID50137 when evaluating a condition in a PlanDefinition.action.condition @Joel Francis
Jose Costa Teixeira (Feb 10 2020 at 17:07):
http://build.fhir.org/search.html#combining
Jose Costa Teixeira (Feb 10 2020 at 17:07):
this?
Lloyd McKenzie (Feb 10 2020 at 17:55):
value-concept=http://radlex.org|RID50136,http://radlex.org|RID50137,....
Alex Goel (Feb 10 2020 at 18:02):
@Lloyd McKenzie thanks
Last updated: Apr 12 2022 at 19:14 UTC