Skip to content

Commit

Permalink
indicators 46-55
Browse files Browse the repository at this point in the history
  • Loading branch information
Pprado23 authored and pmanko committed Aug 13, 2024
1 parent b94542e commit 9121d80
Show file tree
Hide file tree
Showing 13 changed files with 154 additions and 102 deletions.
2 changes: 0 additions & 2 deletions input/cql/HIVCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ context Patient

//DRAFT



//need to add Time to start ART (within 7, 30 or 90 days of diagnosis, as per country guidelines)
//need to add Disaggregation by time since diagnosis

Expand Down
2 changes: 2 additions & 0 deletions input/cql/HIVConceptsCustom.cql
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ code "buprenorphine": 'buprenorphine' from "missing concepts"
code "viral load test": 'viral load test' from "missing concepts"
code "delivery": 'delivery' from "missing concepts"
code "tb treatment": 'tb treatment' from "missing concepts"
code "ART medication": 'ART medication' from "missing concepts"
code "DSD ART eligibility assessed" : 'DSD ART eligibility assessed' from "missing concepts"
65 changes: 37 additions & 28 deletions input/cql/HIVElements.cql
Original file line number Diff line number Diff line change
Expand Up @@ -5546,8 +5546,9 @@ define "Established on ART Observation":
*/

define "ART start type":
[Observation: Concepts."ART start type"] O
where O.status in { 'final', 'amended', 'corrected' }
[MedicationStatement] MS
where exists(MS.reasonCode C where C ~ Concepts."On ART - HIV.D.DE38")
sort by start of effective.toInterval()
/* End of ART start type */

/*
Expand All @@ -5557,8 +5558,8 @@ define "ART start type":
*/

define "First-time user of ART":
"ART start type" O
where O.value ~ Concepts."First-time user of ART"
"ART start type" MS
where exists(MS.reasonCode C where C ~ Concepts."First-time user of ART")
/* End of First-time user of ART */

/*
Expand All @@ -5568,8 +5569,9 @@ define "First-time user of ART":
*/

define "Restarting ART":
"ART start type" O
where O.value ~ Concepts."Restarting ART"
"ART start type" MS
where exists(MS.reasonCode C where C ~ Concepts."Restarting ART")

/* End of Restarting ART */

/*
Expand Down Expand Up @@ -10253,10 +10255,8 @@ define "Malaria prevention such as bed nets and prophylaxis, depending on epidem
@activity: HIV.D21 Determine regimen and treatment options
@description: Client is eligible for differentiated service delivery (DSD) for ART
*/
// TODO: Replace placeholder with relevant CQL logic

define "Eligible for DSD ART":
exists "Eligible for DSD ART Observation"
define "Eligible for DSD ART Observation":
[Observation: Concepts."Eligible for DSD ART"] O
where O.status in { 'final', 'amended', 'corrected' }
and O.value is true
Expand All @@ -10267,41 +10267,47 @@ define "Eligible for DSD ART Observation":
@activity: HIV.D21 Determine regimen and treatment options
@description: Date client was assessed for eligibility for differentiated service delivery (DSD) for ART
*/
// TODO: Replace placeholder with relevant CQL logic

define "Date DSD ART eligibility assessed":
[Observation: Concepts."Date DSD ART eligibility assessed"] O
where O.status in { 'final', 'amended', 'corrected' }
define "Date DSD ART eligibility assessed Value":
"Date DSD ART eligibility assessed" O
return O.value
[Procedure: CustomConcepts."DSD ART eligibility assessed"] P
where P.status in { 'completed' }
return P.performed.toInterval()
/* End of Date DSD ART eligibility assessed */

/*
@dataElement: HIV.D.DE762 - Currently enrolled in DSD ART model
@activity: HIV.D21 Determine regimen and treatment options
@description: Client currently enrolled in differentiated service delivery (DSD) ART model
*/
// TODO: Replace placeholder with relevant CQL logic

define "Currently enrolled in DSD ART model":
exists "Currently enrolled in DSD ART model Observation"
define "Currently enrolled in DSD ART model Observation":
[Observation: Concepts."Currently enrolled in DSD ART model"] O
where O.status in { 'final', 'amended', 'corrected' }
and O.value is true
[EpisodeOfCare] EOC
where exists(EOC.type T where T ~ Concepts."Currently enrolled in DSD ART model")

/* End of Currently enrolled in DSD ART model */

/*
@dataElement: HIV.D.DE763 - DSD ART start date
@activity: HIV.D21 Determine regimen and treatment options
@description: Date client started on differentiated service delivery (DSD) for ART
*/
// TODO: Replace placeholder with relevant CQL logic

define "DSD ART start date":
[Observation: Concepts."DSD ART start date"] O
where O.status in { 'final', 'amended', 'corrected' }
define "DSD ART start date Value":
"DSD ART start date" O
return O.value
flatten{"DSD ART status","DSD ART statusHistory".statusHistory.period}

define "DSD ART status":
[EpisodeOfCare] EOC
where exists(EOC.type T where T ~ Concepts."Currently enrolled in DSD ART model")
and EOC.status = 'finished'
return EOC.period

define "DSD ART statusHistory":
[EpisodeOfCare] EOC
where exists(EOC.type T where T ~ Concepts."Currently enrolled in DSD ART model")
and (exists (
EOC.statusHistory H
where H.status = 'finished'
and H.period is not null))
/* End of DSD ART start date */

/*
Expand Down Expand Up @@ -15011,4 +15017,7 @@ define "Reporting date Value":

/*
* Custom elements and logic for use DT and IND CQL Libraries
*/
*/

define "First On ART":
(First("On ART D.DE38"))
14 changes: 7 additions & 7 deletions input/cql/HIVIND47Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ define "Initial Population":

define "Numerator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and (start of HE."First On ART".effective.toInterval() during "Measurement Period")
and HIE."Date of TB diagnosis"


Expand All @@ -117,7 +117,7 @@ define "Numerator":

define "Denominator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and (start of HE."First On ART".effective.toInterval() during "Measurement Period")


/* end Populations */
Expand All @@ -138,10 +138,10 @@ define "Geographic Region Stratifier":
define "patientGroups Stratifier":
HIC."patientGroups"

define "Stratification":
HIC."By Administrative Gender Stratifier".code
+ ':' + HIC."By Age Stratifier"
+ ':' + HIC."By Geographic Region Stratifier"
+ Combine(HIC.patientGroups, ':')
//define "Stratification":
// HIC."By Administrative Gender Stratifier".code
// + ':' + HIC."By Age Stratifier"
//+ ':' + HIC."By Geographic Region Stratifier"
//+ Combine(HIC.patientGroups, ':')

//add Pregnant or breastfeeding women
12 changes: 6 additions & 6 deletions input/cql/HIVIND48Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ define "Initial Population":

define "Numerator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and (start of HE."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"
and HIE."TB screening date"

Expand All @@ -104,7 +104,7 @@ define "Numerator":

define "Denominator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and (start of HE."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"


Expand All @@ -123,9 +123,9 @@ define "Age Stratifier":
define "Geographic Region Stratifier":
HIC."By Geographic Region Stratifier"

define "Stratification":
HIC."By Administrative Gender Stratifier".code
+ ':' + HIC."By Age Stratifier"
+ ':' + HIC."By Geographic Region Stratifier"
//define "Stratification":
//HIC."By Administrative Gender Stratifier".code
// + ':' + HIC."By Age Stratifier"
//+ ':' + HIC."By Geographic Region Stratifier"


14 changes: 6 additions & 8 deletions input/cql/HIVIND49Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ define "Initial Population":

define "Numerator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"
and (start of First(HE."First-time user of ART").effective.toInterval() during "Measurement Period")
and HIE."Screen positive for TB"


Expand All @@ -109,8 +108,7 @@ define "Numerator":

define "Denominator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"
and (start of First(HE."First-time user of ART").effective.toInterval() during "Measurement Period")
and HIE."TB screening date"


Expand All @@ -129,7 +127,7 @@ define "Age Stratifier":
define "Geographic Region Stratifier":
HIC."By Geographic Region Stratifier"

define "Stratification":
HIC."By Administrative Gender Stratifier".code
+ ':' + HIC."By Age Stratifier"
+ ':' + HIC."By Geographic Region Stratifier"
//define "Stratification":
//HIC."By Administrative Gender Stratifier".code
// + ':' + HIC."By Age Stratifier"
//+ ':' + HIC."By Geographic Region Stratifier"
14 changes: 6 additions & 8 deletions input/cql/HIVIND50Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ define "Initial Population":

define "Numerator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"
and (start of First(HE."First-time user of ART").effective.toInterval() during "Measurement Period")
//related the two since we want a positive observation from a specific diagnostic test.
and exists(
HE."TB diagnostic test category" P
Expand All @@ -126,8 +125,7 @@ define "Numerator":

define "Denominator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"
and (start of First(HE."First-time user of ART").effective.toInterval() during "Measurement Period")
and HIE."Screen positive for TB"


Expand All @@ -146,7 +144,7 @@ define "Age Stratifier":
define "Geographic Region Stratifier":
HIC."By Geographic Region Stratifier"

define "Stratification":
HIC."By Administrative Gender Stratifier".code
+ ':' + HIC."By Age Stratifier"
+ ':' + HIC."By Geographic Region Stratifier"
//define "Stratification":
// HIC."By Administrative Gender Stratifier".code
// + ':' + HIC."By Age Stratifier"
//+ ':' + HIC."By Geographic Region Stratifier"
14 changes: 6 additions & 8 deletions input/cql/HIVIND51Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ define "Initial Population":

define "Numerator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"
and (start of First(HE."First-time user of ART").effective.toInterval() during "Measurement Period")
//related the two since we want a positive observation from a specific diagnostic test.
and exists(
HE."TB diagnostic test category" P
Expand All @@ -128,8 +127,7 @@ define "Numerator":

define "Denominator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"
and (start of First(HE."First-time user of ART").effective.toInterval() during "Measurement Period")
//related the two since we want a positive observation from a specific diagnostic test.
and exists(
HE."TB diagnostic test category" P
Expand All @@ -154,7 +152,7 @@ define "Age Stratifier":
define "Geographic Region Stratifier":
HIC."By Geographic Region Stratifier"

define "Stratification":
HIC."By Administrative Gender Stratifier".code
+ ':' + HIC."By Age Stratifier"
+ ':' + HIC."By Geographic Region Stratifier"
//define "Stratification":
// HIC."By Administrative Gender Stratifier".code
// + ':' + HIC."By Age Stratifier"
//+ ':' + HIC."By Geographic Region Stratifier"
14 changes: 6 additions & 8 deletions input/cql/HIVIND52Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ define "Initial Population":

define "Numerator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"
and (start of First(HE."First-time user of ART").effective.toInterval() during "Measurement Period")
//related the two since we want a positive observation from a specific diagnostic test.
and exists(
HE."TB diagnostic test category" P
Expand All @@ -130,8 +129,7 @@ define "Numerator":

define "Denominator":
HIE."HIV-positive B.DE116"
and (start of HIC."First On ART".effective.toInterval() during "Measurement Period")
and HIE."First-time user of ART"
and (start of First(HE."First-time user of ART").effective.toInterval() during "Measurement Period")
//related the two since we want a positive observation from a specific diagnostic test.
and exists(
HE."TB diagnostic test category" P
Expand All @@ -158,7 +156,7 @@ define "Age Stratifier":
define "Geographic Region Stratifier":
HIC."By Geographic Region Stratifier"

define "Stratification":
HIC."By Administrative Gender Stratifier".code
+ ':' + HIC."By Age Stratifier"
+ ':' + HIC."By Geographic Region Stratifier"
//define "Stratification":
// HIC."By Administrative Gender Stratifier".code
// + ':' + HIC."By Age Stratifier"
//+ ':' + HIC."By Geographic Region Stratifier"
Loading

0 comments on commit 9121d80

Please sign in to comment.