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.13 OAMT minimum duration (Experimental)

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

% of OAMT recipients who received treatment for at least six months

Knowledge Artifact Metadata
Name (machine-readable) HIVIND13
Title (human-readable) HIV.IND.13 OAMT minimum duration
Status Draft
Experimental true
Description

% of OAMT recipients who received treatment for at least six months

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

Initial Population

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

Number of people starting OAMT during defined cohort recruitment period

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

Number of people in cohort retained in OAMT for at least six months

Logic Definition: Numerator
Stratifier ID: HIV.IND.13.S
Measure Logic
Primary Library HIV.IND.13 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 HE
Resource: HIVElements
Canonical URL: http://smart.who.int/hiv/Library/HIVElements
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 HIE
Resource: HIVIndicatorElements
Canonical URL: http://smart.who.int/hiv/Library/HIVIndicatorElements
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
Direct Reference Code Display: OAMT
Code: HIV.PRV.DE4
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: Community-level testing
Code: HIV.B.DE16
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Rapid diagnostic test for HIV
Code: HIV.B.DE82
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Facility-level testing
Code: HIV.B.DE17
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: EpisodeOfCare
Profile(s): EpisodeOfCare
Must Support Elements: type, period, statusHistory
Data Requirement Type: Patient
Profile(s): Patient
Must Support Elements: use
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: encounter, status, code, issued
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: location
Measure Logic Definitions
Logic Definition Library Name: HIVElements
define "OAMT status":
    [EpisodeOfCare] EOC
    where exists(EOC.type T where T ~ Concepts."OAMT")
    return EOC.period
Logic Definition Library Name: HIVElements
define "OAMT statusHistory":
    [EpisodeOfCare] EOC
    where exists(EOC.type T where T ~ Concepts."OAMT") 
    and (exists (
      EOC.statusHistory H
      where H.period is not null))
Logic Definition Library Name: HIVElements
/* End of PrEP service */

/*
@dataElement: HIV.PRV.DE4 - OAMT
@activity: HIV.B6 Capture or update client history
@description: Client accessed opioid agonist maintenance treatment (OAMT) services
*/

define "OAMT":
  flatten{"OAMT status","OAMT statusHistory".statusHistory.period}
Logic Definition Library Name: HIVIND13Logic
/**
 * Numerator
 * 
 * Definition: Number of people in cohort retained in OAMT for at least six months
 * Calculation: COUNT of clients within cohort "Retained on OAMT"=True 6 months after "Date OAMT initiated"
 */

define "Numerator":
  exists(HE."OAMT" t where t starts during "Measurement Period" and t ends after (end of "Measurement Period" + 6 months))
Logic Definition Library Name: HIVIndicatorElements
/* End of PrEP service */

/*
@dataElement: HIV.PRV.DE4 - OAMT
@activity: HIV.B6 Capture or update client history
@description: Client accessed opioid agonist maintenance treatment (OAMT) services
*/

define "OAMT":
  exists(Elements."OAMT" t where t during "Measurement Period")
Logic Definition Library Name: HIVIND13Logic
/**
 * Denominator
 *
 * Definition: Number of people starting OAMT during defined cohort recruitment period
 * Calculation: COUNT of clients within cohort with "Date OAMT initiated" in cohort recruitment period
 */

define "Denominator":
  HIE.OAMT
Logic Definition Library Name: HIVIND13Logic
/* 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
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: HIVIndicatorElements
/**
 * HIV Elements
 */

/* General Data Elements */

// From Common

define "Community_testing":
  exists([Observation] O
    with [Encounter] E
      such that O.encounter.references(E) and exists(E.location.physicalType PT where PT ~  Concepts."Community-level testing") 
  where (O.status in { 'final', 'amended' }
  and O.code ~ Concepts."Rapid diagnostic test for HIV - HIV.B.DE82"
  and O.issued after start of "Measurement Period"
  and O.issued before end of "Measurement Period"))
Logic Definition Library Name: HIVIndicatorElements
/*@triggeredBy Encounter with location = facility level testing*/
define "Facility_testing":
  exists([Observation] O
    with [Encounter] E
      such that O.encounter.references(E) and exists(E.location.physicalType PT where PT ~  Concepts."Facility-level testing")
  where (O.status in { 'final', 'amended' }
  and O.code ~ Concepts."Rapid diagnostic test for HIV - HIV.B.DE82"
  and O.issued after start of "Measurement Period"
  and O.issued before end of "Measurement Period")
  )
Logic Definition Library Name: HIVIndicatorElements
define setting:
  case
    when Community_testing then Concepts."Community-level testing"
    when Facility_testing then Concepts."Facility-level testing"
    else null
  end
Logic Definition Library Name: HIVIND13Logic
//provider type not provided?

define "Stratification":
 HIE."By Administrative Gender Stratifier".code 
  + ':' + HIE."By Age Stratifier 3"
+ ':' + HIE."By Geographic Region Stratifier"
 + ':' + HIE."setting".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 ToInterval(period FHIR.Period):
    if period is null then
        null
    else
        if period."start" is null then
            Interval(period."start".value, period."end".value]
        else
            Interval[period."start".value, period."end".value]
Logic Definition Library Name: FHIRHelpers
define function ToString(value AdministrativeGender): 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
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 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