Stream: implementers
Topic: Reverse chaining example syntax
Simone Heckmann (Nov 07 2016 at 14:05):
...is this correct?
GET [base]/Patient?_has:Observation:patient:code=1234-5
I'd have expected
GET [base]/Patient?_has:Observation.patient.code=1234-5
Simone Heckmann (Nov 07 2016 at 14:05):
http://build.fhir.org/search.html#has
James Agnew (Nov 07 2016 at 20:13):
The first one is correct. patient.code
would imply the wrong thing, since that query you actually want is "find me Patients referred to by Observations by the Observation.patient
field where the Observation.code
field has the value 1234-5
"
Simone Heckmann (Nov 08 2016 at 10:18):
(deleted)
Simone Heckmann (Nov 08 2016 at 10:18):
So the generic pattern is
GET [base]/Patient?_has:[referring type]:[referring field]:[condition field]=1234-5
Simone Heckmann (Nov 08 2016 at 10:23):
Oh, I see _inculde and _revinclude use a similar syntax:
Parameter values for both _include and _revinclude have three parts, separated by a : character:
1. The name of the source resource from which the join comes
2. The name of the search parameter which must be of type reference
3. (Optional) A specific of type of target resource (for when the search parameter refers to multiple possible target types)
_include and _revInclude parameters do not include multiple values. Instead, the parameters are repeated for each different include criteria.
Maybe it would be helpful to add a similar paragraph to the _has-specification to explain the syntax pattern?
Simone Heckmann (Nov 08 2016 at 18:47):
Something that just came up in the Provenance discussion thread:
If we were to use logical References for Provenance.entity.reference
e.g. Provenance.entity.reference.identifier=http://someNamingSystem.org|112345
Is it possible to use _has to retrieve e.g. all Observations derived from this entity,
assuming Provenance has a search parameter "entity" for Provenance.entity.reference.
/Observation?_has:Provenance:target:entity=http://someNamingSystem.org|12345
Is it even possible to search for logical identifier references? I can't find explicit wording about this in the spec...
Grahame Grieve (Nov 08 2016 at 21:19):
well, you can't chain. but you can search for them
Simone Heckmann (Nov 08 2016 at 21:44):
So the query above is legit?
Last updated: Apr 12 2022 at 19:14 UTC