| Title: |
Example CQL Library |
| Id: |
example |
| Version: |
0.2.0 |
| Url: |
Example CQL Library |
| Status: |
draft |
| Experimental: |
true |
| Type: |
system: http://terminology.hl7.org/CodeSystem/library-type
code: logic-library
|
| Subject: |
system: http://hl7.org/fhir/resource-types
code: Patient
|
| Date: |
2025-12-05 19:07:02+0000 |
| Publisher: |
HL7 International - [Some] Work Group |
| Description: |
|
| Jurisdiction: |
001 |
| Related Artifacts: |
Dependencies
|
| Parameters: |
| Name | Type | Min | Max | In/Out |
| Measurement Period | Period | 0 | 1 | In |
| Patient | Patient | 0 | 1 | Out |
| Inpatient, Emergency, or Telephone Evaluation or Management Encounter | Encounter | 0 | * | Out |
| Initial Population | boolean | 0 | 1 | Out |
| Denominator | boolean | 0 | 1 | Out |
| COVID-19 Communicable Disease Screening | Observation | 0 | * | Out |
| Numerator | boolean | 0 | 1 | Out |
|
| Data Requirements: |
| Type | Profile | MS | Code Filter |
| Encounter |
http://hl7.org/fhir/StructureDefinition/Encounter |
|
code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307
|
| Encounter |
http://hl7.org/fhir/StructureDefinition/Encounter |
|
code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
|
| Encounter |
http://hl7.org/fhir/StructureDefinition/Encounter |
|
code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1082
|
| Encounter |
http://hl7.org/fhir/StructureDefinition/Encounter |
|
code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1053
|
| Observation |
http://hl7.org/fhir/StructureDefinition/Observation |
|
code filter:
path: code
value set: TBD
|
|
| Content: text/cql |
library example version '1.0.0'
using FHIR version '4.0.1'
include fhir.cqf.common.FHIRHelpers version '4.0.1'
codesystem "Observation Category Codes": 'http://terminology.hl7.org/CodeSystem/observation-category'
valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'
valueset "Telephone Evaluation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1082'
valueset "Telephone Management": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1053'
valueset "COVID-19 Screening Result": 'TBD'
code "Laboratory Observation Category": 'laboratory' from "Observation Category Codes"
parameter "Measurement Period" Interval<DateTime>
context Patient
define "Inpatient, Emergency, or Telephone Evaluation or Management Encounter":
(
[Encounter: "Encounter Inpatient"]
union [Encounter: "Emergency Department Visit"]
union [Encounter: "Telephone Evaluation"]
union [Encounter: "Telephone Management"]
) Encounter
where Encounter.status = 'finished'
and Encounter.period during "Measurement Period"
define "Initial Population":
exists ("Inpatient, Emergency, or Telephone Evaluation or Management Encounter")
define "Denominator":
true
define "COVID-19 Communicable Disease Screening":
[Observation: "COVID-19 Screening Result"] Result
where exists (Result.category C where C ~ "Laboratory Observation Category")
and Result.status in { 'final', 'amended', 'corrected' }
and Result.effective during "Measurement Period"
define "Numerator":
exists ("COVID-19 Communicable Disease Screening")
|
|
| Content: application/elm+xml |
Encoded data (37428 characters)
|
|
| Content: application/elm+json |
Encoded data (66428 characters)
|
|