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
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:
- Choose a US Core profile to start with.
- Review the narrative, elements, and search parameters, building a list of what would commonly be used and benefit from having an authoring pattern defined.
- Compare those patterns with QI Core Authoring Patterns to see if we can align.
- Evaluate if our libraries already support the pattern or if more functions need to be added.
- 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:).
- 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).
- 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:
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