cqframework / cqframework/cql-tests-runner

Test Runner Not Detecting Equal Lists on Interval<Time>

Open
#94 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5
Forks
3
Avg merge
2d 16h
Merged PRs (30d)
2

Description

When running the test CqlIntervalOperatorsTest:Expand:ExpandPerHour, the test runner reports:

Test CqlIntervalOperatorsTest:Expand:ExpandPerHour status: fail expected: { Interval[@T10, @T10], Interval[@T11, @T11], Interval[@T12, @T12] } actual: [ [Object], [Object], [Object] ]

My engine is returning { Interval[@T10, @T10], Interval[@T11, @T11], Interval[@T12, @T12] } and translating it to a list of Tuples since the CQL IG FHIR type mapping doesn't have a specific mapping for Interval<Time> (and since Period represents start/end as dateTime values):

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "extension": [
        {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-cqlType",
          "valueString": "List<Interval<System.Time>>"
        }
      ],
      "name": "return",
      "part": [
        {
          "name": "low",
          "valueTime": "10:00:00",
          "_valueTime": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/time-precision",
                "valueCode": "h"
              }
            ]
          }
        },
        {
          "name": "lowClosed",
          "valueBoolean": true
        },
        {
          "name": "high",
          "valueTime": "10:00:00",
          "_valueTime": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/time-precision",
                "valueCode": "h"
              }
            ]
          }
        },
        {
          "name": "highClosed",
          "valueBoolean": true
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-cqlType",
          "valueString": "List<Interval<System.Time>>"
        }
      ],
      "name": "return",
      "part": [
        {
          "name": "low",
          "valueTime": "11:00:00",
          "_valueTime": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/time-precision",
                "valueCode": "h"
              }
            ]
          }
        },
        {
          "name": "lowClosed",
          "valueBoolean": true
        },
        {
          "name": "high",
          "valueTime": "11:00:00",
          "_valueTime": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/time-precision",
                "valueCode": "h"
              }
            ]
          }
        },
        {
          "name": "highClosed",
          "valueBoolean": true
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://hl7.org/fhir/StructureDefinition/cqf-cqlType",
          "valueString": "List<Interval<System.Time>>"
        }
      ],
      "name": "return",
      "part": [
        {
          "name": "low",
          "valueTime": "12:00:00",
          "_valueTime": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/time-precision",
                "valueCode": "h"
              }
            ]
          }
        },
        {
          "name": "lowClosed",
          "valueBoolean": true
        },
        {
          "name": "high",
          "valueTime": "12:00:00",
          "_valueTime": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/time-precision",
                "valueCode": "h"
              }
            ]
          }
        },
        {
          "name": "highClosed",
          "valueBoolean": true
        }
      ]
    }
  ]
}

Given the current guidance on mapping, this is the best way to represent a list of Interval<Time>.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CqlIntervalOperatorsTest:Expand:ExpandPerHour case and trace how the test runner compares its expected Interval list with the returned Parameters representation. Check how the list of Interval tuples is parsed or displayed, then confirm that equivalent values are recognized as equal and the test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.