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.66 Syphilis treatment coverage, HIV prevention services (Experimental)

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

% of people attending HIV prevention services tested positive for syphilis who were treated based on national guidelines during the reporting period

Knowledge Artifact Metadata
Name (machine-readable) HIVIND66
Title (human-readable) HIV.IND.66 Syphilis treatment coverage, HIV prevention services
Status Draft
Experimental true
Description

% of people attending HIV prevention services tested positive for syphilis who were treated based on national guidelines during the reporting period

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

Initial Population

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

Number of people attending HIV prevention services who tested positive for syphilis during the reporting period

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

Number of people attending HIV prevention services who tested positive for syphilis and were treated based on national guidelines during the reporting period

Logic Definition: Numerator
Measure Logic
Primary Library HIV.IND.66 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 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 WCom
Resource: WHOCommon
Canonical URL: http://smart.who.int/hiv/Library/WHOCommon
Dependency Description: Library HIE
Resource: HIVIndicatorElements
Canonical URL: http://smart.who.int/hiv/Library/HIVIndicatorElements
Dependency Description: Code system HIVConcepts
Resource: WHO SMART HIV Concepts CodeSystem
Canonical URL: http://smart.who.int/hiv/CodeSystem/HIVConcepts
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: Syphilis test result
Code: HIV.B.DE250
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Positive
Code: HIV.B.DE251
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Code: syphilis test
System: https://worldhealthorganization.github.io/smart-hiv/CodeSystem/missing-concepts
Direct Reference Code Code: syphilis treatment
System: https://worldhealthorganization.github.io/smart-hiv/CodeSystem/missing-concepts
Direct Reference Code Display: PrEP for HIV prevention
Code: HIV.C.DE76
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: STI testing and treatment services
Code: HIV.B.DE164
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: VMMC procedure performed
Code: HIV.B.DE197
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: HIV prevention intervention
Code: HIV.PRV.DE2
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: Other
Code: HIV.PRV.DE8
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
Direct Reference Code Display: OAMT
Code: HIV.PRV.DE4
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
Measure Logic Data Requirements
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, status, value, partOf
Code Filter(s):
Path: code
Code:
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: status, code, value, effective
Data Requirement Type: Procedure
Profile(s): Procedure
Must Support Elements: status, code, performed
Data Requirement Type: MedicationStatement
Profile(s): MedicationStatement
Must Support Elements: status, reasonCode, effective
Data Requirement Type: EpisodeOfCare
Profile(s): EpisodeOfCare
Must Support Elements: type, period
Measure Logic Definitions
Logic Definition Library Name: HIVElements
/* End of Syphilis test date B.DE249 */

/*
@dataElement: HIV.B.DE250 - Syphilis test result
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Result from syphilis test
*/

define "Syphilis test result B.DE250":
  [Observation: Concepts."Syphilis test result - HIV.B.DE250"] O
    where O.status in { 'final', 'amended', 'corrected' }
Logic Definition Library Name: HIVElements
/* End of Syphilis test result B.DE250 */

/*
@dataElement: HIV.B.DE251 - Positive
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Test result is positive for syphilis
*/

define "Positive B.DE251":
  "Syphilis test result B.DE250" O
    where O.status in { 'final', 'amended', 'corrected' }
      and O.value ~ Concepts."Positive - HIV.B.DE251"
Logic Definition Library Name: HIVElements
/* End of Any STI syndrome diagnosed B.DE235 */

/*
@dataElement: HIV.B.DE249 - Syphilis test date
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Date of syphilis test
*/

define "Syphilis test date B.DE249":
  [Procedure] P
  where P.status = 'completed'
  and P.code ~ ConceptsCustom."syphilis test"
Logic Definition Library Name: HIVElements
/* End of Inconclusive B.DE253 */

/*
@dataElement: HIV.B.DE254 - Syphilis treatment start date
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Date of initiation of syphilis treatment
*/

define "Syphilis treatment start date B.DE254":
  [MedicationStatement] MS
    where MS.status = 'completed'
    and exists(MS.reasonCode C where C ~ ConceptsCustom."syphilis treatment")
Logic Definition Library Name: HIVIndicatorElements
/* End of Inconclusive B.DE253 */

/*
@dataElement: HIV.B.DE254 - Syphilis treatment start date
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Date of initiation of syphilis treatment
*/

define "Syphilis treatment start date B.DE254":
  exists (Elements."Syphilis treatment start date B.DE254" MS
    where MS.effective.toInterval() during "Measurement Period")
Logic Definition Library Name: HIVIND66Logic
/**
 * Numerator
 * 
 * Definition: Number of people attending HIV prevention services who tested positive for syphilis and were treated based on national guidelines during the reporting period
 * Calculation: COUNT of clients with "Syphilis test date" in the reporting period AND "Syphilis test result"='Positive' AND "Syphilis treatment start date" in the reporting period
 */

define "Numerator":
  exists(HE."Positive B.DE251" S
  with HE."Syphilis test date B.DE249" P
  such that S.partOf.references(P) and P.performed.toInterval() during "Measurement Period")
  and HIE."Syphilis treatment start date B.DE254"
Logic Definition Library Name: HIVElements
define "PrEP service date":
  [MedicationStatement] MS
    where exists(MS.reasonCode C where C ~ Concepts."PrEP for HIV prevention")
    return start of MS.effective.toInterval()
Logic Definition Library Name: HIVElements
define "STI services date":
  [Procedure] P
  where P.status = 'completed'
  and P.code ~ Concepts."STI testing and treatment services"
  return start of P.performed.toInterval()
Logic Definition Library Name: HIVElements
/* End of STI services */

/*
@dataElement: HIV.PRV.DE7 - VMMC
@activity: HIV.B6 Capture or update client history
@description: Client accessed voluntary medical male circumcision (VMMC) services
*/
// define "VMMC_done":
// [Procedure] P
//   where P.status = 'completed'
//   and P.code ~ Concepts."Voluntary medical male circumcision VMMC"


define "VMMC":
  [Procedure] P
  where P.status = 'completed'
  and P.code ~ Concepts."VMMC procedure"
Logic Definition Library Name: HIVElements
define "VMMC date":
  "VMMC" P
  return start of P.performed.toInterval()
Logic Definition Library Name: HIVElements
define "Other PRV.DE8 date":
  [Observation] O
    where O.status in {'final', 'amended'}
    and O.code ~ Concepts."HIV prevention intervention"
    and O.value ~ Concepts."Other - HIV.PRV.DE8"
  return start of O.effective.toInterval()
Logic Definition Library Name: HIVElements
define "OAMT status date":
  [EpisodeOfCare] EOC
    where exists(EOC.type T where T ~ Concepts."OAMT")
    return start of EOC.period
Logic Definition Library Name: HIVElements
/* End of Other PRV.DE8 */

/*
@dataElement: HIV.PRV.DE10 - Date accessed HIV prevention intervention
@activity: HIV.B6 Capture or update client history
@description: Date the client accessed HIV prevention intervention
*/
// TODO: NSP date requires fix to DeviceUseStatement support
define "Date accessed HIV prevention intervention": 
  flatten{"PrEP service date", /*"NSP date",*/ "STI services date", "VMMC date", "Other PRV.DE8 date","OAMT status date"}
Logic Definition Library Name: HIVIND66Logic
/**
 * Denominator
 *
 * Definition: Number of people attending HIV prevention services who tested positive for syphilis during the reporting period
 * Calculation: COUNT of clients with "Syphilis test date" on "Date accessed HIV prevention intervention" in the reporting period AND "Syphilis test result"='Positive'
 */

define "Denominator":
  exists(HE."Positive B.DE251" S
  with HE."Syphilis test date B.DE249" P
  such that S.partOf.references(P) and P.performed.toInterval() during "Measurement Period"
  and exists (HE."Date accessed HIV prevention intervention" t where t = start of P.performed.toInterval()))
Logic Definition Library Name: HIVIND66Logic
/* Populations */

/*
 *Initial Population
 */

define "Initial Population":
  true
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 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 ToString(value MedicationStatementStatus): value.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]
Generated using version 0.4.6 of the sample-content-ig Liquid templates