Stream: implementers
Topic: Additional context for entry.search.mode=include
Paul Church (May 17 2021 at 20:54):
Thinking about adding an extension on Bundle.entry.search with additional context for include/revinclude results. Currently there's no way to tell by looking at the entry which resource(s) it is associated with, whether it was a forward or reverse include, etc.
Has anyone created similar extensions for this? I'm happy to be consistent if there's already a pattern out there.
Josh Mandel (May 18 2021 at 17:42):
Would be good to take this up in FHIR-I as core extensions. (It's interesting/tricky as all of these might need to be repeating params, since individual resources can be included for more than one reason; currently we punt on this at the top level for mode, with "There is only one mode. In some corner cases, a resource may be included because it is both a match and an include. In these circumstances, 'match' takes precedence.")
Lloyd McKenzie (May 18 2021 at 20:58):
Keep in mind that a single resource could, theoretically, be an _include from multiple resources in the page and could even be an _include for some and a _revinclude for others - or in odd cases, could be an _include and _revinclude for the same resource. Also, this is redundant with just looking at the references in the resource, so not sure how much it'd be buying?
Paul Church (May 18 2021 at 21:04):
Our experience has been that although the client can figure it out (especially in specific use cases), in the general case it takes a fair amount of effort. There are a bunch of references in the resources, each of which may or may not be involved. You can't tell the difference between an include and a revinclude, so you have to look for both connections. With :iterate there could be a whole graph of links.
Meanwhile, the server - at least for our implementation - knows most of this information explicitly while it's constructing the results, and could easily record it.
Lloyd McKenzie (May 18 2021 at 21:15):
What action would be taken based on whether it was an _include or _revinclude?
Paul Church (May 18 2021 at 21:17):
It determines which resource's references the client needs to search through to figure out where the link was.
Last updated: Apr 12 2022 at 19:14 UTC