FirelyTeam / firely-cql-sdk

BSD 3-Clause "New" or "Revised" License
31 stars 17 forks source link

SameOrAfter expression is compiled to ELM node with untyped intervals #542

Open ewoutkramer opened 2 months ago

ewoutkramer commented 2 months ago

When running this test from the DQIC set (from file CqlDateTimeOperatorsTest.xml):

<test name="Issue32DateTime">
      <expression>@2017-12-21T02:00:00.0 same or after @2017-12-20T11:00:00.0</expression>
      <output>true</output>
</test>

Our cql2elm compiler generates a SameOrAfter ELM node with two operators, each of which is an Interval without a point type. Our TypeFor() translates this to a .NET type CqlInterval<object>, which then results in an exception Cannot convert Hl7.Cql.Primitives.CqlInterval1[Hl7.Cql.Primitives.CqlDateTime] to Hl7.Cql.Primitives.CqlInterval1[System.Object]. when building the rest of the expression.