cqframework / cql-engine

Clinical Quality Language Evaluation Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two DateTime that display the same compare as different

duncand opened this issue · comments

Two DateTime expressions display the same in CQL Runner but compare as different.

Run the following CQL:

define x:
    Interval[
        @2017-12-20T11:00:00,
        DateTime(
            year from (@2017-12-20T11:00:00 + 1 day),
            month from (@2017-12-20T11:00:00 + 1 day),
            day from (@2017-12-20T11:00:00 + 1 day),
            0, 0, 0, 0,
            timezone from (@2017-12-20T11:00:00 + 1 day)
        )
    )
define y: Interval [ @2017-12-20T11:00:00, @2017-12-20T23:59:59.999 ]
define z: Equivalent(x,y)

Expected result:

x: Interval [ @2017-12-20T11:00:00, @2017-12-20T23:59:59.999 ]
y: Interval [ @2017-12-20T11:00:00, @2017-12-20T23:59:59.999 ]
z: true

Actual result:

>> x [ 1:1] Interval [ 2017-12-20T11:00:00, 2017-12-20T23:59:59.999 ]
>> y [12:1] Interval [ 2017-12-20T11:00:00, 2017-12-20T23:59:59.999 ]
>> z [13:1] false

These failing CQL Engine tests reflect this bug:

  • CqlTypesTest.xml -> Issue33

I confirm pull request #51 fixes this issue.