Skip to content

cql(measures): apply inline code-filter to all 6 unfiltered measures#62

Merged
Taleef7 merged 1 commit into
mainfrom
cql/code-filter-tightening
Jun 8, 2026
Merged

cql(measures): apply inline code-filter to all 6 unfiltered measures#62
Taleef7 merged 1 commit into
mainfrom
cql/code-filter-tightening

Conversation

@Taleef7
Copy link
Copy Markdown
Owner

@Taleef7 Taleef7 commented Jun 8, 2026

Summary

  • Updated audiogram.cql, flu_vaccine.cql, hypertension.cql, diabetes_hba1c.cql, obesity_bmi.cql, and cholesterol_ldl.cql to apply the same inline code-filter pattern already in use by TB and HAZWOPER.
  • Both the qualifying event ([Procedure] / [Immunization]) and the enrollment/exemption [Condition] defines now filter by code+system, matching what SyntheticFhirBundleBuilder stamps.
  • Replaces the broader exists([Condition]) / Count([Condition]) > 1 pattern that was semantically correct but not code-scoped.
  • Updates docs/MEASURES.md Implementation Notes to document that all 8 active CQL measures now code-filter, and that true VS expansion remains a known evaluator limitation.

No synthetic-data changes needed

Verified that SyntheticFhirBundleBuilder already emits the correct system/code for every measure's enrollment, exemption, and qualifying event. No builder changes required.

Verification

./gradlew test --tests "com.workwell.compile.CqlEvaluationServiceTest" --rerun-tasks
# BUILD SUCCESSFUL — 4 tests passed
# cqlEvaluationProducesRealExpressionResults ✓
# singleSubjectEvaluationMatchesBatchOutcome ✓
# perEmployeeFailureIsolationKeepsRunGoing ✓
# tbHazwoperAndFluEvaluationsProduceStructuredOutcomes ✓

All five outcome buckets (COMPLIANT, DUE_SOON, OVERDUE, MISSING_DATA, EXCLUDED) still populate for each measure.

Test plan

  • All 8 Active measures produce all 5 outcome buckets when run via the UI
  • No measure goes all-MISSING_DATA (which would indicate a code/system mismatch)
  • CqlEvaluationServiceTest stays green

🤖 Generated with Claude Code

…easures

Previously only TB and HAZWOPER filtered the qualifying Procedure by
code/system; the other 6 measures used exists([Condition]) /
Count([Condition]) > 1 for enrollment/exemption and grabbed the last
*any* Procedure or Immunization for recency.

Updated audiogram, flu_vaccine, hypertension, diabetes_hba1c,
obesity_bmi, and cholesterol_ldl to:
- filter enrollment/exemption [Condition] by code+system
- filter [Procedure] / [Immunization] by code+system (matching
  SyntheticFhirBundleBuilder examCode/examValueSet stamps)

No synthetic-data changes required; builder already emits the correct
codes. All five outcome buckets still populate for each measure.

Regression: CqlEvaluationServiceTest (4 tests) → BUILD SUCCESSFUL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workwell-measure-studio Ready Ready Preview, Comment Jun 8, 2026 2:52pm

@Taleef7 Taleef7 merged commit 717a69b into main Jun 8, 2026
20 checks passed
@Taleef7 Taleef7 deleted the cql/code-filter-tightening branch June 8, 2026 17:18
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.

1 participant