Skip to content

WIP of HighBoundary and LowBoundary - #372

Draft
dehall wants to merge 1 commit into
masterfrom
high_low_boundary
Draft

WIP of HighBoundary and LowBoundary#372
dehall wants to merge 1 commit into
masterfrom
high_low_boundary

Conversation

@dehall

@dehall dehall commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This PR is a Work-In-Progress of implementing the HighBoundary and LowBoundary operators. (closes #159)

Turns out this depends on CQL Decimal specifics, so I didn't want to implement this before the upcoming "BigDecimal" work. Putting this up as a WIP/Draft mostly so that we don't forget about it if the BigDecimal effort takes a long time. The Date/Time/DateTime versions should be functional but there is likely some cleanup and de-duplication possible.

Pull requests into cql-execution require the following.
Submitter and reviewer should ✔ when done.
For items that are not-applicable, mark "N/A" and ✔.

Submitter:

  • This pull request describes why these changes were made
  • Code diff has been done and been reviewed (it does not contain: additional white space, not applicable code changes, debug statements, etc.)
  • Tests are included and test edge cases
  • Tests have been run locally and pass
  • Code coverage has not gone down and all code touched or added is covered.
  • Code passes lint and prettier (hint: use npm run test:plus to run tests, lint, and prettier)
  • All dependent libraries are appropriately updated or have a corresponding PR related to this change
  • cql4browsers.js built with npm run build:browserify if source changed.

Reviewer:

Name:

  • Code is maintainable and reusable, reuses existing code and infrastructure where appropriate, and accomplishes the task’s purpose
  • The tests appropriately test the new code, including edge cases
  • You have tried to break the code

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.25%. Comparing base (5c28fd1) to head (7a1fdeb).

Files with missing lines Patch % Lines
src/datatypes/datetime.ts 68.75% 14 Missing and 1 partial ⚠️
src/elm/arithmetic.ts 20.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #372      +/-   ##
==========================================
- Coverage   88.41%   88.25%   -0.16%     
==========================================
  Files          54       54              
  Lines        4832     4895      +63     
  Branches     1359     1376      +17     
==========================================
+ Hits         4272     4320      +48     
- Misses        368      379      +11     
- Partials      192      196       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cmoesel

cmoesel commented Jul 31, 2026

Copy link
Copy Markdown
Member

Well, this is kind of embarrassing, but... I just found an implement_missing_operators branch that I totally forgot about. It has a complete implementation of LowBoundary and HighBoundary already. I just rebased it. Should we just go with that?

@dehall

dehall commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Well, this is kind of embarrassing, but... I just found an implement_missing_operators branch that I totally forgot about. It has a complete implementation of LowBoundary and HighBoundary already. I just rebased it. Should we just go with that?

Your branch looks good for date/time but the numeric piece might need to be updated. From the CQL 1.5.3 spec: https://cql.hl7.org/09-b-cqlreference.html#highboundary

HighBoundary(1.587, 8) // 1.58799999

but that doesn't fully make sense to me since 1.58799999 doesn't round to 1.587.

I think others agreed because if you look at latest build spec: https://build.fhir.org/ig/HL7/cql/09-b-cqlreference.html#highboundary

HighBoundary(1.587) // 1.58750000

which I agree with, if you think of it as the high boundary of an interval with an open endpoint.

Plus since I'm working on Decimals at the moment there would need to be rebasing anyway, so let's hold off for now and revisit that after the new Decimals are in.

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.

Support "HighBoundary" and "LowBoundary" operators

3 participants