Skip to content

QA Using a Period Where a Date is Expected

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

Questions and Answers


Q&A - Using a Period Where a Date is Expected

Question

We cannot get our measure to calculate. There is an error related to the "same as" logic. As from what we can tell, there is no work-around for same as logic.

Answer

The issue appears to be related to "Medication Actively Being Taken by Tobacco User":

  define "Medication Actively Being Taken by Tobacco User": 
    ["Medication, Active" : "Tobacco Use Cessation Pharmacotherapy" ] Med 
      with "Screened and Identified as Tobacco User" Assess
          such that Med.relevantPeriod same or after Assess.authorDatetime
            and Med.relevantPeriod before end of "Measurement Period"

The interval Med.relevantPeriod is being used rather than a particular date for the comparisons against the Assess.authorDatetime and "Measurement Period". Consider modifying the query to something along the lines of what's below.

  define "Medication Actively Being Taken by Tobacco User": 
    ["Medication, Active" : "Tobacco Use Cessation Pharmacotherapy" ] Med 
      with "Screened and Identified as Tobacco User" Assess
        such that Med.relevantPeriod starts same or after Assess.authorDatetime
          and Med.relevantPeriod starts before end of "Measurement Period"

Note the addition of starts to both queries. See section 9.8.3 for "Before" and 9.8.10 for "Same or After" in the CQL specification, which need to take two Date Time arguments. The logic as it stands is providing an interval argument and a Date Time argument.

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