Stream: implementers
Topic: Search for an Organization via Id or PartOf-Reference
Steffen Lehnert (Nov 06 2019 at 08:34):
Hi,
I am currently implementing the following query:
"Get the organization whose Id equals '1' or which is part of an organization whose Id equals '1'"
My query string is defined as follows:
[GET] Organization?_filter=_id eq 1 or partof eq 1
However, when I execute the query like this:
http://hapi.fhir.org/baseDstu3/Organization?_filter=_id%20eq%201%20or%20partof%20eq%201
...it returns a bundle containing one CodeSystem-resource.
Now I'm confused: is there something wrong with my query (and approach) or is this a bug?
René Spronk (Nov 06 2019 at 08:44):
I've never played with _filter, but the base question to ask is: what URL does the 'self' link contain in the response bundle?
And why not simply use GET Organization?partof._id=1&_include=partof ?
Steffen Lehnert (Nov 06 2019 at 09:17):
Maybe I'm wrong, but doesn't this query only adress the last part of my query:
"which is part of an organization whose Id equals '1'"
The first part "Get the organization whose Id equals '1' " wouldn't be covered by this?
Thus I would be forced to execute a 2nd query like the following GET Organization?_id=1?
Steffen Lehnert (Nov 06 2019 at 10:22):
Here's a working example of my initial query:
http://hapi.fhir.org/baseR4/Organization?_filter=_id%20eq%2044664%20or%20partof._id%20eq%2044664 --> this query returns 3 organizations (and the correct ones too).
However, if you replace "44664" for something non-existing, the result will be random rubish , sometimes of type "CodeSystem", some other time "MessageHeader", e.g.:
http://hapi.fhir.org/baseR4/Organization?_filter=_id%20eq%204466%20or%20partof._id%20eq%204466
René Spronk (Nov 06 2019 at 12:10):
I can replicate the error, you may wish to take that one up on the #hapi stream, for that's c;early an hapi issue.
René Spronk (Nov 06 2019 at 12:16):
Using http://hapi.fhir.org/baseR4/Organization?partof._id=44664&_include=partof then the _include part doesn't appear to work. IMHO another hapi issue.
Steffen Lehnert (Nov 06 2019 at 12:19):
Thank you for confirming the issue!
Last updated: Apr 12 2022 at 19:14 UTC