Skip to content

Conversation

igajurelNCQA
Copy link
Contributor

Fixes #1024

@baseTwo baseTwo requested a review from Copilot September 11, 2025 07:41
@baseTwo
Copy link
Collaborator

baseTwo commented Sep 11, 2025

This PR should either be in draft, or if it is ready to be reviewed, assigned to a reviewer. I assume it's ready, so I'll assign myself this time

@baseTwo baseTwo self-requested a review September 11, 2025 07:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes unit normalization issues for UCUM and calendar-based CQL quantities by replacing UCUM unit codes with CQL calendar units. The changes eliminate automatic conversion between CQL units and UCUM codes, allowing both to coexist while maintaining backward compatibility.

Key changes:

  • Replaced UCUM unit mapping logic with direct CQL unit handling
  • Updated arithmetic operators to handle both singular/plural forms of units
  • Modified date/time precision handling to use CQL calendar units instead of UCUM codes

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Cql/Iso8601/DateTimePrecision.cs Updates unit parsing to handle full unit names instead of UCUM character codes
Cql/Cql.Runtime/Operators/CqlOperators.TypeOperators.cs Removes UCUM unit conversion in normalize operator
Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs Replaces UCUM unit references with CQL units in expand operations
Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs Updates interval expansion to use CQL units instead of UCUM
Cql/Cql.Runtime/Operators/CqlOperators.DateTimeOperators.cs Removes UCUM unit conversion in precision comparison
Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs Adds normalization logic for singular/plural unit forms
Cql/Cql.Runtime/Conversion/UnitConverter.cs Removes UCUM unit conversion and fixes typo
Cql/Cql.Runtime/Conversion/UcumConversionExtensions.cs Fixes typo in comment
Cql/Cql.Runtime/Conversion/ConversionConstants.cs Updates days per year to include leap year calculation
Cql/Cql.Runtime/Comparers/CqlComparers.CqlQuantityCqlComparer.cs Fixes grammar in comment
Cql/Cql.Abstractions/Primitives/CqlTime.cs Updates unit handling to use full unit names instead of character parsing
Cql/Cql.Abstractions/Primitives/CqlQuantity.cs Removes automatic UCUM unit conversion
Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs Updates precision handling to use CQL units
Cql/Cql.Abstractions/Primitives/CqlDateTime.cs Updates unit handling for date/time arithmetic operations
Cql/Cql.Abstractions/Primitives/CqlDate.cs Updates unit handling for date arithmetic operations
Cql/Cql.Abstractions/Abstractions/Units.cs Replaces UCUM mapping with date precision to CQL unit mapping
Cql/Cql.Abstractions/Abstractions/UCUMUnits.cs Adds date/time unit constants and removes precision mapping function
Cql/CoreTests/PrimitiveTests.cs Updates tests to reflect new unit behavior
Cql/CoreTests/ModelTest.cs Updates test to use CQL unit instead of UCUM

@baseTwo
Copy link
Collaborator

baseTwo commented Sep 11, 2025

I agree with copilot's remarks

@igajurelNCQA igajurelNCQA marked this pull request as draft September 12, 2025 15:36
@igajurelNCQA
Copy link
Contributor Author

I agree with copilot's remarks

resolved comments. Also resolved other build errors that I reproduced with Release config, however, still pipeline build fails and I have no clue what's causing it.

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.

Fix Unit normalization for quantity units such as UCUM and Calendar date units
2 participants