Skip to content

Test Runner Not Detecting Equal Intervals (Open vs Closed Boundaries) #85

Description

@cmoesel

When running the test CqlIntervalOperatorsTest:Except:DecimalIntervalExcept1to3, the test runner reports:

Test CqlIntervalOperatorsTest:Except:DecimalIntervalExcept1to3 status: fail expected: Interval [ 1.0, 3.99999999 ] actual: { low: 1, lowClosed: true, high: 4, highClosed: false }

My engine is returning the following result:

{
  "resourceType": "Parameters",
  "parameters": [
    {
      "extension": [
        {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-cqlType",
          "valueString": "Interval<System.Decimal>"
        }
      ],
      "name": "return",
      "part": [
        {
          "name": "low",
          "valueDecimal": 1
        },
        {
          "name": "lowClosed",
          "valueBoolean": true
        },
        {
          "name": "high",
          "valueDecimal": 4
        },
        {
          "name": "highClosed",
          "valueBoolean": false
        }
      ]
    }
  ]
}

The CQL IG FHIR type mapping does not map Interval<System.Decimal> to a specific FHIR type, so it uses the same mapping approach as Tuples (e.g., using part). I've confirmed that this works correctly in some test cases, so I think the basic shape of the representation is correct.

In this case, I suspect the runner is not detecting my engine's result as equal to the expected result because we've chosen to represent the high value as an open boundary (e.g., Interval [ 1.0, 4.0 ) rather than Interval [ 1.0, 3.99999999 ]).

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions