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

DO NOT SQUASH: Implement initial support for CQL-related operations #2577

Merged
merged 28 commits into from
Sep 22, 2021

Conversation

csandersdev
Copy link
Contributor

@csandersdev csandersdev commented Jul 7, 2021

I've been working for the last two cohorting sprints on implementing an IBM FHIR native backend for the open source CQL engine and building out operations that support the most directly useful parts of the Clinical Practice Guidelines and Quality Measures IGs. #2480

This is an initial step. It is not a complete implementation of either IG and the quality measure and reporting space is being actively developed and changed right now and will need further development to keep up with standards. For example, both the May2021 ballot of the CQF measures IG and Davinci change some of the operations that were implemented here.

My intention is to get this foundational work integrated with the IBM FHIR server so that the Alvearie/quality-measure-and-cohort-engine project can start building on top of it. This will also provide a simple onramp for IBM FHIR server users that are interested in cohorting or clinical quality measure evaluation and want to get started quickly with the fewest number of dependencies. Clinical quality reporting operations are implemented in such a way that clients can either use the CQL engine remotely as expected in the R1 release of the cohort engine or evaluation could be done directly in IBM FHIR via the Library/$evaluate and Measure/$evaluate-measure operations, so as to avoid additional data hops necessary for evaluation in the client/server mode of operation.

New projects added in this PR:

fhir-cql -- Foundation classes for implementing the CQL Engine backend in IBM FHIR
fhir-cql-rest -- REST Client-based implementation of CQL Engine backend
fhir-cql-server -- Internal API-based implementation of CQL Engine backend
fhir-quality-measure -- FHIR Quality Measure evaluation logic
operation/fhir-operation-cpg -- Optional module that implements CQL operations
operation/fhir-operation-cqf -- Optional module that implements CQF operations

Operations provided by this work include:

#CPG

  • /$cql
  • /Library/$evaluate
  • /Library/[id]/$evaluate

#CQF

  • /Library/$data-requirements
  • /Measure/[id]/$data-requirements
  • /Measure/$evaluate-measure
  • /Measure/[id]/$evaluate-measure
  • /Measure/$collect-data
  • /Measure/[id]/$collect-data
  • /Measure/$care-gaps
  • /Measure/$submit-data
  • /Measure/[id]/$submit-data

The CQF IG describes dataflows that also involve the ActivityDefinition/$apply and PlanDefinition/$apply operations. Some prior work was done by @JohnTimm in the fhir-operation-apply module, but without support for CQL. This work has not been integrated with that work yet.

csandersdev and others added 26 commits June 7, 2021 13:52
Issue #2480 - pre-compute type map for resolveType method
Issue #2480 - updated typeMap creation and usage
Signed-off-by: Corey Sanders <[email protected]>
Signed-off-by: Corey Sanders <[email protected]>
Includes bug fixes for bugs found in CPG operations during testing.

Signed-off-by: Corey Sanders <[email protected]>
* Had to overhaul the FhirBundleCursor to deal with empty bundles
returned due to the total=none optimization
* Had to rework the LibraryEvaluate expression parameter handling
* Had to update the FhirTypeConverter toCqlDatetime logic to handle
temporal values without a zone offset.
* Added some logging to help figure out what is going on in the server
retrieve provider.


Signed-off-by: Corey Sanders <[email protected]>
Signed-off-by: Corey Sanders <[email protected]>
Signed-off-by: Corey Sanders <[email protected]>
This implementation is based on the cqf-ruler implementation which seems
like it needs to be refined in future work. For now, though, we keep
parity with the reference.

Signed-off-by: Corey Sanders <[email protected]>
@prb112 prb112 changed the title Implement initial support for CQL-related operations DO NOT SQUASH: Implement initial support for CQL-related operations Sep 16, 2021
@prb112
Copy link
Contributor

prb112 commented Sep 16, 2021

I brought your PR up to date and updated the automation and readme.

@prb112 prb112 merged commit 5377e79 into main Sep 22, 2021
@prb112 prb112 deleted the issue-2480 branch September 22, 2021 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants