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.25 HIV retesting coverage (Experimental)

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

% of people testing HIV-negative who tested again within a defined period of time after their previous test

Knowledge Artifact Metadata
Name (machine-readable) HIVIND25
Title (human-readable) HIV.IND.25 HIV retesting coverage
Status Draft
Experimental true
Description

% of people testing HIV-negative who tested again within a defined period of time after their previous test

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

Initial Population

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

Number of people assessed as being at elevated risk for HIV acquisition (includes people requesting/receiving any HIV prevention intervention, people from key populations, people with known risk factors or those assessed as being at risk of HIV acquisition) who received an HIV-negative test result in the reporting period.

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

Number of individuals who tested HIV-negative assessed to be at elevated risk for HIV acquisition who had another HIV test within a defined period after previous test.

Logic Definition: Numerator
Stratifier ID: HIV.IND.25.S
Measure Logic
Primary Library HIV.IND.25 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 WC
Resource: WHOCommon
Canonical URL: http://smart.who.int/hiv/Library/WHOCommon
Dependency Description: Library Config
Resource: HIVConfig
Canonical URL: http://smart.who.int/hiv/Library/HIVConfig
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 ObservationCategoryCodes
Resource: Observation Category Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/observation-category
Dependency Description: Value set HIV test type - HIV.B.DE81 Choices
Resource: HIV test type ValueSet
Canonical URL: http://smart.who.int/hiv/ValueSet/HIV.B.DE81
Direct Reference Code Display: HIV-negative
Code: HIV.B.DE113
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
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: HIV status of partner or contact
Code: HIV.H.DE34
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: Already knew positive
Code: HIV.H.DE35
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Newly diagnosed
Code: HIV.H.DE36
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Negative
Code: HIV.H.DE37
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
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: Observation
Profile(s): Observation
Must Support Elements: code, status, category, issued
Code Filter(s):
Path: code
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
ValueSet: HIV test type ValueSet
Data Requirement Type: Patient
Profile(s): Patient
Must Support Elements: use
Measure Logic Definitions
Logic Definition Library Name: HIVElements
/* End of Date informed of HIV-positive diagnosis */

/*
@activity: HIV.B7 Test for HIV using testing algorithm
*/
define "HIV test":
  [Observation: Concepts."HIV test type - HIV.B.DE81 Choices"] O
  where O.status in { 'final', 'amended', 'corrected' }
Logic Definition Library Name: HIVElements
/* End of HIV test date B.DE110 */

/*
@dataElement: HIV.B.DE111 - HIV test result
@activity: HIV.B7 Test for HIV using testing algorithm
@description: The result from HIV testing after applying the testing algorithm
*/
// Same as test - see profile
define "HIV test result Observation":
  "HIV test" O
Logic Definition Library Name: HIVElements
/* End of HIV-positive B.DE112 */

/*
@dataElement: HIV.B.DE113 - HIV-negative
@activity: HIV.B7 Test for HIV using testing algorithm
@description: Test result is HIV-negative
*/
define "HIV-negative test result":
  "HIV test result Observation" O
    where O.value ~ Concepts."HIV-negative - HIV.B.DE113"
Logic Definition Library Name: HIVIndicatorElements
define "Negative Tests within Measurement Period":
  Elements."HIV-negative test result" O
    // with Elements."At elevated risk for HIV acquisition B.DE225" HIV
    // such that O.hasMember.references(HIV)
    where O.effective.toInterval() starts during "Measurement Period"
    sort by start of effective.toInterval()
Logic Definition Library Name: HIVIndicatorElements
define "First Negative Test within Measurement Period":
  (First("Negative Tests within Measurement Period"))
Logic Definition Library Name: HIVConfig
define "Testing Interval":
  3 months
Logic Definition Library Name: HIVIndicatorElements
define "Negative Tests after First Negative Test":
  Elements."HIV-negative test result" O
    // with Elements."At elevated risk for HIV acquisition B.DE225" HIV
    //   such that O.hasMember.references(HIV)
    where  O.effective.toInterval() starts after start of "First Negative Test within Measurement Period".effective.toInterval()
      and O.effective.toInterval() starts before (start of "First Negative Test within Measurement Period".effective.toInterval() + Config."Testing Interval")
    sort by start of effective.toInterval()
Logic Definition Library Name: HIVIND25Logic
/**
 * Numerator
 * 
 * Definition: Number of individuals who tested HIV-negative assessed to be at elevated risk for HIV acquisition who had another HIV test within a defined period after previous test.
 * Calculation: COUNT of clients with "At elevated risk for HIV acquisition"=True AND with a second "HIV test date" within fixed period after "HIV test date" in the reporting period with "HIV test result"='HIV-negative'
 */

define "Numerator":
  exists(HIE."Negative Tests after First Negative Test")
Logic Definition Library Name: HIVIND25Logic
/**
 * Denominator
 *
 * Definition: Number of people assessed as being at elevated risk for HIV acquisition (includes people requesting/receiving any HIV prevention intervention, people from key populations, people with known risk factors or those assessed as being at risk of HIV acquisition) who received an HIV-negative test result in the reporting period.
 * Calculation: COUNT of clients with "At elevated risk for HIV acquisition"=True AND with an "HIV test date" in the reporting period with "HIV test result"='HIV-negative'
 */

define "Denominator":
  exists(HIE."Negative Tests within Measurement Period")
Logic Definition Library Name: HIVIND25Logic
/* Populations */

/*
 *Initial Population
 */

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 HIV status of partner or contact */

/*
@dataElement: HIV.H.DE35 - Already knew positive
@activity: HIV.B6 Capture or update client history
@description: The partner or contact of the index case already knew they are HIV-positive
*/

define "Already knew positive":
  [Observation: Concepts."HIV status of partner or contact"] O 
    where O.status in { 'final', 'amended', 'corrected' }
    and exists(O.category OC where OC ~ ConceptsCustom."social-history")
    and O.code ~ Concepts."Already knew positive"
Logic Definition Library Name: HIVIndicatorElements
/* End of Inconclusive G.DE73 */

/*
@dataElement: HIV.H.DE35 - Already knew positive
@activity: HIV.B6 Capture or update client history
@description: The partner or contact of the index case already knew they are HIV-positive
*/

define "Already knew positive":
  exists(Elements."Already knew positive" O where O.issued during "Measurement Period")
Logic Definition Library Name: HIVElements
/* End of Already knew positive */

/*
@dataElement: HIV.H.DE36 - Newly diagnosed
@activity: HIV.B6 Capture or update client history
@description: The partner or contact of the index case is newly diagnosed as HIV-positive
*/

define "Newly diagnosed":
  [Observation: Concepts."HIV status of partner or contact"] O 
    where O.status in { 'final', 'amended', 'corrected' }
    and exists(O.category OC where OC ~ ConceptsCustom."social-history")
    and O.code ~ Concepts."Newly diagnosed"
Logic Definition Library Name: HIVIndicatorElements
/* End of Already knew positive */

/*
@dataElement: HIV.H.DE36 - Newly diagnosed
@activity: HIV.B6 Capture or update client history
@description: The partner or contact of the index case is newly diagnosed as HIV-positive
*/

define "Newly diagnosed":
  exists(Elements."Newly diagnosed" O where O.issued during "Measurement Period")
Logic Definition Library Name: HIVElements
/* End of Newly diagnosed */

/*
@dataElement: HIV.H.DE37 - Negative
@activity: HIV.B6 Capture or update client history
@description: The partner or contact of the index case is newly diagnosed is HIV-negative
*/

define "Negative H.DE37":
  [Observation: Concepts."HIV status of partner or contact"] O 
    where O.status in { 'final', 'amended', 'corrected' }
    and exists(O.category OC where OC ~ ConceptsCustom."social-history")
    and O.code ~ Concepts."Negative - HIV.H.DE37"
Logic Definition Library Name: HIVIndicatorElements
/* End of Newly diagnosed */

/*
@dataElement: HIV.H.DE37 - Negative
@activity: HIV.B6 Capture or update client history
@description: The partner or contact of the index case is newly diagnosed is HIV-negative
*/

define "Negative H.DE37":
  exists(Elements."Negative H.DE37" O where O.issued during "Measurement Period")
Logic Definition Library Name: HIVIndicatorElements
define "HIV status of partner or contact":
  case 
      when "Already knew positive" then Concepts."Already knew positive"
      when "Newly diagnosed" then Concepts."Newly diagnosed"
      when "Negative H.DE37" then Concepts."Negative - HIV.H.DE37"
      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
 * Age (0–4, 5–9, 10–14, 15–19, 20–24, 25–49, 50+ years)
 * 
 */
define "By Age Stratifier 2":
  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" <= 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
/* 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: HIVIND25Logic
define "Stratification":
 HIE."By Administrative Gender Stratifier".code 
 + ':' + HIE."HIV status of partner or contact".code
  + ':' + HIE."By Age Stratifier 2"
+ ':' + HIE."By Geographic Region Stratifier"
+ Combine(HIE.patientGroups, ':')
Logic Definition Library Name: FHIRHelpers
define function ToString(value ObservationStatus): 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 AdministrativeGender): value.value
Logic Definition Library Name: FHIRHelpers
define function ToDateTime(value instant): value.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
Generated using version 0.4.6 of the sample-content-ig Liquid templates