Update TruncatedDivide Quantity unit semantics to match plain Divide - #148
Merged
bryantaustin13 merged 1 commit intoSep 14, 2026
Merged
Conversation
bryantaustin13
approved these changes
Sep 8, 2026
bryantaustin13
left a comment
Contributor
There was a problem hiding this comment.
Approved. Once merged, expect the reference engine to start failing, which is the point.
cmoesel
self-requested a review
September 9, 2026 14:50
cmoesel
approved these changes
Sep 9, 2026
cmoesel
left a comment
Member
There was a problem hiding this comment.
Approved (on behalf of MITRE's JS cql-execution team).
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.
This PR updates the expected results for TruncatedDivide tests on Quantity operands, to match the unit conversion semantics from plain Divide. Specifically, (from https://cql.hl7.org/09-b-cqlreference.html#divide )
The spec doesn't explicitly call out this same note for TruncatedDivide, it only says (from https://cql.hl7.org/09-b-cqlreference.html#truncated-divide )
But, the spec also says the same "appropriate unit [...]" for plain Divide, so if instead the semantics are intentionally different for TruncatedDivide vs Divide, I think that would need to be made more explicit.
For quick reference, here is the corresponding test for plain Divide
cql-tests/tests/cql/CqlArithmeticFunctionsTest.xml
Lines 184 to 194 in 727219f