Skip to content

Fix overlaps for boundless and unknown intervals#366

Merged
cmoesel merged 2 commits into
masterfrom
boundless-overlaps
May 29, 2026
Merged

Fix overlaps for boundless and unknown intervals#366
cmoesel merged 2 commits into
masterfrom
boundless-overlaps

Conversation

@cmoesel
Copy link
Copy Markdown
Member

@cmoesel cmoesel commented May 29, 2026

Add special case logic for overlaps, overlaps before, and overlaps after when arguments are boundless intervals (e.g., Interval[null, null]) or unknown intervals (e.g., Interval(null, null)).

When we process an Interval that has both boundaries null, we can't infer the point type since we have no value to infer it from. This caused problems in the existing logic that needs to know the point type for some calculations. To address this, I've added special-case logic for these edge cases since we often don't really need to know the point type to arrive at the correct answer.

My CQL Long PR introduces the approach of using the resultType from the ELM when we can't easily infer types from the data. We should extend that to also work in these cases, but since we want to get this fix out ASAP, I decided to implement this approach first. We need this approach regardless since ELM does not always carry the resultType.

NOTE: The CI that runs npm audit currently fails, but the reported audit issues are currently not resolvable, so there's not much we can do.

Fixes #364.

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-commenter commented May 29, 2026

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.69%. Comparing base (5bc96b7) to head (9dba192).

Files with missing lines Patch % Lines
src/datatypes/interval.ts 85.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #366      +/-   ##
==========================================
+ Coverage   87.58%   87.69%   +0.11%     
==========================================
  Files          52       52              
  Lines        4606     4624      +18     
  Branches     1297     1307      +10     
==========================================
+ Hits         4034     4055      +21     
+ Misses        359      354       -5     
- Partials      213      215       +2     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

@elsaperelli elsaperelli left a comment

Choose a reason for hiding this comment

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

🥳

@cmoesel cmoesel merged commit f7024ab into master May 29, 2026
12 of 14 checks passed
@cmoesel cmoesel deleted the boundless-overlaps branch May 29, 2026 22:48
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.

Incorrect Test Patient Evaluation with Interval[null, null] Overlap

3 participants