Reject invalid $evaluate measure inputs with typed exceptions#1025
Draft
lukedegruchy wants to merge 1 commit into
Draft
Reject invalid $evaluate measure inputs with typed exceptions#1025lukedegruchy wants to merge 1 commit into
lukedegruchy wants to merge 1 commit into
Conversation
Two early-validation failures previously surfaced as confusing errors: a non-existent measureUrl produced a NullPointerException, and an empty measure-reference list silently flowed through and failed downstream with "Expected only a single MeasureReport but got multiples". Introduce InvalidMeasureRequestException as a shared parent for client- input errors in cqf-fhir-cr, with InvalidMeasureDefinitionException (re-parented) and a new MeasureLookupException as children. The HAPI provider catches the parent type at the boundary and translates to InvalidRequestException (HTTP 400), which also upgrades the existing empty-stratifier case from PR #1019 from 500 to 400. - R4MeasureServiceUtils.resolveByUrl: throw MeasureLookupException for zero or multiple matches (mirroring resolveByIdentifier). - R4MultiMeasureService.evaluateToListOfList: reject empty measureRefs upfront, covering both the production evaluate path and the test-only evaluateWithDefs path. - MeasureOperationsProvider (R4): wrap evaluateMeasure and evaluate in a single try/catch translating InvalidMeasureRequestException to InvalidRequestException. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Formatting check succeeded! |
|
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.


Two early-validation failures previously surfaced as confusing errors: a non-existent measureUrl produced a NullPointerException, and an empty measure-reference list silently flowed through and failed downstream with "Expected only a single MeasureReport but got multiples".
Introduce InvalidMeasureRequestException as a shared parent for client- input errors in cqf-fhir-cr, with InvalidMeasureDefinitionException (re-parented) and a new MeasureLookupException as children. The HAPI provider catches the parent type at the boundary and translates to InvalidRequestException (HTTP 400), which also upgrades the existing empty-stratifier case from PR #1019 from 500 to 400.