Stream: implementers
Topic: Search for related resource
Peter Bernhardt (Apr 28 2020 at 14:58):
I have a search requirement that seeks to find all organizations in which a given practitioner is associated via his/her role at that organization. And all I would know about the practitioner is an identifier (e.g., NPI). So, the question I would ask is: For this practitioner's identifier, send me all the Organization resources where the Practioner has a role.
I think I would need to use a combination of a chained and reverse chain query, but not sure exactly how to structure the query given the syntax is different for each. Here's my first stab at the query, but I don't think this is kosher.
GET [base]/Organization?_has:PractionerRole:practitioner.identifier=<practionerId>
René Spronk (Apr 28 2020 at 15:17):
PractitionerRole?practitioner.identifier=<prac.id>&_include=PractitionerRole:organization - the resulting Bundle will also contain PractitionerRole resources, but these can be easily ignored by your client.
Peter Bernhardt (Apr 28 2020 at 15:39):
René Spronk said:
PractitionerRole?practitioner.identifier=<prac.id>&_include=PractitionerRole:organization - the resulting Bundle will also contain PractitionerRole resources, but these can be easily ignored by your client.
So the bundle returned will include PractionerRole entries with Organization contained in each entry?
Vassil Peytchev (Apr 28 2020 at 15:41):
They will be separate entries, not nested.
Peter Bernhardt (Apr 28 2020 at 15:42):
Ok ... so a bundle with both Organization entries (what I really want) and PractionerRole entries (that may be ignored). Thanks.
René Spronk (Apr 29 2020 at 10:04):
Organization?_has:PractionerRole:organization:practitioner.identifier=<prac.id> may also work on some servers (I've seen similar searches work).
Last updated: Apr 12 2022 at 19:14 UTC