Common CQL Assets for FHIR (US-Based)
1.0.0-ballot - STU 1 Ballot United States of America flag

This page is part of the Common CQL Assets for FHIR (US-Based) (v1.0.0-ballot: STU 1 Ballot 1) based on FHIR (HL7® FHIR® Standard) R4. No current official version has been published yet. For a full list of available versions, see the Directory of published versions

Patterns

Page standards status: Informative

This topic provides best-practices and patterns for authoring CQL expressions for each type of data accessed in CQL-based questionnaires:

Methodology

US Core is the baseline for expected interoperability; this implementation guide builds CQL authoring patterns on top of US Core. To establishe a new set of patterns, the following methodology is used:

  1. Choose a US Core profile to start with.
  2. Review the narrative, elements, and search parameters, building a list of what would commonly be used and benefit from having an authoring pattern defined.
  3. Compare those patterns with QI Core Authoring Patterns to see if we can align.
  4. Evaluate if our libraries already support the pattern or if more functions need to be added.
  5. Add the patterns to a local copy of this implementation guide, with pages split out by US Core profile. For each include a CQL example (ex:).
  6. Evaluate if there are any differences with older versions of US Core that should be called out (at time of writing, most systems are on 3.1.1, working on moving to 6.1.0 by Jan 1st 2026, and planning for 7.0.0 by Jan 1st, 2028).
  7. Submit the proposed patterns and underlying profile as a change request JIRA tracker to this implementation guide.

Note that things like community calls, ballot feedback, JIRA issues, and trying to support example questionnaires can also feed into adding more patterns outside of this methodology.

Overall patterns are discussed here:

Overall

The following table lists the patterns page for each profile:

US Core Profile Patterns
USCore AllergyIntolerance AllergyIntolerance Patterns
USCore Condition Condition Patterns
USCore Coverage Coverage Patterns
USCore Medication Medication Patterns
USCore Observation Lab Observation Lab Patterns
USCore Patient Patient Patterns
USCore Service Service Patterns

Elements from current example questionnaires:

  • DiagnosticReport - Query for and attach to response, but not necessarily drive any particular questions out of the contents
  • Laboratory Results
  • Clinical Tests
  • Family History - including age at diagnosis, availability for testing (e.g., family member deceased, refused testing or patient not in contact with affected family member) and any genetic testing performed on family member (attach pedigree, if available)
  • Patient History
  • Is Test Part of a Clinical Trial
  • ServiceRequest
  • MedicationRequest
  • Associated Procedures for a Request (given a particular prior auth there will sometimes be additional associated prior authorizations required)
    • for example, given an allergy appointment, you're probably gonna have additional testing