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.IND.01 Percentage of pregnant women with first ANC contact in the first trimester

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

This library provides logic for calculating the percentage of pregnant women with first ANC contact in the first trimester

Id: ANCIND01
Url: ANC.IND.01 Percentage of pregnant women with first ANC contact in the first trimester
Version: 0.3.0
Name: ANCIND01
Title: ANC.IND.01 Percentage of pregnant women with first ANC contact in the first trimester
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: This library provides logic for calculating the percentage of pregnant women with first ANC contact in the first trimester
Jurisdiction: 001
Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Measurement PeriodPeriod01In
encounterstring01In
PatientPatient01Out
Initial Populationboolean01Out
First antenatal care contactEncounter0*Out
Gestational ageQuantity01Out
Numeratorboolean01Out
Denominatorboolean01Out
Age StratifierCoding01Out
Education Level StratifierCodeableConcept0*Out
Most Recent Encounter Location ReferenceReference01Out
Location CodeCodeableConcept01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient ;;
EpisodeOfCare http://hl7.org/fhir/StructureDefinition/EpisodeOfCare ; code filter:
path: type
value set: http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-case
Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;;; code filter:
path: type
value set: http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-contact
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
Location http://hl7.org/fhir/StructureDefinition/Location ;;
Content: text/cql
/*
Library ANC.IND.1
WHO Antenatal Care (ANC) Indicator 1
Percentage of pregnant women with first ANC contact in the first trimester (before 12 weeks of gestation)

Numerator: Number of pregnant women who had their first ANC contact before 12 weeks (facility level)
Numerator Computation: Count of women whose gestational age <= 12 weeks at the time of first contact
Denominator: Total number of antenatal clients with a first contact
Denominator Computation: Count of all women who had first contact within the last reporting period
Disaggregation:
Age (10-14, 15-19, 20+)
Education Level (none, don't know, primary, secondary, higher)
Reference:
WHO ANC monitoring framework (1) 

WHO–UNICEF guidance for RMNCAH programme managers on the analysis and use of health-care facility data (2) 

Attribution:
Typically facility and organization are 1..1, but there are cases where there are
multiple organizations reporting from the same facility. In these cases, reporter -> location is insufficient
*/
library ANCIND01

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'

include ANCBaseConcepts called BCx
include ANCConcepts called Cx
include ANCBaseDataElements called BaseData
include ANCDataElements called PatientData
include ANCContactDataElements called ContactData
include ANCStratifiers called Stratifiers

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

context Patient

/*
Initial population: Antenatal clients
*/
define "Initial Population":
  exists (BaseData."Antenatal care case")

define "First antenatal care contact":
  BaseData."Antenatal care contact" C
    where C.reasonCode in Cx."First Antenatal Care Contact Choices"

define "Gestational age":
  ContactData."Gestational age"

/*
Numerator: Number of pregnant women who had their first ANC contact before 12 weeks (facility level)
Numerator Computation: Count of women whose gestational age <= 12 weeks at the time of first contact
*/
define Numerator:
  exists (
    "First antenatal care contact" C
      where C.period starts during "Measurement Period"
        and ContactData."Gestational age" <= 12 weeks
  )

/*
Denominator: Total number of antenatal clients with a first contact
Denominator Computation: Count of all women who had first contact within the last reporting period
*/
define Denominator:
  exists (
    "First antenatal care contact" C
      where C.period starts during "Measurement Period"
  )

/*
Disaggregation: Age (10-14, 15-19, 20+)
*/
define "Age Stratifier":
  Stratifiers."By Age"

/*
Disaggregation: Education Level (none, don't know, primary, secondary, higher)
*/
define "Education Level Stratifier":
  Stratifiers."By Education Level"

/*
Most recent encounter location
*/
define "Most Recent Encounter Location Reference":
  Last(
    [Encounter] E
      return First(E.location L return L.location)
      //sort by start of period
  )

/*
Location Code
*/
define "Location Code":
  singleton from (
    [Location] L
      let identifier: singleton from (L.identifier I where I.system = 'http://example.org/opencr-identifiers')
      where L.id = Last(Split("Most Recent Encounter Location Reference".reference, '/'))
      return CodeableConcept {
        coding: {
          Coding {
            code: code { value: identifier.value },
            system: identifier.system
          }
        }
      }
  )
Content: application/elm+xml
Encoded data (53332 characters)
Content: application/elm+json
Encoded data (93928 characters)