Skip to content

Replace FHIR/Ucum-java with ucumate for improved performance#2511

Merged
johngrimes merged 3 commits into
release/9.0.0from
issue/2510
Oct 27, 2025
Merged

Replace FHIR/Ucum-java with ucumate for improved performance#2511
johngrimes merged 3 commits into
release/9.0.0from
issue/2510

Conversation

@johngrimes

@johngrimes johngrimes commented Oct 27, 2025

Copy link
Copy Markdown
Member

Changes

  • Migrate from au.csiro.pathling:ucum to io.github.fhnaumann:ucumate-core:1.0.8
  • Reimplement Ucum.java wrapper using ucumate's API
  • Add error logging for failed UCUM operations
  • Update test dependencies

Breaking changes

None. All public APIs remain unchanged.

Closes #2510

Migrate from FHIR/Ucum-java to ucumate (fhnaumann/ucumate), which
provides up to 100× performance improvement for UCUM operations.

Key changes:
- Replace au.csiro.pathling:ucum dependency with ucumate-core 1.0.8
  from Maven Central (io.github.fhnaumann:ucumate-core)
- Rewrite Ucum.java wrapper to use ucumate's UCUMService API
- Use pattern matching on CanonicalizationResult to handle success/failure
- Extract canonical values using magnitude().getValue()
- Get canonical codes using service.print(canonicalTerm())
- Add logging for UCUM operation errors
- Update test dependencies to use ucumate's UCUMService type

The Ucum wrapper class maintains all existing public APIs, ensuring
no breaking changes for consumers. Error handling now logs warnings
for failed canonicalisations before returning null.

Resolves: #2510
@johngrimes johngrimes self-assigned this Oct 27, 2025
@johngrimes johngrimes added the optimisation Improvement to the performance or efficiency of existing functionality label Oct 27, 2025
@github-project-automation github-project-automation Bot moved this to Backlog in Pathling Oct 27, 2025
@johngrimes johngrimes moved this from Backlog to In progress in Pathling Oct 27, 2025
Use pull_request instead of pull_request_target to run the workflow
in the context of the PR head rather than the base repository, which
is more appropriate for standard pull requests.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
55.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@johngrimes

Copy link
Copy Markdown
Member Author

Here are the results of the benchmark:

image

/cc @fhnaumann @piotrszul

@johngrimes johngrimes merged commit 835d841 into release/9.0.0 Oct 27, 2025
3 of 4 checks passed
@johngrimes johngrimes deleted the issue/2510 branch October 27, 2025 21:20
@github-project-automation github-project-automation Bot moved this from In progress to Done in Pathling Oct 27, 2025
@johngrimes johngrimes mentioned this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimisation Improvement to the performance or efficiency of existing functionality

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant