Stream: implementers
Topic: Reverse chaining within a chain
Josh Mandel (Feb 21 2019 at 16:13):
Similar questions have been asked before, but I can't quite find the answer to this.
I'd like to express a query of "find all encounters involving patients who are members of Group 102." Is the following valid?
Encounter?patient._has:Group:member:_id=102
I haven't seen the ?param._has
pattern documented or used before, so it's not clear to me if this is valid.
When I tried testing this on https://test.fhir.org, I didn't get very far, because my query for "find Patients who are members of Group 102" didn't seem to work (I'm probably doing something silly, but I can't figure out what):
$ curl -s -H "Accept: application/fhir+json" "http://test.fhir.org/r4/Patient?_has:Group:member:_id=102"
This appears to just return all patients.
Alexander Zautke (Feb 21 2019 at 17:25):
{{BASE_URL}}/Encounter?patient._has:Group:member:_id=102
works perfectly fine in Vonk. I agree that this behaviour is not documented anywhere in the specification as far as I know, but I don't see a reason why it should not be allowed, as _has is yet another search parameter valid for all resources.
Grahame Grieve (Feb 21 2019 at 21:14):
I haven't got to reverse chaining yet. It's on my todo list
Josh Mandel (Feb 21 2019 at 21:41):
Thanks @Alexander Zautke (I had a :
where I should have written .
, now fixed). @Grahame Grieve do you agree this query is consistent with the FHIR spec? (Understood that your server doesn't support it today; that's a different matter.)
Alexander Zautke (Feb 26 2019 at 09:29):
Added Gforge #20474 to clarify the behaviour.
Last updated: Apr 12 2022 at 19:14 UTC