diff --git a/input/cql/HIVConceptsCustom.cql b/input/cql/HIVConceptsCustom.cql index dffa0937bd..00291dcbb9 100644 --- a/input/cql/HIVConceptsCustom.cql +++ b/input/cql/HIVConceptsCustom.cql @@ -77,6 +77,10 @@ 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" +code "HCV test" : 'HCV test' from "missing concepts" +code "HCV viral load" : 'HCV viral load' from "missing concepts" +code "cervical cancer screening test" : 'cervical cancer screening test' from "missing concepts" +code "cervical precancer lesion treatment" : 'cervical precancer lesion treatment' from "missing concepts" +code "Invasive cervical cancer treatment" : 'Invasive cervical cancer 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 df493c2db6..d9a1375d08 100644 --- a/input/cql/HIVElements.cql +++ b/input/cql/HIVElements.cql @@ -6247,13 +6247,11 @@ define "Indeterminate D.DE165": @activity: HIV.D12 Determine recommended screenings and tests @description: Date when client started treatment (TDF) for hepatitis B virus (HBV) */ -// TODO: Replace placeholder with relevant CQL logic + define "HBV treatment TDF start date": - [Observation: Concepts."HBV treatment TDF start date"] O - where O.status in { 'final', 'amended', 'corrected' } -define "HBV treatment TDF start date Value": - "HBV treatment TDF start date" O - return O.value + "Currently on TDF-based ART" MS + sort by start of effective.toInterval() + /* End of HBV treatment TDF start date */ /* @@ -6269,17 +6267,17 @@ define "HCV test date D.DE169": /* End of HCV test date D.DE169 */ + /* @dataElement: HIV.D.DE170 - HCV test result @activity: HIV.D12 Determine recommended screenings and tests @description: Hepatitis C virus test result (HCV antibody, HCV RNA or HCV core antigen) */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV test result D.DE170": - exists "HCV test result D.DE170 Observation" -define "HCV test result D.DE170 Observation": [Observation: Concepts."HCV test result - HIV.D.DE170"] O where O.status in { 'final', 'amended', 'corrected' } + /* End of HCV test result D.DE170 */ /* @@ -6287,16 +6285,10 @@ define "HCV test result D.DE170 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV test result was positive */ -// TODO: Replace placeholder with relevant CQL logic + define "Positive D.DE171": - exists "Positive D.DE171 Condition" - or exists "Positive D.DE171 Observation" -define "Positive D.DE171 Condition": - [Condition: Concepts."Positive - HIV.D.DE171"] -define "Positive D.DE171 Observation": - "HCV test result D.DE170 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Positive - HIV.D.DE171" + "HCV test result D.DE170" O + where O.value ~ Concepts."Positive - HIV.D.DE171" /* End of Positive D.DE171 */ /* @@ -6304,16 +6296,10 @@ define "Positive D.DE171 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV test result was negative */ -// TODO: Replace placeholder with relevant CQL logic + define "Negative D.DE172": - exists "Negative D.DE172 Condition" - or exists "Negative D.DE172 Observation" -define "Negative D.DE172 Condition": - [Condition: Concepts."Negative - HIV.D.DE172"] -define "Negative D.DE172 Observation": - "HCV test result D.DE170 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Negative - HIV.D.DE172" + "HCV test result D.DE170" O + where O.value ~ Concepts."Negative - HIV.D.DE172" /* End of Negative D.DE172 */ /* @@ -6321,16 +6307,10 @@ define "Negative D.DE172 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV test result was indeterminate */ -// TODO: Replace placeholder with relevant CQL logic + define "Indeterminate D.DE173": - exists "Indeterminate D.DE173 Condition" - or exists "Indeterminate D.DE173 Observation" -define "Indeterminate D.DE173 Condition": - [Condition: Concepts."Indeterminate - HIV.D.DE173"] -define "Indeterminate D.DE173 Observation": - "HCV test result D.DE170 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Indeterminate - HIV.D.DE173" + "HCV test result D.DE170" O + where O.value ~ Concepts."Indeterminate - HIV.D.DE173" /* End of Indeterminate D.DE173 */ /* @@ -6338,13 +6318,10 @@ define "Indeterminate D.DE173 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Date when client started treatment for hepatitis C virus (HCV) */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV treatment start date": - [Observation: Concepts."HCV treatment start date"] O - where O.status in { 'final', 'amended', 'corrected' } -define "HCV treatment start date Value": - "HCV treatment start date" O - return O.value + "HCV medicine type" MS + sort by start of effective.toInterval() /* End of HCV treatment start date */ /* @@ -6352,13 +6329,10 @@ define "HCV treatment start date Value": @activity: HIV.D12 Determine recommended screenings and tests @description: Date when client completed treatment for hepatitis C virus (HCV) */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV treatment completion date": - [Observation: Concepts."HCV treatment completion date"] O - where O.status in { 'final', 'amended', 'corrected' } -define "HCV treatment completion date Value": - "HCV treatment completion date" O - return O.value + "HCV medicine type" MS + sort by end of effective.toInterval() /* End of HCV treatment completion date */ /* @@ -6366,13 +6340,12 @@ define "HCV treatment completion date Value": @activity: HIV.D12 Determine recommended screenings and tests @description: Hepatitis C viral load test date */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV viral load test date D.DE178": - [Observation: Concepts."HCV viral load test date - HIV.D.DE178"] O - where O.status in { 'final', 'amended', 'corrected' } -define "HCV viral load test date D.DE178 Value": - "HCV viral load test date D.DE178" O - return O.value + [Procedure] P + where P.status = 'completed' + and P.code ~ ConceptsCustom."HCV viral load" + /* End of HCV viral load test date D.DE178 */ /* @@ -6380,12 +6353,11 @@ define "HCV viral load test date D.DE178 Value": @activity: HIV.D12 Determine recommended screenings and tests @description: Hepatitis C viral load test result (qualitative) */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV viral load test result D.DE179": - exists "HCV viral load test result D.DE179 Observation" -define "HCV viral load test result D.DE179 Observation": - [Observation: Concepts."HCV viral load test result - HIV.D.DE179"] O + [Observation: Concepts."HCV test result - HIV.D.DE170"] O where O.status in { 'final', 'amended', 'corrected' } + /* End of HCV viral load test result D.DE179 */ /* @@ -6393,16 +6365,9 @@ define "HCV viral load test result D.DE179 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV was detected */ -// TODO: Replace placeholder with relevant CQL logic + define "Detected D.DE180": - exists "Detected D.DE180 Condition" - or exists "Detected D.DE180 Observation" -define "Detected D.DE180 Condition": - [Condition: Concepts."Detected - HIV.D.DE180"] -define "Detected D.DE180 Observation": - "HCV viral load test result D.DE179 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Detected - HIV.D.DE180" + "HCV viral load test result D.DE179" O where O.value ~ Concepts."Detected - HIV.D.DE180" /* End of Detected D.DE180 */ /* @@ -6410,16 +6375,9 @@ define "Detected D.DE180 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV was not detected */ -// TODO: Replace placeholder with relevant CQL logic + define "Not detected D.DE181": - exists "Not detected D.DE181 Condition" - or exists "Not detected D.DE181 Observation" -define "Not detected D.DE181 Condition": - [Condition: Concepts."Not detected - HIV.D.DE181"] -define "Not detected D.DE181 Observation": - "HCV viral load test result D.DE179 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Not detected - HIV.D.DE181" + "HCV viral load test result D.DE179" O where O.value ~ Concepts."Not detected - HIV.D.DE181" /* End of Not detected D.DE181 */ /* @@ -6427,12 +6385,10 @@ define "Not detected D.DE181 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Type of medicine client is prescribed */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV medicine type": - exists "HCV medicine type Observation" -define "HCV medicine type Observation": - [Observation: Concepts."HCV medicine type"] O - where O.status in { 'final', 'amended', 'corrected' } +[MedicationStatement] MS + where exists(MS.reasonCode C where C ~ Concepts."Positive - HIV.D.DE171") /* End of HCV medicine type */ /* @@ -6440,16 +6396,9 @@ define "HCV medicine type Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Client is prescribed interferon */ -// TODO: Replace placeholder with relevant CQL logic + define "Interferon": - exists "Interferon Condition" - or exists "Interferon Observation" -define "Interferon Condition": - [Condition: Concepts."Interferon"] -define "Interferon Observation": - "HCV medicine type Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Interferon" + "HCV medicine type" MS where (MS.medication ~ Concepts."Interferon") /* End of Interferon */ /* @@ -6457,16 +6406,9 @@ define "Interferon Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Client is prescribed direct acting antivirals */ -// TODO: Replace placeholder with relevant CQL logic + define "Direct acting antivirals": - exists "Direct acting antivirals Condition" - or exists "Direct acting antivirals Observation" -define "Direct acting antivirals Condition": - [Condition: Concepts."Direct acting antivirals"] -define "Direct acting antivirals Observation": - "HCV medicine type Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Direct acting antivirals" + "HCV medicine type" MS where (MS.medication ~ Concepts."Direct acting antivirals") /* End of Direct acting antivirals */ /* @@ -6474,13 +6416,10 @@ define "Direct acting antivirals Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Client is currently on TDF-based ART regimen */ -// TODO: Replace placeholder with relevant CQL logic + define "Currently on TDF-based ART": - exists "Currently on TDF-based ART Observation" -define "Currently on TDF-based ART Observation": - [Observation: Concepts."Currently on TDF-based ART"] O - where O.status in { 'final', 'amended', 'corrected' } - and O.value is true + "TDF D.DE912" MS where exists(MS.reasonCode C where C ~ Concepts."Currently on TDF-based ART") + /* End of Currently on TDF-based ART */ /* @@ -9570,13 +9509,10 @@ define "Other medications Observation": @activity: HIV.D28 Offer other services @description: Date of cervical cancer screening test */ -// TODO: Replace placeholder with relevant CQL logic + define "Date of cervical cancer screening test": - [Observation: Concepts."Date of cervical cancer screening test"] O - where O.status in { 'final', 'amended', 'corrected' } -define "Date of cervical cancer screening test Value": - "Date of cervical cancer screening test" O - return O.value + "Cervical cancer primary screening test type" P + sort by start of performed.toInterval() /* End of Date of cervical cancer screening test */ /* @@ -9584,13 +9520,14 @@ define "Date of cervical cancer screening test Value": @activity: HIV.D28 Offer other services @description: Client's lifetime number of screenings for cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Lifetime screening test number": [Observation: Concepts."Lifetime screening test number"] O where O.status in { 'final', 'amended', 'corrected' } + define "Lifetime screening test number Value": "Lifetime screening test number" O - return O.value + return O.value as FHIR.string /* End of Lifetime screening test number */ /* @@ -9598,12 +9535,11 @@ define "Lifetime screening test number Value": @activity: HIV.D28 Offer other services @description: Type of cervical cancer screening test used in primary screening */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical cancer primary screening test type": - exists "Cervical cancer primary screening test type Observation" -define "Cervical cancer primary screening test type Observation": - [Observation: Concepts."Cervical cancer primary screening test type"] O - where O.status in { 'final', 'amended', 'corrected' } + [Procedure] P + where P.status = 'completed' + and P.category ~ ConceptsCustom."cervical cancer screening test" /* End of Cervical cancer primary screening test type */ /* @@ -9611,16 +9547,10 @@ define "Cervical cancer primary screening test type Observation": @activity: HIV.D28 Offer other services @description: Screened for cervical cancer using HPV-DNA test */ -// TODO: Replace placeholder with relevant CQL logic + define "HPV-DNA": - exists "HPV-DNA Condition" - or exists "HPV-DNA Observation" -define "HPV-DNA Condition": - [Condition: Concepts."HPV-DNA"] -define "HPV-DNA Observation": - "Cervical cancer primary screening test type Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."HPV-DNA" + "Cervical cancer primary screening test type" P + where P.code ~ Concepts."HPV-DNA" /* End of HPV-DNA */ /* @@ -9628,16 +9558,10 @@ define "HPV-DNA Observation": @activity: HIV.D28 Offer other services @description: Screened for cervical cancer using visual inspection with acetic acid (VIA) */ -// TODO: Replace placeholder with relevant CQL logic + define "VIA": - exists "VIA Condition" - or exists "VIA Observation" -define "VIA Condition": - [Condition: Concepts."VIA"] -define "VIA Observation": - "Cervical cancer primary screening test type Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."VIA" + "Cervical cancer primary screening test type" P + where P.code ~ Concepts."VIA" /* End of VIA */ /* @@ -9645,16 +9569,10 @@ define "VIA Observation": @activity: HIV.D28 Offer other services @description: Screened for cervical cancer using cervical cytology */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical cytology": - exists "Cervical cytology Condition" - or exists "Cervical cytology Observation" -define "Cervical cytology Condition": - [Condition: Concepts."Cervical cytology"] -define "Cervical cytology Observation": - "Cervical cancer primary screening test type Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Cervical cytology" + "Cervical cancer primary screening test type" P + where P.code ~ Concepts."Cervical cytology" /* End of Cervical cytology */ /* @@ -9662,16 +9580,10 @@ define "Cervical cytology Observation": @activity: HIV.D28 Offer other services @description: Screened for cervical cancer using other method */ -// TODO: Replace placeholder with relevant CQL logic + define "Other D.DE662": - exists "Other D.DE662 Condition" - or exists "Other D.DE662 Observation" -define "Other D.DE662 Condition": - [Condition: Concepts."Other - HIV.D.DE662"] -define "Other D.DE662 Observation": - "Cervical cancer primary screening test type Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Other - HIV.D.DE662" + "Cervical cancer primary screening test type" P + where P.code ~ Concepts."Other - HIV.D.DE662" /* End of Other D.DE662 */ /* @@ -9693,9 +9605,10 @@ define "Date of diagnosis of cervical precancer lesions or invasive cervical can @activity: HIV.D28 Offer other services @description: Client's screening outcome for cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical cancer screening outcome": - exists "Cervical cancer screening outcome Observation" + "Cervical cancer screening outcome Observation" + define "Cervical cancer screening outcome Observation": [Observation: Concepts."Cervical cancer screening outcome"] O where O.status in { 'final', 'amended', 'corrected' } @@ -9706,12 +9619,10 @@ define "Cervical cancer screening outcome Observation": @activity: HIV.D28 Offer other services @description: Screening outcome for cervical precancer lesions is positive */ -// TODO: Replace placeholder with relevant CQL logic + define "Positive for cervical precancer lesions": - exists "Positive for cervical precancer lesions Condition" - or exists "Positive for cervical precancer lesions Observation" -define "Positive for cervical precancer lesions Condition": - [Condition: Concepts."Positive for cervical precancer lesions"] + "Positive for cervical precancer lesions Observation" + define "Positive for cervical precancer lesions Observation": "Cervical cancer screening outcome Observation" O where O.status in { 'final', 'amended', 'corrected' } @@ -9723,12 +9634,10 @@ define "Positive for cervical precancer lesions Observation": @activity: HIV.D28 Offer other services @description: Screening outcome for cervical precancer lesions is negative */ -// TODO: Replace placeholder with relevant CQL logic + define "Negative for cervical precancer lesions": - exists "Negative for cervical precancer lesions Condition" - or exists "Negative for cervical precancer lesions Observation" -define "Negative for cervical precancer lesions Condition": - [Condition: Concepts."Negative for cervical precancer lesions"] + "Negative for cervical precancer lesions Observation" + define "Negative for cervical precancer lesions Observation": "Cervical cancer screening outcome Observation" O where O.status in { 'final', 'amended', 'corrected' } @@ -9740,12 +9649,10 @@ define "Negative for cervical precancer lesions Observation": @activity: HIV.D28 Offer other services @description: Type of cervical cancer diagnosis */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical cancer diagnosis": - exists "Cervical cancer diagnosis Observation" -define "Cervical cancer diagnosis Observation": - [Observation: Concepts."Cervical cancer diagnosis"] O - where O.status in { 'final', 'amended', 'corrected' } + "Cervical precancer lesions" union "Invasive cervical cancer" + /* End of Cervical cancer diagnosis */ /* @@ -9753,16 +9660,10 @@ define "Cervical cancer diagnosis Observation": @activity: HIV.D28 Offer other services @description: Client is diagnosed with cervical precancer lesions */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical precancer lesions": - exists "Cervical precancer lesions Condition" - or exists "Cervical precancer lesions Observation" -define "Cervical precancer lesions Condition": [Condition: Concepts."Cervical precancer lesions"] -define "Cervical precancer lesions Observation": - "Cervical cancer diagnosis Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Cervical precancer lesions" + /* End of Cervical precancer lesions */ /* @@ -9770,16 +9671,10 @@ define "Cervical precancer lesions Observation": @activity: HIV.D28 Offer other services @description: Client is diagnosed with invasive cervical cancer disease */ -// TODO: Replace placeholder with relevant CQL logic + define "Invasive cervical cancer": - exists "Invasive cervical cancer Condition" - or exists "Invasive cervical cancer Observation" -define "Invasive cervical cancer Condition": [Condition: Concepts."Invasive cervical cancer"] -define "Invasive cervical cancer Observation": - "Cervical cancer diagnosis Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Invasive cervical cancer" + /* End of Invasive cervical cancer */ /* @@ -9787,10 +9682,8 @@ define "Invasive cervical cancer Observation": @activity: HIV.D28 Offer other services @description: Cervical cancer stage at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical cancer stage at diagnosis": - exists "Cervical cancer stage at diagnosis Observation" -define "Cervical cancer stage at diagnosis Observation": [Observation: Concepts."Cervical cancer stage at diagnosis"] O where O.status in { 'final', 'amended', 'corrected' } /* End of Cervical cancer stage at diagnosis */ @@ -9800,16 +9693,10 @@ define "Cervical cancer stage at diagnosis Observation": @activity: HIV.D28 Offer other services @description: Stage 0 cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage 0": - exists "Stage 0 Condition" - or exists "Stage 0 Observation" -define "Stage 0 Condition": - [Condition: Concepts."Stage 0"] -define "Stage 0 Observation": - "Cervical cancer stage at diagnosis Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Stage 0" + "Cervical cancer stage at diagnosis" O + where O.value ~ Concepts."Stage 0" /* End of Stage 0 */ /* @@ -9817,16 +9704,10 @@ define "Stage 0 Observation": @activity: HIV.D28 Offer other services @description: Stage I cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage I": - exists "Stage I Condition" - or exists "Stage I Observation" -define "Stage I Condition": - [Condition: Concepts."Stage I"] -define "Stage I Observation": - "Cervical cancer stage at diagnosis Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Stage I" + "Cervical cancer stage at diagnosis" O + where O.value ~ Concepts."Stage I" /* End of Stage I */ /* @@ -9834,16 +9715,10 @@ define "Stage I Observation": @activity: HIV.D28 Offer other services @description: Stage II cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage II": - exists "Stage II Condition" - or exists "Stage II Observation" -define "Stage II Condition": - [Condition: Concepts."Stage II"] -define "Stage II Observation": - "Cervical cancer stage at diagnosis Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Stage II" + "Cervical cancer stage at diagnosis" O + where O.value ~ Concepts."Stage II" /* End of Stage II */ /* @@ -9851,16 +9726,10 @@ define "Stage II Observation": @activity: HIV.D28 Offer other services @description: Stage III cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage III": - exists "Stage III Condition" - or exists "Stage III Observation" -define "Stage III Condition": - [Condition: Concepts."Stage III"] -define "Stage III Observation": - "Cervical cancer stage at diagnosis Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Stage III" + "Cervical cancer stage at diagnosis" O + where O.value ~ Concepts."Stage III" /* End of Stage III */ /* @@ -9868,16 +9737,10 @@ define "Stage III Observation": @activity: HIV.D28 Offer other services @description: Stage IV cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage IV": - exists "Stage IV Condition" - or exists "Stage IV Observation" -define "Stage IV Condition": - [Condition: Concepts."Stage IV"] -define "Stage IV Observation": - "Cervical cancer stage at diagnosis Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Stage IV" + "Cervical cancer stage at diagnosis" O + where O.value ~ Concepts."Stage IV" /* End of Stage IV */ /* @@ -9885,13 +9748,11 @@ define "Stage IV Observation": @activity: HIV.D28 Offer other services @description: Date of treatment for cervical precancer lesions */ -// TODO: Replace placeholder with relevant CQL logic + define "Date of treatment for cervical precancer lesions": - [Observation: Concepts."Date of treatment for cervical precancer lesions"] O - where O.status in { 'final', 'amended', 'corrected' } -define "Date of treatment for cervical precancer lesions Value": - "Date of treatment for cervical precancer lesions" O - return O.value + [Procedure] P + where P.status = 'completed' + and P.category ~ ConceptsCustom."cervical precancer lesion treatment" /* End of Date of treatment for cervical precancer lesions */ /* @@ -9899,13 +9760,14 @@ define "Date of treatment for cervical precancer lesions Value": @activity: HIV.D28 Offer other services @description: Client's lifetime number of treatments for invasive cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Invasive cervical cancer treatment episode": [Observation: Concepts."Invasive cervical cancer treatment episode"] O where O.status in { 'final', 'amended', 'corrected' } + define "Invasive cervical cancer treatment episode Value": - "Invasive cervical cancer treatment episode" O - return O.value + "Lifetime screening test number" O + return O.value as FHIR.string /* End of Invasive cervical cancer treatment episode */ /* @@ -9913,12 +9775,12 @@ define "Invasive cervical cancer treatment episode Value": @activity: HIV.D28 Offer other services @description: Invasive cervical cancer treatment method */ -// TODO: Replace placeholder with relevant CQL logic + define "Invasive cervical cancer treatment method": - exists "Invasive cervical cancer treatment method Observation" -define "Invasive cervical cancer treatment method Observation": - [Observation: Concepts."Invasive cervical cancer treatment method"] O - where O.status in { 'final', 'amended', 'corrected' } + [Procedure] P + where P.status = 'completed' + and P.category ~ ConceptsCustom."Invasive cervical cancer treatment" + /* End of Invasive cervical cancer treatment method */ /* @@ -9926,16 +9788,11 @@ define "Invasive cervical cancer treatment method Observation": @activity: HIV.D28 Offer other services @description: Invasive cervical cancer treatment method is a conization */ -// TODO: Replace placeholder with relevant CQL logic + define "Conization": - exists "Conization Condition" - or exists "Conization Observation" -define "Conization Condition": - [Condition: Concepts."Conization"] -define "Conization Observation": - "Invasive cervical cancer treatment method Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Conization" + "Invasive cervical cancer treatment method" P + where P.code ~ Concepts."Conization" + /* End of Conization */ /* @@ -9943,16 +9800,10 @@ define "Conization Observation": @activity: HIV.D28 Offer other services @description: Invasive cervical cancer treatment method is a trachelectomy */ -// TODO: Replace placeholder with relevant CQL logic + define "Trachelectomy": - exists "Trachelectomy Condition" - or exists "Trachelectomy Observation" -define "Trachelectomy Condition": - [Condition: Concepts."Trachelectomy"] -define "Trachelectomy Observation": - "Invasive cervical cancer treatment method Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Trachelectomy" + "Invasive cervical cancer treatment method" P + where P.code ~ Concepts."Trachelectomy" /* End of Trachelectomy */ /* @@ -9960,16 +9811,10 @@ define "Trachelectomy Observation": @activity: HIV.D28 Offer other services @description: Invasive cervical cancer treatment method is a hysterectomy */ -// TODO: Replace placeholder with relevant CQL logic + define "Hysterectomy": - exists "Hysterectomy Condition" - or exists "Hysterectomy Observation" -define "Hysterectomy Condition": - [Condition: Concepts."Hysterectomy"] -define "Hysterectomy Observation": - "Invasive cervical cancer treatment method Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Hysterectomy" + "Invasive cervical cancer treatment method" P + where P.code ~ Concepts."Hysterectomy" /* End of Hysterectomy */ /* @@ -9980,13 +9825,10 @@ define "Hysterectomy Observation": // TODO: Replace placeholder with relevant CQL logic define "Management of invasive cervical cancer": exists "Management of invasive cervical cancer Condition" - or exists "Management of invasive cervical cancer Observation" + define "Management of invasive cervical cancer Condition": [Condition: Concepts."Management of invasive cervical cancer"] -define "Management of invasive cervical cancer Observation": - "Invasive cervical cancer treatment method Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Management of invasive cervical cancer" + /* End of Management of invasive cervical cancer */ /* @@ -9997,13 +9839,10 @@ define "Management of invasive cervical cancer Observation": // TODO: Replace placeholder with relevant CQL logic define "Radiotherapy": exists "Radiotherapy Condition" - or exists "Radiotherapy Observation" + define "Radiotherapy Condition": [Condition: Concepts."Radiotherapy"] -define "Radiotherapy Observation": - "Invasive cervical cancer treatment method Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Radiotherapy" + /* End of Radiotherapy */ /* @@ -10014,13 +9853,10 @@ define "Radiotherapy Observation": // TODO: Replace placeholder with relevant CQL logic define "Chemotherapy": exists "Chemotherapy Condition" - or exists "Chemotherapy Observation" + define "Chemotherapy Condition": [Condition: Concepts."Chemotherapy"] -define "Chemotherapy Observation": - "Invasive cervical cancer treatment method Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Chemotherapy" + /* End of Chemotherapy */ /* @@ -10031,13 +9867,10 @@ define "Chemotherapy Observation": // TODO: Replace placeholder with relevant CQL logic define "Chemoradiation": exists "Chemoradiation Condition" - or exists "Chemoradiation Observation" + define "Chemoradiation Condition": [Condition: Concepts."Chemoradiation"] -define "Chemoradiation Observation": - "Invasive cervical cancer treatment method Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Chemoradiation" + /* End of Chemoradiation */ /* @@ -10048,13 +9881,10 @@ define "Chemoradiation Observation": // TODO: Replace placeholder with relevant CQL logic define "Other D.DE739": exists "Other D.DE739 Condition" - or exists "Other D.DE739 Observation" + define "Other D.DE739 Condition": [Condition: Concepts."Other - HIV.D.DE739"] -define "Other D.DE739 Observation": - "Invasive cervical cancer treatment method Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Other - HIV.D.DE739" + /* End of Other D.DE739 */ /* @@ -11058,16 +10888,11 @@ define "Terfenadine Observation": @activity: HIV.D21 Determine regimen and treatment options @description: TDF currently being taken by, or considered for, client */ -// TODO: Replace placeholder with relevant CQL logic + define "TDF D.DE912": - exists "TDF D.DE912 Condition" - or exists "TDF D.DE912 Observation" -define "TDF D.DE912 Condition": - [Condition: Concepts."TDF - HIV.D.DE912"] -define "TDF D.DE912 Observation": - "Medication/drug Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."TDF - HIV.D.DE912" + [MedicationStatement] MS + where MS.medication ~ Concepts."TDF - HIV.D.DE912" + /* End of TDF D.DE912 */ /* diff --git a/input/cql/HIVIND86Logic.cql b/input/cql/HIVIND86Logic.cql index 39c4c6b8fa..2e5b098d0d 100644 --- a/input/cql/HIVIND86Logic.cql +++ b/input/cql/HIVIND86Logic.cql @@ -81,6 +81,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] @@ -103,7 +106,10 @@ define "Initial Population": */ define "Numerator": - true + HIE."Has HIV-positive Status" and + 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") /** @@ -114,8 +120,36 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" and HIE."HBsAg test date D.DE161" /* 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/HIVIND87Logic.cql b/input/cql/HIVIND87Logic.cql index c9b88aa3b3..6945bb2a79 100644 --- a/input/cql/HIVIND87Logic.cql +++ b/input/cql/HIVIND87Logic.cql @@ -80,6 +80,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] @@ -102,7 +105,13 @@ define "Initial Population": */ define "Numerator": - true + HIE."Currently pregnant SRV.DE7" and + 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" and + exists (HE."ANC contact date E.DE85" E where start of E = start of P.performed.toInterval())) + + /** @@ -113,8 +122,39 @@ define "Numerator": */ define "Denominator": - true + HIE."Currently pregnant SRV.DE7" and + exists(HE."HBsAg test date D.DE161" P + where P.performed.toInterval() during "Measurement Period" + and exists (HE."ANC contact date E.DE85" E where start of E = 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/HIVIND88Logic.cql b/input/cql/HIVIND88Logic.cql index 494cb49777..3c98293044 100644 --- a/input/cql/HIVIND88Logic.cql +++ b/input/cql/HIVIND88Logic.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,10 @@ define "Initial Population": */ define "Numerator": - true + exists(HE."Positive D.DE171" G + with HE."HCV test date D.DE169" P + such that G.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())) /** @@ -115,8 +121,38 @@ define "Numerator": */ define "Denominator": - true + exists(HE."HCV test date D.DE169" 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/HIVIND89Logic.cql b/input/cql/HIVIND89Logic.cql index 9501833a38..d3e01c7bf4 100644 --- a/input/cql/HIVIND89Logic.cql +++ b/input/cql/HIVIND89Logic.cql @@ -80,6 +80,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] @@ -102,7 +106,10 @@ define "Initial Population": */ define "Numerator": - true + HIE."Has HIV-positive Status" and + exists(HE."Positive D.DE171" G + with HE."HCV test date D.DE169" P + such that G.partOf.references(P) and P.performed.toInterval() during "Measurement Period") /** @@ -113,8 +120,33 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" and HIE."HCV test date D.DE169" /* 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, ':') + +//add Provider type \ No newline at end of file diff --git a/input/cql/HIVIND90Logic.cql b/input/cql/HIVIND90Logic.cql index 0134bb1db1..01e021f3d5 100644 --- a/input/cql/HIVIND90Logic.cql +++ b/input/cql/HIVIND90Logic.cql @@ -83,6 +83,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] @@ -105,7 +108,14 @@ define "Initial Population": */ define "Numerator": - true + HIE."Has HIV-positive Status" and + 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") and + (exists(HE."HBV treatment TDF start date" MS where start of MS.effective.toInterval() during "Measurement Period") or + exists(HE."HBV treatment TDF start date" MS where MS.effective.toInterval() overlaps "Measurement Period") + ) + /** @@ -116,8 +126,35 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" and + 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") /* 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, ':') + diff --git a/input/cql/HIVIND91Logic.cql b/input/cql/HIVIND91Logic.cql index e7c8babd51..68c34944a8 100644 --- a/input/cql/HIVIND91Logic.cql +++ b/input/cql/HIVIND91Logic.cql @@ -85,6 +85,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] @@ -101,13 +104,18 @@ define "Initial Population": /** * Numerator - * + * THIS REFERS TO ANY MEDICATION BUT ABOVE DESCRIPTION ONLY SAYS DIRECT ACTING ANTIRETROVIRALS * Definition: Number of people living with HIV newly started on HCV treatment during the reporting period * Calculation: COUNT of clients with "HIV status"='HIV-positive' AND "HCV test date" in the reporting period AND "HCV test result"='HCV positive' AND "HCV treatment start date" in the reporting period */ define "Numerator": - true + HIE."Has HIV-positive Status" and + exists(HE."Positive D.DE171" G + with HE."HCV test date D.DE169" P + such that G.partOf.references(P) and P.performed.toInterval() during "Measurement Period") and + HIE."HCV treatment start date" + /** @@ -118,8 +126,38 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" and + exists(HE."Positive D.DE171" G + with HE."HCV test date D.DE169" 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 "By HCV medicine type Stratifier": + HIE."By HCV medicine type Stratifier" + + +define "Stratification": + HIE."By Administrative Gender Stratifier".code + + ':' + HIE."By Age Stratifier 2" ++ ':' + HIE."By Geographic Region Stratifier" ++ Combine(HIE.patientGroups, ':') ++ HIE."By HCV medicine type Stratifier".code \ No newline at end of file diff --git a/input/cql/HIVIND92Logic.cql b/input/cql/HIVIND92Logic.cql index 0a17fbe577..acbbd38ea0 100644 --- a/input/cql/HIVIND92Logic.cql +++ b/input/cql/HIVIND92Logic.cql @@ -83,6 +83,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] @@ -105,7 +108,17 @@ define "Initial Population": */ define "Numerator": - true + HIE."Has HIV-positive Status" and + exists(HE."Positive D.DE171" G + with HE."HCV test date D.DE169" P + such that G.partOf.references(P) and P.performed.toInterval() during "Measurement Period") and + HIE."HCV treatment completion date" and + exists( + HE."Not detected D.DE181" O + with HE."HCV viral load test date D.DE178" P + such that O.partOf.references(P) and (weeks between end of P.performed.toInterval() and date from end of Last(HE."HCV treatment completion date").effective.toInterval()> 12 weeks) and + (weeks between end of P.performed.toInterval() and date from end of Last(HE."HCV treatment completion date").effective.toInterval()< 24 weeks) + ) /** @@ -116,8 +129,44 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" and + exists(HE."Positive D.DE171" G + with HE."HCV test date D.DE169" P + such that G.partOf.references(P) and P.performed.toInterval() during "Measurement Period") and + HIE."HCV treatment completion date" and + exists( + HE."HCV viral load test date D.DE178" P + where (weeks between end of P.performed.toInterval() and date from end of Last(HE."HCV treatment completion date").effective.toInterval()> 12 weeks) and + (weeks between end of P.performed.toInterval() and date from end of Last(HE."HCV treatment completion date").effective.toInterval()< 24 weeks) + ) /* 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 "By HCV medicine type Stratifier": + HIE."By HCV medicine type Stratifier" + + +define "Stratification": + HIE."By Administrative Gender Stratifier".code + + ':' + HIE."By Age Stratifier 2" ++ ':' + HIE."By Geographic Region Stratifier" ++ Combine(HIE.patientGroups, ':') ++ HIE."By HCV medicine type Stratifier".code \ No newline at end of file diff --git a/input/cql/HIVIND93Logic.cql b/input/cql/HIVIND93Logic.cql index 8f4b2807db..39a8279b4a 100644 --- a/input/cql/HIVIND93Logic.cql +++ b/input/cql/HIVIND93Logic.cql @@ -52,6 +52,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] @@ -74,7 +77,7 @@ define "Initial Population": */ define "Measure Population": - true + HIE."Has HIV-positive Status" and HIE."Date of cervical cancer screening test" /** @@ -87,3 +90,23 @@ define function "Measure Observation"(Patient "Patient"): 1 /* end Populations */ +/* + * Disaggregators + */ + +define "Age Stratifier": + HIE."By Age Stratifier 2" + +define "Geographic Region Stratifier": + HIE."By Geographic Region Stratifier" + +define "Lifetime screening test number Statifier": + HIE."Lifetime screening test number Value" + + +define "Stratification": +HIE."By Age Stratifier 2" ++ ':' + HIE."By Geographic Region Stratifier" ++ ':' + (HIE."Lifetime screening test number Value") + + diff --git a/input/cql/HIVIND94Logic.cql b/input/cql/HIVIND94Logic.cql index a5498b3e77..4bba85c366 100644 --- a/input/cql/HIVIND94Logic.cql +++ b/input/cql/HIVIND94Logic.cql @@ -57,6 +57,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] @@ -79,7 +83,11 @@ define "Initial Population": */ define "Numerator": - true + HIE."Has HIV-positive Status" and + exists(HE."Positive for cervical precancer lesions" G + with HE."Date of cervical cancer screening test" P + such that G.partOf.references(P) and P.performed.toInterval() during "Measurement Period" + and exists(HE."Date of treatment for cervical precancer lesions" T where months between start of T.performed.toInterval() and end of P.performed.toInterval() < 6 months)) /** @@ -90,8 +98,29 @@ define "Numerator": */ define "Denominator": - true + HIE."Has HIV-positive Status" and + exists(HE."Positive for cervical precancer lesions" G + with HE."Date of cervical cancer screening test" P + such that G.partOf.references(P) and P.performed.toInterval() during "Measurement Period") /* end Populations */ +/* + * Disaggregators + */ + +define "Age Stratifier": + HIE."By Age Stratifier 2" + +define "Geographic Region Stratifier": + HIE."By Geographic Region Stratifier" + + + + +define "Stratification": +HIE."By Age Stratifier 2" ++ ':' + HIE."By Geographic Region Stratifier" + +//need to add provider \ No newline at end of file diff --git a/input/cql/HIVIND95Logic.cql b/input/cql/HIVIND95Logic.cql index 9f2689a05a..b772238405 100644 --- a/input/cql/HIVIND95Logic.cql +++ b/input/cql/HIVIND95Logic.cql @@ -67,6 +67,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] @@ -86,10 +89,14 @@ define "Initial Population": * * Definition: Number of women living with HIV who received treatment after being diagnosed with invasive cervical cancer * Calculation: COUNT of women with "HIV status"='HIV-positive' AND "Cervical cancer diagnosis"='Invasive cervical cancer' for a "Date of diagnosis of cervical precancer lesions or invasive cervical cancer" within the reporting period AND "Invasive cervical cancer treatment method" is NOT NULL + //can't just be not null because if had treatment in past then is true */ define "Numerator": - true + HIE."Has HIV-positive Status" and + HIE."Invasive cervical cancer" and + exists HE."Invasive cervical cancer treatment method" P + where P.performed after start of "Measurement Period" /** @@ -97,11 +104,33 @@ define "Numerator": * * Definition: Number of women living with HIV who were diagnosed with invasive cervical cancer * Calculation: COUNT of women with "HIV status"='HIV-positive' AND "Cervical cancer diagnosis"='Invasive cervical cancer' for a "Date of diagnosis of cervical precancer lesions or invasive cervical cancer" within the reporting period + //language should specify only invasive cancer */ define "Denominator": - true + HIE."Has HIV-positive Status" and + HIE."Invasive cervical cancer" /* end Populations */ +/* + * Disaggregators + */ + +define "Age Stratifier": + HIE."By Age Stratifier 2" + +define "Geographic Region Stratifier": + HIE."By Geographic Region Stratifier" + +define "Invasive cervical cancer treatment episode Statifier": + HIE."Invasive cervical cancer treatment episode Value" + + +define "Stratification": +HIE."By Age Stratifier 2" ++ ':' + HIE."By Geographic Region Stratifier" ++ ':' + (HIE."Invasive cervical cancer treatment episode Value") + +//treatment type not specified \ No newline at end of file diff --git a/input/cql/HIVIND96Logic.cql b/input/cql/HIVIND96Logic.cql index e74c58a07f..8506396718 100644 --- a/input/cql/HIVIND96Logic.cql +++ b/input/cql/HIVIND96Logic.cql @@ -61,6 +61,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] @@ -83,7 +86,12 @@ define "Initial Population": */ define "Numerator": - true + HIE."Has HIV-positive Status" and + exists (HE."Invasive cervical cancer" C + where C.prevalenceInterval() starts before start of "Measurement Period" + and C.prevalenceInterval() starts after (start of "Measurement Period" - 12 months) + ) + /** * Numerator Exclusions @@ -92,7 +100,13 @@ define "Numerator": */ define "Numerator Exclusions": - false + exists (HE."Invasive cervical cancer" C + where C.prevalenceInterval() starts before start of "Measurement Period" + and C.prevalenceInterval() starts after (start of "Measurement Period" - 12 months) + and (HE."Death documented" after start of C.prevalenceInterval() and + HE."Death documented" before (start of C.prevalenceInterval() + 12 months)) + ) + /** * Denominator @@ -102,8 +116,29 @@ define "Numerator Exclusions": */ define "Denominator": - true + HIE."Has HIV-positive Status" and + exists (HE."Invasive cervical cancer" C + where C.prevalenceInterval() starts before start of "Measurement Period" + and C.prevalenceInterval() starts after (start of "Measurement Period" - 12 months)) /* end Populations */ +/* + * Disaggregators + */ + +define "Age Stratifier": + HIE."By Age Stratifier 2" + +define "Geographic Region Stratifier": + HIE."By Geographic Region Stratifier" + +define "Cervical cancer stage at diagnosis of cervical cancer Stratifier": + HIE."By Cervical cancer stage at diagnosis of cervical cancer Stratifier" + + +define "Stratification": +HIE."By Age Stratifier 2" ++ ':' + HIE."By Geographic Region Stratifier" ++ HIE."By Cervical cancer stage at diagnosis of cervical cancer Stratifier".code diff --git a/input/cql/HIVIndicatorElements.cql b/input/cql/HIVIndicatorElements.cql index d0017b8255..b2fafb87f5 100644 --- a/input/cql/HIVIndicatorElements.cql +++ b/input/cql/HIVIndicatorElements.cql @@ -2738,13 +2738,11 @@ define "Indeterminate D.DE165": @activity: HIV.D12 Determine recommended screenings and tests @description: Date when client started treatment (TDF) for hepatitis B virus (HBV) */ -// TODO: Replace placeholder with relevant CQL logic + define "HBV treatment TDF start date": - Elements."HBV treatment TDF start date" O - where O.effective.toInterval() during "Measurement Period" -define "HBV treatment TDF start date Value": - "HBV treatment TDF start date" O - return O.value + exists(Elements."HBV treatment TDF start date" MS + where MS.effective.toInterval() during "Measurement Period") + /* End of HBV treatment TDF start date */ /* @@ -2754,7 +2752,7 @@ define "HBV treatment TDF start date Value": */ define "HCV test date D.DE169": - exists(Elements."HBsAg test date D.DE161" P + exists(Elements."HCV test date D.DE169" P where P.performed.toInterval() during "Measurement Period") /* End of HCV test date D.DE169 */ @@ -2764,11 +2762,9 @@ define "HCV test date D.DE169": @activity: HIV.D12 Determine recommended screenings and tests @description: Hepatitis C virus test result (HCV antibody, HCV RNA or HCV core antigen) */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV test result D.DE170": - exists "HCV test result D.DE170 Observation" -define "HCV test result D.DE170 Observation": - Elements."HCV test result D.DE170 Observation" O + exists Elements."HCV test result D.DE170" O where O.effective.toInterval() during "Measurement Period" /* End of HCV test result D.DE170 */ @@ -2777,16 +2773,9 @@ define "HCV test result D.DE170 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV test result was positive */ -// TODO: Replace placeholder with relevant CQL logic + define "Positive D.DE171": - exists "Positive D.DE171 Condition" - or exists "Positive D.DE171 Observation" -define "Positive D.DE171 Condition": - Elements."Positive D.DE171 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Positive D.DE171 Observation": - Elements."Positive D.DE171 Observation" O + exists Elements."Positive D.DE171" O where O.effective.toInterval() during "Measurement Period" /* End of Positive D.DE171 */ @@ -2795,16 +2784,9 @@ define "Positive D.DE171 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV test result was negative */ -// TODO: Replace placeholder with relevant CQL logic + define "Negative D.DE172": - exists "Negative D.DE172 Condition" - or exists "Negative D.DE172 Observation" -define "Negative D.DE172 Condition": - Elements."Negative D.DE172 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Negative D.DE172 Observation": - Elements."Negative D.DE172 Observation" O + exists Elements."Negative D.DE172" O where O.effective.toInterval() during "Measurement Period" /* End of Negative D.DE172 */ @@ -2813,16 +2795,9 @@ define "Negative D.DE172 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV test result was indeterminate */ -// TODO: Replace placeholder with relevant CQL logic + define "Indeterminate D.DE173": - exists "Indeterminate D.DE173 Condition" - or exists "Indeterminate D.DE173 Observation" -define "Indeterminate D.DE173 Condition": - Elements."Indeterminate D.DE173 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Indeterminate D.DE173 Observation": - Elements."Indeterminate D.DE173 Observation" O + exists Elements."Indeterminate D.DE173" O where O.effective.toInterval() during "Measurement Period" /* End of Indeterminate D.DE173 */ @@ -2831,13 +2806,10 @@ define "Indeterminate D.DE173 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Date when client started treatment for hepatitis C virus (HCV) */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV treatment start date": - Elements."HCV treatment start date" O - where O.effective.toInterval() during "Measurement Period" -define "HCV treatment start date Value": - "HCV treatment start date" O - return O.value + exists Elements."HCV medicine type" MS where start of MS.effective.toInterval() during "Measurement Period" + /* End of HCV treatment start date */ /* @@ -2845,13 +2817,9 @@ define "HCV treatment start date Value": @activity: HIV.D12 Determine recommended screenings and tests @description: Date when client completed treatment for hepatitis C virus (HCV) */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV treatment completion date": - Elements."HCV treatment completion date" O - where O.effective.toInterval() during "Measurement Period" -define "HCV treatment completion date Value": - "HCV treatment completion date" O - return O.value + exists Elements."HCV medicine type" MS where end of MS.effective.toInterval() during "Measurement Period" /* End of HCV treatment completion date */ /* @@ -2859,13 +2827,11 @@ define "HCV treatment completion date Value": @activity: HIV.D12 Determine recommended screenings and tests @description: Hepatitis C viral load test date */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV viral load test date D.DE178": - Elements."HCV viral load test date D.DE178" O - where O.effective.toInterval() during "Measurement Period" -define "HCV viral load test date D.DE178 Value": - "HCV viral load test date D.DE178" O - return O.value + exists Elements."HCV viral load test date D.DE178" P + where P.performed.toInterval() during "Measurement Period" + /* End of HCV viral load test date D.DE178 */ /* @@ -2873,12 +2839,10 @@ define "HCV viral load test date D.DE178 Value": @activity: HIV.D12 Determine recommended screenings and tests @description: Hepatitis C viral load test result (qualitative) */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV viral load test result D.DE179": - exists "HCV viral load test result D.DE179 Observation" -define "HCV viral load test result D.DE179 Observation": - Elements."HCV viral load test result D.DE179 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."HCV viral load test result D.DE179" O + where O.effective.toInterval() during "Measurement Period" /* End of HCV viral load test result D.DE179 */ /* @@ -2886,17 +2850,10 @@ define "HCV viral load test result D.DE179 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV was detected */ -// TODO: Replace placeholder with relevant CQL logic + define "Detected D.DE180": - exists "Detected D.DE180 Condition" - or exists "Detected D.DE180 Observation" -define "Detected D.DE180 Condition": - Elements."Detected D.DE180 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Detected D.DE180 Observation": - Elements."Detected D.DE180 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Detected D.DE180" O + where O.effective.toInterval() during "Measurement Period" /* End of Detected D.DE180 */ /* @@ -2904,17 +2861,10 @@ define "Detected D.DE180 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: HCV was not detected */ -// TODO: Replace placeholder with relevant CQL logic + define "Not detected D.DE181": - exists "Not detected D.DE181 Condition" - or exists "Not detected D.DE181 Observation" -define "Not detected D.DE181 Condition": - Elements."Not detected D.DE181 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Not detected D.DE181 Observation": - Elements."Not detected D.DE181 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Not detected D.DE181" O + where O.effective.toInterval() during "Measurement Period" /* End of Not detected D.DE181 */ /* @@ -2922,12 +2872,16 @@ define "Not detected D.DE181 Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Type of medicine client is prescribed */ -// TODO: Replace placeholder with relevant CQL logic + define "HCV medicine type": - exists "HCV medicine type Observation" -define "HCV medicine type Observation": - Elements."HCV medicine type Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."HCV medicine type" + +define "By HCV medicine type Stratifier": + case + when "Interferon" then Concepts."Interferon" + when "Direct acting antivirals" then Concepts."Direct acting antivirals" + else null + end /* End of HCV medicine type */ /* @@ -2935,17 +2889,9 @@ define "HCV medicine type Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Client is prescribed interferon */ -// TODO: Replace placeholder with relevant CQL logic + define "Interferon": - exists "Interferon Condition" - or exists "Interferon Observation" -define "Interferon Condition": - Elements."Interferon Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Interferon Observation": - Elements."Interferon Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Interferon" MS where MS.effective.toInterval() during "Measurement Period" /* End of Interferon */ /* @@ -2953,17 +2899,9 @@ define "Interferon Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Client is prescribed direct acting antivirals */ -// TODO: Replace placeholder with relevant CQL logic + define "Direct acting antivirals": - exists "Direct acting antivirals Condition" - or exists "Direct acting antivirals Observation" -define "Direct acting antivirals Condition": - Elements."Direct acting antivirals Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Direct acting antivirals Observation": - Elements."Direct acting antivirals Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Direct acting antivirals" MS where MS.effective.toInterval() during "Measurement Period" /* End of Direct acting antivirals */ /* @@ -2971,12 +2909,10 @@ define "Direct acting antivirals Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Client is currently on TDF-based ART regimen */ -// TODO: Replace placeholder with relevant CQL logic + define "Currently on TDF-based ART": - exists "Currently on TDF-based ART Observation" -define "Currently on TDF-based ART Observation": - Elements."Currently on TDF-based ART Observation" O - where O.effective.toInterval() during "Measurement Period" + exists(Elements."Currently on TDF-based ART" MS + where MS.effective.toInterval() during "Measurement Period") /* End of Currently on TDF-based ART */ /* @@ -3801,13 +3737,10 @@ define "Enhanced adherence counselling provided Observation": @activity: HIV.D28 Offer other services @description: Date of cervical cancer screening test */ -// TODO: Replace placeholder with relevant CQL logic + define "Date of cervical cancer screening test": - Elements."Date of cervical cancer screening test" O - where O.effective.toInterval() during "Measurement Period" -define "Date of cervical cancer screening test Value": - "Date of cervical cancer screening test" O - return O.value + exists Elements."Date of cervical cancer screening test" P + where P.performed during "Measurement Period" /* End of Date of cervical cancer screening test */ /* @@ -3815,13 +3748,16 @@ define "Date of cervical cancer screening test Value": @activity: HIV.D28 Offer other services @description: Client's lifetime number of screenings for cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Lifetime screening test number": - Elements."Lifetime screening test number" O - where O.effective.toInterval() during "Measurement Period" + Last(Elements."Lifetime screening test number" O + where start of O.issued.toInterval() before end of "Measurement Period" + sort by issued) + + define "Lifetime screening test number Value": "Lifetime screening test number" O - return O.value + return O.value as FHIR.string /* End of Lifetime screening test number */ /* @@ -3843,9 +3779,10 @@ define "Date of diagnosis of cervical precancer lesions or invasive cervical can @activity: HIV.D28 Offer other services @description: Client's screening outcome for cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical cancer screening outcome": exists "Cervical cancer screening outcome Observation" + define "Cervical cancer screening outcome Observation": Elements."Cervical cancer screening outcome Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3858,12 +3795,8 @@ define "Cervical cancer screening outcome Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Positive for cervical precancer lesions": - exists "Positive for cervical precancer lesions Condition" - or exists "Positive for cervical precancer lesions Observation" -define "Positive for cervical precancer lesions Condition": - Elements."Positive for cervical precancer lesions Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + exists "Positive for cervical precancer lesions Observation" + define "Positive for cervical precancer lesions Observation": Elements."Positive for cervical precancer lesions Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3876,12 +3809,8 @@ define "Positive for cervical precancer lesions Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Negative for cervical precancer lesions": - exists "Negative for cervical precancer lesions Condition" - or exists "Negative for cervical precancer lesions Observation" -define "Negative for cervical precancer lesions Condition": - Elements."Negative for cervical precancer lesions Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + exists "Negative for cervical precancer lesions Observation" + define "Negative for cervical precancer lesions Observation": Elements."Negative for cervical precancer lesions Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3892,12 +3821,11 @@ define "Negative for cervical precancer lesions Observation": @activity: HIV.D28 Offer other services @description: Type of cervical cancer diagnosis */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical cancer diagnosis": - exists "Cervical cancer diagnosis Observation" -define "Cervical cancer diagnosis Observation": - Elements."Cervical cancer diagnosis Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Cervical cancer diagnosis" C + where C.prevalenceInterval() overlaps "Measurement Period" + /* End of Cervical cancer diagnosis */ /* @@ -3905,17 +3833,11 @@ define "Cervical cancer diagnosis Observation": @activity: HIV.D28 Offer other services @description: Client is diagnosed with cervical precancer lesions */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical precancer lesions": - exists "Cervical precancer lesions Condition" - or exists "Cervical precancer lesions Observation" -define "Cervical precancer lesions Condition": - Elements."Cervical precancer lesions Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Cervical precancer lesions Observation": - Elements."Cervical precancer lesions Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Cervical precancer lesions" C + where C.prevalenceInterval() overlaps "Measurement Period" + /* End of Cervical precancer lesions */ /* @@ -3923,17 +3845,11 @@ define "Cervical precancer lesions Observation": @activity: HIV.D28 Offer other services @description: Client is diagnosed with invasive cervical cancer disease */ -// TODO: Replace placeholder with relevant CQL logic + define "Invasive cervical cancer": - exists "Invasive cervical cancer Condition" - or exists "Invasive cervical cancer Observation" -define "Invasive cervical cancer Condition": - Elements."Invasive cervical cancer Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Invasive cervical cancer Observation": - Elements."Invasive cervical cancer Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Invasive cervical cancer" C + where C.prevalenceInterval() overlaps "Measurement Period" + /* End of Invasive cervical cancer */ /* @@ -3941,12 +3857,11 @@ define "Invasive cervical cancer Observation": @activity: HIV.D28 Offer other services @description: Cervical cancer stage at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical cancer stage at diagnosis": - exists "Cervical cancer stage at diagnosis Observation" -define "Cervical cancer stage at diagnosis Observation": - Elements."Cervical cancer stage at diagnosis Observation" O + exists Elements."Cervical cancer stage at diagnosis" O where O.effective.toInterval() during "Measurement Period" + /* End of Cervical cancer stage at diagnosis */ /* @@ -3954,17 +3869,10 @@ define "Cervical cancer stage at diagnosis Observation": @activity: HIV.D28 Offer other services @description: Stage 0 cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage 0": - exists "Stage 0 Condition" - or exists "Stage 0 Observation" -define "Stage 0 Condition": - Elements."Stage 0 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Stage 0 Observation": - Elements."Stage 0 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Stage 0" O + where O.effective.toInterval() during "Measurement Period" /* End of Stage 0 */ /* @@ -3972,17 +3880,10 @@ define "Stage 0 Observation": @activity: HIV.D28 Offer other services @description: Stage I cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage I": - exists "Stage I Condition" - or exists "Stage I Observation" -define "Stage I Condition": - Elements."Stage I Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Stage I Observation": - Elements."Stage I Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Stage I" O + where O.effective.toInterval() during "Measurement Period" /* End of Stage I */ /* @@ -3990,17 +3891,10 @@ define "Stage I Observation": @activity: HIV.D28 Offer other services @description: Stage II cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage II": - exists "Stage II Condition" - or exists "Stage II Observation" -define "Stage II Condition": - Elements."Stage II Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Stage II Observation": - Elements."Stage II Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Stage II" O + where O.effective.toInterval() during "Measurement Period" /* End of Stage II */ /* @@ -4008,17 +3902,10 @@ define "Stage II Observation": @activity: HIV.D28 Offer other services @description: Stage III cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage III": - exists "Stage III Condition" - or exists "Stage III Observation" -define "Stage III Condition": - Elements."Stage III Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Stage III Observation": - Elements."Stage III Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Stage III" O + where O.effective.toInterval() during "Measurement Period" /* End of Stage III */ /* @@ -4026,31 +3913,31 @@ define "Stage III Observation": @activity: HIV.D28 Offer other services @description: Stage IV cervical cancer at diagnosis of cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Stage IV": - exists "Stage IV Condition" - or exists "Stage IV Observation" -define "Stage IV Condition": - Elements."Stage IV Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Stage IV Observation": - Elements."Stage IV Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Stage IV" O + where O.effective.toInterval() during "Measurement Period" /* End of Stage IV */ +define "By Cervical cancer stage at diagnosis of cervical cancer Stratifier": + case + when "Stage 0" then Concepts."Stage 0" + when "Stage I" then Concepts."Stage I" + when "Stage II" then Concepts."Stage II" + when "Stage III" then Concepts."Stage III" + when "Stage IV" then Concepts."Stage IV" + else null + end + /* @dataElement: HIV.D.DE718 - Date of treatment for cervical precancer lesions @activity: HIV.D28 Offer other services @description: Date of treatment for cervical precancer lesions */ -// TODO: Replace placeholder with relevant CQL logic + define "Date of treatment for cervical precancer lesions": - Elements."Date of treatment for cervical precancer lesions" O - where O.effective.toInterval() during "Measurement Period" -define "Date of treatment for cervical precancer lesions Value": - "Date of treatment for cervical precancer lesions" O - return O.value + exists Elements."Date of treatment for cervical precancer lesions" P + where P.performed during "Measurement Period" /* End of Date of treatment for cervical precancer lesions */ /* @@ -4058,13 +3945,15 @@ define "Date of treatment for cervical precancer lesions Value": @activity: HIV.D28 Offer other services @description: Client's lifetime number of treatments for invasive cervical cancer */ -// TODO: Replace placeholder with relevant CQL logic + define "Invasive cervical cancer treatment episode": - Elements."Invasive cervical cancer treatment episode" O - where O.effective.toInterval() during "Measurement Period" + Last(Elements."Invasive cervical cancer treatment episode" O + where start of O.effective.toInterval() before end of "Measurement Period" + sort by effective) + define "Invasive cervical cancer treatment episode Value": "Invasive cervical cancer treatment episode" O - return O.value + return O.value as FHIR.string /* End of Invasive cervical cancer treatment episode */ /* @@ -4072,12 +3961,11 @@ define "Invasive cervical cancer treatment episode Value": @activity: HIV.D28 Offer other services @description: Invasive cervical cancer treatment method */ -// TODO: Replace placeholder with relevant CQL logic + define "Invasive cervical cancer treatment method": - exists "Invasive cervical cancer treatment method Observation" -define "Invasive cervical cancer treatment method Observation": - Elements."Invasive cervical cancer treatment method Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Invasive cervical cancer treatment method" P + where P.performed during "Measurement Period" + /* End of Invasive cervical cancer treatment method */ /* @@ -4085,17 +3973,10 @@ define "Invasive cervical cancer treatment method Observation": @activity: HIV.D28 Offer other services @description: Invasive cervical cancer treatment method is a conization */ -// TODO: Replace placeholder with relevant CQL logic + define "Conization": - exists "Conization Condition" - or exists "Conization Observation" -define "Conization Condition": - Elements."Conization Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Conization Observation": - Elements."Conization Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Conization" P + where P.performed during "Measurement Period" /* End of Conization */ /* @@ -4103,17 +3984,10 @@ define "Conization Observation": @activity: HIV.D28 Offer other services @description: Invasive cervical cancer treatment method is a trachelectomy */ -// TODO: Replace placeholder with relevant CQL logic + define "Trachelectomy": - exists "Trachelectomy Condition" - or exists "Trachelectomy Observation" -define "Trachelectomy Condition": - Elements."Trachelectomy Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Trachelectomy Observation": - Elements."Trachelectomy Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Trachelectomy" P + where P.performed during "Measurement Period" /* End of Trachelectomy */ /* @@ -4121,17 +3995,10 @@ define "Trachelectomy Observation": @activity: HIV.D28 Offer other services @description: Invasive cervical cancer treatment method is a hysterectomy */ -// TODO: Replace placeholder with relevant CQL logic + define "Hysterectomy": - exists "Hysterectomy Condition" - or exists "Hysterectomy Observation" -define "Hysterectomy Condition": - Elements."Hysterectomy Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Hysterectomy Observation": - Elements."Hysterectomy Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Hysterectomy" P + where P.performed during "Measurement Period" /* End of Hysterectomy */ /* @@ -4142,14 +4009,12 @@ define "Hysterectomy Observation": // TODO: Replace placeholder with relevant CQL logic define "Management of invasive cervical cancer": exists "Management of invasive cervical cancer Condition" - or exists "Management of invasive cervical cancer Observation" + define "Management of invasive cervical cancer Condition": Elements."Management of invasive cervical cancer Condition" C where C.prevalenceInterval() overlaps before "Measurement Period" or C.prevalenceInterval() overlaps after "Measurement Period" -define "Management of invasive cervical cancer Observation": - Elements."Management of invasive cervical cancer Observation" O - where O.effective.toInterval() during "Measurement Period" + /* End of Management of invasive cervical cancer */ /* @@ -4160,14 +4025,12 @@ define "Management of invasive cervical cancer Observation": // TODO: Replace placeholder with relevant CQL logic define "Radiotherapy": exists "Radiotherapy Condition" - or exists "Radiotherapy Observation" + define "Radiotherapy Condition": Elements."Radiotherapy Condition" C where C.prevalenceInterval() overlaps before "Measurement Period" or C.prevalenceInterval() overlaps after "Measurement Period" -define "Radiotherapy Observation": - Elements."Radiotherapy Observation" O - where O.effective.toInterval() during "Measurement Period" + /* End of Radiotherapy */ /* @@ -4178,14 +4041,12 @@ define "Radiotherapy Observation": // TODO: Replace placeholder with relevant CQL logic define "Chemotherapy": exists "Chemotherapy Condition" - or exists "Chemotherapy Observation" + define "Chemotherapy Condition": Elements."Chemotherapy Condition" C where C.prevalenceInterval() overlaps before "Measurement Period" or C.prevalenceInterval() overlaps after "Measurement Period" -define "Chemotherapy Observation": - Elements."Chemotherapy Observation" O - where O.effective.toInterval() during "Measurement Period" + /* End of Chemotherapy */ /* @@ -4196,14 +4057,12 @@ define "Chemotherapy Observation": // TODO: Replace placeholder with relevant CQL logic define "Chemoradiation": exists "Chemoradiation Condition" - or exists "Chemoradiation Observation" + define "Chemoradiation Condition": Elements."Chemoradiation Condition" C where C.prevalenceInterval() overlaps before "Measurement Period" or C.prevalenceInterval() overlaps after "Measurement Period" -define "Chemoradiation Observation": - Elements."Chemoradiation Observation" O - where O.effective.toInterval() during "Measurement Period" + /* End of Chemoradiation */ /* @@ -4214,14 +4073,12 @@ define "Chemoradiation Observation": // TODO: Replace placeholder with relevant CQL logic define "Other D.DE739": exists "Other D.DE739 Condition" - or exists "Other D.DE739 Observation" + define "Other D.DE739 Condition": Elements."Other D.DE739 Condition" C where C.prevalenceInterval() overlaps before "Measurement Period" or C.prevalenceInterval() overlaps after "Measurement Period" -define "Other D.DE739 Observation": - Elements."Other D.DE739 Observation" O - where O.effective.toInterval() during "Measurement Period" + /* End of Other D.DE739 */ /*