Skip to content

Commit

Permalink
Updates to Indicators, DT, profiling, and narrative (#20)
Browse files Browse the repository at this point in the history
* 60-74 indicators done (#55)

* Smart HIV DAK Business Processes Translation (#56)

* L2 HIV testing and Treatment User scenarios Translations (#53)

---------

Co-authored-by: Pprado23 <141263871+Pprado23@users.noreply.github.com>
Co-authored-by: abertnamanya <abertnamanya@gmail.com>
  • Loading branch information
3 people authored Oct 17, 2024
1 parent 18668b8 commit 3843ac3
Show file tree
Hide file tree
Showing 23 changed files with 1,226 additions and 141 deletions.
3 changes: 3 additions & 0 deletions input/cql/HIVConceptsCustom.cql
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ 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"
code "syphilis test" : 'syphilis test' from "missing concepts"
code "Gonorrhoea test" : 'Gonorrhoea test' from "missing concepts"
code "syphilis treatment" : 'syphilis treatment' from "missing concepts"
code "Gonorrhoea treatment" : 'Gonorrhoea treatment' from "missing concepts"


valueset "Antenatal care contact": 'http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-contact'
80 changes: 26 additions & 54 deletions input/cql/HIVElements.cql
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,10 @@ define "Facility-level testing Observation":
@activity: HIV.B6 Capture or update client history
@description: Client is currently pregnant
*/
// TODO: Replace placeholder with relevant CQL logic

define "Currently pregnant B.DE29":
exists "Currently pregnant B.DE29 Observation"
define "Currently pregnant B.DE29 Observation":
[Observation: Concepts."Currently pregnant - HIV.B.DE29"] O
where O.status in { 'final', 'amended', 'corrected' }
and O.value is true
[Condition: Concepts."Currently pregnant - HIV.B.DE29"] C
sort by start of prevalenceInterval()
/* End of Currently pregnant B.DE29 */

/*
Expand Down Expand Up @@ -2800,38 +2797,32 @@ define "Inconclusive B.DE253":
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Date of initiation of syphilis treatment
*/
// TODO: Replace placeholder with relevant CQL logic

define "Syphilis treatment start date B.DE254":
[Observation: Concepts."Syphilis treatment start date - HIV.B.DE254"] O
where O.status in { 'final', 'amended', 'corrected' }
define "Syphilis treatment start date B.DE254 Value":
"Syphilis treatment start date B.DE254" O
return O.value
[MedicationStatement] MS
where MS.status = 'completed'
and exists(MS.reasonCode C where C ~ ConceptsCustom."syphilis treatment")
/* End of Syphilis treatment start date B.DE254 */

/*
@dataElement: HIV.B.DE255 - Gonorrhoea test date
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Date of Gonorrhoea test
*/
// TODO: Replace placeholder with relevant CQL logic

define "Gonorrhoea test date B.DE255":
[Observation: Concepts."Gonorrhoea test date - HIV.B.DE255"] O
where O.status in { 'final', 'amended', 'corrected' }
define "Gonorrhoea test date B.DE255 Value":
"Gonorrhoea test date B.DE255" O
return O.value
[Procedure] P
where P.status = 'completed'
and P.code ~ ConceptsCustom."Gonorrhoea test"
/* End of Gonorrhoea test date B.DE255 */

/*
@dataElement: HIV.B.DE256 - Gonorrhoea test result
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Result from Gonorrhoea test
*/
// TODO: Replace placeholder with relevant CQL logic

define "Gonorrhoea test result B.DE256":
exists "Gonorrhoea test result B.DE256 Observation"
define "Gonorrhoea test result B.DE256 Observation":
[Observation: Concepts."Gonorrhoea test result - HIV.B.DE256"] O
where O.status in { 'final', 'amended', 'corrected' }
/* End of Gonorrhoea test result B.DE256 */
Expand All @@ -2841,64 +2832,45 @@ define "Gonorrhoea test result B.DE256 Observation":
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Test result is positive for Neisseria gonorrhoeae
*/
// TODO: Replace placeholder with relevant CQL logic

define "Positive B.DE257":
exists "Positive B.DE257 Condition"
or exists "Positive B.DE257 Observation"
define "Positive B.DE257 Condition":
[Condition: Concepts."Positive - HIV.B.DE257"]
define "Positive B.DE257 Observation":
"Gonorrhoea test result B.DE256 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Positive - HIV.B.DE257"
"Gonorrhoea test result B.DE256" O
where O.value ~ Concepts."Positive - HIV.B.DE257"
/* End of Positive B.DE257 */

/*
@dataElement: HIV.B.DE258 - Negative
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Test result is negative for Neisseria gonorrhoeae
*/
// TODO: Replace placeholder with relevant CQL logic

define "Negative B.DE258":
exists "Negative B.DE258 Condition"
or exists "Negative B.DE258 Observation"
define "Negative B.DE258 Condition":
[Condition: Concepts."Negative - HIV.B.DE258"]
define "Negative B.DE258 Observation":
"Gonorrhoea test result B.DE256 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Negative - HIV.B.DE258"
"Gonorrhoea test result B.DE256" O
where O.value ~ Concepts."Negative - HIV.B.DE258"

/* End of Negative B.DE258 */

/*
@dataElement: HIV.B.DE259 - Inconclusive
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Test result is inconclusive
*/
// TODO: Replace placeholder with relevant CQL logic

define "Inconclusive B.DE259":
exists "Inconclusive B.DE259 Condition"
or exists "Inconclusive B.DE259 Observation"
define "Inconclusive B.DE259 Condition":
[Condition: Concepts."Inconclusive - HIV.B.DE259"]
define "Inconclusive B.DE259 Observation":
"Gonorrhoea test result B.DE256 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Inconclusive - HIV.B.DE259"
"Gonorrhoea test result B.DE256" O
where O.value ~ Concepts."Inconclusive - HIV.B.DE259"
/* End of Inconclusive B.DE259 */

/*
@dataElement: HIV.B.DE260 - Gonorrhoea treatment start date
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Date of initiation of Gonorrhoea treatment
*/
// TODO: Replace placeholder with relevant CQL logic

define "Gonorrhoea treatment start date B.DE260":
[Observation: Concepts."Gonorrhoea treatment start date - HIV.B.DE260"] O
where O.status in { 'final', 'amended', 'corrected' }
define "Gonorrhoea treatment start date B.DE260 Value":
"Gonorrhoea treatment start date B.DE260" O
return O.value
[MedicationStatement] MS
where MS.status = 'completed'
and exists(MS.reasonCode C where C ~ ConceptsCustom."Gonorrhoea treatment")
/* End of Gonorrhoea treatment start date B.DE260 */

/*
Expand Down
6 changes: 3 additions & 3 deletions input/cql/HIVIND60Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ define "Initial Population":
*/

define "Numerator":
First(HE."ANC contact date E.DE85") during "Measurement Period"
First(HIE."ANC within pregnancy").period.toInterval() during "Measurement Period"
and exists(HE."Syphilis test date B.DE249" P
where start of P.performed.toInterval() = start of First(HE."ANC contact date E.DE85"))
where start of P.performed.toInterval() = start of First(HIE."ANC within pregnancy").period.toInterval())


/**
Expand All @@ -98,7 +98,7 @@ define "Numerator":
*/

define "Denominator":
First(HE."ANC contact date E.DE85") during "Measurement Period"
First(HIE."ANC within pregnancy").period.toInterval() during "Measurement Period"


/* end Populations */
Expand Down
8 changes: 3 additions & 5 deletions input/cql/HIVIND61Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ define "Initial Population":
* Calculation: COUNT of pregnant women with "ANC contact date" in reporting period AND "Syphilis test date" on ANY "ANC contact date" for this pregnancy
*/

define "all anc dates":
flatten{HE."ANC contact date E.DE85"}

define "Numerator":
HIE."ANC contact date E.DE85"
exists(HIE."ANC within pregnancy within measurement period")
and exists(HE."Syphilis test date B.DE249" P
where exists("all anc dates" t where duration in days of (t intersect P.performed.toInterval()) > 0)
where exists(HIE."all anc dates" t where duration in days of (t intersect P.performed.toInterval()) > 0)
)


Expand All @@ -100,7 +98,7 @@ define "Numerator":
*/

define "Denominator":
HIE."ANC contact date E.DE85"
exists(HIE."ANC within pregnancy within measurement period")


/* end Populations */
Expand Down
38 changes: 36 additions & 2 deletions input/cql/HIVIND64Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ include HIVCommon version '0.0.1' called HIC
include FHIRHelpers version '4.0.1'

include WHOCommon called WCom
include HIVElements called HE
include HIVIndicatorElements called HIE
include HIVConfig called Config

// Indicator Definition
parameter "Measurement Period" Interval<Date> default Interval[@2023-01-01, @2023-01-30]
Expand All @@ -89,8 +92,17 @@ define "Initial Population":
* Calculation: COUNT of pregnant women with first "ANC contact date" for this pregnancy in the reporting period AND with "Syphilis test date" on first "ANC contact date" AND "Syphilis test result"='Positive'
*/





define "Numerator":
true
First(HIE."ANC within pregnancy").period.toInterval() during "Measurement Period"
and 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 start of P.performed.toInterval() = start of HIE."first anc date"
)


/**
Expand All @@ -101,8 +113,30 @@ define "Numerator":
*/

define "Denominator":
true
First(HIE."ANC within pregnancy").period.toInterval() during "Measurement Period"
and exists(HE."Syphilis test date B.DE249" P
where P.performed.toInterval() during "Measurement Period"
and start of P.performed.toInterval() = start of HIE."first anc date"
)


/* end Populations */

/*
* Disaggregators
*/


define "Age Stratifier":
HIE."By Age Stratifier 2"

define "Geographic Region Stratifier":
HIE."By Geographic Region Stratifier"

define "HIV Status":
HIE."HIV Status Stratifier"

define "Stratification":
HIE."By Age Stratifier 2"
+ ':' + HIE."By Geographic Region Stratifier"
+ ':' + HIE."HIV Status Stratifier".code
31 changes: 29 additions & 2 deletions input/cql/HIVIND65Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ include HIVCommon version '0.0.1' called HIC
include FHIRHelpers version '4.0.1'

include WHOCommon called WCom
include HIVElements called HE
include HIVIndicatorElements called HIE
include HIVConfig called Config

// Indicator Definition
parameter "Measurement Period" Interval<Date> default Interval[@2023-01-01, @2023-01-30]
Expand All @@ -89,8 +92,12 @@ define "Initial Population":
* Calculation: COUNT of pregnant women with "ANC contact date" in reporting period AND with "Syphilis test date" on ANY "ANC contact date" for this pregnancy AND "Syphilis test result"='Positive'
*/


define "Numerator":
true
exists(HIE."ANC within pregnancy within measurement period")
and exists(HE."Positive B.DE251" S
with HE."Syphilis test date B.DE249" P
such that S.partOf.references(P) and exists(HIE."all anc dates" t where duration in days of (t intersect P.performed.toInterval()) > 0))


/**
Expand All @@ -101,8 +108,28 @@ define "Numerator":
*/

define "Denominator":
true
exists(HIE."ANC within pregnancy within measurement period")
and exists(HE."Syphilis test date B.DE249" P
where exists(HIE."all anc dates" t where duration in days of (t intersect P.performed.toInterval()) > 0))


/* end Populations */

/*
* Disaggregators
*/


define "Age Stratifier":
HIE."By Age Stratifier 2"

define "Geographic Region Stratifier":
HIE."By Geographic Region Stratifier"

define "HIV Status":
HIE."HIV Status Stratifier"

define "Stratification":
HIE."By Age Stratifier 2"
+ ':' + HIE."By Geographic Region Stratifier"
+ ':' + HIE."HIV Status Stratifier".code
39 changes: 37 additions & 2 deletions input/cql/HIVIND66Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ include HIVCommon version '0.0.1' called HIC
include FHIRHelpers version '4.0.1'

include WHOCommon called WCom
include HIVElements called HE
include HIVIndicatorElements called HIE
include HIVConfig called Config

// Indicator Definition
parameter "Measurement Period" Interval<Date> default Interval[@2023-01-01, @2023-01-30]
Expand All @@ -118,7 +121,10 @@ define "Initial Population":
*/

define "Numerator":
true
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"


/**
Expand All @@ -129,8 +135,37 @@ define "Numerator":
*/

define "Denominator":
true
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()))


/* end Populations */

/*
* Disaggregators
*/

define "Administrative Gender Stratifier":
HIE."By Administrative Gender Stratifier"

define "Age Stratifier":
HIE."By Age Stratifier 2"

define "Geographic Region Stratifier":
HIE."By Geographic Region Stratifier"

define "patientGroups Stratifier":
HIE."patientGroups"

define "HIV Status":
HIE."HIV Status Stratifier"

define "Stratification":
HIE."By Administrative Gender Stratifier".code
+ ':' + HIE."By Age Stratifier 2"
+ ':' + HIE."By Geographic Region Stratifier"
+ Combine(HIE.patientGroups, ':')
+ ':' + HIE."HIV Status Stratifier".code

Loading

0 comments on commit 3843ac3

Please sign in to comment.