Repository navigation
Conversation
|
Formatting check succeeded! |
|
antvaset
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds two opt-in performance levers to the CQL retrieve path and updates the engine to the released CQL 5.8.0. Both levers are off by default, so existing behavior is unchanged unless a caller enables them.
Lazy FHIR-to-CQL conversion
Resources returned from a retrieve were always eagerly converted to CQL values - every element materialized up front, even fields the CQL never reads. This restores the engine 4.6.0 "convert only what you read" behavior as an opt-in via
RetrieveSettings.conversionMode:AUTO(default) - lazy only when the repository is known to return value-stable resources, which today means anInMemoryFhirRepository(bundle-backed, read-only during evaluation); eager otherwise.EAGER- always convert every element up front (safe for any repository).LAZY- always convert lazily (only for a repository known to return stable resources).RepositoryRetrieveProviderresolves the mode once and passes the flag through the newtoCqlValue(resource, expandPrimitives, lazy)overload landed in CQL 5.8.0 (cqframework/clinical_quality_language#1954). Lazy conversion reads resource fields at access time, so AUTO deliberately scopes it to the in-memory repository rather than enabling it broadly.Evaluated-resources collection toggle
Adds
CqlEngineOptions.isEvaluatedResourcesCollectionDisabled(off by default), wiring the engine'sDisableEvaluatedResourcesCollectionoption (cqframework/clinical_quality_language#1939). This is a memory lever — the engine otherwise retains every resource touched during a run. Measure evaluation populatesMeasureReport.evaluatedResourcefrom the per-expression evaluated resources, so this must only be enabled once verified not to empty that output (covered byEvaluatedResourcesCollectionToggleTest).CQL 5.8.0 bump + data-requirements count updates
Updates the CQL engine dependency to the released 5.8.0. That release includes
cqframework/clinical_quality_language#1958(collapse duplicate data requirements emitted by function inlining), which deduplicates module-definitiondataRequirementoutput. Several golden-count assertions were updated to the deduped values — these are reductions from removed exact duplicates, not behavioral changes:DataRequirementsTest): resource-basis 28/29→16, boolean-basis 3→2.The matching
parameterDef/relatedArtifactcounts are unchanged, so period handling and other semantics are intact - only duplicatedataRequiremententries were collapsed.Testing
ConversionModeParityTestasserts EAGER vs LAZY produce identical population counts, measure scores, SDE values, and evaluated-resource provenance.EvaluatedResourcesCollectionToggleTestcovers the toggle's effect onMeasureReport.evaluatedResource.:cqf-fhir-cql:testand:cqf-fhir-cr:testgreen against released 5.8.0; spotless clean.🤖 Generated with Claude Code