diff --git a/input/cql/HIVConceptsCustom.cql b/input/cql/HIVConceptsCustom.cql index 2a158e00b8..dffa0937bd 100644 --- a/input/cql/HIVConceptsCustom.cql +++ b/input/cql/HIVConceptsCustom.cql @@ -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' \ No newline at end of file diff --git a/input/cql/HIVElements.cql b/input/cql/HIVElements.cql index fdbc05c041..df493c2db6 100644 --- a/input/cql/HIVElements.cql +++ b/input/cql/HIVElements.cql @@ -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' } @@ -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" @@ -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" @@ -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' } @@ -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" @@ -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' } @@ -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 */ @@ -6216,16 +6212,11 @@ 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 */ /* @@ -6233,16 +6224,11 @@ define "Positive D.DE163 Observation": @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 */ /* @@ -6250,16 +6236,10 @@ define "Negative D.DE164 Observation": @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 */ /* @@ -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 */ /* @@ -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 */ /* diff --git a/input/cql/HIVIND27Logic.cql b/input/cql/HIVIND27Logic.cql index af3889313b..3113188e34 100644 --- a/input/cql/HIVIND27Logic.cql +++ b/input/cql/HIVIND27Logic.cql @@ -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 default Interval[@2023-01-01, @2023-01-30] @@ -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 diff --git a/input/cql/HIVIND70Logic.cql b/input/cql/HIVIND70Logic.cql index c639f09174..52b0196948 100644 --- a/input/cql/HIVIND70Logic.cql +++ b/input/cql/HIVIND70Logic.cql @@ -133,6 +133,7 @@ define "Initial Population": define "Numerator": HIE."Gonorrhoea test date B.DE255" + and HIE."Date accessed HIV prevention intervention" /** diff --git a/input/cql/HIVIND75Logic.cql b/input/cql/HIVIND75Logic.cql index 33dc1b02b7..cc6d07e8fa 100644 --- a/input/cql/HIVIND75Logic.cql +++ b/input/cql/HIVIND75Logic.cql @@ -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 default Interval[@2023-01-01, @2023-01-30] @@ -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" + /** @@ -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, ':') \ No newline at end of file diff --git a/input/cql/HIVIND76Logic.cql b/input/cql/HIVIND76Logic.cql index bfe1fa89c1..d433ed35eb 100644 --- a/input/cql/HIVIND76Logic.cql +++ b/input/cql/HIVIND76Logic.cql @@ -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 default Interval[@2023-01-01, @2023-01-30] @@ -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())) /** @@ -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", ':') \ No newline at end of file diff --git a/input/cql/HIVIND77Logic.cql b/input/cql/HIVIND77Logic.cql index 5b95d7381d..303b179286 100644 --- a/input/cql/HIVIND77Logic.cql +++ b/input/cql/HIVIND77Logic.cql @@ -90,6 +90,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 default Interval[@2023-01-01, @2023-01-30] @@ -112,7 +115,10 @@ define "Initial Population": */ define "Numerator": - true + HIE."Has HIV-positive Status" + and exists(HE."Syndrome/STI diagnosed B.DE226 Observation" O + where O.effective.toInterval() during "Measurement Period" + and exists (HE."Visit date SRV.DE15" t where start of t.period.toInterval() = start of O.effective.toInterval())) /** @@ -123,8 +129,42 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" + and HIE."Visit date SRV.DE15" /* 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 "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", ':') ++ Combine(HIE."STI syndrome", ':') \ No newline at end of file diff --git a/input/cql/HIVIND78Logic.cql b/input/cql/HIVIND78Logic.cql index 2cd0cac084..d8a933cc5c 100644 --- a/input/cql/HIVIND78Logic.cql +++ b/input/cql/HIVIND78Logic.cql @@ -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 default Interval[@2023-01-01, @2023-01-30] @@ -119,7 +122,9 @@ define "Initial Population": */ define "Numerator": - true + Count((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())))>1 /** @@ -130,8 +135,45 @@ define "Numerator": */ define "Denominator": - 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())) /* 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", ':') \ No newline at end of file diff --git a/input/cql/HIVIND79Logic.cql b/input/cql/HIVIND79Logic.cql index 89fbe50ae5..ba9d988775 100644 --- a/input/cql/HIVIND79Logic.cql +++ b/input/cql/HIVIND79Logic.cql @@ -79,6 +79,9 @@ * - method: Individual-level data obtained from programme records * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + +THE DEFINITION IS INCONSISTENT WITH THE CONTEXT - no mention of HIV prevention services. + */ library HIVIND79Logic @@ -90,6 +93,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 default Interval[@2023-01-01, @2023-01-30] @@ -112,7 +118,10 @@ define "Initial Population": */ define "Numerator": - true +HIE."Has HIV-positive Status" + and Count((HE."Syndrome/STI diagnosed B.DE226 Observation" O + where O.effective.toInterval() during "Measurement Period" + and exists (HE."Visit date SRV.DE15" t where start of t.period.toInterval() = start of O.effective.toInterval())))>1 /** @@ -123,8 +132,37 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" + and HIE."Visit date SRV.DE15" /* 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 "STI syndrome": + HIE."STI syndrome" + + + +define "Stratification": + HIE."By Administrative Gender Stratifier".code + + ':' + HIE."By Age Stratifier 2" ++ ':' + HIE."By Geographic Region Stratifier" ++ Combine(HIE.patientGroups, ':') ++ Combine(HIE."STI syndrome", ':') diff --git a/input/cql/HIVIND80Logic.cql b/input/cql/HIVIND80Logic.cql index 2ffcd47c04..42fd005e53 100644 --- a/input/cql/HIVIND80Logic.cql +++ b/input/cql/HIVIND80Logic.cql @@ -73,6 +73,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 default Interval[@2023-01-01, @2023-01-30] @@ -89,14 +92,14 @@ define "Initial Population": /** * Numerator - * + * CALCULATION SHOULD BE MODIFIED TO REFLECT CONTEXT * Definition: Number of people attending HIV prevention services tested for HBsAg during the reporting period * Calculation: COUNT of clients with "HBsAg test date" in the reporting period */ define "Numerator": - true - + HIE."HBsAg test date D.DE161" and + HIE."Date accessed HIV prevention intervention" /** * Denominator @@ -106,8 +109,37 @@ 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 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 + +//add Provider type diff --git a/input/cql/HIVIND81Logic.cql b/input/cql/HIVIND81Logic.cql index 9573128bee..369cce3824 100644 --- a/input/cql/HIVIND81Logic.cql +++ b/input/cql/HIVIND81Logic.cql @@ -75,6 +75,10 @@ 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 default Interval[@2023-01-01, @2023-01-30] @@ -97,7 +101,7 @@ define "Initial Population": */ define "Numerator": - true + HIE."Has HIV-positive Status" and HIE."HBsAg test date D.DE161" /** @@ -108,8 +112,34 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" + and HIE."Visit date SRV.DE15" /* 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" + +//Add provider types + +//HIV Status Indicators should not be included + +define "Stratification": + HIE."By Administrative Gender Stratifier".code + + ':' + HIE."By Age Stratifier 2" ++ ':' + HIE."By Geographic Region Stratifier" ++ Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND82Logic.cql b/input/cql/HIVIND82Logic.cql index c5fcfe2398..2c08ae83f7 100644 --- a/input/cql/HIVIND82Logic.cql +++ b/input/cql/HIVIND82Logic.cql @@ -72,6 +72,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 default Interval[@2023-01-01, @2023-01-30] @@ -94,7 +97,7 @@ define "Initial Population": */ define "Numerator": - true + HIE."HBsAg test date D.DE161" and HIE."Currently pregnant SRV.DE7" /** @@ -105,8 +108,36 @@ define "Numerator": */ define "Denominator": - true + HIE."Currently pregnant SRV.DE7" and HIE."ANC contact date E.DE85" /* 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 + +//add Provider type \ No newline at end of file diff --git a/input/cql/HIVIND83Logic.cql b/input/cql/HIVIND83Logic.cql index 43fcb514f0..643e1b33ba 100644 --- a/input/cql/HIVIND83Logic.cql +++ b/input/cql/HIVIND83Logic.cql @@ -73,6 +73,10 @@ 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 default Interval[@2023-01-01, @2023-01-30] @@ -89,13 +93,14 @@ define "Initial Population": /** * Numerator - * + * * CALCULATION SHOULD BE MODIFIED TO REFLECT CONTEXT * Definition: Number of people attending HIV prevention services tested for HCV (HCV antibody, HCV RNA or HCV core antigen) during the reporting period * Calculation: COUNT of clients with "HCV test date" in the reporting period */ define "Numerator": - true + HIE."HCV test date D.DE169" and + HIE."Date accessed HIV prevention intervention" /** @@ -106,8 +111,37 @@ 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 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 + +//add Provider type diff --git a/input/cql/HIVIND84Logic.cql b/input/cql/HIVIND84Logic.cql index 065a1861dd..7e176b4d48 100644 --- a/input/cql/HIVIND84Logic.cql +++ b/input/cql/HIVIND84Logic.cql @@ -74,6 +74,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 default Interval[@2023-01-01, @2023-01-30] @@ -96,7 +99,7 @@ define "Initial Population": */ define "Numerator": - true + HIE."Has HIV-positive Status" and HIE."HCV test date D.DE169" /** @@ -107,8 +110,34 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" + and HIE."Visit date SRV.DE15" /* 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" + +//Add provider types + + + +define "Stratification": + HIE."By Administrative Gender Stratifier".code + + ':' + HIE."By Age Stratifier 2" ++ ':' + HIE."By Geographic Region Stratifier" ++ Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND85Logic.cql b/input/cql/HIVIND85Logic.cql index 2ae7a77a95..ac8b290d94 100644 --- a/input/cql/HIVIND85Logic.cql +++ b/input/cql/HIVIND85Logic.cql @@ -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 default Interval[@2023-01-01, @2023-01-30] @@ -104,7 +107,9 @@ define "Initial Population": */ define "Numerator": - true + exists(HE."Positive D.DE163" G + with HE."HBsAg test date D.DE161" P + such that G.partOf.references(P) and P.performed.toInterval() during "Measurement Period") /** @@ -115,8 +120,38 @@ define "Numerator": */ define "Denominator": - true + exists(HE."HBsAg test date D.DE161" P + where 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 + +//add Provider type \ No newline at end of file diff --git a/input/cql/HIVIndicatorElements.cql b/input/cql/HIVIndicatorElements.cql index 3f2804ce26..d0017b8255 100644 --- a/input/cql/HIVIndicatorElements.cql +++ b/input/cql/HIVIndicatorElements.cql @@ -1565,9 +1565,21 @@ 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 "STI syndrome": + List{ + if "Urethral discharge syndrome B.DE227" then 'Urethral Discharge' else null, + if "Vaginal discharge syndrome B.DE228" then 'Vaginal Discharge' else null, + if "Lower Abdominal pain B.DE229" then 'Lower Abdominal Pain' else null, + if "Genital ulcer disease syndrome B.DE230" then 'Genital Ulcer' else null, + if "Anorectal discharge B.DE231" then 'Anorectal discharge ' else null + } + + 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": Elements."Syndrome/STI diagnosed B.DE226 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1578,7 +1590,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" @@ -1596,7 +1608,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" @@ -1614,14 +1626,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": - Elements."Lower Abdominal pain B.DE229 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + exists "Lower Abdominal pain B.DE229 Observation" + define "Lower Abdominal pain B.DE229 Observation": Elements."Lower Abdominal pain B.DE229 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1632,7 +1640,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" @@ -1650,14 +1658,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": - Elements."Anorectal discharge B.DE231 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + exists "Anorectal discharge B.DE231 Observation" + define "Anorectal discharge B.DE231 Observation": Elements."Anorectal discharge B.DE231 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2678,13 +2682,11 @@ define "Current ART regimen 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": - Elements."HBsAg test date D.DE161" O - where O.effective.toInterval() during "Measurement Period" -define "HBsAg test date D.DE161 Value": - "HBsAg test date D.DE161" O - return O.value + exists(Elements."HBsAg test date D.DE161" P + where P.performed.toInterval() during "Measurement Period") + /* End of HBsAg test date D.DE161 */ /* @@ -2692,11 +2694,9 @@ define "HBsAg test date D.DE161 Value": @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": - Elements."HBsAg test result D.DE162 Observation" O + exists Elements."HBsAg test result D.DE162" O where O.effective.toInterval() during "Measurement Period" /* End of HBsAg test result D.DE162 */ @@ -2705,16 +2705,9 @@ 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": - Elements."Positive D.DE163 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Positive D.DE163 Observation": - Elements."Positive D.DE163 Observation" O + exists Elements."Positive D.DE163" O where O.effective.toInterval() during "Measurement Period" /* End of Positive D.DE163 */ @@ -2725,14 +2718,7 @@ define "Positive D.DE163 Observation": */ // 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": - Elements."Negative D.DE164 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Negative D.DE164 Observation": - Elements."Negative D.DE164 Observation" O + exists Elements."Negative D.DE164" O where O.effective.toInterval() during "Measurement Period" /* End of Negative D.DE164 */ @@ -2741,16 +2727,9 @@ define "Negative D.DE164 Observation": @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": - Elements."Indeterminate D.DE165 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Indeterminate D.DE165 Observation": - Elements."Indeterminate D.DE165 Observation" O + exists Elements."Indeterminate D.DE165" O where O.effective.toInterval() during "Measurement Period" /* End of Indeterminate D.DE165 */ @@ -2773,13 +2752,11 @@ 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": - Elements."HCV test date D.DE169" O - where O.effective.toInterval() during "Measurement Period" -define "HCV test date D.DE169 Value": - "HCV test date D.DE169" O - return O.value + exists(Elements."HBsAg test date D.DE161" P + where P.performed.toInterval() during "Measurement Period") + /* End of HCV test date D.DE169 */ /* @@ -6802,12 +6779,13 @@ 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": - Elements."Currently pregnant SRV.DE7 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists "Currently pregnant SRV.DE7 Condition" +define "Currently pregnant SRV.DE7 Condition": + Elements."Currently pregnant SRV.DE7 Condition" C + where C.prevalenceInterval() overlaps before "Measurement Period" + or C.prevalenceInterval() overlaps after "Measurement Period" /* End of Currently pregnant SRV.DE7 */ /*