Stream: implementers
Topic: Reverse Chaining
Chidamber Kumar (Oct 22 2021 at 16:46):
Hello
I've a question on the example given under the section of reverse chaining.
GET [base]/Patient?_has:Observation:patient:_has:AuditEvent:entity:user=MyUserId
If my understanding is correct about reverse chaining, 'user' should be a search parameter for the Resource 'Audit'. I don't see any such search parameter defined for 'Audit'.
Any insights?
Thanks
Josh Mandel (Oct 22 2021 at 16:52):
You're correct! This is an error stemming from the fact that the example you cited is not validated automatically. The word user
should probably be agent
. I'll submit a Jira ticket.
Josh Mandel (Oct 22 2021 at 16:53):
Chidamber Kumar (Oct 22 2021 at 17:44):
Thank you @Josh Mandel for taking that as an action.
Mohsen Jafari (Jan 24 2022 at 15:31):
Regarding the Reverse Chaining, I cannot understand how multiple _has work. For example, [base]/Patient?_has:Observation:patient:code=123&_has:Observation:patient:code=456. In the documentation it says that each _has parameter is processed independently of other _has parameters, but I cannot understand the meaning of independently here. Would you please help me in this matter?
Paul Church (Jan 24 2022 at 15:41):
A better example would be to find patients where (has an Observation with code 123) AND (has an Observation with status "final"). But those could be two different Observations because each "has" is treated independently (or separately).
It is not possible to use _has to find patients where (has an Observation with (code 123 AND status "final")).
Daniel Venton (Jan 24 2022 at 15:54):
You could gather the observations you care about, collect a set of Patient id values from them then read each of those patients.
René Spronk (Jan 24 2022 at 18:34):
Paul is correct that this can't be done using 2 different _has parameters, there are other ways of doing this in one single search, e.g. using _include: GET [base]/Observation?code=123&status=final&_include=Observation: patient (ok, that'd also return the actual observations), or configuring [if one has the option of doing so] the server to support a new composite type search parameter for Observations, a composite search parameter for the tuple (code, status).
Last updated: Apr 12 2022 at 19:14 UTC