Add capability to log CQL evaluation results during Measure integration testing to help debug#1006
Merged
Merged
Conversation
…ging Thread CQL EvaluationResult objects through the Measure and MultiMeasure test DSLs so they are accessible from SelectedMeasureDef and SelectedMeasureDefCollection. Add logEvaluationResults() on SelectedMeasureDef and logAllMeasureEvaluationResults() on SelectedMeasureDefCollection to pretty-print evaluation results per subject, with separator lines for readability. This mirrors the existing logReportJson() pattern on SelectedMeasureReport. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Formatting check succeeded! |
|
JPercival
approved these changes
Apr 28, 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
This MR adds debugging support to the Measure/MultiMeasure integration testing framework by making CQL evaluation results available for logging alongside the existing
logReportJson()capability. Previously, evaluation results were either inaccessible (single-measure path didn't thread them to the test assertion layer) or discarded entirely (multi-measure path dropped them intoMeasureDefAndParametersResults()).logEvaluationResults()onSelectedMeasureDef: Logs pretty-printed CQL evaluation results (expression names, values, evaluated resources) per subject for a single measure, with separator lines between subjects for readability.logAllMeasureEvaluationResults()onSelectedMeasureDefCollection: Logs evaluation results for all measures in a multi-measure evaluation in a single formatted block, with separator lines between measures and subjects.MeasureDefAndR4ParametersWithMeasureReportsnow carriesMap<MeasureDef, Map<String, EvaluationResult>>, andR4MultiMeasureService.toMeasureDefAndParametersResults()populates it instead of discarding the data.Code Review Suggestions
evaluationResultsPerMeasuremap inMeasureDefAndR4ParametersWithMeasureReportsis keyed byMeasureDefreference identity (notequals()/hashCode()). Verify that the sameMeasureDefinstances flow fromtoMeasureDefAndParametersResults()through toSelectedMeasureDefCollection.get()without being copied or rebuilt, since a different instance with the same data would miss the map lookup.MeasureDefAndR4ParametersWithMeasureReportsis annotated@VisibleForTestingbut lives insrc/main— confirm this is acceptable given that the newevaluationResultsPerMeasurefield increases the data retained in this record beyond what production code needs.formatMeasureEvaluationResultsmethod onEvaluationResultFormatteris in production code (src/main) — verify this is the right home vs. a test utility, since it is only called from test classes.QA Test Suggestions
Setup
This is test infrastructure only — no production behavior changes. QA validation is done by adding the new logging calls to existing integration tests and verifying output.
.logEvaluationResults()to a single-measure test (e.g., in a test usingMeasure.given()), run the test, and verify that formatted evaluation results appear in the test log output at INFO level with separator lines between subjects..logAllMeasureEvaluationResults()to a multi-measure test (e.g., inMultiMeasureServiceTest), run the test, and verify that results for all evaluated measures appear in a single log block with separator lines between measures and between subjects.(no evaluation results available)rather than throwing an exception..logReportJson()onSelectedMeasureReportcontinues to work as before and is unaffected by these changes.