Your User Friendly Name for MyContentIG Here
0.5.3 - CI Build

Your User Friendly Name for MyContentIG Here, published by HL7 International - [Some] Work Group. This guide is not an authorized publication; it is the continuous build for version 0.5.3 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/sample-content-ig/ and changes regularly. See the Directory of published versions

## Library: QuestionnaireMeasureExample

Official URL: http://somewhere.org/fhir/uv/mycontentig/Library/QuestionnaireMeasureExample | Version: 0.5.3
Draft as of 2025-12-10 | Computable Name: QuestionnaireMeasureExample

Metadata
Version | 0.5.3
Status | Draft
Jurisdiction | 001 from http://unstats.un.org/unsd/methods/m49/m49.htm
Steward (Publisher) | HL7 International - [Some] Work Group
Type | logic-library from http://terminology.hl7.org/CodeSystem/library-type
Dependency | Description: Library FHIRHelpers Resource: `http://somewhere.org/fhir/uv/mycontentig/Library/FHIRHelpers|4.0.1` Canonical URL: `http://somewhere.org/fhir/uv/mycontentig/Library/FHIRHelpers|4.0.1`
Dependency | Description: Library PHQ9Logic Resource: PHQ9LogicExample Canonical URL: `http://somewhere.org/fhir/uv/mycontentig/Library/PHQ9LogicExample`
Data Requirement | Type: Patient Profile(s): Patient
Parameters
Name | Use | Card. | Type | Documentation
Measurement Period | In | 0..1 | Period |
Patient | Out | 0..1 | Patient |
Initial Population | Out | 0..1 | boolean |
Measure Population | Out | 0..1 | boolean |
Library Content
CQL Content |
    library QuestionnaireMeasureExample version '0.5.3-cibuild'

    using FHIR version '4.0.1'

    include FHIRHelpers version '4.0.1'

    include PHQ9LogicExample called PHQ9Logic

    parameter "Measurement Period" Interval<Date> default Interval[@2021-01-01, @2021-12-31]

    context Patient

    define "Initial Population":
      AgeInYearsAt(start of "Measurement Period") >= 18

    // Likely some condition or other relevant characteristic such as a depression diagnosis
    define "Measure Population":
      true

    /*
    Measure observation is a function defined in terms of the types of members of the measure
    population, Patient in this case. In a population evaluation scenario, the measure
    observation is evaluated for every member of the population.

    In an individual report scenario, however, the measure observation is evaluated for
    the current patient. Note that the patient context is flowing through the call here
    */
    define function "MeasureObservation"(patient Patient):
      PHQ9Logic.CalculateTotalScore
ELM XML Content |
    Encoded data
ELM JSON Content |
    Encoded data
Generated using version 0.5.3 of the sample-content-ig Liquid templates