QDM Related Formatting Conventions - cqframework/CQL-Formatting-and-Usage-Wiki GitHub Wiki

QDM-Specific Formatting Conventions

In addition to general CQL Formatting Conventions, the following guidelines are intended to promote consistency and reusability of CQL developed for measures that use the Quality Data Model (QDM) to represent patient information.

Library-level Identifiers

Identifiers for top-level constructs including named expressions, functions, parameters, code systems, value sets, concepts, and codes should follow these guidelines:

  • Always use quoted identifiers
  • Use Title Case and appropriate spacing
  • Provide a descriptive, meaningful name

For example:

define "Encounters During Measurement Period":
  "Valid Encounters" Encounter
    where Encounter.relevantPeriod during "Measurement Period"

define function "ED Stay Time"(Encounter "Encounter, Performed"):
duration in minutes of Encounter.locationPeriod

Data Type Names

  • Always use quoted identifiers
  • Use PascalCase plus appropriate spacing
  • Use the friendly name

For example:

["Encounter, Performed"]

Attribute Names

  • Never use quoted identifiers
  • Use camelCase

For example:

relevantPeriod
authorDatetime
prevalencePeriod

Aliases and Argument Names

  • Never use quoted identifiers
  • Use PascalCase
  • Don't use abbreviations
  • Use descriptive names

For example:

define "Encounters During Measurement Period":
  "Valid Encounters" Encounter
    where Encounter.relevantPeriod during "Measurement Period"

define function "ED Stay Time"(Encounter "Encounter, Performed"):
duration in minutes of Encounter.locationPeriod