Stream: implementers
Topic: Perform search with OR conditions
Yassiel Oliva (Mar 15 2019 at 00:00):
Hello, I would like to make a search over Task
. I would like to filter by the subject.name=peter or requester.name=peter or ...
but I can't find the way to write the query or if that's even possible.
Lloyd McKenzie (Mar 15 2019 at 02:45):
You could send a batch containing two queries or you could use _filter or you could use graphQL. Those are the only mechanisms I'm aware of. It can't be done with a simple RESTful query unless you design a custom search parameter that matches on both subject.name and requester.name and get the relevant server(s) to implement that.
Yassiel Oliva (Mar 15 2019 at 14:46):
I will check it out but looks like _filter
can be what I need. Sorry, I should have seen that in the docs. thanks
Lloyd McKenzie (Mar 15 2019 at 14:51):
Be aware that _filter isn't supported that widely.
Brian Postlethwaite (Apr 06 2019 at 23:38):
"OR" on the same property is through the ',' eg patient?name=brian,lloyd
Lloyd McKenzie (Apr 07 2019 at 00:46):
Right, but the request was for OR of distinct properties
Brian Postlethwaite (Apr 07 2019 at 01:05):
Ok, missed that part.
nicola (RIO/SS) (Apr 20 2019 at 08:55):
another hack is to create search parameter with both names and use comma
Last updated: Apr 12 2022 at 19:14 UTC