cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
251 stars 121 forks source link

The spec test ToDateTime4 does not translate properly #1298

Closed EvanMachusak closed 6 months ago

EvanMachusak commented 7 months ago

The expected output ToDateTime4 in CqlTypeOperatorsTest is defined to be: @2014-01-01T12:05:05.955+01:30

The converted ELM for this expression does not include the offset minutes value and produces this instead:

{
          "type" : "DateTime",
          "year" : {
            "type" : "Literal",
            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
            "value" : "2014"
          },
          "month" : {
            "type" : "Literal",
            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
            "value" : "1"
          },
          "day" : {
            "type" : "Literal",
            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
            "value" : "1"
          },
          "hour" : {
            "type" : "Literal",
            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
            "value" : "12"
          },
          "minute" : {
            "type" : "Literal",
            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
            "value" : "5"
          },
          "second" : {
            "type" : "Literal",
            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
            "value" : "5"
          },
          "millisecond" : {
            "type" : "Literal",
            "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
            "value" : "955"
          },
          "timezoneOffset" : {
            "type" : "Literal",
            "valueType" : "{urn:hl7-org:elm-types:r1}Decimal",
            "value" : "1.0"
          },
          "locator" : "89:2-89:31",
          "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime"
        }

The timezoneOffset value is 1.0, not 1.5 as expected.

JPercival commented 6 months ago

Fix pending review here: https://github.com/cqframework/clinical_quality_language/pull/1313