Skip to content

Specific Occurrences

Bryn Rhodes edited this page May 25, 2017 · 3 revisions

Specific Occurrences

Specific occurrences in versions of Quality Data Model (QDM) prior to version 5 allowed measure logic to associate criteria with a specific occurrence or single instance of a QDM Data Element. This functionality was necessary in QDM because logic could not be applied to the result of an expression. CQL, however, allows expressions to be built up from other expressions, so the ability to express different criteria that apply to the same instance of a QDM Data Element is a natural part of the language.

Simple Usage of Specific Occurrences

For example, consider the following snippet of QDM 4.3 logic:

AND: "Occurrence A of Encounter, Performed: BH Outpatient encounter" >= 
  42 day(s) starts before start of "Measurement End Date"
AND: "Occurrence A of Encounter, Performed: BH Outpatient encounter"
  starts after start of "Measurement Start Date"

Without the specific occurrencing, this criteria could potentially be satisfied by different encounters. The specific occurrence label ensures that the criteria is only satisfied if there is at least one encounter that satisfies both of the criteria.

In CQL, however, this is expressed by combining the criteria in a single where clause:

define "Valid Encounters":
  ["Encounter, Performed": "BH Outpatient encounter"] E
    where E.relevantPeriod starts 42 days or less before end of "Measurement Period"
      and E.relevantPeriod starts after start of "Measurement Period"

Multiple Specific Occurrences of the Same Event Type

Specific occurrencing could also be used to related different instances of the same type of data element:

AND: "Occurrence A of Encounter, Performed: HIV Visit" during "Measurement Period"
AND: "Occurrence B of Encounter, Performed: HIV Visit" during "Measurement Period"
AND: "Occurrence B of Encounter, Performed: HIV Visit" >= 90 day(s)
  starts after end of "Occurrence A of Encounter, Performed: HIV Visit"

In CQL, this would be accomplished with a query to relate different encounters:

define "HIV Visits During Measurement Period":
  ["Encounter, Performed": "HIV Visit"] E
    where E.relevantPeriod during "Measurement Period"

define "HIV Followup Visits":
  "HIV Visits During Measurement Period" V1
    with "HIV Visits During Measurement Period" V2
      such that V1.relevantPeriod starts 90 days or more after end of V2.relevantPeriod

Note the use of the definition HIV Visits During Measurement Period in the second query. Using that definition means that only encounters that satisfy the first criteria of being during the measurement period will be considered, and using the definition twice allows us to set up a relationship between different encounters in that same set.

Multiple Specific Occurrences of Different Event Types

Specific occurrencing could also be used to relate different types of QDM Data Elements:

AND: "Occurrence A of Medication, Order: Dapsone and pyrimethamine" <=
  3 month(s) starts after end of "Occurrence A of Laboratory Test, Performed: CD4+ Count (result)"
AND: "Occurrence A of Medication, Order: Leucovorin" <=
  3 month(s) starts after end of "Occurrence A of Laboratory Test, Performed: CD4+ Count (result)"

In CQL, again, this is expressed with a query:

define "CD4+ Count With Results and Medications":
  ["Laboratory Test, Performed": "CD4+ Count"] LTP
    with ["Medication, Order": "Dapsone and pyrimethamine"] MODP
      such that MODP.authorDatetime occurs 3 months or less after end of LTP.relevantPeriod
    with ["Medication, Order": "Leucovorin"] MOL
      such that MOL.authorDatetime occurs 3 months or less after end of LTP.relevantPeriod
  where LTP.result is not null

Specific Occurrences in OR Clauses and Negations

When a specific occurrence is used in criteria that are combined with an OR clause, it means that the criteria is satisfied is there an event in at least one of the branches of the OR.

Specific Occurrences Between Populations

One of the

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