Skip to content

Add public evaluateWithDef to expose MeasureDef and CQL results - #1149

Draft
c-schuler wants to merge 1 commit into
mainfrom
public-evaluate-with-def
Draft

c-schuler wants to merge 1 commit into
mainfrom
public-evaluate-with-def

Conversation

@c-schuler

@c-schuler c-schuler commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a supported, public way to get the MeasureDef and per-subject CQL results from an R4 single-measure evaluation, so downstream callers no longer need a split-package workaround to reach the previously package-private capture-def method.

Specifically requested by Lantana customer

What changed

  • New public API R4MultiMeasureService.evaluateWithDef(...) — same parameter shape as the existing public evaluate(MeasureReference, …), but returns the full MeasureDefAndR4MeasureReport (measureDef(), measureReport(), and the per-subject Map<String, CqlEvaluationResult>). It delegates to the existing evaluateSingleMeasureCaptureDef and evaluates against the service's own repository.
  • MeasureDefAndR4MeasureReport is no longer @VisibleForTesting — it is now a supported return type. No field/shape change, so existing readers are unaffected.
  • Test R4MultiMeasureServiceEvaluateWithDefTest asserts the returned MeasureReport, MeasureDef (populated groups), and per-subject CQL results are all present.

Why

The public evaluate(MeasureReference, …) returns only the MeasureReport; the MeasureDef (population definitions, errors, url/version) and raw CQL results (expression/debug/trace) were reachable only via the package-private @VisibleForTesting evaluateSingleMeasureCaptureDef. Downstream callers reached it with a class placed in cqf-fhir's own package, which breaks whenever the method changes. This gives them a documented, supported method instead.

Testing

  • New acceptance test passes.
  • :cqf-fhir-cr measure suite green (1126 tests, 0 failures); spotlessCheck passes.

@c-schuler c-schuler self-assigned this Nov 25, 2026
@c-schuler c-schuler added the enhancement New feature or request label Nov 25, 2026
@github-actions

Copy link
Copy Markdown

Formatting check succeeded!

@sonarqubecloud

Copy link
Copy Markdown

.measureReport();
}

/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment, no action required: It would be good for cdr-cr and cqis-spark to eventually leverage this.

@c-schuler
c-schuler marked this pull request as draft November 25, 2026 19:20
@c-schuler

Copy link
Copy Markdown
Contributor Author

#1150 <-- linking issue for further discussion

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants