WHO Antenatal Care Guideline Implementation Guide
0.3.0 - CI Build International flag

WHO Antenatal Care Guideline Implementation Guide, published by World Health Organization (WHO). This guide is not an authorized publication; it is the continuous build for version 0.3.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/WorldHealthOrganization/smart-anc/ and changes regularly. See the Directory of published versions

Library: ANC Stratifiers

Official URL: http://fhir.org/guides/who/anc-cds/Library/ANCStratifiers Version: 0.3.0
Active as of 2024-09-10 Computable Name: ANCStratifiers

The ANC Stratifiers library provides expressions for determining stratifiers used across ANC indicators

Id: ANCStratifiers
Url: ANC Stratifiers
Version: 0.3.0
Name: ANCStratifiers
Title: ANC Stratifiers
Status: active
Experimental: false
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2024-09-10 13:23:00+0000
Publisher: World Health Organization (WHO)
Description: The ANC Stratifiers library provides expressions for determining stratifiers used across ANC indicators
Jurisdiction: 001
Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Measurement PeriodPeriod01In
encounterstring01In
PatientPatient01Out
By AgeCoding01Out
By Education LevelCodeableConcept0*Out
By Number of Contactsinteger01Out
By Trimester Categorystring01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient ;;
Encounter http://hl7.org/fhir/StructureDefinition/Encounter
Observation http://hl7.org/fhir/StructureDefinition/Observation ;;;; code filter:
path: code
value set: http://fhir.org/guides/who/anc-cds/ValueSet/anc-b6-de17
Content: text/cql
library ANCStratifiers

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'
include ANCDataElements called PatientData
// TODO: Report based on latest contact that occurred in the reporting period
include ANCContactDataElements called ContactData

codesystem "ISO-8601-Derived Periods": 'http://ohie.org/CodeSystem/iso-8601-derived-periods' // { 'P0Y--P1Y', 'P1Y--P5Y', ... }

valueset "Qualifying Reason for closing ANC record Choices": 'http://fhir.org/guides/who/anc-cds/ValueSet/qualifying-reason-for-closing-anc-record-choices'

// Age Groups
code "P10Y--P14Y": 'P10Y--P14Y' from "ISO-8601-Derived Periods" display '10-14 years'
code "P15Y--P19Y": 'P15Y--P19Y' from "ISO-8601-Derived Periods" display '15-19 years'
code "P20Y--P9999Y": 'P20Y--P9999Y' from "ISO-8601-Derived Periods" display '20+ years'

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

context Patient

/*
By Patient Age as of the start of the Measurement Period
Age (10-14, 15-19, 20+)
*/
define "By Age":
  case
    when AgeInYearsAt(start of "Measurement Period") in Interval[10, 14] then "P10Y--P14Y"
    when AgeInYearsAt(start of "Measurement Period") in Interval[15, 19] then "P15Y--P19Y"
    when AgeInYearsAt(start of "Measurement Period") >= 20 then "P20Y--P9999Y"
    else null
  end

/*
By Patient Education Level (none, don't know, primary, secondary, higher)
*/
define "By Education Level":
  Patient.extension E
    where E.url = 'http://fhir.org/guides/who/anc-cds/StructureDefinition/educationlevel'
    return E.value as CodeableConcept

/*
By Number of Contacts (1, 2-3, 4-8, 9+)
*/
define "By Number of Contacts":
  Count(PatientData."ANC contact number")

/*
By Trimester Category: 1st (GA ≤ 12 weeks); 2nd (GA > 12 weeks to ≤ 28 weeks); 3rd (GA > 28 weeks)
*/
define "By Trimester Category":
  case
    when ContactData."Gestational age" <= 12 weeks then 'GA ≤ 12 weeks'
    when ContactData."Gestational age" <= 28 weeks then 'GA > 12 weeks to ≤ 28 weeks'
    else 'GA > 28 weeks'
  end
Content: application/elm+xml
Encoded data (31240 characters)
Content: application/elm+json
Encoded data (55528 characters)