Skip to content

Commit

Permalink
done with indicators 75-85 and adjusted tx curr (#59) (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: Patric Prado <pprado@caa.columbia.edu>
  • Loading branch information
pmanko and Pprado23 authored Oct 30, 2024
1 parent 3843ac3 commit 0d065e9
Show file tree
Hide file tree
Showing 16 changed files with 513 additions and 158 deletions.
3 changes: 2 additions & 1 deletion input/cql/HIVConceptsCustom.cql
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ 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 "HBsAg test" : 'HBsAg 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"

code "HCV test" : 'Gonorrhoea treatment' from "missing concepts"

valueset "Antenatal care contact": 'http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-contact'
103 changes: 40 additions & 63 deletions input/cql/HIVElements.cql
Original file line number Diff line number Diff line change
Expand Up @@ -2592,9 +2592,11 @@ define "At elevated risk for HIV acquisition B.DE225":
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Syndrome or STI for which client is diagnosed
*/
// TODO: Replace placeholder with relevant CQL logic

define "Syndrome/STI diagnosed B.DE226":
exists "Syndrome/STI diagnosed B.DE226 Observation"
"Urethral discharge syndrome B.DE227" or "Vaginal discharge syndrome B.DE228" or "Lower Abdominal pain B.DE229" or "Genital ulcer disease syndrome B.DE230" or
"Anorectal discharge B.DE231"

define "Syndrome/STI diagnosed B.DE226 Observation":
[Observation: Concepts."Syndrome/STI diagnosed - HIV.B.DE226"] O
where O.status in { 'final', 'amended', 'corrected' }
Expand All @@ -2605,7 +2607,7 @@ define "Syndrome/STI diagnosed B.DE226 Observation":
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Client diagnosed with urethral discharge syndrome
*/
// TODO: Replace placeholder with relevant CQL logic

define "Urethral discharge syndrome B.DE227":
exists "Urethral discharge syndrome B.DE227 Condition"
or exists "Urethral discharge syndrome B.DE227 Observation"
Expand All @@ -2622,7 +2624,7 @@ define "Urethral discharge syndrome B.DE227 Observation":
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Client diagnosed with vaginal discharge syndrome
*/
// TODO: Replace placeholder with relevant CQL logic

define "Vaginal discharge syndrome B.DE228":
exists "Vaginal discharge syndrome B.DE228 Condition"
or exists "Vaginal discharge syndrome B.DE228 Observation"
Expand All @@ -2639,12 +2641,10 @@ define "Vaginal discharge syndrome B.DE228 Observation":
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Client diagnosed with lower abdominal pain
*/
// TODO: Replace placeholder with relevant CQL logic

define "Lower Abdominal pain B.DE229":
exists "Lower Abdominal pain B.DE229 Condition"
or exists "Lower Abdominal pain B.DE229 Observation"
define "Lower Abdominal pain B.DE229 Condition":
[Condition: Concepts."Lower Abdominal pain - HIV.B.DE229"]
exists "Lower Abdominal pain B.DE229 Observation"

define "Lower Abdominal pain B.DE229 Observation":
"Syndrome/STI diagnosed B.DE226 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
Expand All @@ -2656,7 +2656,7 @@ define "Lower Abdominal pain B.DE229 Observation":
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Client diagnosed with genital ulcer disease syndrome
*/
// TODO: Replace placeholder with relevant CQL logic

define "Genital ulcer disease syndrome B.DE230":
exists "Genital ulcer disease syndrome B.DE230 Condition"
or exists "Genital ulcer disease syndrome B.DE230 Observation"
Expand All @@ -2673,12 +2673,10 @@ define "Genital ulcer disease syndrome B.DE230 Observation":
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Client diagnosed with anorectal discharge
*/
// TODO: Replace placeholder with relevant CQL logic

define "Anorectal discharge B.DE231":
exists "Anorectal discharge B.DE231 Condition"
or exists "Anorectal discharge B.DE231 Observation"
define "Anorectal discharge B.DE231 Condition":
[Condition: Concepts."Anorectal discharge - HIV.B.DE231"]
exists "Anorectal discharge B.DE231 Observation"

define "Anorectal discharge B.DE231 Observation":
"Syndrome/STI diagnosed B.DE226 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
Expand Down Expand Up @@ -6189,24 +6187,22 @@ define "STI testing and treatment D.DE160 Observation":
@activity: HIV.D12 Determine recommended screenings and tests
@description: Date client was tested for hepatitis B virus (HBV)
*/
// TODO: Replace placeholder with relevant CQL logic

define "HBsAg test date D.DE161":
[Observation: Concepts."HBsAg test date - HIV.D.DE161"] O
where O.status in { 'final', 'amended', 'corrected' }
define "HBsAg test date D.DE161 Value":
"HBsAg test date D.DE161" O
return O.value
[Procedure] P
where P.status = 'completed'
and P.code ~ ConceptsCustom."HBsAg test"

/* End of HBsAg test date D.DE161 */


/*
@dataElement: HIV.D.DE162 - HBsAg test result
@activity: HIV.D12 Determine recommended screenings and tests
@description: Hepatitis B virus test result (HBsAg)
*/
// TODO: Replace placeholder with relevant CQL logic

define "HBsAg test result D.DE162":
exists "HBsAg test result D.DE162 Observation"
define "HBsAg test result D.DE162 Observation":
[Observation: Concepts."HBsAg test result - HIV.D.DE162"] O
where O.status in { 'final', 'amended', 'corrected' }
/* End of HBsAg test result D.DE162 */
Expand All @@ -6216,50 +6212,34 @@ define "HBsAg test result D.DE162 Observation":
@activity: HIV.D12 Determine recommended screenings and tests
@description: HBsAg test result was positive
*/
// TODO: Replace placeholder with relevant CQL logic

define "Positive D.DE163":
exists "Positive D.DE163 Condition"
or exists "Positive D.DE163 Observation"
define "Positive D.DE163 Condition":
[Condition: Concepts."Positive - HIV.D.DE163"]
define "Positive D.DE163 Observation":
"HBsAg test result D.DE162 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Positive - HIV.D.DE163"
"HBsAg test result D.DE162" O
where O.value ~ Concepts."Positive - HIV.D.DE163"

/* End of Positive D.DE163 */

/*
@dataElement: HIV.D.DE164 - Negative
@activity: HIV.D12 Determine recommended screenings and tests
@description: HBsAg test result was negative
*/
// TODO: Replace placeholder with relevant CQL logic

define "Negative D.DE164":
exists "Negative D.DE164 Condition"
or exists "Negative D.DE164 Observation"
define "Negative D.DE164 Condition":
[Condition: Concepts."Negative - HIV.D.DE164"]
define "Negative D.DE164 Observation":
"HBsAg test result D.DE162 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Negative - HIV.D.DE164"
"HBsAg test result D.DE162" O
where O.value ~ Concepts."Negative - HIV.D.DE164"

/* End of Negative D.DE164 */

/*
@dataElement: HIV.D.DE165 - Indeterminate
@activity: HIV.D12 Determine recommended screenings and tests
@description: HBsAg test result was indeterminate
*/
// TODO: Replace placeholder with relevant CQL logic

define "Indeterminate D.DE165":
exists "Indeterminate D.DE165 Condition"
or exists "Indeterminate D.DE165 Observation"
define "Indeterminate D.DE165 Condition":
[Condition: Concepts."Indeterminate - HIV.D.DE165"]
define "Indeterminate D.DE165 Observation":
"HBsAg test result D.DE162 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Indeterminate - HIV.D.DE165"
"HBsAg test result D.DE162" O
where O.value ~ Concepts."Indeterminate - HIV.D.DE165"
/* End of Indeterminate D.DE165 */

/*
Expand All @@ -6281,13 +6261,12 @@ define "HBV treatment TDF start date Value":
@activity: HIV.D12 Determine recommended screenings and tests
@description: Date client was tested for hepatitis C virus (HCV antibody, HCV RNA or HCV core antigen)
*/
// TODO: Replace placeholder with relevant CQL logic

define "HCV test date D.DE169":
[Observation: Concepts."HCV test date - HIV.D.DE169"] O
where O.status in { 'final', 'amended', 'corrected' }
define "HCV test date D.DE169 Value":
"HCV test date D.DE169" O
return O.value
[Procedure] P
where P.status = 'completed'
and P.code ~ ConceptsCustom."HCV test"

/* End of HCV test date D.DE169 */

/*
Expand Down Expand Up @@ -14760,13 +14739,11 @@ define "ART start date SRV.DE6 Value":
@activity: HIV.B6 Capture or update client history
@description: Client is currently pregnant
*/
// TODO: Replace placeholder with relevant CQL logic

define "Currently pregnant SRV.DE7":
exists "Currently pregnant SRV.DE7 Observation"
define "Currently pregnant SRV.DE7 Observation":
[Observation: Concepts."Currently pregnant - HIV.SRV.DE7"] O
where O.status in { 'final', 'amended', 'corrected' }
and O.value is true
exists "Currently pregnant SRV.DE7 Condition"
define "Currently pregnant SRV.DE7 Condition":
[Condition: Concepts."Currently pregnant - HIV.SRV.DE7"]
/* End of Currently pregnant SRV.DE7 */

/*
Expand Down
22 changes: 19 additions & 3 deletions input/cql/HIVIND27Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ include FHIRHelpers version '4.0.1'
include WHOCommon called WCom
include HIVElements called HE
include HIVIndicatorElements called HIE
include HIVConfig called Config
include HIVConcepts called Concepts

// Indicator Definition
parameter "Measurement Period" Interval<Date> default Interval[@2023-01-01, @2023-01-30]
Expand All @@ -84,10 +86,24 @@ context Patient

define "Measure Population":
HIE."Has HIV-positive Status"
and HIE."On ART H.DE47"
and exists(HE."On ART H.DE47" A
with [EpisodeOfCare] EOC
such that A.context.references(EOC) and
//Not Transferred out
not (exists(EOC.type T where T ~ Concepts."On ART - HIV.H.DE47")
and EOC.status = 'finished' and EOC.period.toInterval() ends during "Measurement Period")
and not exists (
EOC.statusHistory H
where H.status = 'finished'
and H.period.toInterval() ends during "Measurement Period")
//On ART for at least one day in measurement period
where A.effective.toInterval() starts before end of "Measurement Period"
and A.effective.toInterval() ends after start of "Measurement Period"
//Not Lost to follow up
and (A.effective.toInterval() ends after (end of "Measurement Period" - Config."LTFU Days"))
)
and not HIE."Has death documented"
and not HIE."Has transferred out"
and not HIE."Is lost to follow-up"


/*
* As defined by Member States
Expand Down
1 change: 1 addition & 0 deletions input/cql/HIVIND70Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ define "Initial Population":

define "Numerator":
HIE."Gonorrhoea test date B.DE255"
and HIE."Date accessed HIV prevention intervention"


/**
Expand Down
36 changes: 34 additions & 2 deletions input/cql/HIVIND75Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,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 @@ -104,7 +107,12 @@ define "Initial Population":
*/

define "Numerator":
true
HIE."Has HIV-positive Status"
and exists(HE."Positive B.DE257" G
with HE."Gonorrhoea test date B.DE255" P
such that G.partOf.references(P) and P.performed.toInterval() during "Measurement Period")
and HIE."Gonorrhoea treatment start date B.DE260"



/**
Expand All @@ -115,8 +123,32 @@ define "Numerator":
*/

define "Denominator":
true
HIE."Has HIV-positive Status"
and exists(HE."Positive B.DE257" G
with HE."Gonorrhoea test date B.DE255" P
such that G.partOf.references(P) and P.performed.toInterval() during "Measurement Period")


/* 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 "Stratification":
HIE."By Administrative Gender Stratifier".code
+ ':' + HIE."By Age Stratifier 2"
+ ':' + HIE."By Geographic Region Stratifier"
+ Combine(HIE.patientGroups, ':')
43 changes: 41 additions & 2 deletions input/cql/HIVIND76Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,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 @@ -119,7 +122,9 @@ define "Initial Population":
*/

define "Numerator":
true
exists(HE."Syndrome/STI diagnosed B.DE226 Observation" O
where O.effective.toInterval() during "Measurement Period"
and exists (HE."Date accessed HIV prevention intervention" t where t = start of O.effective.toInterval()))


/**
Expand All @@ -130,8 +135,42 @@ define "Numerator":
*/

define "Denominator":
true
HIE."Date accessed HIV prevention intervention"


/* 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 prevention intervention":
HIE."HIV prevention intervention"

define "STI syndrome":
HIE."STI syndrome"

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, ':')
+ Combine(HIE."HIV prevention intervention", ':')
+ ':' + HIE."HIV Status Stratifier".code
+ Combine(HIE."STI syndrome", ':')
Loading

0 comments on commit 0d065e9

Please sign in to comment.