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.21 Linkage to ART (Experimental)

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

% of people newly diagnosed with HIV initiated on ART

Knowledge Artifact Metadata
Name (machine-readable) HIVIND21
Title (human-readable) HIV.IND.21 Linkage to ART
Status Draft
Experimental true
Description

% of people newly diagnosed with HIV initiated on ART

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.21.IP
Description:

Initial Population

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

Number of people newly diagnosed with HIV during the reporting period

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

Number of people newly diagnosed with HIV and started on ART during the reporting period

Logic Definition: Numerator
Stratifier ID: HIV.IND.21.S
Measure Logic
Primary Library HIV.IND.21 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 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 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 HE
Resource: HIVElements
Canonical URL: http://smart.who.int/hiv/Library/HIVElements
Dependency Description: Library WC
Resource: WHOCommon
Canonical URL: http://smart.who.int/hiv/Library/WHOCommon
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: 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 ObservationCategoryCodes
Resource: Observation Category Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/observation-category
Direct Reference Code Display: Male
Code: HIV.A.DE20
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Female
Code: HIV.A.DE19
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Transgender female
Code: HIV.A.DE22
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Transgender male
Code: HIV.A.DE21
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Other
Code: HIV.A.DE23
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: On ART
Code: HIV.H.DE47
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-positive
Code: HIV.B.DE116
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Within 7 days of HIV diagnosis
Code: HIV.D.DE384
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Within 30 days of HIV diagnosis
Code: HIV.D.DE385
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Within 90 days of HIV diagnosis
Code: HIV.D.DE386
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Key population member*
Code: HIV.B.DE49
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Social History
Code: social-history
System: http://terminology.hl7.org/CodeSystem/observation-category
Direct Reference Code Display: TB diagnosis result
Code: HIV.D.DE939
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Diagnosed TB
Code: HIV.D.DE940
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Presumptive TB
Code: HIV.D.DE945
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: TB excluded
Code: HIV.D.DE941
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Parameter Name: Measurement Period
Use: In
Min Cardinality: 0
Max Cardinality: 1
Type: Period
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: Patient
Profile(s): Patient
Must Support Elements: use
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: reasonCode
Data Requirement Type: Condition
Profile(s): Condition
Must Support Elements: clinicalStatus, category, code
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, status, category, effective, issued, code.coding
Code Filter(s):
Path: code
Code:
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, status, value, effective
Code Filter(s):
Path: code
Code:
Measure Logic Definitions
Logic Definition Library Name: HIVIND21Logic
/*
 * As defined by Member State
 */
define "Initial Population":
  true
Logic Definition Library Name: HIVIndicatorElements
/*
@dataElement: HIV.A.DE18 - Gender
@activity: HIV.A6.1 Review sociodemographic data with client | HIV.A5 Create new client record
@description: Gender of the client
*/

/*
 * By Administrative Gender of Patient Stratifier
 * Need to expand codes
 */

define "By Administrative Gender Stratifier":
  case 
      when Patient.gender = 'male' then Concepts."Male"
      when Patient.gender = 'female' then Concepts."Female"
      when Patient.gender = 'transgender female' then Concepts."Transgender female"
      when Patient.gender = 'transgender male' then Concepts."Transgender male"
      else Concepts."Other - HIV.A.DE23"
  end
Logic Definition Library Name: HIVElements
/* End of Refused stopped treatment */

/*
@dataElement: HIV.H.DE47 - On ART
@activity: HIV.H3 Record outreach and result
@description: Client is currently taking ART 
*/

define "On ART H.DE47":
    [MedicationStatement] MS
    where exists(MS.reasonCode C where C ~ Concepts."On ART - HIV.H.DE47")
    sort by start of effective.toInterval()
Logic Definition Library Name: HIVElements
define "First HIV Treatment":
  First("On ART H.DE47")
Logic Definition Library Name: HIVElements
define "HIV Positive Condition":
[Condition] C
    where C.clinicalStatus ~ ConceptsCustom."active"
    and exists(C.category CC where CC ~ ConceptsCustom."encounter-diagnosis")
    and C.code ~ Concepts."HIV-positive - HIV.B.DE116"
    sort by start of onset.toInterval()
Logic Definition Library Name: HIVElements
define "First HIV Positive Condition":
  First("HIV Positive Condition")
Logic Definition Library Name: HIVElements
/* End of Date of baseline CD4 count test D.DE368 */

/*
@dataElement: HIV.D.DE383 - Time to start ART
@activity: HIV.D8 Capture or update client history
@description: Time from HIV diagnosis to when client started ART
*/
define "Time to start ART":
  case 
      when difference in days between start of "First HIV Treatment".effective.toInterval() and start of "First HIV Positive Condition".onset.toInterval() <= 7 then Concepts."Within 7 days of HIV diagnosis"
      when difference in days between start of "First HIV Treatment".effective.toInterval() and start of "First HIV Positive Condition".onset.toInterval() <= 30 then Concepts."Within 30 days of HIV diagnosis"
      when difference in days between start of "First HIV Treatment".effective.toInterval() and start of "First HIV Positive Condition".onset.toInterval() <= 90 then Concepts."Within 90 days of HIV diagnosis"
  else null
  end
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
/*
 * By Age Stratifiers
 * (0–4, 5–9, 10–14, 15–19, 20–24, 25–29, 30–34, 35–39, 40–44, 45–49, 50+ years)
 * 
 */
define "By Age Stratifier":
  case 
      when "Age In Years" <= 4 then '0-4'
      when "Age In Years" <= 9 then '5-9'
      when "Age In Years" <= 14 then '10–14'
      when "Age In Years" <= 19 then '15–19'
      when "Age In Years" <= 24 then '20–24'
      when "Age In Years" <= 29 then '25–29'
      when "Age In Years" <= 34 then '30–34'
      when "Age In Years" <= 39 then '35–39'
      when "Age In Years" <= 44 then '40–44'
      when "Age In Years" <= 49 then '45–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
/* End of Key population member B.DE49 */

/*
@dataElement: HIV.B.DE50 - Key population member type
@activity: HIV.B6 Capture or update client history
@description: The type of key population that the client is included in
*/
define "Key population member type Observation":
  [Observation: Concepts."Key population member - HIV.B.DE49"] O
    where O.status in { 'final', 'amended', 'corrected' }
    and exists(O.category OC where OC ~ ConceptsCustom."social-history")
Logic Definition Library Name: HIVIndicatorElements
define "Key population member type Observation":
  Elements."Key population member type Observation" O
    where O.effective.toInterval() before end of "Measurement Period"
    or O.issued before end of "Measurement Period"
Logic Definition Library Name: HIVIndicatorElements
// Stratifier
define patientGroups:
  "Key population member type Observation" O
  return Combine(O.code.coding.code, ':')
Logic Definition Library Name: HIVElements
/* End of Extrapulmonary TB D.DE937 */

/*
@dataElement: HIV.D.DE939 - TB diagnosis result
@activity: HIV.D8 Capture or update client history
@description: Final result of the TB investigation (bacteriological and/or clinical)
*/

define "TB diagnosis result":
  [Observation: Concepts."TB diagnosis result"] O
    where O.status in { 'final', 'amended', 'corrected' }
Logic Definition Library Name: HIVElements
/* End of TB diagnosis result */

/*
@dataElement: HIV.D.DE940 - Diagnosed TB
@activity: HIV.D8 Capture or update client history
@description: Client is diagnosed with TB disease
*/

define "Diagnosed TB":
  "TB diagnosis result" O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.value ~ Concepts."Diagnosed TB"
Logic Definition Library Name: HIVIndicatorElements
/* End of TB diagnosis result */

/*
@dataElement: HIV.D.DE940 - Diagnosed TB
@activity: HIV.D8 Capture or update client history
@description: Client is diagnosed with TB disease
*/

define "Diagnosed TB":
  exists Elements."Diagnosed TB" O
    where O.effective.toInterval() during "Measurement Period"
Logic Definition Library Name: HIVElements
/* End of TB excluded */

/*
@dataElement: HIV.D.DE945 - Presumptive TB
@activity: HIV.D8 Capture or update client history
@description: Client has signs or symptoms of tuberculosis (TB) without laboratory confirmation
*/

define "Presumptive TB D.DE945":
  "TB diagnosis result" O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.value ~ Concepts."Presumptive TB - HIV.D.DE945"
Logic Definition Library Name: HIVIndicatorElements
/* End of TB excluded */

/*
@dataElement: HIV.D.DE945 - Presumptive TB
@activity: HIV.D8 Capture or update client history
@description: Client has signs or symptoms of tuberculosis (TB) without laboratory confirmation
*/

define "Presumptive TB D.DE945":
  exists Elements."Presumptive TB D.DE945" O
    where O.effective.toInterval() during "Measurement Period"
Logic Definition Library Name: HIVElements
/* End of Diagnosed TB */

/*
@dataElement: HIV.D.DE941 - TB excluded
@activity: HIV.D8 Capture or update client history
@description: Client is not diagnosed with TB
*/

define "TB excluded":
  "TB diagnosis result" O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.value ~ Concepts."TB excluded"
Logic Definition Library Name: HIVIndicatorElements
/* End of Diagnosed TB */

/*
@dataElement: HIV.D.DE941 - TB excluded
@activity: HIV.D8 Capture or update client history
@description: Client is not diagnosed with TB
*/

define "TB excluded":
  exists Elements."TB excluded" O
    where O.effective.toInterval() during "Measurement Period"
Logic Definition Library Name: HIVIndicatorElements
define tb:
  case 
      when "Diagnosed TB"  then Concepts."Diagnosed TB"
      when "Presumptive TB D.DE945" then Concepts."Presumptive TB - HIV.D.DE945"
      when "TB excluded" then Concepts."TB excluded"
      else null
  end
Logic Definition Library Name: HIVIND21Logic
define "Stratification":
 HIE."By Administrative Gender Stratifier".code 
 + ':' + HE."Time to start ART".code
  + ':' + HIE."By Age Stratifier"
+ ':' + HIE."By Geographic Region Stratifier"
+ Combine(HIE.patientGroups, ':')
+ ':' + HIE."tb".code
Logic Definition Library Name: FHIRHelpers
define function ToString(value AdministrativeGender): value.value
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 ToString(value string): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value AddressUse): 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
Generated using version 0.4.6 of the sample-content-ig Liquid templates