Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FHIR Query Options for queries that return FHIR results #1078

Open
MikeRileyGTRI opened this issue Oct 29, 2018 · 2 comments
Open

Add FHIR Query Options for queries that return FHIR results #1078

MikeRileyGTRI opened this issue Oct 29, 2018 · 2 comments

Comments

@MikeRileyGTRI
Copy link

MikeRileyGTRI commented Oct 29, 2018

When doing CQL queries for FHIR resources, it would be nice to be able to handle some extra options when searching. https://hl7.org/fhir/stu3/search.html

The possible search options you could add are:
_sort
_count
_include
_revinclude
_summary
_elements
_contained
_containedType

Mainly the big one is the _include and _revinclude, as only having to make one query to the server for referenced documents is a good practice for large-scale operations.

Much like what happens in BaseFhirDataProvider.java when we need to determine the patient reference key

protected String getPatientSearchParam(String dataType) {

    switch (dataType) {

        case "Coverage":

            return "beneficiary";

        case "Patient":

            return "_id";

        case "Observation":

        case "RiskAssessment":

            return "subject";

        default: return "patient";

    }

}

Instead of just an internal process to generate keys, maybe we could have a user keyword exposed to do the same thing within a certain Context? Like a "Patient-Include-All" Context?

@brynrhodes
Copy link
Member

This is a great suggestion and something we've planned to do. I was thinking it would be something that would be determined through static analysis of the query, so the provider would automatically determine the right includes to perform. This would be a bit of a lift, but definitely worth it for performance. Adding this to the list of enhancements to be done.

@JPercival
Copy link
Contributor

There's been some effort in this direction since this issue was opened. The data provider in the engine now has some limited ability to customize the queries based on the capabilities that a given FHIR server supports. See SearchParameterResolver.

_revinclude and _include are yet to be supported but actually require some larger changes.

@JPercival JPercival transferred this issue from cqframework/cql-engine Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants