Skip to content

$cql: a declared Interval<Long> with Long-LITERAL boundaries serializes as an unbounded Range #495

Description

@Taleef7

Follow-up in the #488 lineage, found by the #494 review. cql-execution passes a Long literal through as its string (the same representation split #494 documents), so Interval[1L, 4L) reaches the serializer as {low: "1", high: "4"}. The numeric-interval branch in backend-ts/src/fhir/cql-result-parameters.ts filters boundaries with typeof b === "number", drops both strings, and ships valueRange: {} — a bounded interval reads as unbounded, and after #494 it is confidently labeled Interval<System.Long>.

Pre-existing (before #494 the same empty Range shipped labeled Decimal), and unreachable from any WorkWell measure (none uses Long). But the declared point type now identifies the case exactly where the string boundaries could be recovered:

  • Under a declared Interval<Long> point, accept string boundaries that match an integer-literal shape (convert for the step arithmetic, ship as unity-quantity numbers — in-range Longs render as digits; or decide the valueString-boundary form with the runner's wirePointType ambiguity note in view)
  • Regression test: Interval[1L, 4L) must ship bounded ([1, 3] under step 1), never valueRange: {}
  • Long arithmetic boundaries (JS numbers) already serialize correctly with step 1 — pin that too

$cql transport only; no measure-evaluation impact.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions