WHO Immunization Implementation Guide
1.0.0 - release

WHO Immunization Implementation Guide, published by WHO. This guide is not an authorized publication; it is the continuous build for version 1.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/WorldHealthOrganization/smart-immunizations/tree/132/merge and changes regularly. See the Directory of published versions

Measure: IMMZIND45

Official URL: http://smart.who.int/immunizations/Measure/IMMZIND45 Version: 1.0.0
Draft as of 2025-06-11 Computable Name: IMMZIND45

IMMZ.IND.45 Immunization session completion rate

Knowledge Artifact Metadata
Name (machine-readable) IMMZIND45
Title (human-readable) IMMZIND45
Status Draft
Experimental false
Description

IMMZ.IND.45 Immunization session completion rate

Measure Steward WHO
Steward Contact Details WHO: http://who.int
Measure Metadata
Version Number 1.0.0
Measure Scoring Proportion
Measure Population Criteria
Initial Population ID: IMMZ.IND.45.IP
Description:

Initial Population

Logic Definition: Initial Population
Denominator ID: IMMZ.IND.45.D
Description:

Denominator

Logic Definition: Denominator
Numerator ID: IMMZ.IND.45.N
Description:

Numerator

Logic Definition: Numerator
Stratifier ID: {idprefix}.S1
Code: By-Administrative Area
Stratifier ID: {idprefix}.S2
Code: By-Administrative Area
Population Basis boolean
Measure Logic
Primary Library IMMZIND45Logic
Dependency Description: FHIR model information
Resource: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
Canonical URL: http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1
Dependency Description: Library WC
Resource: WHOCommon
Canonical URL: http://smart.who.int/immunizations/Library/WHOCommon
Dependency Description: Library FHIRHelpers
Resource: http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1
Canonical URL: http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1
Dependency Description: Library Elements
Resource: http://smart.who.int/immunizations/Library/IMMZIndicatorElements
Canonical URL: http://smart.who.int/immunizations/Library/IMMZIndicatorElements
Parameter Name: Measurement Period
Use: In
Min Cardinality: 0
Max Cardinality: 1
Type: Period
Parameter Name: Numerator
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: Stratification 2
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: string
Parameter Name: Stratification 1
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: string
Parameter Name: Denominator
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Parameter Name: Initial Population
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Measure Logic Data Requirements
Data Requirement Type: Immunization
Profile(s): Immunization
Must Support Elements: occurrence, status, location
Data Requirement Type: Patient
Profile(s): Patient
Must Support Elements: birthDate
Data Requirement Type: Resource
Profile(s): Resource
Must Support Elements: id
Data Requirement Type: Location
Profile(s): Location
Must Support Elements: address, address.state, name
Measure Logic Definitions
Logic Definition Library Name: IMMZIND45Logic
/*
 * As defined by Member State
 */
define "Initial Population":
  Immunization.occurrence is not null
  and Immunization.occurrence.toInterval() starts during "Measurement Period"
Logic Definition Library Name: IMMZIND45Logic
/*
@denominator: Number of planned immunization sessions at the vaccination location during the reporting period
@pseudocode: COUNT number of planned sessions during the reporting period
*/
define "Denominator":
  "Initial Population"
Logic Definition Library Name: IMMZIND45Logic
/*
@numerator: Number of immunization sessions completed at the vaccination location during the reporting period
@pseudocode: COUNT of immunization events WHERE "Immunization event status" = "Completed" during the reporting period
*/
define "Numerator":
  "Denominator"
    and Immunization.status = 'completed'
Logic Definition Library Name: IMMZIND45Logic
define "Stratification 2":
  Elements.GetGeographicRegionForImmunization( Immunization )
Logic Definition Library Name: IMMZIND45Logic
/*
@disaggregation: Vaccination location
                 Administrative area
*/
define "Stratification 1":
  Elements.GetLocationNameForImmunization( Immunization )
Logic Definition Library Name: WHOCommon
/*
From FHIRCommon 4.1.0:
*/

/*
@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval
@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types
to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible
representations for timing-valued elements in FHIR, allowing this function to be used across any resource.

The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.
The intent of this function is to provide a clear and concise mechanism to treat single
elements that have multiple possible representations as intervals so that logic doesn't have to account
for the variability. More complex calculations (such as medication request period or dispense period
calculation) need specific guidance and consideration. That guidance may make use of this function, but
the focus of this function is on single element calculations where the semantics are unambiguous.
If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.
If the input is a Period, the result is a DateTime Interval.
If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.
If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.
If the input is a string, an error is raised indicating a single interval cannot be computed from a string.
If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,
and ending immediately prior to when the patient was the given Age plus one year.
If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given
by the low end of the Range, and ending immediately prior to when the patient was the Age given by the
high end of the Range plus one year.

NOTE: Due to the
complexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used
with a Timing or String.
*/
define fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):
  case
    when choice is FHIR.dateTime then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
    when choice is FHIR.Period then
      FHIRHelpers.ToInterval(choice as FHIR.Period)
    when choice is FHIR.instant then
      Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
    when choice is FHIR.Age then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
    when choice is FHIR.Range then
      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
    when choice is FHIR.Timing then
      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')
    when choice is FHIR.string then
      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
    else
      null as Interval<DateTime>
  end
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value dateTime): value.value
Logic Definition Library Name: FHIRHelpers
define function ToInterval(period FHIR.Period):
    if period is null then
        null
    else
        if period."start" is null then
            Interval(period."start".value, period."end".value]
        else
            Interval[period."start".value, period."end".value]
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value instant): value.value
Logic Definition Library Name: FHIRHelpers
define function ToDate(value date): value.value
Logic Definition Library Name: FHIRHelpers
define function ToQuantity(quantity FHIR.Quantity):
    case
        when quantity is null then null
        when quantity.value is null then null
        when quantity.comparator is not null then
            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
        else
            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
    end
Logic Definition Library Name: FHIRHelpers
define function ToCalendarUnit(unit System.String):
    case unit
        when 'ms' then 'millisecond'
        when 's' then 'second'
        when 'min' then 'minute'
        when 'h' then 'hour'
        when 'd' then 'day'
        when 'wk' then 'week'
        when 'mo' then 'month'
        when 'a' then 'year'
        else unit
    end
Logic Definition Library Name: FHIRHelpers
define function ToString(value ImmunizationStatus): value.value
Logic Definition Library Name: IMMZIndicatorElements
/** 
 * @function
 * @param immunization The immunization record for which the location should be retrieved
 * @return FHIR.address The location that the immunization event occurred
 */
define function GetGeographicRegionForImmunization(immunization Immunization):
  (
    [Location] L
        where immunization.location.references(L)
  ).only().address.state
Logic Definition Library Name: WHOCommon
define fluent function only(locations List<Location>):
  singleton from locations
Logic Definition Library Name: WHOCommon
/*
@description: Returns true if the given reference is to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(reference FHIR.Reference, resource FHIR.Resource):
  resource.id = Last(Split(reference.reference, '/'))
Logic Definition Library Name: FHIRHelpers
define function ToString(value string): value.value
Logic Definition Library Name: IMMZIndicatorElements
/** 
 * @function
 * @param immunization The immunization record for which the location should be retrieved
 * @return FHIR.name The name of the location that the immunization event occurred
 */
define function GetLocationNameForImmunization(immunization Immunization):
  (
    [Location] L
        where immunization.location.references(L)
  ).only().name
Generated using version 0.4.6 of the sample-content-ig Liquid templates