| HIVIND35 |
| HIV.IND.35 ARV toxicity prevalence |
| Draft |
| true |
% of ART patients with treatment-limiting ARV toxicity
|
| WHO |
| WHO: http://who.int |
| 0.4.4 |
| Proportion |
| Decreased score indicates improvement |
| boolean |
ID: HIV.IND.35.IP
Description:
Initial Population
Logic Definition: Initial Population
|
ID: HIV.IND.35.DEN
Description:
Number of ART patients in the reporting period
Logic Definition: Denominator
|
ID: HIV.IND.35.NUM
Description:
Number of ART patients who have stopped treatment or switched regimen due to toxicity in the reporting period
Logic Definition: Numerator
|
|
ID: HIV.IND.35.S
|
| HIV.IND.35 Logic |
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
|
Description: Library HIE
Resource: HIVIndicatorElements
Canonical URL: http://smart.who.int/hiv/Library/HIVIndicatorElements
|
Description: Library Elements
Resource: HIVElements
Canonical URL: http://smart.who.int/hiv/Library/HIVElements
|
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
|
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
|
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
|
Description: Library WC
Resource: WHOCommon
Canonical URL: http://smart.who.int/hiv/Library/WHOCommon
|
Description: Code system HIVConcepts
Resource: WHO SMART HIV Concepts CodeSystem
Canonical URL: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Description: Code system ConditionClinicalStatusCodes
Resource: Condition Clinical Status Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/condition-clinical
|
Description: Code system ConditionCategoryCodes
Resource: Condition Category Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/condition-category
|
Description: Code system ObservationCategoryCodes
Resource: Observation Category Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/observation-category
|
Display: HIV-positive
Code: HIV.B.DE116
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Code: active
System: http://terminology.hl7.org/CodeSystem/condition-clinical
|
Display: Encounter Diagnosis
Code: encounter-diagnosis
System: http://terminology.hl7.org/CodeSystem/condition-category
|
Display: HIV status
Code: HIV.B.DE115
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: On ART
Code: HIV.H.DE47
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Toxicity/side effects
Code: HIV.H.DE75
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Code: HIV.D.DE485
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Code: HIV.D.DE491
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Male
Code: HIV.A.DE20
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Female
Code: HIV.A.DE19
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Transgender female
Code: HIV.A.DE22
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Transgender male
Code: HIV.A.DE21
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Other
Code: HIV.A.DE23
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Key population member*
Code: HIV.B.DE49
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Social History
Code: social-history
System: http://terminology.hl7.org/CodeSystem/observation-category
|
Display: Preferred first-line ART regimen
Code: HIV.D.DE77
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Alternative first-line ART regimen
Code: HIV.D.DE78
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: First-line ART regimen under special circumstances
Code: HIV.D.DE79
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Preferred second-line ART regimen
Code: HIV.D.DE80
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Alternative second-line ART regimen
Code: HIV.D.DE81
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Gastrointestinal
Code: HIV.D.DE467
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Skin issues
Code: HIV.D.DE468
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Peripheral neuropathy
Code: HIV.D.DE469
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Central nervous system symptoms
Code: HIV.D.DE470
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Weight gain
Code: HIV.D.DE471
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Hepatic dysfunction
Code: HIV.D.DE472
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Haematological disorders
Code: HIV.D.DE473
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Fatigue
Code: HIV.D.DE474
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Headache
Code: HIV.D.DE475
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Bone dysfunction
Code: HIV.D.DE476
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Metabolic symptoms
Code: HIV.D.DE477
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Kidney dysfunction
Code: HIV.D.DE478
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Unexpected adverse drug reaction
Code: HIV.D.DE479
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Display: Currently pregnant
Code: HIV.B.DE29
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Code: recurrence
System: http://terminology.hl7.org/CodeSystem/condition-clinical
|
Code: relapse
System: http://terminology.hl7.org/CodeSystem/condition-clinical
|
Display: Breastfeeding
Code: HIV.B.DE32
System: http://smart.who.int/hiv/CodeSystem/HIVConcepts
|
Name: Measurement Period
Use: In
Min Cardinality: 0
Max Cardinality: 1
Type: Period
|
Name: Numerator
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
|
Name: Denominator
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
|
Name: Initial Population
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
|
Name: Stratification
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: string
|
Type: Condition
Profile(s):
Condition
Must Support Elements: code, clinicalStatus, category, onset
Code Filter(s):
Path: code
Code:
|
Type: Condition
Profile(s):
Condition
Must Support Elements: code
Code Filter(s):
Path: code
Code:
|
Type: Observation
Profile(s):
Observation
Must Support Elements: code, status, value, issued, effective
Code Filter(s):
Path: code
Code:
|
Type: Observation
Profile(s):
Observation
Must Support Elements: code, status, category, effective, issued, code.coding
Code Filter(s):
Path: code
Code:
|
Type: Observation
Profile(s):
Observation
Must Support Elements: code, status, value, effective
Code Filter(s):
Path: code
Code:
|
Type: MedicationStatement
Profile(s):
MedicationStatement
Must Support Elements: status, reasonCode, statusReason, effective, partOf, medication
|
Type: Patient
Profile(s):
Patient
Must Support Elements: use
|
Type: AdverseEvent
Profile(s):
AdverseEvent
Must Support Elements: actuality, event, date
|
| 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()
|
| Library Name: HIVIndicatorElements |
define "HIV Status Positive Condition":
Elements."HIV Status Positive Condition" C
where C.onset before end of "Measurement Period"
|
| 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' }
|
| 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()
|
| 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"
|
| Library Name: HIVIndicatorElements |
define "Has HIV-positive Status":
exists "HIV Status Positive Condition"
or exists "HIV Status Positive Observation"
|
| Library Name: HIVIndicatorElements |
/* End of Reason ART stopped H.DE74 */
/*
@dataElement: HIV.H.DE75 - Toxicity/side effects
@activity: HIV.H3 Record outreach and result
@description: Client stopped ART because of toxicity/side effects
*/
define "Toxicity/side effects H.DE75":
exists([MedicationStatement] MS
where MS.status in {'stopped'}
and exists(MS.reasonCode C where C ~ Concepts."On ART - HIV.H.DE47")
and exists(MS.statusReason R where R ~ Concepts."Toxicity/side effects - HIV.H.DE75")
and start of MS.effective.toInterval() during "Measurement Period")
|
| 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()
|
| Library Name: HIVIndicatorElements |
/* 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":
exists(Elements."On ART H.DE47" ART
where ART.effective.toInterval() during "Measurement Period"
)
|
| Library Name: HIVElements |
/* End of Unexpected adverse drug reaction */
/*
HIV.D.DE485
New regimen after switch to second-line regimen
*/
define "New regimen after switch to second-line regimen":
[MedicationStatement] MS
where exists(MS.reasonCode C where C ~ Concepts."New regimen after switch to second-line regimen")
sort by start of effective.toInterval()
|
| Library Name: HIVElements |
/* End of Reason ART stopped H.DE74 */
/*
@dataElement: HIV.H.DE75 - Toxicity/side effects
@activity: HIV.H3 Record outreach and result
@description: Client stopped ART because of toxicity/side effects
*/
define "Toxicity/side effects H.DE75":
[MedicationStatement] MS
where MS.status in {'stopped'}
and exists(MS.reasonCode C where C ~ Concepts."On ART - HIV.H.DE47")
and exists(MS.statusReason R where R ~ Concepts."Toxicity/side effects - HIV.H.DE75")
sort by start of effective.toInterval()
|
| Library Name: HIVElements |
/*
HIV.D.DE491
New regimen after switch to third-line regimen
*/
define "New regimen after switch to third-line regimen":
[MedicationStatement] MS
where exists(MS.reasonCode C where C ~ Concepts."New regimen after switch to third-line regimen")
sort by start of effective.toInterval()
|
| Library Name: HIVElements |
/*
HIV.D.DE489 New regimen(s) after substitution within second-line regimen
*/
define "New regimen after substitution within second-line regimen":
[MedicationStatement] MS
where exists(MS.reasonCode C where C ~ Concepts."New regimen after switch to second-line regimen")
sort by start of effective.toInterval()
|
| Library Name: HIVElements |
/*
HIV.D.DE495 New regimen(s) after substitution within third-line regimen
*/
define "New regimen after substitution within third-line regimen":
[MedicationStatement] MS
where exists(MS.reasonCode C where C ~ Concepts."New regimen after switch to third-line regimen")
sort by start of effective.toInterval()
|
| Library Name: HIVIND35Logic |
/**
* Numerator
*
* Definition: Number of ART patients who have stopped treatment or switched regimen due to toxicity in the reporting period
* Calculation: COUNT of clients with "HIV status"='HIV-positive' with a "Date ART stopped" in the reporting period AND "Reason ART stopped"='Toxicity/side effects' | PLUS | COUNT of clients with "HIV status"='HIV-positive' AND "On ART"=True AND either "Date of switch to second-line regimen" OR "Date of switch to third-line regimen" in the reporting period with a "Reason for regimen switch"='Toxicity/side effects' | PLUS | COUNT of clients with "HIV status"='HIV-positive' AND "On ART"=True AND either "Date(s) of substitution within second-line regimen" OR "Date(s) of substitution within third-line regimen" in the reporting period AND "Reason for ARV drug regimen substitution"='Toxicity/side effects'
*/
define "Numerator":
(HIE."Has HIV-positive Status"
and HIE."Toxicity/side effects H.DE75")
and ((
HIE."Has HIV-positive Status"
and HIE."On ART H.DE47"
and
(exists(HE."New regimen after switch to second-line regimen" R
with HE."Toxicity/side effects H.DE75" T
such that R.partOf.references(T)
where R.effective.toInterval() during "Measurement Period"
)
or
(
exists(HE."New regimen after switch to third-line regimen" R
with HE."Toxicity/side effects H.DE75" T
such that R.partOf.references(T)
where R.effective.toInterval() during "Measurement Period"
)
)
)
)
or
(
HIE."Has HIV-positive Status"
and HIE."On ART H.DE47"
and
(exists(HE."New regimen after substitution within second-line regimen" R
with HE."Toxicity/side effects H.DE75" T
such that R.partOf.references(T)
where R.effective.toInterval() during "Measurement Period"
)
or
(
exists(HE."New regimen after substitution within third-line regimen" R
with HE."Toxicity/side effects H.DE75" T
such that R.partOf.references(T)
where R.effective.toInterval() during "Measurement Period"
)
)
)
)
)
|
| Library Name: HIVIND35Logic |
/**
* Denominator
*
* Definition: Number of ART patients in the reporting period
* Calculation: COUNT of clients with "HIV status"='HIV-positive' AND "On ART"=True within the reporting period
*/
define "Denominator":
HIE."Has HIV-positive Status"
and HIE."On ART H.DE47"
|
| Library Name: HIVIND35Logic |
/* Populations */
/*
*Initial Population
*/
define "Initial Population":
true
|
| 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
|
| 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")
|
| Library Name: HIVIndicatorElements |
//(<0–4, 5–9, 10–14, 15-19, >19 years)
define "By Age Stratifier 6":
case
when "Age In Years" < 5 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" >= 20 then '>19'
else null
end
|
| Library Name: HIVIndicatorElements |
// Geographic Region
define "By Geographic Region Stratifier":
First(Patient.address A where A.use in { 'home' }).state
|
| 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")
|
| 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"
|
| Library Name: HIVIndicatorElements |
// Stratifier
define patientGroups:
"Key population member type Observation" O
return Combine(O.code.coding.code, ':')
|
| Library Name: HIVElements |
/* End of Current ART regimen */
/*
@dataElement: HIV.D.DE77 - Preferred first-line ART regimen
@activity: HIV.D8 Capture or update client history
@description: The preferred first-line ART regimen for the client according to WHO (or national) guidelines
*/
define "Preferred first-line ART regimen":
[MedicationStatement] MS
where MS.status = 'completed'
and MS.medication ~ Concepts."Preferred first-line ART regimen"
|
| Library Name: HIVElements |
/* End of Preferred first-line ART regimen */
/*
@dataElement: HIV.D.DE78 - Alternative first-line ART regimen
@activity: HIV.D8 Capture or update client history
@description: The alternative first-line ART regimen for the client according to WHO (or national) guidelines
*/
define "Alternative first-line ART regimen":
[MedicationStatement] MS
where MS.status = 'completed'
and MS.medication ~ Concepts."Alternative first-line ART regimen"
|
| Library Name: HIVElements |
/* End of Alternative first-line ART regimen */
/*
@dataElement: HIV.D.DE79 - First-line ART regimen under special circumstances
@activity: HIV.D8 Capture or update client history
@description: The first-line ART regimen for the client under special circumstances according to WHO (or national) guidelines
*/
define "First-line ART regimen under special circumstances":
[MedicationStatement] MS
where MS.status = 'completed'
and MS.medication ~ Concepts."First-line ART regimen under special circumstances"
|
| Library Name: HIVElements |
/* End of First-line ART regimen under special circumstances */
/*
@dataElement: HIV.D.DE80 - Preferred second-line ART regimen
@activity: HIV.D8 Capture or update client history
@description: The preferred second-line ART regimen for the client according to WHO (or national) guidelines
*/
define "Preferred second-line ART regimen":
[MedicationStatement] MS
where MS.status = 'completed'
and MS.medication ~ Concepts."Preferred second-line ART regimen"
|
| Library Name: HIVElements |
/* End of Preferred second-line ART regimen */
/*
@dataElement: HIV.D.DE81 - Alternative second-line ART regimen
@activity: HIV.D8 Capture or update client history
@description: The alternative second-line ART regimen for the client according to WHO (or national) guidelines
*/
define "Alternative second-line ART regimen":
[MedicationStatement] MS
where MS.status = 'completed'
and MS.medication ~ Concepts."Alternative second-line ART regimen"
|
| Library Name: HIVIndicatorElements |
/* End of Restarting ART */
/*
@dataElement: HIV.D.DE75 - Current ART regimen
@activity: HIV.D8 Capture or update client history
@description: The current ART regimen the client is taking
*/
define "Current ART regimen":
case
when exists(Elements."Preferred first-line ART regimen" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."Preferred first-line ART regimen"
when exists(Elements."Alternative first-line ART regimen" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."Alternative first-line ART regimen"
when exists(Elements."First-line ART regimen under special circumstances" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."First-line ART regimen under special circumstances"
when exists(Elements."Preferred second-line ART regimen" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."Preferred second-line ART regimen"
when exists(Elements."Alternative second-line ART regimen" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."Alternative second-line ART regimen"
else null
end
|
| Library Name: HIVElements |
/* End of Type of treatment-limiting toxicity */
/*
@dataElement: HIV.D.DE467 - Gastrointestinal
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to GI issues (nausea, diarrhoea, abdominal pain, vomiting)
*/
define "Gastrointestinal":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Gastrointestinal"
|
| Library Name: HIVIndicatorElements |
/* End of Type of treatment-limiting toxicity */
/*
@dataElement: HIV.D.DE467 - Gastrointestinal
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to GI issues (nausea, diarrhoea, abdominal pain, vomiting)
*/
define "Gastrointestinal":
exists Elements."Gastrointestinal" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Gastrointestinal */
/*
@dataElement: HIV.D.DE468 - Skin issues
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to skin issues (rash, hypersensitivity reaction)
*/
define "Skin issues":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Skin issues"
|
| Library Name: HIVIndicatorElements |
/* End of Gastrointestinal */
/*
@dataElement: HIV.D.DE468 - Skin issues
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to skin issues (rash, hypersensitivity reaction)
*/
define "Skin issues":
exists Elements."Skin issues" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Skin issues */
/*
@dataElement: HIV.D.DE469 - Peripheral neuropathy
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to peripheral neuropathy (burning/numbness/ tingling)
*/
define "Peripheral neuropathy":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Peripheral neuropathy"
|
| Library Name: HIVIndicatorElements |
/* End of Skin issues */
/*
@dataElement: HIV.D.DE469 - Peripheral neuropathy
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to peripheral neuropathy (burning/numbness/ tingling)
*/
define "Peripheral neuropathy":
exists Elements."Peripheral neuropathy" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Peripheral neuropathy */
/*
@dataElement: HIV.D.DE470 - Central nervous system symptoms
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to central nervous system symptoms (dizzy, anxiety, nightmare, depression, seizures)
*/
define "Central nervous system symptoms":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Central nervous system symptoms"
|
| Library Name: HIVIndicatorElements |
/* End of Peripheral neuropathy */
/*
@dataElement: HIV.D.DE470 - Central nervous system symptoms
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to central nervous system symptoms (dizzy, anxiety, nightmare, depression, seizures)
*/
define "Central nervous system symptoms":
exists Elements."Central nervous system symptoms" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Central nervous system symptoms */
/*
@dataElement: HIV.D.DE471 - Weight gain
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to weight gain
*/
define "Weight gain":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Weight gain"
|
| Library Name: HIVIndicatorElements |
/* End of Central nervous system symptoms */
/*
@dataElement: HIV.D.DE471 - Weight gain
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to weight gain
*/
define "Weight gain":
exists Elements."Weight gain" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Weight gain */
/*
@dataElement: HIV.D.DE472 - Hepatic dysfunction
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to hepatic dysfunction (jaundice)
*/
define "Hepatic dysfunction":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Hepatic dysfunction"
|
| Library Name: HIVIndicatorElements |
/* End of Weight gain */
/*
@dataElement: HIV.D.DE472 - Hepatic dysfunction
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to hepatic dysfunction (jaundice)
*/
define "Hepatic dysfunction":
exists Elements."Hepatic dysfunction" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Hepatic dysfunction */
/*
@dataElement: HIV.D.DE473 - Haematological disorders
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to haematological (anaemia, neutropenia) disorders
*/
define "Haematological disorders":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Haematological disorders"
|
| Library Name: HIVIndicatorElements |
/* End of Hepatic dysfunction */
/*
@dataElement: HIV.D.DE473 - Haematological disorders
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to haematological (anaemia, neutropenia) disorders
*/
define "Haematological disorders":
exists Elements."Haematological disorders" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Haematological disorders */
/*
@dataElement: HIV.D.DE474 - Fatigue
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to fatigue
*/
define "Fatigue":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Fatigue"
|
| Library Name: HIVIndicatorElements |
/* End of Haematological disorders */
/*
@dataElement: HIV.D.DE474 - Fatigue
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to fatigue
*/
define "Fatigue":
exists Elements."Fatigue" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Fatigue */
/*
@dataElement: HIV.D.DE475 - Headache
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to headache
*/
define "Headache D.DE475":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Headache - HIV.D.DE475"
|
| Library Name: HIVIndicatorElements |
/* End of Fatigue */
/*
@dataElement: HIV.D.DE475 - Headache
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to headache
*/
define "Headache D.DE475":
exists Elements."Headache D.DE475" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Headache D.DE475 */
/*
@dataElement: HIV.D.DE476 - Bone dysfunction
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to bone dysfunction (fractures, osteopenia)
*/
define "Bone dysfunction":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Bone dysfunction"
|
| Library Name: HIVIndicatorElements |
/* End of Headache D.DE475 */
/*
@dataElement: HIV.D.DE476 - Bone dysfunction
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to bone dysfunction (fractures, osteopenia)
*/
define "Bone dysfunction":
exists Elements."Bone dysfunction" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Bone dysfunction */
/*
@dataElement: HIV.D.DE477 - Metabolic symptoms
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to metabolic symptoms (body fat changes, hyperglycaemia, dyslipidaemia)
*/
define "Metabolic symptoms":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Metabolic symptoms"
|
| Library Name: HIVIndicatorElements |
/* End of Bone dysfunction */
/*
@dataElement: HIV.D.DE477 - Metabolic symptoms
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to metabolic symptoms (body fat changes, hyperglycaemia, dyslipidaemia)
*/
define "Metabolic symptoms":
exists Elements."Metabolic symptoms" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Metabolic symptoms */
/*
@dataElement: HIV.D.DE478 - Kidney dysfunction
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to kidney dysfunction (nephrolithiasis, renal insufficiency)
*/
define "Kidney dysfunction":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Kidney dysfunction"
|
| Library Name: HIVIndicatorElements |
/* End of Metabolic symptoms */
/*
@dataElement: HIV.D.DE478 - Kidney dysfunction
@activity: HIV.D21 Determine regimen and treatment options
@description: Treatment-limiting toxicity due to kidney dysfunction (nephrolithiasis, renal insufficiency)
*/
define "Kidney dysfunction":
exists Elements."Kidney dysfunction" AE where AE.date during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Kidney dysfunction */
/*
@dataElement: HIV.D.DE479 - Unexpected adverse drug reaction
@activity: HIV.D21 Determine regimen and treatment options
@description: Client experienced an unexpected adverse drug reaction
*/
define "Unexpected adverse drug reaction":
[AdverseEvent] AE
where AE.actuality = 'actual'
and AE.event ~ Concepts."Unexpected adverse drug reaction"
|
| Library Name: HIVIndicatorElements |
/* End of Kidney dysfunction */
/*
@dataElement: HIV.D.DE479 - Unexpected adverse drug reaction
@activity: HIV.D21 Determine regimen and treatment options
@description: Client experienced an unexpected adverse drug reaction
*/
define "Unexpected adverse drug reaction":
exists Elements."Unexpected adverse drug reaction" AE where AE.date during "Measurement Period"
|
| Library Name: HIVIndicatorElements |
/* End of Number of days medications prescribed */
/*
@dataElement: HIV.D.DE466 - Type of treatment-limiting toxicity
@activity: HIV.D21 Determine regimen and treatment options
@description: Type of treatment-limiting toxicity experienced by client. Treatment-limiting toxicity is defined as a serious adverse drug reaction that results in drug discontinuation or substitution. In addition, any reaction that leads to treatment interruption or requires changing the drug or regimen because of an adverse drug reaction is also considered a serious adverse drug reaction.
*/
define "Type of treatment-limiting toxicity":
case
when "Gastrointestinal" then Concepts."Gastrointestinal"
when "Skin issues" then Concepts."Skin issues"
when "Peripheral neuropathy" then Concepts."Peripheral neuropathy"
when "Central nervous system symptoms" then Concepts."Central nervous system symptoms"
when "Weight gain" then Concepts."Weight gain"
when "Hepatic dysfunction" then Concepts."Hepatic dysfunction"
when "Haematological disorders" then Concepts."Haematological disorders"
when "Fatigue" then Concepts."Fatigue"
when "Headache D.DE475" then Concepts."Headache - HIV.D.DE475"
when "Bone dysfunction" then Concepts."Bone dysfunction"
when "Metabolic symptoms" then Concepts."Metabolic symptoms"
when "Kidney dysfunction" then Concepts."Kidney dysfunction"
when "Unexpected adverse drug reaction" then Concepts."Unexpected adverse drug reaction"
else null
end
|
| Library Name: HIVElements |
/* End of Facility-level testing */
/*
@dataElement: HIV.B.DE29 - Currently pregnant
@activity: HIV.B6 Capture or update client history
@description: Client is currently pregnant
*/
define "Currently pregnant B.DE29":
[Condition: Concepts."Currently pregnant - HIV.B.DE29"] C
sort by start of prevalenceInterval()
|
| Library Name: HIVIndicatorElements |
/* End of Facility-level testing */
/*
@dataElement: HIV.B.DE29 - Currently pregnant
@activity: HIV.B6 Capture or update client history
@description: Client is currently pregnant
*/
define "Currently pregnant B.DE29":
Elements."Currently pregnant B.DE29" C
where C.prevalenceInterval() during "Measurement Period"
|
| Library Name: HIVElements |
/* End of Currently pregnant B.DE29 */
/*
@dataElement: HIV.B.DE32 - Breastfeeding
@activity: HIV.B6 Capture or update client history
@description: Infant is being breastfed by mother
*/
define "Breastfeeding B.DE32":
[Observation: Concepts."Breastfeeding - HIV.B.DE32"] O
where O.status in { 'final', 'amended', 'corrected' }
and O.value is true
|
| Library Name: HIVIndicatorElements |
/* End of Currently pregnant B.DE29 */
/*
@dataElement: HIV.B.DE32 - Breastfeeding
@activity: HIV.B6 Capture or update client history
@description: Infant is being breastfed by mother
*/
define "Breastfeeding B.DE32":
Elements."Breastfeeding B.DE32" O
where O.effective.toInterval() during "Measurement Period"
|
| Library Name: HIVIndicatorElements |
define "pregnancy stratifier":
case
when exists("Currently pregnant B.DE29") then Concepts."Currently pregnant - HIV.B.DE29"
when exists("Breastfeeding B.DE32") then Concepts."Breastfeeding - HIV.B.DE32"
else null
end
|
| Library Name: HIVIND35Logic |
define "Stratification":
HIE."By Administrative Gender Stratifier".code
+ ':' + HIE."By Age Stratifier 6"
+ ':' + HIE."By Geographic Region Stratifier"
+ Combine(HIE.patientGroups, ':')
+ HIE."Current ART regimen".code
+ HIE."Type of treatment-limiting toxicity".code
+ HIE."pregnancy stratifier".code
|
| 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
}
|
| 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
}
|
| Library Name: FHIRHelpers |
define function ToDateTime(value dateTime): value.value
|
| Library Name: FHIRHelpers |
define function ToString(value ObservationStatus): value.value
|
| Library Name: FHIRHelpers |
define function ToDateTime(value instant): value.value
|
| Library Name: FHIRHelpers |
define function ToString(value MedicationStatementStatus): value.value
|
| 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))
|
| 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, '/'))
|
| Library Name: FHIRHelpers |
define function ToString(value string): value.value
|
| Library Name: FHIRHelpers |
define function ToString(value AdministrativeGender): value.value
|
| Library Name: FHIRHelpers |
define function ToString(value AddressUse): value.value
|
| Library Name: FHIRHelpers |
define function ToString(value AdverseEventActuality): value.value
|
| Library Name: WHOCommon |
/*
@description: Returns an interval representing the normalized prevalence period of a given Condition resource.
@comment: Uses the toInterval and toAbatementInterval functions to determine the widest potential interval from
onset to abatement as specified in the given Condition.
*/
define fluent function prevalenceInterval(condition Condition):
if condition.clinicalStatus ~ "active"
or condition.clinicalStatus ~ "recurrence"
or condition.clinicalStatus ~ "relapse" then
Interval[start of condition.onset.toInterval(), end of condition.abatementInterval()]
else
(end of condition.abatementInterval()) abatementDate
return
if abatementDate is null then
Interval[start of condition.onset.toInterval(), abatementDate)
else
Interval[start of condition.onset.toInterval(), abatementDate]
|
| Library Name: WHOCommon |
/*
@description: Returns an interval representing the normalized Abatement of a given Condition resource.
@comment: NOTE: Due to the complexity of determining an interval from a String, this function will throw
a run-time exception if used with a Condition instance that has a String as the abatement value.
*/
define fluent function abatementInterval(condition Condition):
if condition.abatement is FHIR.dateTime then
Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)]
else if condition.abatement is FHIR.Period then
FHIRHelpers.ToInterval(condition.abatement as FHIR.Period)
else if condition.abatement is FHIR.string then
Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')
else if condition.abatement is FHIR.Age then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year)
else if condition.abatement is FHIR.Range then
Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low),
FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year)
else if condition.abatement is FHIR.boolean then
Interval[end of condition.onset.toInterval(), condition.recordedDate)
else
null
|
| 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]
|
| Library Name: FHIRHelpers |
define function ToDate(value date): value.value
|
| Library Name: FHIRHelpers |
define function ToQuantity(quantity FHIR.Quantity):
case
when quantity is null then null
when quantity.value is null then null
when quantity.comparator is not null then
Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')
when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'
or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then
System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }
else
Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')
end
|
| Library Name: FHIRHelpers |
define function ToCalendarUnit(unit System.String):
case unit
when 'ms' then 'millisecond'
when 's' then 'second'
when 'min' then 'minute'
when 'h' then 'hour'
when 'd' then 'day'
when 'wk' then 'week'
when 'mo' then 'month'
when 'a' then 'year'
else unit
end
|
| Library Name: FHIRHelpers |
define function ToBoolean(value boolean): value.value
|