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.44 TPT initiation (Experimental)

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

Number and % of eligible people living with HIV on ART who initiated TB preventive treatment

Knowledge Artifact Metadata
Name (machine-readable) HIVIND44
Title (human-readable) HIV.IND.44 TPT initiation
Status Draft
Experimental true
Description

Number and % of eligible people living with HIV on ART who initiated TB preventive treatment

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

Initial Population

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

Number of ART patients who are eligible for TPT during the reporting period

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

Number of ART patients who initiated TPT during the reporting period

Logic Definition: Numerator
Stratifier ID: HIV.IND.44.S
Measure Logic
Primary Library HIV.IND.44 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: Library Common
Resource: HIVCommon
Canonical URL: http://smart.who.int/hiv/Library/HIVCommon
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: Value set ART regimen Choices
Resource: ART regimen ValueSet
Canonical URL: http://smart.who.int/hiv/ValueSet/HIV.D.DE90
Dependency Description: Value set TPT regimen type Choices
Resource: TPT regimen type ValueSet
Canonical URL: http://smart.who.int/hiv/ValueSet/HIV.D.DE1028
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: Eligible for TB preventive treatment
Code: HIV.D.DE1017
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
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, value, issued, effective
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:
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: medication, effective, status, coding, code
Code Filter(s):
Path: medication
ValueSet: ART regimen ValueSet
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: medication, effective, status, coding, code
Code Filter(s):
Path: medication
ValueSet: TPT regimen type ValueSet
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: medication.reference, effective, status, medication, coding, code
Data Requirement Type: Medication
Profile(s): Medication
Must Support Elements: id, code
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
/* On ART - includes "On ART - HIV.B.DE47" and "On ART - HIV.B.DE48" */
define "ART Medication Statement":
  [MedicationStatement: Concepts."ART regimen Choices"] MS
  sort by start of effective.toInterval()
Logic Definition Library Name: HIVIndicatorElements
// HIV Status

// ART Status

define "ART Medication Statement":
  Elements."ART Medication Statement" MS
  where MS.effective.toInterval() during "Measurement Period"
  sort by start of effective.toInterval()
Logic Definition Library Name: HIVIndicatorElements
define "On ART":
  exists "ART Medication Statement"
Logic Definition Library Name: HIVElements
/* End of C reactive protein test result */

/*
@dataElement: HIV.D.DE1028 - TPT regimen type
@activity: HIV.D4 Screen for TB
@description: Type of TPT regimen the client is currently on
*/
define "TPT regimen":
  [MedicationStatement: Concepts."TPT regimen type Choices"] MS
    where MS.status in { 'active', 'completed' }
Logic Definition Library Name: HIVElements
/* End of Date of TB diagnosis */

/*
@dataElement: HIV.D.DE954 - TB preventive treatment TPT start date
@activity: HIV.D8 Capture or update client history
@description: The date on which the client began taking TPT
*/
// TODO: Replace placeholder with relevant CQL logic
define "TB preventive treatment TPT start date":
  "TPT regimen" MS
  return start of MS.effective.toInterval()
Logic Definition Library Name: HIVIndicatorElements
/* End of Date of TB diagnosis */

/*
@dataElement: HIV.D.DE954 - TB preventive treatment TPT start date
@activity: HIV.D8 Capture or update client history
@description: The date on which the client began taking TPT
*/
define "TB preventive treatment TPT start date in measurement period":
  Elements."TB preventive treatment TPT start date" D
    where D in "Measurement Period"
Logic Definition Library Name: HIVIND44Logic
/**
 * Numerator
 * 
 * Definition: Number of ART patients who initiated TPT during the reporting period
 * Calculation: COUNT of clients with "HIV status"='HIV-positive' AND "On ART"=True AND "TB preventive treatment (TPT) start date" in the reporting period
 */

define "Numerator":
 HIE."Has HIV-positive Status" and HIE."On ART" and exists(HIE."TB preventive treatment TPT start date in measurement period")
Logic Definition Library Name: HIVElements
define "Eligible for TB preventive treatment Observation":
  [Observation: Concepts."Eligible for TB preventive treatment"] O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.value is true
Logic Definition Library Name: HIVIndicatorElements
define "Eligible for TB preventive treatment Observation":
  Elements."Eligible for TB preventive treatment Observation" O
    where O.effective.toInterval() during "Measurement Period"
Logic Definition Library Name: HIVIndicatorElements
/* End of TB treatment start date */

/*
@dataElement: HIV.D.DE1017 - Eligible for TB preventive treatment
@activity: HIV.D14 Prevent, screen, and manage comorbidities and coinfections
@description: Client is eligible for tuberculosis preventive treatment (TPT)
*/
// TODO: Replace placeholder with relevant CQL logic
define "Eligible for TB preventive treatment":
  exists "Eligible for TB preventive treatment Observation"
Logic Definition Library Name: HIVIND44Logic
/**
 * Denominator
 *
 * Definition: Number of ART patients who are eligible for TPT during the reporting period
 * Calculation: COUNT of clients with "HIV status"='HIV-positive' AND "On ART"=True at end of last reporting period AND "Eligible for TB preventive treatment"=True
 */

define "Denominator":
 HIE."Has HIV-positive Status" and HIE."On ART" and HIE."Eligible for TB preventive treatment"
Logic Definition Library Name: HIVIND44Logic
/* 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: 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
define "TPT regimen":
  Elements."TPT regimen" MS
    where MS.effective.toInterval() during "Measurement Period"
Logic Definition Library Name: HIVIndicatorElements
define "TPT regimen type":
  "TPT regimen" MS
  return Common.ExtractMedicationCode(MS.medication)
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: HIVIND44Logic
/*
 * Combined stratifiers
 */
define "Stratification":
  HIE."By Administrative Gender Stratifier".code 
    + ':' + HIE."By Age Stratifier"
    + ':' + Combine(HIE."TPT regimen type".coding.code)
	  + ':' + HIE."By Geographic Region Stratifier"
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 string): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value MedicationStatementStatus): value.value
Logic Definition Library Name: FHIRHelpers
define function ToBoolean(value boolean): value.value
Logic Definition Library Name: FHIRHelpers
define function ToString(value AdministrativeGender): value.value
Logic Definition Library Name: HIVCommon
/**
 * @description Takes a choice between a Medication and a CodeableConcept and returns just the code of the medication
 */
define function ExtractMedicationCode(choice Choice<FHIR.CodeableConcept, FHIR.Reference>):
  case
	  when choice is FHIR.CodeableConcept then
    	choice as FHIR.CodeableConcept
    when choice is FHIR.Reference then
      First([Medication] M 
        where M.id = Last(Split(choice.reference, '/'))
        return M.code as FHIR.CodeableConcept)
    else
      Message(null as FHIR.CodeableConcept, true, '1', 'Error', 'Cannot compute a medication code') // TODO: I'm sure that this is supported somehow?
  end
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