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>.
When running the test
CqlIntervalOperatorsTest:Expand:ExpandPerHour, the test runner reports: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 forInterval<Time>(and sincePeriodrepresents start/end asdateTimevalues):{ "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>.