Your User Friendly Name for MyContentIG Here
0.4.9-cibuild - CI Build International flag

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.4.9-cibuild 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: Measure calculating scores from multiple questionnaires example (Experimental)

Official URL: http://somewhere.org/fhir/uv/mycontentig/Library/QuestionnaireMeasureExample Version: 0.4.9-cibuild
Draft as of 2025-07-03 Computable Name: QuestionnaireMeasureExample

Example library illustrating basic CQL constructs using questionnaire results to calculate a measure score

Metadata
Title Measure calculating scores from multiple questionnaires example
Version 0.4.9-cibuild
Status Draft
Experimental true
Subject Type Patient
Jurisdiction Global (Whole world)
Steward (Publisher) HL7 International - [Some] Work Group
Description

Example library illustrating basic CQL constructs using questionnaire results to calculate a measure score

Type Logic Library
Parameter Name: Measurement Period
Use: In
Min Cardinality: 0
Max Cardinality: 1
Type: Period
Parameter Name: Patient
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Patient
Parameter Name: Initial Population
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: Measure Population
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Data Requirement Type: Patient
Profile(s): Patient
Library Content
CQL Content
library QuestionnaireMeasureExample version '0.4.1'

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 (11420 characters)
ELM JSON Content
Encoded data (19708 characters)
Generated using version 0.4.9-cibuild of the sample-content-ig Liquid templates