WHO SMART Guidelines - HIV
0.4.4 - ci-build

WHO SMART Guidelines - HIV, published by WHO. This guide is not an authorized publication; it is the continuous build for version 0.4.4 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/WorldHealthOrganization/smart-hiv/tree/main and changes regularly. See the Directory of published versions

Measure: HIV.IND.37 Viral suppression at labour and delivery (Experimental)

Official URL: http://smart.who.int/hiv/Measure/HIVIND37 Version: 0.4.4
Draft as of 2024-08-18 Computable Name: HIVIND37

% of HIV-positive pregnant women who are virally suppressed at labour and delivery

Knowledge Artifact Metadata
Name (machine-readable) HIVIND37
Title (human-readable) HIV.IND.37 Viral suppression at labour and delivery
Status Draft
Experimental true
Description

% of HIV-positive pregnant women who are virally suppressed at labour and delivery

Measure Steward WHO
Steward Contact Details WHO: http://who.int
Measure Metadata
Version Number 0.4.4
Measure Scoring Proportion
Improvement Notation Increased score indicates improvement
Population Basis boolean
Measure Population Criteria
Initial Population ID: HIV.IND.37.IP
Description:

Initial Population

Logic Definition: Initial Population
Denominator ID: HIV.IND.37.DEN
Description:

Number of HIV-positive pregnant women on ART during pregnancy who deliver at a facility during the reporting period and had a viral load test during delivery, or the estimated total number of pregnant women living with HIV

Logic Definition: Denominator
Numerator ID: HIV.IND.37.NUM
Description:

Number of HIV-positive pregnant women on ART during pregnancy and delivering at a facility during the reporting period who were virally suppressed (less than 1000 copies/mL) at delivery

Logic Definition: Numerator
Stratifier ID: HIV.IND.37.S
Measure Logic
Primary Library HIV.IND.37 Logic
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 HIE
Resource: HIVIndicatorElements
Canonical URL: http://smart.who.int/hiv/Library/HIVIndicatorElements
Dependency Description: Library Elements
Resource: HIVElements
Canonical URL: http://smart.who.int/hiv/Library/HIVElements
Dependency Description: Library Concepts
Resource: http://smart.who.int/hiv/Library/HIVConcepts|0.0.2
Canonical URL: http://smart.who.int/hiv/Library/HIVConcepts|0.0.2
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 ConceptsCustom
Resource: http://smart.who.int/hiv/Library/HIVConceptsCustom|0.0.1
Canonical URL: http://smart.who.int/hiv/Library/HIVConceptsCustom|0.0.1
Dependency Description: Library WC
Resource: WHOCommon
Canonical URL: http://smart.who.int/hiv/Library/WHOCommon
Dependency Description: Code system HIVConcepts
Resource: WHO SMART HIV Concepts CodeSystem
Canonical URL: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Dependency Description: Code system ConditionClinicalStatusCodes
Resource: Condition Clinical Status Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/condition-clinical
Dependency Description: Code system ConditionCategoryCodes
Resource: Condition Category Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/condition-category
Dependency Description: Code system missing concepts
Resource: https://worldhealthorganization.github.io/smart-hiv/CodeSystem/missing-concepts
Canonical URL: https://worldhealthorganization.github.io/smart-hiv/CodeSystem/missing-concepts
Direct Reference Code Display: HIV-positive
Code: HIV.B.DE116
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Code: active
System: http://terminology.hl7.org/CodeSystem/condition-clinical
Direct Reference Code Display: Encounter Diagnosis
Code: encounter-diagnosis
System: http://terminology.hl7.org/CodeSystem/condition-category
Direct Reference Code Display: HIV status
Code: HIV.B.DE115
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: On ART
Code: HIV.D.DE38
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Place of delivery
Code: HIV.E.DE67
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Health facility
Code: HIV.E.DE68
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Viral load test result
Code: HIV.D.DE387
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Code: viral load test
System: https://worldhealthorganization.github.io/smart-hiv/CodeSystem/missing-concepts
Direct Reference Code Display: Timing of ART initiation
Code: HIV.E.DE41
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Already on ART at first antenatal care visit
Code: HIV.E.DE42
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Newly on ART during pregnancy
Code: HIV.E.DE43
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Newly on ART during labour and delivery
Code: HIV.E.DE44
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
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: 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
Parameter Name: Stratification
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: string
Measure Logic Data Requirements
Data Requirement Type: Condition
Profile(s): Condition
Must Support Elements: code, clinicalStatus, category, onset
Code Filter(s):
Path: code
Code:
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, status, effective, value, issued
Code Filter(s):
Path: code
Code:
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, status, value, effective, subject, subject.reference
Code Filter(s):
Path: code
Code:
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, status, effective, partOf, value
Code Filter(s):
Path: code
Code:
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, status, effective, value
Code Filter(s):
Path: code
Code:
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: reasonCode, effective
Data Requirement Type: Location
Profile(s): Location
Must Support Elements: id, physicalType
Data Requirement Type: Procedure
Profile(s): Procedure
Must Support Elements: status, code, performed
Data Requirement Type: Patient
Profile(s): Patient
Must Support Elements: use
Measure Logic Definitions
Logic Definition Library Name: HIVElements
define "HIV Status Positive Condition":
  [Condition: Concepts."HIV-positive - HIV.B.DE116"] C
    where C.clinicalStatus ~ ConceptsCustom."active"
      and exists(C.category CC where CC ~ ConceptsCustom."encounter-diagnosis")
    sort by start of onset.toInterval()
Logic Definition Library Name: HIVIndicatorElements
define "HIV Status Positive Condition":
  Elements."HIV Status Positive Condition" C
  where C.onset before end of "Measurement Period"
Logic Definition Library Name: HIVElements
/* End of HIV-inconclusive */

/*
@dataElement: HIV.B.DE115 - HIV status
@activity: HIV.B7 Test for HIV using testing algorithm
@description: HIV status reported after applying the national HIV testing algorithm. No single HIV test can provide an HIV-positive diagnosis.
*/
define "HIV Status Observation":
  [Observation: Concepts."HIV status"] O
    where O.status in { 'final', 'amended', 'corrected' }
Logic Definition Library Name: HIVElements
define "HIV Status Positive Observation":
"HIV Status Observation" O
    where O.value ~ Concepts."HIV-positive - HIV.B.DE116"
      sort by start of effective.toInterval()
Logic Definition Library Name: HIVIndicatorElements
define "HIV Status Positive Observation":
  Elements."HIV Status Positive Observation" O
  where O.issued before end of "Measurement Period"
  or O.effective.toInterval() starts before end of "Measurement Period"
Logic Definition Library Name: HIVIndicatorElements
define "Has HIV-positive Status":
  exists "HIV Status Positive Condition"
  or exists "HIV Status Positive Observation"
Logic Definition Library Name: HIVElements
/* End of Serodiscordant partner D.DE37 */

/*
@dataElement: HIV.D.DE38 - On ART
@activity: HIV.D8 Capture or update client history
@description: Client is currently taking ART
*/

define "On ART D.DE38":
    [MedicationStatement] MS
    where exists(MS.reasonCode C where C ~ Concepts."On ART - HIV.D.DE38")
    sort by start of effective.toInterval()
Logic Definition Library Name: HIVIndicatorElements
/* End of Breastfeeding D.DE32 */

/*
@dataElement: HIV.D.DE38 - On ART
@activity: HIV.D8 Capture or update client history
@description: Client is currently taking ART
*/

define "On ART D.DE38":
  exists(Elements."On ART D.DE38" ART
   where ART.effective.toInterval() during "Measurement Period")
Logic Definition Library Name: HIVElements
/* End of Delivery date */

/*
@dataElement: HIV.E.DE67 - Place of delivery
@activity: HIV.E1 Capture or update mother's history
@description: The type of place where the woman delivered
*/

define "Place of delivery":
  [Observation: Concepts."Place of delivery"] O
    where O.status in { 'final', 'amended', 'corrected' }
    and O.value is not null
Logic Definition Library Name: HIVElements
/* End of Place of delivery */

/*
@dataElement: HIV.E.DE68 - Health facility
@activity: HIV.E1 Capture or update mother's history
@description: The woman delivered at a health facility
*/

define "Health facility":
  "Place of delivery" O
  with [Location] L
      such that O.value is FHIR.Reference and O.subject.reference = L.id
      and L.physicalType ~ Concepts."Health facility"
Logic Definition Library Name: HIVIndicatorElements
/* End of Place of delivery */

/*
@dataElement: HIV.E.DE68 - Health facility
@activity: HIV.E1 Capture or update mother's history
@description: The woman delivered at a health facility
*/
// TODO: Replace placeholder with relevant CQL logic
define "Health facility":
  exists (Elements."Health facility" O
  where O.effective.toInterval() during "Measurement Period")
Logic Definition Library Name: HIVElements
/* End of Time to start ART */

/*
@dataElement: HIV.D.DE387 - Viral load test result
@activity: HIV.D20 Diagnostics
@description: Result from the viral load test in number of copies/mL
*/

define "Viral load test result D.DE387":
  [Observation: Concepts."Viral load test result - HIV.D.DE387"] O
    where O.status in { 'final', 'amended', 'corrected' }
Logic Definition Library Name: HIVIndicatorElements
/* End of Date of baseline CD4 count test D.DE368 */

/*
@dataElement: HIV.D.DE387 - Viral load test result
@activity: HIV.D20 Diagnostics
@description: Result from the viral load test in number of copies/mL
*/

define "Viral load test result D.DE387":
  Elements."Viral load test result D.DE387" O
    where O.effective.toInterval() during "Measurement Period"
Logic Definition Library Name: HIVElements
define "viral load sample collection":
  [Procedure] P
  where P.status = 'completed'
  and P.code ~ ConceptsCustom."viral load test"
Logic Definition Library Name: HIVIND37Logic
/**
 * Numerator
 * 
 * Definition: Number of HIV-positive pregnant women on ART during pregnancy and delivering at a facility during the reporting period who were virally suppressed (<1000 copies/mL) at delivery
 * Calculation: COUNT of clients with "HIV status"='HIV-positive' AND "Place of delivery" is a 'Health facility' AND "Delivery date" is in the reporting period AND "Date of viral load sample collection" is on "Delivery date" AND "Viral load test result" LESS THAN 1000 copies/mL
 */

//health facility birth
define "First Health facility":
  (First(HE."Health facility"))
Logic Definition Library Name: HIVIND37Logic
define "Numerator":
  HIE."Has HIV-positive Status"
  and HIE."On ART D.DE38"
  and HIE."Health facility"
  and exists(
    HIE."Viral load test result D.DE387" VL
    with HE."viral load sample collection" P 
    such that VL.partOf.references(P) and start of P.performed.toInterval() = start of "First Health facility".effective.toInterval()
    where VL.value < 1000
    )
Logic Definition Library Name: HIVIND37Logic
/**
 * Denominator
 *
 * Definition: Number of HIV-positive pregnant women on ART during pregnancy who deliver at a facility during the reporting period and had a viral load test during delivery, or the estimated total number of pregnant women living with HIV
 * Calculation: COUNT of clients with "HIV status"='HIV-positive' AND "Place of delivery" is a 'Health facility' AND "Delivery date" is in the reporting period AND "Date of viral load sample collection" is on "Delivery date" |  | Alternatively: *Estimated total number of pregnant women living with HIV
 */

define "Denominator":
  HIE."Has HIV-positive Status"
  and HIE."On ART D.DE38"
  and HIE."Health facility"
  and exists(
    HIE."Viral load test result D.DE387" VL
    with HE."viral load sample collection" P 
    such that VL.partOf.references(P) and start of P.performed.toInterval() = start of "First Health facility".effective.toInterval()
    )
Logic Definition Library Name: HIVIND37Logic
/* Populations */

/*
 *Initial Population
 */

define "Initial Population":
  true
Logic Definition Library Name: HIVIndicatorElements
/* End of Visit date A.DE3 */

/*
@dataElement: HIV.A.DE17 - Age
@activity: HIV.A6.1 Review sociodemographic data with client | HIV.A5 Create new client record
@description: Calculated age (number of years) of the client based on date of birth
*/
define "Age In Years":
  AgeInYearsAt(start of "Measurement Period")
Logic Definition Library Name: HIVIndicatorElements
define "By Age Stratifier 3":
  case 
      when "Age In Years" >= 15 and "Age In Years"<= 19 then '15-19'
      when "Age In Years" <= 24 then '20-24'
      when "Age In Years" <= 49 then '25–49'
      when "Age In Years" >= 50 then '50+'
      else null
  end
Logic Definition Library Name: HIVIndicatorElements
// Geographic Region
define "By Geographic Region Stratifier":
    First(Patient.address A where A.use in { 'home' }).state
Logic Definition Library Name: HIVElements
define "Timing of ART initiation Observation":
  [Observation: Concepts."Timing of ART initiation"] O
    where O.status in { 'final', 'amended', 'corrected' }
Logic Definition Library Name: HIVElements
/* End of Timing of ART initiation */

/*
@dataElement: HIV.E.DE42 - Already on ART at first antenatal care visit
@activity: HIV.E1 Capture or update mother's history
@description: The pregnant woman was already on antiretroviral therapy (ART) at first antenatal care visit
*/

define "Already on ART at first antenatal care visit":
  "Timing of ART initiation Observation" O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.value ~ Concepts."Already on ART at first antenatal care visit"
Logic Definition Library Name: HIVIndicatorElements
/* End of Timing of ART initiation */

/*
@dataElement: HIV.E.DE42 - Already on ART at first antenatal care visit
@activity: HIV.E1 Capture or update mother's history
@description: The pregnant woman was already on antiretroviral therapy (ART) at first antenatal care visit
*/

define "Already on ART at first antenatal care visit":
  exists Elements."Already on ART at first antenatal care visit" O
    where O.effective.toInterval() during "Measurement Period"
Logic Definition Library Name: HIVElements
/* End of Already on ART at first antenatal care visit */

/*
@dataElement: HIV.E.DE43 - Newly on ART during pregnancy
@activity: HIV.E1 Capture or update mother's history
@description: The pregnant woman started ART during her pregnancy
*/

define "Newly on ART during pregnancy":
  "Timing of ART initiation Observation" O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.value ~ Concepts."Newly on ART during pregnancy"
Logic Definition Library Name: HIVIndicatorElements
/* End of Already on ART at first antenatal care visit */

/*
@dataElement: HIV.E.DE43 - Newly on ART during pregnancy
@activity: HIV.E1 Capture or update mother's history
@description: The pregnant woman started ART during her pregnancy
*/

define "Newly on ART during pregnancy":
  exists Elements."Newly on ART during pregnancy" O
    where O.effective.toInterval() during "Measurement Period"
Logic Definition Library Name: HIVElements
/* End of Newly on ART during pregnancy */

/*
@dataElement: HIV.E.DE44 - Newly on ART during labour and delivery
@activity: HIV.E1 Capture or update mother's history
@description: The woman started ART during labour and delivery
*/

define "Newly on ART during labour and delivery":
  "Timing of ART initiation Observation" O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.value ~ Concepts."Newly on ART during labour and delivery"
Logic Definition Library Name: HIVIndicatorElements
/* End of Newly on ART during pregnancy */

/*
@dataElement: HIV.E.DE44 - Newly on ART during labour and delivery
@activity: HIV.E1 Capture or update mother's history
@description: The woman started ART during labour and delivery
*/

define "Newly on ART during labour and delivery":
  exists Elements."Newly on ART during labour and delivery" O
    where O.effective.toInterval() during "Measurement Period"
Logic Definition Library Name: HIVIndicatorElements
/* End of Completed */

/*
@dataElement: HIV.E.DE41 - Timing of ART initiation
@activity: HIV.E1 Capture or update mother's history
@description: When the pregnant woman or mother initiated ART, for women living with HIV.
*/

define "Timing of ART initiation":
  case
    when "Already on ART at first antenatal care visit" then Concepts."Already on ART at first antenatal care visit"
    when "Newly on ART during pregnancy" then Concepts."Newly on ART during pregnancy"
    when "Newly on ART during labour and delivery" then Concepts."Newly on ART during labour and delivery"
    else null
  end
Logic Definition Library Name: HIVIND37Logic
define "Stratification":
 HIE."By Age Stratifier 3"
+ ':' + HIE."By Geographic Region Stratifier"
+ HIE."Timing of ART initiation".code
Logic Definition Library Name: FHIRHelpers
define function ToConcept(concept FHIR.CodeableConcept):
    if concept is null then
        null
    else
        System.Concept {
            codes: concept.coding C return ToCode(C),
            display: concept.text.value
        }
Logic Definition Library Name: FHIRHelpers
define function ToCode(coding FHIR.Coding):
    if coding is null then
        null
    else
        System.Code {
          code: coding.code.value,
          system: coding.system.value,
          version: coding.version.value,
          display: coding.display.value
        }
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value dateTime): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value ObservationStatus): value.value
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value instant): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value ProcedureStatus): value.value
Logic Definition Library Name: WHOCommon
/*
@description: Returns true if any of the given references are to the given resource
@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.
NOTE: This function assumes resources from the same source server.
*/
define fluent function references(references List<FHIR.Reference>, resource FHIR.Resource):
  exists (references R where R.references(resource))
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: FHIRHelpers
define function ToInteger(value integer): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value AddressUse): value.value
Generated using version 0.4.6 of the sample-content-ig Liquid templates