You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Implement _revinclude on the client Search API. This should cause the search response to include resources (that have a relationship to the primary resources) in the returned result.
Describe the solution you'd like
Implement a new function (Search#include) like the Search#has function in the search DSL that should cause the search response to include resources that have a relationship with the primary resource in the returned search result.
Describe alternatives you've considered
None that is related to using existing functionality on the search DSL. I however contemplated running two queries i.e. run a query to fetch the primary resources, then run a custom SQL query (not supported) that uses SQL UNION against the ReferenceIndexEntity table to fetch the accompanying resources for each of the primary resource. The example below fetches accompanying resources (Tasks, Conditions and CarePlan) for the Patient referenced with id Patient/fee261ad-4e90-4054-9cd3-906a60362c59.
NOTE: The custom query in this proposal CANNOT work with the current Search API as the functionality for running custom queries does not exist
Additional context
The implementation for this function should be close to Search#has for instance in this example: Fetch all Patients with Condition Diabetes, Search#has would return just the Patient resources with the Condition, whereas the new function should also include the Conditions in the result.
See Search parameter's _revinclude
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Implement
_revinclude
on the client Search API. This should cause the search response to include resources (that have a relationship to the primary resources) in the returned result.Describe the solution you'd like
Implement a new function (
Search#include
) like theSearch#has
function in the search DSL that should cause the search response to include resources that have a relationship with the primary resource in the returned search result.Describe alternatives you've considered
None that is related to using existing functionality on the search DSL. I however contemplated running two queries i.e. run a query to fetch the primary resources, then run a custom SQL query (not supported) that uses SQL UNION against the
ReferenceIndexEntity
table to fetch the accompanying resources for each of the primary resource. The example below fetches accompanying resources (Tasks, Conditions and CarePlan) for the Patient referenced with idPatient/fee261ad-4e90-4054-9cd3-906a60362c59
.Additional context
The implementation for this function should be close to
Search#has
for instance in this example:Fetch all Patients with Condition Diabetes,
Search#has
would return just the Patient resources with the Condition, whereas the new function should also include theConditions
in the result.See Search parameter's _revinclude
The text was updated successfully, but these errors were encountered: