Skip to content

Commit

Permalink
Collected updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pmanko committed Jan 13, 2025
1 parent 5671ed9 commit 4a1e0a9
Show file tree
Hide file tree
Showing 58 changed files with 747 additions and 631 deletions.
3 changes: 3 additions & 0 deletions input/cql/HIVConcepts.cql
Original file line number Diff line number Diff line change
Expand Up @@ -1236,3 +1236,6 @@ code "Other priority populations": 'HIV.Config.DE19' from "HIVConcepts" display
code "Reporting period end date": 'HIV.Config.DE20' from "HIVConcepts" display 'Reporting period end date'
code "Reporting period start date": 'HIV.Config.DE21' from "HIVConcepts" display 'Reporting period start date'
code "Reporting date": 'HIV.Config.DE22' from "HIVConcepts" display 'Reporting date'

// Additional
code "Live birth": 'HIV.E.DE48' from "HIVConcepts" display 'Live birth'
116 changes: 31 additions & 85 deletions input/cql/HIVElements.cql
Original file line number Diff line number Diff line change
Expand Up @@ -2569,12 +2569,14 @@ define "At elevated risk for HIV acquisition B.DE225":
*/

define "Syndrome/STI diagnosed B.DE226":
"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"
exists("Urethral discharge syndrome B.DE227") or exists("Vaginal discharge syndrome B.DE228") or exists("Lower Abdominal pain B.DE229") or exists("Genital ulcer disease syndrome B.DE230") or
exists("Anorectal discharge B.DE231")

define "Syndrome/STI diagnosed B.DE226 Condition":
[Condition] C
where C.code in Concepts."Syndrome/STI diagnosed - HIV.B.DE226 Choices"
and C.verificationStatus.text = 'confirmed'

define "Syndrome/STI diagnosed B.DE226 Observation":
[Observation: Concepts."Syndrome/STI diagnosed - HIV.B.DE226"] O
where O.status in { 'final', 'amended', 'corrected' }
/* End of Syndrome/STI diagnosed B.DE226 */

/*
Expand All @@ -2584,46 +2586,26 @@ define "Syndrome/STI diagnosed B.DE226 Observation":
*/

define "Urethral discharge syndrome B.DE227":
exists "Urethral discharge syndrome B.DE227 Condition"
or exists "Urethral discharge syndrome B.DE227 Observation"
define "Urethral discharge syndrome B.DE227 Condition":
[Condition: Concepts."Urethral discharge syndrome - HIV.B.DE227"]
define "Urethral discharge syndrome B.DE227 Observation":
"Syndrome/STI diagnosed B.DE226 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Urethral discharge syndrome - HIV.B.DE227"
/* End of Urethral discharge syndrome B.DE227 */

/*
@dataElement: HIV.B.DE228 - Vaginal discharge syndrome
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Client diagnosed with vaginal discharge syndrome
*/

define "Vaginal discharge syndrome B.DE228":
exists "Vaginal discharge syndrome B.DE228 Condition"
or exists "Vaginal discharge syndrome B.DE228 Observation"
define "Vaginal discharge syndrome B.DE228 Condition":
[Condition: Concepts."Vaginal discharge syndrome - HIV.B.DE228"]
define "Vaginal discharge syndrome B.DE228 Observation":
"Syndrome/STI diagnosed B.DE226 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Vaginal discharge syndrome - HIV.B.DE228"
/* End of Vaginal discharge syndrome B.DE228 */

/*
@dataElement: HIV.B.DE229 - Lower Abdominal pain
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Client diagnosed with lower abdominal pain
*/

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

define "Lower Abdominal pain B.DE229 Observation":
"Syndrome/STI diagnosed B.DE226 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Lower Abdominal pain - HIV.B.DE229"
/* End of Lower Abdominal pain B.DE229 */

/*
Expand All @@ -2633,63 +2615,35 @@ define "Lower Abdominal pain B.DE229 Observation":
*/

define "Genital ulcer disease syndrome B.DE230":
exists "Genital ulcer disease syndrome B.DE230 Condition"
or exists "Genital ulcer disease syndrome B.DE230 Observation"
define "Genital ulcer disease syndrome B.DE230 Condition":
[Condition: Concepts."Genital ulcer disease syndrome - HIV.B.DE230"]
define "Genital ulcer disease syndrome B.DE230 Observation":
"Syndrome/STI diagnosed B.DE226 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Genital ulcer disease syndrome - HIV.B.DE230"

/* End of Genital ulcer disease syndrome B.DE230 */

/*
@dataElement: HIV.B.DE231 - Anorectal discharge
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Client diagnosed with anorectal discharge
*/

define "Anorectal discharge 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' }
and O.value ~ Concepts."Anorectal discharge - HIV.B.DE231"
[Condition: Concepts."Anorectal discharge - HIV.B.DE231"]
/* End of Anorectal discharge B.DE231 */

/*
@dataElement: HIV.B.DE232 - Sent for testing
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Specimen sent for testing
*/
// TODO: Replace placeholder with relevant CQL logic
define "Sent for testing B.DE232":
exists "Sent for testing B.DE232 Condition"
or exists "Sent for testing B.DE232 Observation"
define "Sent for testing B.DE232 Condition":
[Condition: Concepts."Sent for testing - HIV.B.DE232"]
define "Sent for testing B.DE232 Observation":
"Syndrome/STI diagnosed B.DE226 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Sent for testing - HIV.B.DE232"
/* End of Sent for testing B.DE232 */

/*
@dataElement: HIV.B.DE233 - Other
@activity: HIV.B23 Offer sexual and reproductive health services
@description: Other syndrome/STI diagnosed
*/
// TODO: Replace placeholder with relevant CQL logic
define "Other B.DE233":
exists "Other B.DE233 Condition"
or exists "Other B.DE233 Observation"
define "Other B.DE233 Condition":
[Condition: Concepts."Other - HIV.B.DE233"]
define "Other B.DE233 Observation":
"Syndrome/STI diagnosed B.DE226 Observation" O
where O.status in { 'final', 'amended', 'corrected' }
and O.value ~ Concepts."Other - HIV.B.DE233"
/* End of Other B.DE233 */

/*
Expand Down Expand Up @@ -2784,9 +2738,8 @@ define "Syphilis treatment start date B.DE254":
*/

define "Gonorrhoea test date B.DE255":
[Procedure] P
where P.status = 'completed'
and P.code ~ ConceptsCustom."Gonorrhoea test"
"Gonorrhoea test result B.DE256" O
return O.effective
/* End of Gonorrhoea test date B.DE255 */

/*
Expand Down Expand Up @@ -11800,7 +11753,6 @@ define "Completed Observation":
@activity: HIV.E1 Capture or update mother's history
@description: When the pregnant woman or mother initiated ART, for women living with HIV.
*/
// TODO: Replace placeholder with relevant CQL logic
define "Timing of ART initiation":
exists "Timing of ART initiation Observation"
define "Timing of ART initiation Observation":
Expand Down Expand Up @@ -11864,13 +11816,12 @@ define "Newly on ART during labour and delivery Observation":
@activity: HIV.E1 Capture or update mother's history
@description: Date on which the woman delivered
*/
// TODO: Replace placeholder with relevant CQL logic
define "Delivery date":
[Observation: Concepts."Delivery date"] O
define "Live Birth Delivery":
[Observation: Concepts."Live birth"] O
where O.status in { 'final', 'amended', 'corrected' }
define "Delivery date Value":
"Delivery date" O
return O.value
define "Delivery date":
"Live Birth Delivery" O
return O.effective
/* End of Delivery date */

/*
Expand All @@ -11880,7 +11831,9 @@ define "Delivery date Value":
*/

define "Place of delivery":
[Procedure: ConceptsCustom."delivery"]
[Observation: Concepts."Place of delivery"] O
where O.status in { 'final', 'amended', 'corrected' }
and O.value is not null

/* End of Place of delivery */

Expand All @@ -11891,9 +11844,9 @@ define "Place of delivery":
*/

define "Health facility":
"Place of delivery" P
"Place of delivery" O
with [Location] L
such that P.location.references(L)
such that O.value is FHIR.Reference and O.subject.reference = L.id
and L.physicalType ~ Concepts."Health facility"

/* End of Health facility */
Expand All @@ -11905,9 +11858,9 @@ define "Health facility":
*/

define "Home":
"Place of delivery" P
"Place of delivery" O
with [Location] L
such that P.location.references(L)
such that O.subject.references(L)
and L.physicalType ~ Concepts."Home"

/* End of Home */
Expand All @@ -11919,9 +11872,9 @@ define "Home":
*/

define "Other E.DE70":
"Place of delivery" P
"Place of delivery" O
with [Location] L
such that P.location.references(L)
such that O.subject.references(L)
and L.physicalType ~ Concepts."Other - HIV.E.DE70"
/* End of Other E.DE70 */

Expand Down Expand Up @@ -11981,8 +11934,8 @@ define "Age of infant in years":
@activity: HIV.F6 Check whether infant/child had HIV exposure
@description: Whether the infant or child was determined to have had HIV exposure
*/

define "HIV-exposed infant or child E.DE112":

[Observation: Concepts."HIV-exposed infant or child - HIV.E.DE112"] O
where O.status in { 'final', 'amended', 'corrected' }

Expand Down Expand Up @@ -14058,13 +14011,8 @@ define "Date injecting equipment provided Value":
@activity: HIV.B21 Offer prevention options
@description: Date client initiated opioid agonist maintenance treatment (OAMT)
*/
// TODO: Replace placeholder with relevant CQL logic
define "Date OAMT initiated":
[Observation: Concepts."Date OAMT initiated"] O
where O.status in { 'final', 'amended', 'corrected' }
define "Date OAMT initiated Value":
"Date OAMT initiated" O
return O.value
true
/* End of Date OAMT initiated */

/*
Expand All @@ -14074,11 +14022,9 @@ define "Date OAMT initiated Value":
*/
// TODO: Replace placeholder with relevant CQL logic
define "Currently on OAMT":
exists "Currently on OAMT Observation"
define "Currently on OAMT Observation":
[Observation: Concepts."Currently on OAMT"] O
where O.status in { 'final', 'amended', 'corrected' }
and O.value is true
[MedicationStatement] MS
where exists(MS.reasonCode C where C ~ Concepts."OAMT")

/* End of Currently on OAMT */

/*
Expand Down
12 changes: 9 additions & 3 deletions input/cql/HIVIND11Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
* - method: Individual-level data obtained from programme records. | | The total population of people who are opioid dependent includes both people who inject drugs as well as people who consume opioids by other routes of administration. Not all OAMT recipients will have a history of injecting and not all people who inject drugs will use or be dependent on opioids.
*
* Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm
*
* Profiles:
* - Key Population Member Type
* - OAMT Treatment Status
*/

library HIVIND11Logic
Expand All @@ -67,6 +71,9 @@ using FHIR version '4.0.1'
include HIVCommon version '0.0.1' called HIC
include FHIRHelpers version '4.0.1'

include HIVElements called HE
include HIVIndicatorElements called HIE

include WHOCommon called WCom

// Indicator Definition
Expand All @@ -90,8 +97,7 @@ define "Initial Population":
*/

define "Numerator":
true

exists(HIE."People who inject drugs") and HIE."Currently on OAMT"

/**
* Denominator
Expand All @@ -101,7 +107,7 @@ define "Numerator":
*/

define "Denominator":
true
HE."HIV prevention intervention" and exists(HIE."People who inject drugs")


/* end Populations */
Expand Down
34 changes: 27 additions & 7 deletions input/cql/HIVIND12Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ include FHIRHelpers version '4.0.1'

include WHOCommon called WCom

include HIVElements called HE
include HIVIndicatorElements called HIE

// Indicator Definition
parameter "Measurement Period" Interval<Date> default Interval[@2023-01-01, @2023-01-30]
parameter "Measurement Period" Interval<DateTime> default Interval[@2023-01-01, @2023-01-30]

context Patient
/* Populations */
Expand All @@ -87,20 +90,37 @@ define "Initial Population":
* Calculation: SUM of [DIFFERENCE in MIN("Date OAMT initiated", "Reporting period start date") and MAX("Date of loss to follow-up or OAMT stopped", "Reporting period end date")] for all clients with "Medications prescribed" IN 'Methadone', 'Buprenorphine'
*/

define "Numerator":
true
define "Measure Population":
exists(HIE."buprenorphine_prescribed at date") or exists(HIE."methadone_prescribed at date")


define "Measure Observation":
(
difference in days between
Min(
{
ToDate(First(HIE."OAMT start")),
ToDate(start of "Measurement Period")
}
)

and ToDate(start of "Measurement Period")
)
+
(
difference in days between end of "Measurement Period"
and Coalesce(
ToDate(First(HIE."OAMT end")),
end of "Measurement Period"
)
)

/**
* Denominator
*
* Definition: a) Programme/service provider level: estimated PYFU for all opioid dependent people accessing service during defined reporting period | b) Population level: estimated PYFU for total population of opioid dependent people in relevant geographic area during defined reporting period
* Calculation: Service level: Not calculated in DAK | | Population denominator: | *Estimated PYFU for all opioid-dependent people accessing service during defined reporting period | | Note: Can be reported only as numerator; by population or service level if these denominator estimates available.
*/

define "Denominator":
true


/* end Populations */

3 changes: 3 additions & 0 deletions input/cql/HIVIND13Logic.cql
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
* - method: Individual-level data obtained from programme records
*
* Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm
* Profiles: HivOamtTreatment
*/

library HIVIND13Logic
Expand Down
Loading

0 comments on commit 4a1e0a9

Please sign in to comment.