cqframework / cqframework/cql-tests-runner
Test Runner Not Detecting Equal Intervals (Open vs Closed Boundaries)
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: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 ]).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running CqlIntervalOperatorsTest:Except:DecimalIntervalExcept1to3 and inspect the test runner's comparison path for Interval values represented through FHIR Parameters parts. Trace how decimal boundaries and open or closed flags are compared. Done means the runner accepts the engine's [1.0, 4.0) result as equal to the expected interval representation.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100