Skip to content

QA Using Just the Date of a DateTime

Darren Duncan edited this page Oct 12, 2017 · 1 revision

Questions and Answers


Q&A - Using Just the Date of a DateTime

Question

Our test case is failing in Bonnie. We are not sure what the reason is as the CQL logic is correct but the test case is still failing.

Answer

The logic in question is:

  define "GA with TOD4":
    "TOD 2" T
      with "Gestational age at Delivery" G
        such that G.authorDatetime less than 1 day on or before day of start of T.relevantPeriod

"T" here represents the "Encounter, Performed: Encounter Inpatient" with relevant period starting 1/1/2012 8am

"G" here represents the "Assessment, Perfomred: Estimated Gestational Age at Delivery" with author date time at 12/31/2011 9am.

12/31/2011 at 9am is less than 1 day on or before day of 1/1/2012.

Based on this, it appears that the logic is performing as expected.

Question

We have made changes such that the logic points to the "time of delivery" and not the "encounter" However, the test case is still failing.

Answer

The issue here is "day of"; "day of" makes it so it only pays attention to the date rather than the time. If you want it to pay attention to the time, change:

  such that G.authorDatetime less than 1 day on or before day of A.authorDatetime

to:

  such that G.authorDatetime less than 1 day on or before A.authorDatetime

Wiki Index

Home

Authoring Patterns - QICore v4.1.1

Authoring Patterns - QICore v5.0.0

Authoring Patterns - QICore v6.0.0

Authoring Measures in CQL

Composite Measure Development

Cooking with CQL Examples

Cooking with CQL Q&A All Categories
Additional Q&A Examples

CQL 1.3 Impact Guidance

CQL Error Messages

Developers Introduction to CQL

Discussion Items

Example Measures

Formatting and Usage Topics

Formatting Conventions

Library Versioning

Negation in QDM

QDM Known Issues

Specific Occurrences

Specifying Population Criteria

Supplemental Data Elements

Terminology in CQL

Translator Options For Measure Development

Unions in CQL

Clone this wiki locally