From c7991a5a63f185e3a8482d3589597caa9afa966e Mon Sep 17 00:00:00 2001 From: abertnamanya Date: Mon, 13 Jan 2025 18:53:56 +0300 Subject: [PATCH] Integration of various profiling and indicator work (#64) (#28) (#68) Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com> Co-authored-by: Piotr Mankowski --- input/cql/HIVCommon.cql | 33 +- input/cql/HIVConcepts.cql | 5 + input/cql/HIVConceptsCustom.cql | 36 +- input/cql/HIVElements.cql | 1031 +++------- input/cql/HIVEncounterElements.cql | 201 +- input/cql/HIVIND11Logic.cql | 12 +- input/cql/HIVIND12Logic.cql | 34 +- input/cql/HIVIND13Logic.cql | 17 +- input/cql/HIVIND14Logic.cql | 38 +- input/cql/HIVIND15Logic.cql | 6 +- input/cql/HIVIND16Logic.cql | 6 +- input/cql/HIVIND18Logic.cql | 6 +- input/cql/HIVIND19Logic.cql | 30 +- input/cql/HIVIND20Logic.cql | 14 +- input/cql/HIVIND21Logic.cql | 36 +- input/cql/HIVIND22Logic.cql | 6 +- input/cql/HIVIND24Logic.cql | 4 +- input/cql/HIVIND27Logic.cql | 1 + input/cql/HIVIND28Logic.cql | 68 +- input/cql/HIVIND29Logic.cql | 1 - input/cql/HIVIND2Logic.cql | 10 +- input/cql/HIVIND30Logic.cql | 6 +- input/cql/HIVIND31Logic.cql | 6 +- input/cql/HIVIND32Logic.cql | 6 +- input/cql/HIVIND33Logic.cql | 6 +- input/cql/HIVIND34Logic.cql | 6 +- input/cql/HIVIND35Logic.cql | 24 +- input/cql/HIVIND37Logic.cql | 11 +- input/cql/HIVIND38Logic.cql | 12 +- input/cql/HIVIND39Logic.cql | 21 +- input/cql/HIVIND3Logic.cql | 11 +- input/cql/HIVIND40Logic.cql | 11 +- input/cql/HIVIND45Logic.cql | 2 +- input/cql/HIVIND46Logic.cql | 6 +- input/cql/HIVIND47Logic.cql | 6 +- input/cql/HIVIND48Logic.cql | 4 +- input/cql/HIVIND49Logic.cql | 4 +- input/cql/HIVIND4Logic.cql | 6 +- input/cql/HIVIND50Logic.cql | 4 +- input/cql/HIVIND51Logic.cql | 4 +- input/cql/HIVIND52Logic.cql | 4 +- input/cql/HIVIND53Logic.cql | 9 +- input/cql/HIVIND54Logic.cql | 9 +- input/cql/HIVIND55Logic.cql | 10 +- input/cql/HIVIND56Logic.cql | 4 +- input/cql/HIVIND57Logic.cql | 4 +- input/cql/HIVIND58Logic.cql | 4 +- input/cql/HIVIND59Logic.cql | 4 +- input/cql/HIVIND5Logic.cql | 6 +- input/cql/HIVIND60Logic.cql | 4 +- input/cql/HIVIND61Logic.cql | 4 +- input/cql/HIVIND62Logic.cql | 4 +- input/cql/HIVIND63Logic.cql | 4 +- input/cql/HIVIND64Logic.cql | 4 +- input/cql/HIVIND65Logic.cql | 4 +- input/cql/HIVIND66Logic.cql | 4 +- input/cql/HIVIND67Logic.cql | 4 +- input/cql/HIVIND68Logic.cql | 4 +- input/cql/HIVIND69Logic.cql | 4 +- input/cql/HIVIND6Logic.cql | 11 +- input/cql/HIVIND70Logic.cql | 20 +- input/cql/HIVIND71Logic.cql | 19 +- input/cql/HIVIND72Logic.cql | 22 +- input/cql/HIVIND73Logic.cql | 19 +- input/cql/HIVIND74Logic.cql | 4 +- input/cql/HIVIND75Logic.cql | 16 +- input/cql/HIVIND76Logic.cql | 13 +- input/cql/HIVIND77Logic.cql | 10 +- input/cql/HIVIND78Logic.cql | 19 +- input/cql/HIVIND79Logic.cql | 20 +- input/cql/HIVIND7Logic.cql | 13 +- input/cql/HIVIND80Logic.cql | 13 +- input/cql/HIVIND81Logic.cql | 9 +- input/cql/HIVIND82Logic.cql | 10 +- input/cql/HIVIND83Logic.cql | 16 +- input/cql/HIVIND84Logic.cql | 11 +- input/cql/HIVIND85Logic.cql | 11 +- input/cql/HIVIND86Logic.cql | 8 +- input/cql/HIVIND87Logic.cql | 8 +- input/cql/HIVIND88Logic.cql | 5 +- input/cql/HIVIND89Logic.cql | 7 +- input/cql/HIVIND8Logic.cql | 12 +- input/cql/HIVIND90Logic.cql | 11 +- input/cql/HIVIND91Logic.cql | 12 +- input/cql/HIVIND92Logic.cql | 12 +- input/cql/HIVIND93Logic.cql | 4 +- input/cql/HIVIND94Logic.cql | 16 +- input/cql/HIVIND95Logic.cql | 16 +- input/cql/HIVIND96Logic.cql | 14 +- input/cql/HIVIndicatorElements.cql | 1746 ++++++++--------- input/fsh/examples/HivHcvTest.fsh | 2 +- input/fsh/examples/HivPatient.fsh | 5 + .../HIvTreatmentMedicationRequest.fsh | 10 + input/fsh/profiles/HivAncEncounter.fsh | 8 + .../profiles/HivChildDeliveryObservation.fsh | 16 + input/fsh/profiles/HivEncouner.fsh | 8 + input/fsh/profiles/HivHBsAgTest.fsh | 12 +- input/fsh/profiles/HivHcvTest.fsh | 13 + .../fsh/profiles/HivHcvViralLoadTest copy.fsh | 20 + input/fsh/profiles/HivHcvViralLoadTest.fsh | 16 +- input/fsh/profiles/HivHtsVisit.fsh | 2 +- input/fsh/profiles/HivInfant.fsh | 17 + input/fsh/profiles/HivMother.fsh | 7 + input/fsh/profiles/HivOamtEpisodeOfCare.fsh | 37 + input/fsh/profiles/HivOamtTreatment.fsh | 36 + input/fsh/profiles/HivPatient.fsh | 18 +- input/fsh/profiles/HivPregnancyCondition.fsh | 8 + .../HivSyndromeStiDiagnosisCondition.fsh | 11 + .../HivTimingOfArtForPregnantMothers.fsh | 0 todo.md | 14 +- 110 files changed, 1985 insertions(+), 2247 deletions(-) create mode 100644 input/fsh/profiles/HIvTreatmentMedicationRequest.fsh create mode 100644 input/fsh/profiles/HivAncEncounter.fsh create mode 100644 input/fsh/profiles/HivChildDeliveryObservation.fsh create mode 100644 input/fsh/profiles/HivEncouner.fsh create mode 100644 input/fsh/profiles/HivHcvViralLoadTest copy.fsh create mode 100644 input/fsh/profiles/HivInfant.fsh create mode 100644 input/fsh/profiles/HivMother.fsh create mode 100644 input/fsh/profiles/HivOamtEpisodeOfCare.fsh create mode 100644 input/fsh/profiles/HivOamtTreatment.fsh create mode 100644 input/fsh/profiles/HivPregnancyCondition.fsh create mode 100644 input/fsh/profiles/HivSyndromeStiDiagnosisCondition.fsh create mode 100644 input/fsh/profiles/HivTimingOfArtForPregnantMothers.fsh diff --git a/input/cql/HIVCommon.cql b/input/cql/HIVCommon.cql index 0efa5678f4e..c9bae77c27b 100644 --- a/input/cql/HIVCommon.cql +++ b/input/cql/HIVCommon.cql @@ -146,7 +146,7 @@ define function ToDaily(frequency System.Integer, period System.Quantity): or end of period = maximum DateTime ) - define function MedicationRequestPeriod(Request FHIR.MedicationRequest): + define fluent function MedicationRequestPeriod(Request MedicationRequest): Request R let dosage: singleton from R.dosageInstruction, @@ -209,9 +209,36 @@ define function "DosesPerDay"(frequency Code): //dosage * Quantity { value: dosesPerDay, unit: '/d' } +define fluent function dailyDose(Request "MedicationRequest"): + Request R + let + dosage: singleton from R.dosageInstruction, + doseAndRate: singleton from dosage.doseAndRate, + timing: dosage.timing, + frequency: Coalesce(timing.repeat.frequencyMax, timing.repeat.frequency), + period: System.Quantity { value: timing.repeat.period, unit: timing.repeat.periodUnit.value }, + doseRange: doseAndRate.dose as Range, + doseQuantity: doseAndRate.dose as SimpleQuantity, + dose: Coalesce(doseRange.high, doseQuantity), + dosesPerDay: Coalesce(ToDaily(frequency, period), Count(timing.repeat.timeOfDay), 1.0), + quantity: R.dispenseRequest.quantity + return + quantity / (dose * dosesPerDay) - - +define fluent function dailyDose(Dispense "MedicationDispense"): + Dispense D + let + dosage: singleton from D.dosageInstruction, + doseAndRate: singleton from dosage.doseAndRate, + timing: dosage.timing, + frequency: Coalesce(timing.repeat.frequencyMax, timing.repeat.frequency), + period: System.Quantity { value: timing.repeat.period, unit: timing.repeat.periodUnit.value }, + doseRange: doseAndRate.dose as Range, + doseQuantity: doseAndRate.dose as SimpleQuantity, + dose: Coalesce(doseRange.high, doseQuantity), + dosesPerDay: Coalesce(ToDaily(frequency, period), Count(timing.repeat.timeOfDay), 1.0) + return + D.quantity / (dose * dosesPerDay) diff --git a/input/cql/HIVConcepts.cql b/input/cql/HIVConcepts.cql index fc564cf4f65..2e778adae02 100644 --- a/input/cql/HIVConcepts.cql +++ b/input/cql/HIVConcepts.cql @@ -1209,6 +1209,8 @@ code "Date injecting equipment provided": 'HIV.PRV.DE15' from "HIVConcepts" disp code "Date OAMT initiated": 'HIV.PRV.DE17' from "HIVConcepts" display 'Date OAMT initiated' code "Currently on OAMT": 'HIV.PRV.DE20' from "HIVConcepts" display 'Currently on OAMT' code "Retained on OAMT": 'HIV.PRV.DE21' from "HIVConcepts" display 'Retained on OAMT' +code "Client being inducted on OAMT": 'HIV.PRV.DE22' from "HIVConcepts" display 'Client being inducted on OAMT' +code "Client on reducing doses of OAMT": 'HIV.PRV.DE23' from "HIVConcepts" display 'Client on reducing doses of OAMT' code "Date of loss to follow-up or OAMT stopped": 'HIV.PRV.DE25' from "HIVConcepts" display 'Date of loss to follow-up or OAMT stopped' code "Date medications prescribed - HIV.PRV.DE27": 'HIV.PRV.DE27' from "HIVConcepts" display 'Date medications prescribed' code "Number of days prescribed - HIV.PRV.DE28": 'HIV.PRV.DE28' from "HIVConcepts" display 'Number of days prescribed' @@ -1236,3 +1238,6 @@ code "Other priority populations": 'HIV.Config.DE19' from "HIVConcepts" display code "Reporting period end date": 'HIV.Config.DE20' from "HIVConcepts" display 'Reporting period end date' code "Reporting period start date": 'HIV.Config.DE21' from "HIVConcepts" display 'Reporting period start date' code "Reporting date": 'HIV.Config.DE22' from "HIVConcepts" display 'Reporting date' + +// Additional +code "Live birth": 'HIV.E.DE48' from "HIVConcepts" display 'Live birth' \ No newline at end of file diff --git a/input/cql/HIVConceptsCustom.cql b/input/cql/HIVConceptsCustom.cql index 1b0f157b870..5f807c2cb6e 100644 --- a/input/cql/HIVConceptsCustom.cql +++ b/input/cql/HIVConceptsCustom.cql @@ -4,6 +4,7 @@ codesystem "HIVConceptsCustom": 'http://smart.who.int/hiv/CodeSystem/HIVConcepts codesystem "ConditionCategoryCodes": 'http://terminology.hl7.org/CodeSystem/condition-category' codesystem "ConditionClinicalStatusCodes": 'http://terminology.hl7.org/CodeSystem/condition-clinical' codesystem "ObservationCategoryCodes": 'http://terminology.hl7.org/CodeSystem/observation-category' +codesystem "missing concepts": 'missing concepts' codesystem "Devicestatement-status": 'http://hl7.org/fhir/device-statement-status' codesystem "SNOMEDCT:2018-03": 'urn:oid:2.16.840.1.113883.6.96' version 'urn:hl7:version:2018-03' codesystem "SNOMEDCT": 'urn:oid:2.16.840.1.113883.6.96' @@ -63,19 +64,24 @@ code "Two to four times a day (qualifier value)": '396111001' from "SNOMEDCT" di code "HTS Visit": 'HTS Visit' from "HIVConceptsCustom" //not currently provided -code "needle-syringe": 'needle syringe' from "HIVConceptsCustom" -code "methadone": 'methadone' from "HIVConceptsCustom" -code "buprenorphine": 'buprenorphine' from "HIVConceptsCustom" -code "viral load test": 'viral load test' from "HIVConceptsCustom" -code "delivery": 'delivery' from "HIVConceptsCustom" -code "tb treatment": 'tb treatment' from "HIVConceptsCustom" -code "ART medication": 'ART medication' from "HIVConceptsCustom" -code "DSD ART eligibility assessed" : 'DSD ART eligibility assessed' from "HIVConceptsCustom" -code "syphilis test" : 'syphilis test' from "HIVConceptsCustom" -code "syphilis treatment" : 'syphilis treatment' from "HIVConceptsCustom" -code "Gonorrhoea test" : 'gonorrhoea test' from "HIVConceptsCustom" -code "Gonorrhoea treatment" : 'gonorrhoea treatment' from "HIVConceptsCustom" -code "HBsAg test" : 'HBsAg test' from "HIVConceptsCustom" -code "HCV viral load" : 'HCV viral load' from "HIVConceptsCustom" +code "needle-syringe": 'needle syringe' from "missing concepts" +code "methadone": 'methadone' from "missing concepts" +code "buprenorphine": 'buprenorphine' from "missing concepts" +code "viral load test": 'viral load test' from "missing concepts" +code "delivery": 'delivery' from "missing concepts" +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" : '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" +code "Antenatal care contact": 'Antenatal care contact' from "missing concepts" + -valueset "Antenatal care contact": 'http://fhir.org/guides/who/anc-cds/ValueSet/antenatal-care-contact' diff --git a/input/cql/HIVElements.cql b/input/cql/HIVElements.cql index a660b05d895..68e0bd61a01 100644 --- a/input/cql/HIVElements.cql +++ b/input/cql/HIVElements.cql @@ -85,11 +85,7 @@ define "PEP Prescription": or MR.medication as CodeableConcept in Concepts."Preferred third PEP drug Choices" or MR.medication as CodeableConcept in Concepts."Alternative third PEP drug Choices") -define "routine viral load sample collection": - [Procedure] P - where P.status = 'completed' - and P.code ~ ConceptsCustom."viral load test" - and exists(P.reasonCode RC where RC ~ Concepts."Routine viral load test") + define "viral load sample collection": [Procedure] P @@ -556,10 +552,8 @@ define "Currently pregnant B.DE29": @activity: HIV.B6 Capture or update client history @description: Infant is being breastfed by mother */ -// TODO: Replace placeholder with relevant CQL logic + define "Breastfeeding B.DE32": - exists "Breastfeeding B.DE32 Observation" -define "Breastfeeding B.DE32 Observation": [Observation: Concepts."Breastfeeding - HIV.B.DE32"] O where O.status in { 'final', 'amended', 'corrected' } and O.value is true @@ -2164,13 +2158,12 @@ define "Date/time of follow-up appointment B.DE195 Value": @activity: HIV.B21 Offer prevention options @description: Date on which a voluntary medical male circumcision procedure was performed */ -// TODO: Replace placeholder with relevant CQL logic + define "VMMC procedure date": - [Observation: Concepts."VMMC procedure date"] O - where O.status in { 'final', 'amended', 'corrected' } -define "VMMC procedure date Value": - "VMMC procedure date" O - return O.value + "VMMC" P + return start of P.performed.toInterval() + + /* End of VMMC procedure date */ /* @@ -2178,12 +2171,15 @@ define "VMMC procedure date Value": @activity: HIV.B21 Offer prevention options @description: Severity of the adverse event associated with voluntary medical male circumcision (VMMC) procedure */ -// TODO: Replace placeholder with relevant CQL logic + define "Adverse event severity": - exists "Adverse event severity Observation" -define "Adverse event severity Observation": - [Observation: Concepts."Adverse event severity"] O - where O.status in { 'final', 'amended', 'corrected' } + [AdverseEvent] AE + with [Procedure] P + such that AE.suspectEntity.instance.references(P) and P.status = 'completed' + and P.code ~ Concepts."VMMC" + where AE.actuality = 'actual' + + /* End of Adverse event severity */ /* @@ -2191,16 +2187,10 @@ define "Adverse event severity Observation": @activity: HIV.B21 Offer prevention options @description: Severity of the adverse event associated with VMMC procedure was moderate */ -// TODO: Replace placeholder with relevant CQL logic + define "Moderate": - exists "Moderate Condition" - or exists "Moderate Observation" -define "Moderate Condition": - [Condition: Concepts."Moderate"] -define "Moderate Observation": - "Adverse event severity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Moderate" + "Adverse event severity" VMAC + where (VMAC.severity = ConceptsCustom."moderate") /* End of Moderate */ /* @@ -2208,16 +2198,10 @@ define "Moderate Observation": @activity: HIV.B21 Offer prevention options @description: Severity of the adverse event associated with VMMC procedure was severe */ -// TODO: Replace placeholder with relevant CQL logic + define "Severe": - exists "Severe Condition" - or exists "Severe Observation" -define "Severe Condition": - [Condition: Concepts."Severe"] -define "Severe Observation": - "Adverse event severity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Severe" + "Adverse event severity" VMAC + where (VMAC.severity = ConceptsCustom."severe") /* End of Severe */ /* @@ -2558,7 +2542,6 @@ define "HIV retest prior to starting ART conducted Observation": define "At elevated risk for HIV acquisition B.DE225": [Condition] C where C.code ~ Concepts."At elevated risk for HIV acquisition - HIV.B.DE225" - and C.verificationStatus.text = 'confirmed' /* End of At elevated risk for HIV acquisition B.DE225 */ @@ -2569,12 +2552,14 @@ define "At elevated risk for HIV acquisition B.DE225": */ define "Syndrome/STI diagnosed B.DE226": - "Urethral discharge syndrome B.DE227" or "Vaginal discharge syndrome B.DE228" or "Lower Abdominal pain B.DE229" or "Genital ulcer disease syndrome B.DE230" or - "Anorectal discharge B.DE231" + exists("Urethral discharge syndrome B.DE227") or exists("Vaginal discharge syndrome B.DE228") or exists("Lower Abdominal pain B.DE229") or exists("Genital ulcer disease syndrome B.DE230") or + exists("Anorectal discharge B.DE231") + +define "Syndrome/STI diagnosed B.DE226 Condition": + [Condition] C + where C.code in Concepts."Syndrome/STI diagnosed - HIV.B.DE226 Choices" + and C.verificationStatus.text = 'confirmed' -define "Syndrome/STI diagnosed B.DE226 Observation": - [Observation: Concepts."Syndrome/STI diagnosed - HIV.B.DE226"] O - where O.status in { 'final', 'amended', 'corrected' } /* End of Syndrome/STI diagnosed B.DE226 */ /* @@ -2584,14 +2569,7 @@ define "Syndrome/STI diagnosed B.DE226 Observation": */ define "Urethral discharge syndrome B.DE227": - exists "Urethral discharge syndrome B.DE227 Condition" - or exists "Urethral discharge syndrome B.DE227 Observation" -define "Urethral discharge syndrome B.DE227 Condition": [Condition: Concepts."Urethral discharge syndrome - HIV.B.DE227"] -define "Urethral discharge syndrome B.DE227 Observation": - "Syndrome/STI diagnosed B.DE226 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Urethral discharge syndrome - HIV.B.DE227" /* End of Urethral discharge syndrome B.DE227 */ /* @@ -2599,16 +2577,8 @@ define "Urethral discharge syndrome B.DE227 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Client diagnosed with vaginal discharge syndrome */ - define "Vaginal discharge syndrome B.DE228": - exists "Vaginal discharge syndrome B.DE228 Condition" - or exists "Vaginal discharge syndrome B.DE228 Observation" -define "Vaginal discharge syndrome B.DE228 Condition": [Condition: Concepts."Vaginal discharge syndrome - HIV.B.DE228"] -define "Vaginal discharge syndrome B.DE228 Observation": - "Syndrome/STI diagnosed B.DE226 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Vaginal discharge syndrome - HIV.B.DE228" /* End of Vaginal discharge syndrome B.DE228 */ /* @@ -2616,14 +2586,9 @@ define "Vaginal discharge syndrome B.DE228 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Client diagnosed with lower abdominal pain */ - define "Lower Abdominal pain B.DE229": - exists "Lower Abdominal pain B.DE229 Observation" + [Condition: Concepts."Lower Abdominal pain - HIV.B.DE229"] -define "Lower Abdominal pain B.DE229 Observation": - "Syndrome/STI diagnosed B.DE226 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Lower Abdominal pain - HIV.B.DE229" /* End of Lower Abdominal pain B.DE229 */ /* @@ -2633,14 +2598,8 @@ define "Lower Abdominal pain B.DE229 Observation": */ define "Genital ulcer disease syndrome B.DE230": - exists "Genital ulcer disease syndrome B.DE230 Condition" - or exists "Genital ulcer disease syndrome B.DE230 Observation" -define "Genital ulcer disease syndrome B.DE230 Condition": [Condition: Concepts."Genital ulcer disease syndrome - HIV.B.DE230"] -define "Genital ulcer disease syndrome B.DE230 Observation": - "Syndrome/STI diagnosed B.DE226 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Genital ulcer disease syndrome - HIV.B.DE230" + /* End of Genital ulcer disease syndrome B.DE230 */ /* @@ -2648,14 +2607,8 @@ define "Genital ulcer disease syndrome B.DE230 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Client diagnosed with anorectal discharge */ - define "Anorectal discharge B.DE231": - exists "Anorectal discharge B.DE231 Observation" - -define "Anorectal discharge B.DE231 Observation": - "Syndrome/STI diagnosed B.DE226 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Anorectal discharge - HIV.B.DE231" + [Condition: Concepts."Anorectal discharge - HIV.B.DE231"] /* End of Anorectal discharge B.DE231 */ /* @@ -2663,16 +2616,8 @@ define "Anorectal discharge B.DE231 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Specimen sent for testing */ -// TODO: Replace placeholder with relevant CQL logic define "Sent for testing B.DE232": - exists "Sent for testing B.DE232 Condition" - or exists "Sent for testing B.DE232 Observation" -define "Sent for testing B.DE232 Condition": [Condition: Concepts."Sent for testing - HIV.B.DE232"] -define "Sent for testing B.DE232 Observation": - "Syndrome/STI diagnosed B.DE226 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Sent for testing - HIV.B.DE232" /* End of Sent for testing B.DE232 */ /* @@ -2680,16 +2625,8 @@ define "Sent for testing B.DE232 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Other syndrome/STI diagnosed */ -// TODO: Replace placeholder with relevant CQL logic define "Other B.DE233": - exists "Other B.DE233 Condition" - or exists "Other B.DE233 Observation" -define "Other B.DE233 Condition": [Condition: Concepts."Other - HIV.B.DE233"] -define "Other B.DE233 Observation": - "Syndrome/STI diagnosed B.DE226 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Other - HIV.B.DE233" /* End of Other B.DE233 */ /* @@ -2784,9 +2721,8 @@ define "Syphilis treatment start date B.DE254": */ define "Gonorrhoea test date B.DE255": - [Procedure] P - where P.status = 'completed' - and P.code ~ ConceptsCustom."Gonorrhoea test" + "Gonorrhoea test result B.DE256" O + return O.effective /* End of Gonorrhoea test date B.DE255 */ /* @@ -2864,16 +2800,9 @@ define "Type of specimen B.DE261 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Blood specimen to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Blood B.DE262": - exists "Blood B.DE262 Condition" - or exists "Blood B.DE262 Observation" -define "Blood B.DE262 Condition": - [Condition: Concepts."Blood - HIV.B.DE262"] -define "Blood B.DE262 Observation": - "Type of specimen B.DE261 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Blood - HIV.B.DE262" + "Gonorrhoea test result B.DE256" O where O.method ~ Concepts."Blood - HIV.B.DE262" /* End of Blood B.DE262 */ /* @@ -2881,16 +2810,9 @@ define "Blood B.DE262 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Urine specimen to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Urine B.DE263": - exists "Urine B.DE263 Condition" - or exists "Urine B.DE263 Observation" -define "Urine B.DE263 Condition": - [Condition: Concepts."Urine - HIV.B.DE263"] -define "Urine B.DE263 Observation": - "Type of specimen B.DE261 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Urine - HIV.B.DE263" + "Gonorrhoea test result B.DE256" O where O.method ~ Concepts."Urine - HIV.B.DE263" /* End of Urine B.DE263 */ /* @@ -2898,16 +2820,9 @@ define "Urine B.DE263 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Cervical or vaginal swab to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical or vaginal swab B.DE264": - exists "Cervical or vaginal swab B.DE264 Condition" - or exists "Cervical or vaginal swab B.DE264 Observation" -define "Cervical or vaginal swab B.DE264 Condition": - [Condition: Concepts."Cervical or vaginal swab - HIV.B.DE264"] -define "Cervical or vaginal swab B.DE264 Observation": - "Type of specimen B.DE261 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Cervical or vaginal swab - HIV.B.DE264" + "Gonorrhoea test result B.DE256" O where O.method ~ Concepts."Cervical or vaginal swab - HIV.B.DE264" /* End of Cervical or vaginal swab B.DE264 */ /* @@ -2915,16 +2830,9 @@ define "Cervical or vaginal swab B.DE264 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Urethral or penile swab to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Urethral or penile swab B.DE265": - exists "Urethral or penile swab B.DE265 Condition" - or exists "Urethral or penile swab B.DE265 Observation" -define "Urethral or penile swab B.DE265 Condition": - [Condition: Concepts."Urethral or penile swab - HIV.B.DE265"] -define "Urethral or penile swab B.DE265 Observation": - "Type of specimen B.DE261 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Urethral or penile swab - HIV.B.DE265" + "Gonorrhoea test result B.DE256" O where O.method ~ Concepts."Urethral or penile swab - HIV.B.DE265" /* End of Urethral or penile swab B.DE265 */ /* @@ -2934,14 +2842,7 @@ define "Urethral or penile swab B.DE265 Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Rectal swab B.DE266": - exists "Rectal swab B.DE266 Condition" - or exists "Rectal swab B.DE266 Observation" -define "Rectal swab B.DE266 Condition": - [Condition: Concepts."Rectal swab - HIV.B.DE266"] -define "Rectal swab B.DE266 Observation": - "Type of specimen B.DE261 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Rectal swab - HIV.B.DE266" + "Gonorrhoea test result B.DE256" O where O.method ~ Concepts."Rectal swab - HIV.B.DE266" /* End of Rectal swab B.DE266 */ /* @@ -2951,14 +2852,7 @@ define "Rectal swab B.DE266 Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Other B.DE267": - exists "Other B.DE267 Condition" - or exists "Other B.DE267 Observation" -define "Other B.DE267 Condition": - [Condition: Concepts."Other - HIV.B.DE267"] -define "Other B.DE267 Observation": - "Type of specimen B.DE261 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Other - HIV.B.DE267" + "Gonorrhoea test result B.DE256" O where O.method ~ Concepts."Other - HIV.B.DE267" /* End of Other B.DE267 */ /* @@ -2966,10 +2860,8 @@ define "Other B.DE267 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Type of diagnostic test used for Neisseria gonorrhoeae */ -// TODO: Replace placeholder with relevant CQL logic + define "Neisseria gonorrhoeae test type B.DE276": - exists "Neisseria gonorrhoeae test type B.DE276 Observation" -define "Neisseria gonorrhoeae test type B.DE276 Observation": [Observation: Concepts."Neisseria gonorrhoeae test type - HIV.B.DE276"] O where O.status in { 'final', 'amended', 'corrected' } /* End of Neisseria gonorrhoeae test type B.DE276 */ @@ -2979,16 +2871,10 @@ define "Neisseria gonorrhoeae test type B.DE276 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Nucleic Acid Amplification Test (NAAT) used */ -// TODO: Replace placeholder with relevant CQL logic + define "NAAT B.DE277": - exists "NAAT B.DE277 Condition" - or exists "NAAT B.DE277 Observation" -define "NAAT B.DE277 Condition": - [Condition: Concepts."NAAT - HIV.B.DE277"] -define "NAAT B.DE277 Observation": - "Neisseria gonorrhoeae test type B.DE276 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."NAAT - HIV.B.DE277" + [Observation: Concepts."NAAT - HIV.B.DE277"] O + where O.status in { 'final', 'amended', 'corrected' } /* End of NAAT B.DE277 */ /* @@ -2996,16 +2882,11 @@ define "NAAT B.DE277 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Point-of-care (POC) test used */ -// TODO: Replace placeholder with relevant CQL logic + define "POC Test B.DE278": - exists "POC Test B.DE278 Condition" - or exists "POC Test B.DE278 Observation" -define "POC Test B.DE278 Condition": - [Condition: Concepts."POC Test - HIV.B.DE278"] -define "POC Test B.DE278 Observation": - "Neisseria gonorrhoeae test type B.DE276 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."POC Test - HIV.B.DE278" + [Observation: Concepts."POC Test - HIV.B.DE278"] O + where O.status in { 'final', 'amended', 'corrected' } + /* End of POC Test B.DE278 */ /* @@ -3013,16 +2894,10 @@ define "POC Test B.DE278 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Culture test used */ -// TODO: Replace placeholder with relevant CQL logic + define "Culture B.DE279": - exists "Culture B.DE279 Condition" - or exists "Culture B.DE279 Observation" -define "Culture B.DE279 Condition": - [Condition: Concepts."Culture - HIV.B.DE279"] -define "Culture B.DE279 Observation": - "Neisseria gonorrhoeae test type B.DE276 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Culture - HIV.B.DE279" + [Observation: Concepts."Culture - HIV.B.DE279"] O + where O.status in { 'final', 'amended', 'corrected' } /* End of Culture B.DE279 */ /* @@ -3030,16 +2905,10 @@ define "Culture B.DE279 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Microscopy test used */ -// TODO: Replace placeholder with relevant CQL logic + define "Microscopy B.DE280": - exists "Microscopy B.DE280 Condition" - or exists "Microscopy B.DE280 Observation" -define "Microscopy B.DE280 Condition": - [Condition: Concepts."Microscopy - HIV.B.DE280"] -define "Microscopy B.DE280 Observation": - "Neisseria gonorrhoeae test type B.DE276 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Microscopy - HIV.B.DE280" + [Observation: Concepts."Microscopy - HIV.B.DE280"] O + where O.status in { 'final', 'amended', 'corrected' } /* End of Microscopy B.DE280 */ /* @@ -3047,16 +2916,11 @@ define "Microscopy B.DE280 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Other type of test used */ -// TODO: Replace placeholder with relevant CQL logic + define "Other B.DE281": - exists "Other B.DE281 Condition" - or exists "Other B.DE281 Observation" -define "Other B.DE281 Condition": - [Condition: Concepts."Other - HIV.B.DE281"] -define "Other B.DE281 Observation": - "Neisseria gonorrhoeae test type B.DE276 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Other - HIV.B.DE281" + [Observation: Concepts."Other - HIV.B.DE281"] O + where O.status in { 'final', 'amended', 'corrected' } + /* End of Other B.DE281 */ /* @@ -3081,81 +2945,12 @@ define "Date/time of suspected exposure to HIV C.DE9 Value": /*@triggeredBy Encounter with location = community level testing*/ -define "PREP Product Oral": - exists([MedicationStatement] MS - where MS.status = 'completed' - and exists(MS.reasonCode C where C ~ Concepts."Currently on PrEP") - and (MS.medication ~ Concepts."TDF + FTC - HIV.C.DE18" or - MS.medication ~ Concepts."TDF - HIV.C.DE19" or - MS.medication ~ Concepts."TDF + 3TC - HIV.C.DE20" or - MS.medication ~ Concepts."Other TDF-based regimen") - ) - -define "PREP Product long-acting device": - exists([MedicationStatement] MS - where MS.status = 'completed' - and exists(MS.reasonCode C where C ~ Concepts."Currently on PrEP") - and MS.medication ~ Concepts."Dapivirine vaginal ring DVR - HIV.C.DE22" - ) - -define "PREP Product long-acting injectable": - exists([MedicationStatement] MS - where MS.status = 'completed' - and exists(MS.reasonCode C where C ~ Concepts."Currently on PrEP") - and MS.medication ~ Concepts."CAB-LA - HIV.C.DE23" - ) - -define "PREP first time": - exists([MedicationStatement] MS - where MS.status = 'completed' - and exists(MS.reasonCode C where C ~ Concepts."Currently on PrEP") - and exists(MS.statusReason SR where SR ~ Concepts."First-time user - HIV.C.DE25") - ) - -define "PREP Continuing user": - exists([MedicationStatement] MS - where MS.status = 'completed' - and exists(MS.reasonCode C where C ~ Concepts."Currently on PrEP") - and exists(MS.statusReason SR where SR ~ Concepts."Continuing user") - ) - -define "PREP Restarting": - exists([MedicationStatement] MS - where MS.status = 'completed' - and exists(MS.reasonCode C where C ~ Concepts."Currently on PrEP") - and exists(MS.statusReason SR where SR ~ Concepts."Restarting following a period of not taking PrEP") - ) - -define "Daily_oral_PrEP": - exists([MedicationStatement] MS - where MS.status = 'completed' - and exists(MS.reasonCode C where C ~ Concepts."Currently on PrEP") - and exists(MS.dosage.additionalInstruction AI where AI ~ Concepts."Daily oral PrEP") - ) - -define "Event_driven_PrEP": - exists([MedicationStatement] MS - where MS.status = 'completed' - and exists(MS.reasonCode C where C ~ Concepts."Currently on PrEP") - and exists(MS.dosage.additionalInstruction AI where AI ~ Concepts."Event-driven PrEP 2+1+1") - ) - -define "other_dosing_PrEP": - exists([MedicationStatement] MS +define "Currently on PrEP": + [MedicationStatement] MS where MS.status = 'completed' and exists(MS.reasonCode C where C ~ Concepts."Currently on PrEP") - and exists(MS.dosage.additionalInstruction AI where AI ~ Concepts."Other PrEP dosing type") - ) - - + and MS.medication ~ Concepts."PrEP for HIV prevention" -// TODO: Replace placeholder with relevant CQL logic -define "Currently on PrEP": - exists "Currently on PrEP Observation" -define "Currently on PrEP Observation": - [Observation: Concepts."Currently on PrEP"] O - where O.status in { 'final', 'amended', 'corrected' } - and O.value is true /* End of Currently on PrEP */ /* @@ -3176,16 +2971,10 @@ define "PrEP dosing type Observation": @activity: HIV.C3 Capture or update client history @description: Pre-exposure prophylaxis (PrEP) is taken every day */ -// TODO: Replace placeholder with relevant CQL logic + define "Daily oral PrEP": - exists "Daily oral PrEP Condition" - or exists "Daily oral PrEP Observation" -define "Daily oral PrEP Condition": - [Condition: Concepts."Daily oral PrEP"] -define "Daily oral PrEP Observation": - "PrEP dosing type Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Daily oral PrEP" + "Currently on PrEP" MS + where exists(MS.dosage.additionalInstruction AI where AI ~ Concepts."Daily oral PrEP") /* End of Daily oral PrEP */ /* @@ -3193,16 +2982,10 @@ define "Daily oral PrEP Observation": @activity: HIV.C3 Capture or update client history @description: Event-driven pre-exposure prophylaxis (PrEP) is taken on an even-driven basis (2+1+1) */ -// TODO: Replace placeholder with relevant CQL logic + define "Event-driven PrEP 2+1+1": - exists "Event-driven PrEP 2+1+1 Condition" - or exists "Event-driven PrEP 2+1+1 Observation" -define "Event-driven PrEP 2+1+1 Condition": - [Condition: Concepts."Event-driven PrEP 2+1+1"] -define "Event-driven PrEP 2+1+1 Observation": - "PrEP dosing type Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Event-driven PrEP 2+1+1" + "Currently on PrEP" MS + where exists(MS.dosage.additionalInstruction AI where AI ~ Concepts."Event-driven PrEP 2+1+1") /* End of Event-driven PrEP 2+1+1 */ /* @@ -3210,16 +2993,11 @@ define "Event-driven PrEP 2+1+1 Observation": @activity: HIV.C3 Capture or update client history @description: Other PrEP dosing type */ -// TODO: Replace placeholder with relevant CQL logic + define "Other PrEP dosing type": - exists "Other PrEP dosing type Condition" - or exists "Other PrEP dosing type Observation" -define "Other PrEP dosing type Condition": - [Condition: Concepts."Other PrEP dosing type"] -define "Other PrEP dosing type Observation": - "PrEP dosing type Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Other PrEP dosing type" + "Currently on PrEP" MS + where exists(MS.dosage.additionalInstruction AI where AI ~ Concepts."Other PrEP dosing type") + /* End of Other PrEP dosing type */ /* @@ -3240,16 +3018,10 @@ define "Current PrEP regimen Observation": @activity: HIV.C3 Capture or update client history @description: Treated with tenofovir disoproxil fumarate (TDF) and emtricitabine (FTC) pre-exposure prophylaxis (PrEP) regimen (oral PrEP) */ -// TODO: Replace placeholder with relevant CQL logic + define "TDF + FTC C.DE18": - exists "TDF + FTC C.DE18 Condition" - or exists "TDF + FTC C.DE18 Observation" -define "TDF + FTC C.DE18 Condition": - [Condition: Concepts."TDF + FTC - HIV.C.DE18"] -define "TDF + FTC C.DE18 Observation": - "Current PrEP regimen Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."TDF + FTC - HIV.C.DE18" + "Currently on PrEP" MS + where MS.medication ~ Concepts."TDF + FTC - HIV.C.DE18" /* End of TDF + FTC C.DE18 */ /* @@ -3257,16 +3029,11 @@ define "TDF + FTC C.DE18 Observation": @activity: HIV.C3 Capture or update client history @description: Treated with single-agent tenofovir disoproxil fumarate (TDF) pre-exposure prophylaxis (PrEP) regimen (oral PrEP) */ -// TODO: Replace placeholder with relevant CQL logic + define "TDF C.DE19": - exists "TDF C.DE19 Condition" - or exists "TDF C.DE19 Observation" -define "TDF C.DE19 Condition": - [Condition: Concepts."TDF - HIV.C.DE19"] -define "TDF C.DE19 Observation": - "Current PrEP regimen Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."TDF - HIV.C.DE19" + "Currently on PrEP" MS + where MS.medication ~ Concepts."TDF - HIV.C.DE19" + /* End of TDF C.DE19 */ /* @@ -3274,16 +3041,10 @@ define "TDF C.DE19 Observation": @activity: HIV.C3 Capture or update client history @description: Treated with tenofovir disoproxil fumarate (TDF) and lamivudine (3TC) pre-exposure prophylaxis (PrEP) regimen (oral PrEP) */ -// TODO: Replace placeholder with relevant CQL logic + define "TDF + 3TC C.DE20": - exists "TDF + 3TC C.DE20 Condition" - or exists "TDF + 3TC C.DE20 Observation" -define "TDF + 3TC C.DE20 Condition": - [Condition: Concepts."TDF + 3TC - HIV.C.DE20"] -define "TDF + 3TC C.DE20 Observation": - "Current PrEP regimen Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."TDF + 3TC - HIV.C.DE20" + "Currently on PrEP" MS + where MS.medication ~ Concepts."TDF + 3TC - HIV.C.DE20" /* End of TDF + 3TC C.DE20 */ /* @@ -3291,16 +3052,10 @@ define "TDF + 3TC C.DE20 Observation": @activity: HIV.C3 Capture or update client history @description: Treated with other tenofovir disoproxil fumarate (TDF)-based regimen (oral PrEP) */ -// TODO: Replace placeholder with relevant CQL logic + define "Other TDF-based regimen": - exists "Other TDF-based regimen Condition" - or exists "Other TDF-based regimen Observation" -define "Other TDF-based regimen Condition": - [Condition: Concepts."Other TDF-based regimen"] -define "Other TDF-based regimen Observation": - "Current PrEP regimen Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Other TDF-based regimen" + "Currently on PrEP" MS + where MS.medication ~ Concepts."Other TDF-based regimen" /* End of Other TDF-based regimen */ /* @@ -3308,33 +3063,20 @@ define "Other TDF-based regimen Observation": @activity: HIV.C3 Capture or update client history @description: Dapivirine vaginal ring (DVR) for HIV prevention */ -// TODO: Replace placeholder with relevant CQL logic + define "Dapivirine vaginal ring DVR C.DE22": - exists "Dapivirine vaginal ring DVR C.DE22 Condition" - or exists "Dapivirine vaginal ring DVR C.DE22 Observation" -define "Dapivirine vaginal ring DVR C.DE22 Condition": - [Condition: Concepts."Dapivirine vaginal ring DVR - HIV.C.DE22"] -define "Dapivirine vaginal ring DVR C.DE22 Observation": - "Current PrEP regimen Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Dapivirine vaginal ring DVR - HIV.C.DE22" -/* End of Dapivirine vaginal ring DVR C.DE22 */ + "Currently on PrEP" MS + where MS.medication ~ Concepts."Dapivirine vaginal ring DVR - HIV.C.DE22" /* @dataElement: HIV.C.DE23 - CAB-LA @activity: HIV.C3 Capture or update client history @description: Long-acting injectable cabotegravir */ -// TODO: Replace placeholder with relevant CQL logic + define "CAB-LA C.DE23": - exists "CAB-LA C.DE23 Condition" - or exists "CAB-LA C.DE23 Observation" -define "CAB-LA C.DE23 Condition": - [Condition: Concepts."CAB-LA - HIV.C.DE23"] -define "CAB-LA C.DE23 Observation": - "Current PrEP regimen Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."CAB-LA - HIV.C.DE23" + "Currently on PrEP" MS + where MS.medication ~ Concepts."CAB-LA - HIV.C.DE23" /* End of CAB-LA C.DE23 */ /* @@ -3355,16 +3097,10 @@ define "Experience with PrEP Observation": @activity: HIV.C3 Capture or update client history @description: The client has never used pre-exposure prophylaxis (PrEP) before (naive) */ -// TODO: Replace placeholder with relevant CQL logic + define "First-time user C.DE25": - exists "First-time user C.DE25 Condition" - or exists "First-time user C.DE25 Observation" -define "First-time user C.DE25 Condition": - [Condition: Concepts."First-time user - HIV.C.DE25"] -define "First-time user C.DE25 Observation": - "Experience with PrEP Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."First-time user - HIV.C.DE25" + "Currently on PrEP" MS + where exists(MS.statusReason SR where SR ~ Concepts."First-time user - HIV.C.DE25") /* End of First-time user C.DE25 */ /* @@ -3372,16 +3108,11 @@ define "First-time user C.DE25 Observation": @activity: HIV.C3 Capture or update client history @description: The client has used PrEP before and is continuing to use PrEP */ -// TODO: Replace placeholder with relevant CQL logic + define "Continuing user": - exists "Continuing user Condition" - or exists "Continuing user Observation" -define "Continuing user Condition": - [Condition: Concepts."Continuing user"] -define "Continuing user Observation": - "Experience with PrEP Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Continuing user" + "Currently on PrEP" MS + where exists(MS.statusReason SR where SR ~ Concepts."Continuing user") + /* End of Continuing user */ /* @@ -3389,16 +3120,10 @@ define "Continuing user Observation": @activity: HIV.C3 Capture or update client history @description: The client is restarting PrEP following a period of not taking PrEP */ -// TODO: Replace placeholder with relevant CQL logic + define "Restarting following a period of not taking PrEP": - exists "Restarting following a period of not taking PrEP Condition" - or exists "Restarting following a period of not taking PrEP Observation" -define "Restarting following a period of not taking PrEP Condition": - [Condition: Concepts."Restarting following a period of not taking PrEP"] -define "Restarting following a period of not taking PrEP Observation": - "Experience with PrEP Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Restarting following a period of not taking PrEP" + "Currently on PrEP" MS + where exists(MS.statusReason SR where SR ~ Concepts."Restarting following a period of not taking PrEP") /* End of Restarting following a period of not taking PrEP */ /* @@ -3417,13 +3142,12 @@ define "PEP history": @activity: HIV.C3 Capture or update client history @description: Date client completes PEP course */ -// TODO: Replace placeholder with relevant CQL logic + define "Date client completes PEP course": - [Observation: Concepts."Date client completes PEP course"] O - where O.status in { 'final', 'amended', 'corrected' } -define "Date client completes PEP course Value": - "Date client completes PEP course" O - return O.value + [MedicationStatement] MS + where (MS.status = 'completed' + and exists(MS.reasonCode C where C ~ Concepts."PEP for HIV prevention") + ) /* End of Date client completes PEP course */ /* @@ -3642,16 +3366,11 @@ define "Medications prescribed C.DE75 Observation": @activity: HIV.C23 Prescribe or administer PrEP or PEP @description: Client was prescribed pre-exposure prophylaxis (PrEP) for HIV prevention */ -// TODO: Replace placeholder with relevant CQL logic + define "PrEP for HIV prevention": - exists "PrEP for HIV prevention Condition" - or exists "PrEP for HIV prevention Observation" -define "PrEP for HIV prevention Condition": - [Condition: Concepts."PrEP for HIV prevention"] -define "PrEP for HIV prevention Observation": - "Medications prescribed C.DE75 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."PrEP for HIV prevention" + [MedicationStatement] MS + where MS.status = 'completed' + and MS.medication ~ Concepts."PrEP for HIV prevention" /* End of PrEP for HIV prevention */ /* @@ -3659,16 +3378,13 @@ define "PrEP for HIV prevention Observation": @activity: HIV.C23 Prescribe or administer PrEP or PEP @description: Client was prescribed post-exposure prophylaxis (PEP) for HIV prevention */ -// TODO: Replace placeholder with relevant CQL logic + define "PEP for HIV prevention": - exists "PEP for HIV prevention Condition" - or exists "PEP for HIV prevention Observation" -define "PEP for HIV prevention Condition": - [Condition: Concepts."PEP for HIV prevention"] -define "PEP for HIV prevention Observation": - "Medications prescribed C.DE75 Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."PEP for HIV prevention" + [MedicationRequest] MR + where MR.status = 'completed' + and MR.intent = 'order' + and MR.medication ~ Concepts."PEP for HIV prevention" + /* End of PEP for HIV prevention */ /* @@ -5213,12 +4929,11 @@ define "Current ART regimen Observation": @activity: HIV.D8 Capture or update client history @description: The preferred first-line ART regimen for the client according to WHO (or national) guidelines */ -// TODO: Replace placeholder with relevant CQL logic + define "Preferred first-line ART regimen": - exists "Preferred first-line ART regimen Observation" -define "Preferred first-line ART regimen Observation": - [Observation: Concepts."Preferred first-line ART regimen"] O - where O.status in { 'final', 'amended', 'corrected' } +[MedicationStatement] MS + where MS.status = 'completed' + and MS.medication ~ Concepts."Preferred first-line ART regimen" /* End of Preferred first-line ART regimen */ /* @@ -5226,12 +4941,11 @@ define "Preferred first-line ART regimen Observation": @activity: HIV.D8 Capture or update client history @description: The alternative first-line ART regimen for the client according to WHO (or national) guidelines */ -// TODO: Replace placeholder with relevant CQL logic + define "Alternative first-line ART regimen": - exists "Alternative first-line ART regimen Observation" -define "Alternative first-line ART regimen Observation": - [Observation: Concepts."Alternative first-line ART regimen"] O - where O.status in { 'final', 'amended', 'corrected' } + [MedicationStatement] MS + where MS.status = 'completed' + and MS.medication ~ Concepts."Alternative first-line ART regimen" /* End of Alternative first-line ART regimen */ /* @@ -5239,12 +4953,11 @@ define "Alternative first-line ART regimen Observation": @activity: HIV.D8 Capture or update client history @description: The first-line ART regimen for the client under special circumstances according to WHO (or national) guidelines */ -// TODO: Replace placeholder with relevant CQL logic + define "First-line ART regimen under special circumstances": - exists "First-line ART regimen under special circumstances Observation" -define "First-line ART regimen under special circumstances Observation": - [Observation: Concepts."First-line ART regimen under special circumstances"] O - where O.status in { 'final', 'amended', 'corrected' } + [MedicationStatement] MS + where MS.status = 'completed' + and MS.medication ~ Concepts."First-line ART regimen under special circumstances" /* End of First-line ART regimen under special circumstances */ /* @@ -5252,12 +4965,11 @@ define "First-line ART regimen under special circumstances Observation": @activity: HIV.D8 Capture or update client history @description: The preferred second-line ART regimen for the client according to WHO (or national) guidelines */ -// TODO: Replace placeholder with relevant CQL logic + define "Preferred second-line ART regimen": - exists "Preferred second-line ART regimen Observation" -define "Preferred second-line ART regimen Observation": - [Observation: Concepts."Preferred second-line ART regimen"] O - where O.status in { 'final', 'amended', 'corrected' } + [MedicationStatement] MS + where MS.status = 'completed' + and MS.medication ~ Concepts."Preferred second-line ART regimen" /* End of Preferred second-line ART regimen */ /* @@ -5265,12 +4977,11 @@ define "Preferred second-line ART regimen Observation": @activity: HIV.D8 Capture or update client history @description: The alternative second-line ART regimen for the client according to WHO (or national) guidelines */ -// TODO: Replace placeholder with relevant CQL logic + define "Alternative second-line ART regimen": - exists "Alternative second-line ART regimen Observation" -define "Alternative second-line ART regimen Observation": - [Observation: Concepts."Alternative second-line ART regimen"] O - where O.status in { 'final', 'amended', 'corrected' } + [MedicationStatement] MS + where MS.status = 'completed' + and MS.medication ~ Concepts."Alternative second-line ART regimen" /* End of Alternative second-line ART regimen */ /* @@ -6239,7 +5950,7 @@ define "Toxicity/side effects D.DE218 Observation": @activity: HIV.D10 Counsel returning client @description: Client stopped ART because of severe illness, hospitalization */ -// TODO: Replace placeholder with relevant CQL logic + define "Severe illness, hospitalization D.DE219": exists "Severe illness, hospitalization D.DE219 Condition" or exists "Severe illness, hospitalization D.DE219 Observation" @@ -7680,6 +7391,15 @@ define "Routine viral load test Observation": "Reason for HIV viral load test Observation" O where O.status in { 'final', 'amended', 'corrected' } and O.value ~ Concepts."Routine viral load test" + +define "routine viral load sample collection": + [Procedure] P + where P.status = 'completed' + and P.code ~ ConceptsCustom."viral load test" + and exists(P.reasonCode RC where RC ~ Concepts."Routine viral load test") + + + /* End of Routine viral load test */ /* @@ -8215,13 +7935,10 @@ define "Date medications prescribed D.DE458 Value": @activity: HIV.D23 Prescribe @description: Number of doses (quantity taken at a single point in time) of drugs prescribed/dispensed */ -// TODO: Replace placeholder with relevant CQL logic + define "Dose of medications prescribed": - [Observation: Concepts."Dose of medications prescribed"] O - where O.status in { 'final', 'amended', 'corrected' } -define "Dose of medications prescribed Value": - "Dose of medications prescribed" O - return O.value + [MedicationRequest] P + return P.dailyDose() /* End of Dose of medications prescribed */ /* @@ -8270,16 +7987,11 @@ define "Type of treatment-limiting toxicity Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to GI issues (nausea, diarrhoea, abdominal pain, vomiting) */ -// TODO: Replace placeholder with relevant CQL logic + define "Gastrointestinal": - exists "Gastrointestinal Condition" - or exists "Gastrointestinal Observation" -define "Gastrointestinal Condition": - [Condition: Concepts."Gastrointestinal"] -define "Gastrointestinal Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Gastrointestinal" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Gastrointestinal" /* End of Gastrointestinal */ /* @@ -8287,16 +7999,11 @@ define "Gastrointestinal Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to skin issues (rash, hypersensitivity reaction) */ -// TODO: Replace placeholder with relevant CQL logic + define "Skin issues": - exists "Skin issues Condition" - or exists "Skin issues Observation" -define "Skin issues Condition": - [Condition: Concepts."Skin issues"] -define "Skin issues Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Skin issues" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Skin issues" /* End of Skin issues */ /* @@ -8304,16 +8011,11 @@ define "Skin issues Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to peripheral neuropathy (burning/numbness/ tingling) */ -// TODO: Replace placeholder with relevant CQL logic + define "Peripheral neuropathy": - exists "Peripheral neuropathy Condition" - or exists "Peripheral neuropathy Observation" -define "Peripheral neuropathy Condition": - [Condition: Concepts."Peripheral neuropathy"] -define "Peripheral neuropathy Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Peripheral neuropathy" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Peripheral neuropathy" /* End of Peripheral neuropathy */ /* @@ -8321,16 +8023,11 @@ define "Peripheral neuropathy Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to central nervous system symptoms (dizzy, anxiety, nightmare, depression, seizures) */ -// TODO: Replace placeholder with relevant CQL logic + define "Central nervous system symptoms": - exists "Central nervous system symptoms Condition" - or exists "Central nervous system symptoms Observation" -define "Central nervous system symptoms Condition": - [Condition: Concepts."Central nervous system symptoms"] -define "Central nervous system symptoms Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Central nervous system symptoms" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Central nervous system symptoms" /* End of Central nervous system symptoms */ /* @@ -8338,16 +8035,11 @@ define "Central nervous system symptoms Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to weight gain */ -// TODO: Replace placeholder with relevant CQL logic + define "Weight gain": - exists "Weight gain Condition" - or exists "Weight gain Observation" -define "Weight gain Condition": - [Condition: Concepts."Weight gain"] -define "Weight gain Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Weight gain" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Weight gain" /* End of Weight gain */ /* @@ -8355,16 +8047,11 @@ define "Weight gain Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to hepatic dysfunction (jaundice) */ -// TODO: Replace placeholder with relevant CQL logic + define "Hepatic dysfunction": - exists "Hepatic dysfunction Condition" - or exists "Hepatic dysfunction Observation" -define "Hepatic dysfunction Condition": - [Condition: Concepts."Hepatic dysfunction"] -define "Hepatic dysfunction Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Hepatic dysfunction" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Hepatic dysfunction" /* End of Hepatic dysfunction */ /* @@ -8372,16 +8059,11 @@ define "Hepatic dysfunction Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to haematological (anaemia, neutropenia) disorders */ -// TODO: Replace placeholder with relevant CQL logic + define "Haematological disorders": - exists "Haematological disorders Condition" - or exists "Haematological disorders Observation" -define "Haematological disorders Condition": - [Condition: Concepts."Haematological disorders"] -define "Haematological disorders Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Haematological disorders" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Haematological disorders" /* End of Haematological disorders */ /* @@ -8389,16 +8071,11 @@ define "Haematological disorders Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to fatigue */ -// TODO: Replace placeholder with relevant CQL logic + define "Fatigue": - exists "Fatigue Condition" - or exists "Fatigue Observation" -define "Fatigue Condition": - [Condition: Concepts."Fatigue"] -define "Fatigue Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Fatigue" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Fatigue" /* End of Fatigue */ /* @@ -8406,16 +8083,11 @@ define "Fatigue Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to headache */ -// TODO: Replace placeholder with relevant CQL logic + define "Headache D.DE475": - exists "Headache D.DE475 Condition" - or exists "Headache D.DE475 Observation" -define "Headache D.DE475 Condition": - [Condition: Concepts."Headache - HIV.D.DE475"] -define "Headache D.DE475 Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Headache - HIV.D.DE475" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Headache - HIV.D.DE475" /* End of Headache D.DE475 */ /* @@ -8423,16 +8095,11 @@ define "Headache D.DE475 Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to bone dysfunction (fractures, osteopenia) */ -// TODO: Replace placeholder with relevant CQL logic + define "Bone dysfunction": - exists "Bone dysfunction Condition" - or exists "Bone dysfunction Observation" -define "Bone dysfunction Condition": - [Condition: Concepts."Bone dysfunction"] -define "Bone dysfunction Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Bone dysfunction" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Bone dysfunction" /* End of Bone dysfunction */ /* @@ -8440,16 +8107,11 @@ define "Bone dysfunction Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to metabolic symptoms (body fat changes, hyperglycaemia, dyslipidaemia) */ -// TODO: Replace placeholder with relevant CQL logic + define "Metabolic symptoms": - exists "Metabolic symptoms Condition" - or exists "Metabolic symptoms Observation" -define "Metabolic symptoms Condition": - [Condition: Concepts."Metabolic symptoms"] -define "Metabolic symptoms Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Metabolic symptoms" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Metabolic symptoms" /* End of Metabolic symptoms */ /* @@ -8457,16 +8119,11 @@ define "Metabolic symptoms Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to kidney dysfunction (nephrolithiasis, renal insufficiency) */ -// TODO: Replace placeholder with relevant CQL logic + define "Kidney dysfunction": - exists "Kidney dysfunction Condition" - or exists "Kidney dysfunction Observation" -define "Kidney dysfunction Condition": - [Condition: Concepts."Kidney dysfunction"] -define "Kidney dysfunction Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Kidney dysfunction" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Kidney dysfunction" /* End of Kidney dysfunction */ /* @@ -8474,16 +8131,11 @@ define "Kidney dysfunction Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client experienced an unexpected adverse drug reaction */ -// TODO: Replace placeholder with relevant CQL logic + define "Unexpected adverse drug reaction": - exists "Unexpected adverse drug reaction Condition" - or exists "Unexpected adverse drug reaction Observation" -define "Unexpected adverse drug reaction Condition": - [Condition: Concepts."Unexpected adverse drug reaction"] -define "Unexpected adverse drug reaction Observation": - "Type of treatment-limiting toxicity Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Unexpected adverse drug reaction" + [AdverseEvent] AE + where AE.actuality = 'actual' + and AE.event ~ Concepts."Unexpected adverse drug reaction" /* End of Unexpected adverse drug reaction */ /* @@ -9048,16 +8700,13 @@ define "buprenorphine_prescribed": where MR.status = 'completed' and MR.intent = 'order' and MR.medication ~ ConceptsCustom."buprenorphine" -// TODO: Replace placeholder with relevant CQL logic + + define "Buprenorphine D.DE552": - exists "Buprenorphine D.DE552 Condition" - or exists "Buprenorphine D.DE552 Observation" -define "Buprenorphine D.DE552 Condition": - [Condition: Concepts."Buprenorphine - HIV.D.DE552"] -define "Buprenorphine D.DE552 Observation": - "Current medications Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Buprenorphine - HIV.D.DE552" + [MedicationRequest] MR + where MR.intent = 'order' + and MR.medication ~ ConceptsCustom."buprenorphine" + /* End of Buprenorphine D.DE552 */ /* @@ -9105,16 +8754,11 @@ define "methadone_prescribed": and MR.intent = 'order' and MR.medication ~ ConceptsCustom."methadone" -// TODO: Replace placeholder with relevant CQL logic + define "Methadone D.DE555": - exists "Methadone D.DE555 Condition" - or exists "Methadone D.DE555 Observation" -define "Methadone D.DE555 Condition": - [Condition: Concepts."Methadone - HIV.D.DE555"] -define "Methadone D.DE555 Observation": - "Current medications Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Methadone - HIV.D.DE555" + [MedicationRequest] MR + where MR.intent = 'order' + and MR.medication ~ ConceptsCustom."methadone" /* End of Methadone D.DE555 */ /* @@ -9742,12 +9386,10 @@ define "DSD ART statusHistory": @activity: HIV.D21 Determine regimen and treatment options @description: Type of DSD ART model client is enrolled in (country-specific) */ -// TODO: Replace placeholder with relevant CQL logic + define "DSD ART models": - exists "DSD ART models Observation" -define "DSD ART models Observation": - [Observation: Concepts."DSD ART models"] O - where O.status in { 'final', 'amended', 'corrected' } + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."DSD ART models") /* End of DSD ART models */ /* @@ -9755,16 +9397,10 @@ define "DSD ART models Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in fast track ART refill (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "Fast track ART refill": - exists "Fast track ART refill Condition" - or exists "Fast track ART refill Observation" -define "Fast track ART refill Condition": - [Condition: Concepts."Fast track ART refill"] -define "Fast track ART refill Observation": - "DSD ART models Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Fast track ART refill" + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Fast track ART refill") /* End of Fast track ART refill */ /* @@ -9772,16 +9408,10 @@ define "Fast track ART refill Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in facility adherence club (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "Facility adherence club": - exists "Facility adherence club Condition" - or exists "Facility adherence club Observation" -define "Facility adherence club Condition": - [Condition: Concepts."Facility adherence club"] -define "Facility adherence club Observation": - "DSD ART models Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Facility adherence club" + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Facility adherence club") /* End of Facility adherence club */ /* @@ -9789,16 +9419,10 @@ define "Facility adherence club Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in community ART distribution point (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "Community ART distribution point": - exists "Community ART distribution point Condition" - or exists "Community ART distribution point Observation" -define "Community ART distribution point Condition": - [Condition: Concepts."Community ART distribution point"] -define "Community ART distribution point Observation": - "DSD ART models Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Community ART distribution point" + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Community ART distribution point") /* End of Community ART distribution point */ /* @@ -9806,16 +9430,10 @@ define "Community ART distribution point Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in community health worker/peer educator community ART group (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "CHW/peer educator community ART group": - exists "CHW/peer educator community ART group Condition" - or exists "CHW/peer educator community ART group Observation" -define "CHW/peer educator community ART group Condition": - [Condition: Concepts."CHW/peer educator community ART group"] -define "CHW/peer educator community ART group Observation": - "DSD ART models Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."CHW/peer educator community ART group" + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."CHW/peer educator community ART group") /* End of CHW/peer educator community ART group */ /* @@ -9823,16 +9441,10 @@ define "CHW/peer educator community ART group Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in patient/client community ART group (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "Patient/client community ART group": - exists "Patient/client community ART group Condition" - or exists "Patient/client community ART group Observation" -define "Patient/client community ART group Condition": - [Condition: Concepts."Patient/client community ART group"] -define "Patient/client community ART group Observation": - "DSD ART models Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Patient/client community ART group" + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Patient/client community ART group") /* End of Patient/client community ART group */ /* @@ -9840,16 +9452,10 @@ define "Patient/client community ART group Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in another DSD ART model */ -// TODO: Replace placeholder with relevant CQL logic + define "Other DSD ART model": - exists "Other DSD ART model Condition" - or exists "Other DSD ART model Observation" -define "Other DSD ART model Condition": - [Condition: Concepts."Other DSD ART model"] -define "Other DSD ART model Observation": - "DSD ART models Observation" O - where O.status in { 'final', 'amended', 'corrected' } - and O.value ~ Concepts."Other DSD ART model" + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Other DSD ART model") /* End of Other DSD ART model */ /* @@ -10962,10 +10568,8 @@ define "Extrapulmonary TB D.DE937 Observation": @activity: HIV.D8 Capture or update client history @description: Final result of the TB investigation (bacteriological and/or clinical) */ -// TODO: Replace placeholder with relevant CQL logic + define "TB diagnosis result": - exists "TB diagnosis result Observation" -define "TB diagnosis result Observation": [Observation: Concepts."TB diagnosis result"] O where O.status in { 'final', 'amended', 'corrected' } /* End of TB diagnosis result */ @@ -10975,14 +10579,9 @@ define "TB diagnosis result Observation": @activity: HIV.D8 Capture or update client history @description: Client is diagnosed with TB disease */ -// TODO: Replace placeholder with relevant CQL logic + define "Diagnosed TB": - exists "Diagnosed TB Condition" - or exists "Diagnosed TB Observation" -define "Diagnosed TB Condition": - [Condition: Concepts."Diagnosed TB"] -define "Diagnosed TB Observation": - "TB diagnosis result Observation" O + "TB diagnosis result" O where O.status in { 'final', 'amended', 'corrected' } and O.value ~ Concepts."Diagnosed TB" /* End of Diagnosed TB */ @@ -10992,14 +10591,9 @@ define "Diagnosed TB Observation": @activity: HIV.D8 Capture or update client history @description: Client is not diagnosed with TB */ -// TODO: Replace placeholder with relevant CQL logic + define "TB excluded": - exists "TB excluded Condition" - or exists "TB excluded Observation" -define "TB excluded Condition": - [Condition: Concepts."TB excluded"] -define "TB excluded Observation": - "TB diagnosis result Observation" O + "TB diagnosis result" O where O.status in { 'final', 'amended', 'corrected' } and O.value ~ Concepts."TB excluded" /* End of TB excluded */ @@ -11009,13 +10603,11 @@ define "TB excluded Observation": @activity: HIV.D8 Capture or update client history @description: Client has signs or symptoms of tuberculosis (TB) without laboratory confirmation */ -// TODO: Replace placeholder with relevant CQL logic + define "Presumptive TB D.DE945": - exists "Presumptive TB D.DE945 Observation" -define "Presumptive TB D.DE945 Observation": - [Observation: Concepts."Presumptive TB - HIV.D.DE945"] O + "TB diagnosis result" O where O.status in { 'final', 'amended', 'corrected' } - and O.value is true + and O.value ~ Concepts."Presumptive TB - HIV.D.DE945" /* End of Presumptive TB D.DE945 */ /* @@ -11025,8 +10617,8 @@ define "Presumptive TB D.DE945 Observation": */ define "Date of TB diagnosis": - [Condition: Concepts."Diagnosed TB"] C - return C.prevalenceInterval() + [Observation: Concepts."Diagnosed TB"] C + return C.effective.toInterval() /* End of Date of TB diagnosis */ /* @@ -11813,13 +11405,8 @@ define "Timing of ART initiation Observation": @activity: HIV.E1 Capture or update mother's history @description: The pregnant woman was already on antiretroviral therapy (ART) at first antenatal care visit */ -// TODO: Replace placeholder with relevant CQL logic + define "Already on ART at first antenatal care visit": - exists "Already on ART at first antenatal care visit Condition" - or exists "Already on ART at first antenatal care visit Observation" -define "Already on ART at first antenatal care visit Condition": - [Condition: Concepts."Already on ART at first antenatal care visit"] -define "Already on ART at first antenatal care visit Observation": "Timing of ART initiation Observation" O where O.status in { 'final', 'amended', 'corrected' } and O.value ~ Concepts."Already on ART at first antenatal care visit" @@ -11830,13 +11417,8 @@ define "Already on ART at first antenatal care visit Observation": @activity: HIV.E1 Capture or update mother's history @description: The pregnant woman started ART during her pregnancy */ -// TODO: Replace placeholder with relevant CQL logic + define "Newly on ART during pregnancy": - exists "Newly on ART during pregnancy Condition" - or exists "Newly on ART during pregnancy Observation" -define "Newly on ART during pregnancy Condition": - [Condition: Concepts."Newly on ART during pregnancy"] -define "Newly on ART during pregnancy Observation": "Timing of ART initiation Observation" O where O.status in { 'final', 'amended', 'corrected' } and O.value ~ Concepts."Newly on ART during pregnancy" @@ -11847,13 +11429,8 @@ define "Newly on ART during pregnancy Observation": @activity: HIV.E1 Capture or update mother's history @description: The woman started ART during labour and delivery */ -// TODO: Replace placeholder with relevant CQL logic + define "Newly on ART during labour and delivery": - exists "Newly on ART during labour and delivery Condition" - or exists "Newly on ART during labour and delivery Observation" -define "Newly on ART during labour and delivery Condition": - [Condition: Concepts."Newly on ART during labour and delivery"] -define "Newly on ART during labour and delivery Observation": "Timing of ART initiation Observation" O where O.status in { 'final', 'amended', 'corrected' } and O.value ~ Concepts."Newly on ART during labour and delivery" @@ -11864,13 +11441,12 @@ define "Newly on ART during labour and delivery Observation": @activity: HIV.E1 Capture or update mother's history @description: Date on which the woman delivered */ -// TODO: Replace placeholder with relevant CQL logic -define "Delivery date": - [Observation: Concepts."Delivery date"] O +define "Live Birth Delivery": + [Observation: Concepts."Live birth"] O where O.status in { 'final', 'amended', 'corrected' } -define "Delivery date Value": - "Delivery date" O - return O.value +define "Delivery date": + "Live Birth Delivery" O + return O.effective /* End of Delivery date */ /* @@ -11880,7 +11456,9 @@ define "Delivery date Value": */ define "Place of delivery": - [Procedure: ConceptsCustom."delivery"] + [Observation: Concepts."Place of delivery"] O + where O.status in { 'final', 'amended', 'corrected' } + and O.value is not null /* End of Place of delivery */ @@ -11891,9 +11469,9 @@ define "Place of delivery": */ define "Health facility": - "Place of delivery" P + "Place of delivery" O with [Location] L - such that P.location.references(L) + such that O.value is FHIR.Reference and O.subject.reference = L.id and L.physicalType ~ Concepts."Health facility" /* End of Health facility */ @@ -11905,9 +11483,9 @@ define "Health facility": */ define "Home": - "Place of delivery" P + "Place of delivery" O with [Location] L - such that P.location.references(L) + such that O.subject.references(L) and L.physicalType ~ Concepts."Home" /* End of Home */ @@ -11919,9 +11497,9 @@ define "Home": */ define "Other E.DE70": - "Place of delivery" P + "Place of delivery" O with [Location] L - such that P.location.references(L) + such that O.subject.references(L) and L.physicalType ~ Concepts."Other - HIV.E.DE70" /* End of Other E.DE70 */ @@ -11932,7 +11510,8 @@ define "Other E.DE70": */ define "Antenatal care contact": - ["Encounter": type in ConceptsCustom."Antenatal care contact"] + [Encounter] E + where E.type.coding.code contains ConceptsCustom."Antenatal care contact".code define "ANC contact date E.DE85": "Antenatal care contact" E @@ -11981,8 +11560,8 @@ define "Age of infant in years": @activity: HIV.F6 Check whether infant/child had HIV exposure @description: Whether the infant or child was determined to have had HIV exposure */ - define "HIV-exposed infant or child E.DE112": + [Observation: Concepts."HIV-exposed infant or child - HIV.E.DE112"] O where O.status in { 'final', 'amended', 'corrected' } @@ -12425,10 +12004,8 @@ define "EID test number 2 Observation": @activity: HIV.F8 Test infant/child for HIV using testing algorithm @description: Early infant diagnosis test number 1 test result */ -// TODO: Replace placeholder with relevant CQL logic + define "EID test number 1 test result": - exists "EID test number 1 test result Observation" -define "EID test number 1 test result Observation": [Observation: Concepts."EID test number 1 test result"] O where O.status in { 'final', 'amended', 'corrected' } /* End of EID test number 1 test result */ @@ -12438,14 +12015,9 @@ define "EID test number 1 test result Observation": @activity: HIV.F8 Test infant/child for HIV using testing algorithm @description: Positive HIV test result from the nucleic acid test */ -// TODO: Replace placeholder with relevant CQL logic + define "Positive E.DE187": - exists "Positive E.DE187 Condition" - or exists "Positive E.DE187 Observation" -define "Positive E.DE187 Condition": - [Condition: Concepts."Positive - HIV.E.DE187"] -define "Positive E.DE187 Observation": - "EID test number 1 test result Observation" O + "EID test number 1 test result" O where O.status in { 'final', 'amended', 'corrected' } and O.value ~ Concepts."Positive - HIV.E.DE187" /* End of Positive E.DE187 */ @@ -12455,14 +12027,9 @@ define "Positive E.DE187 Observation": @activity: HIV.F8 Test infant/child for HIV using testing algorithm @description: Negative HIV test result from the nucleic acid test */ -// TODO: Replace placeholder with relevant CQL logic + define "Negative E.DE188": - exists "Negative E.DE188 Condition" - or exists "Negative E.DE188 Observation" -define "Negative E.DE188 Condition": - [Condition: Concepts."Negative - HIV.E.DE188"] -define "Negative E.DE188 Observation": - "EID test number 1 test result Observation" O + "EID test number 1 test result" O where O.status in { 'final', 'amended', 'corrected' } and O.value ~ Concepts."Negative - HIV.E.DE188" /* End of Negative E.DE188 */ @@ -12472,14 +12039,9 @@ define "Negative E.DE188 Observation": @activity: HIV.F8 Test infant/child for HIV using testing algorithm @description: Indeterminate HIV test result from the nucleic acid test */ -// TODO: Replace placeholder with relevant CQL logic + define "Indeterminate E.DE189": - exists "Indeterminate E.DE189 Condition" - or exists "Indeterminate E.DE189 Observation" -define "Indeterminate E.DE189 Condition": - [Condition: Concepts."Indeterminate - HIV.E.DE189"] -define "Indeterminate E.DE189 Observation": - "EID test number 1 test result Observation" O + "EID test number 1 test result" O where O.status in { 'final', 'amended', 'corrected' } and O.value ~ Concepts."Indeterminate - HIV.E.DE189" /* End of Indeterminate E.DE189 */ @@ -14044,13 +13606,15 @@ define "Unknown PRV.DE14 Observation": @activity: HIV.B21 Offer prevention options @description: Date client was provided with injecting equipment */ -// TODO: Replace placeholder with relevant CQL logic + define "Date injecting equipment provided": - [Observation: Concepts."Date injecting equipment provided"] O - where O.status in { 'final', 'amended', 'corrected' } -define "Date injecting equipment provided Value": - "Date injecting equipment provided" O - return O.value + [DeviceUseStatement] DUS + with [Device] D + such that DUS.device.references(D) + and D.type ~ ConceptsCustom."needle-syringe" + where DUS.status = 'completed' + + /* End of Date injecting equipment provided */ /* @@ -14058,13 +13622,8 @@ define "Date injecting equipment provided Value": @activity: HIV.B21 Offer prevention options @description: Date client initiated opioid agonist maintenance treatment (OAMT) */ -// TODO: Replace placeholder with relevant CQL logic define "Date OAMT initiated": - [Observation: Concepts."Date OAMT initiated"] O - where O.status in { 'final', 'amended', 'corrected' } -define "Date OAMT initiated Value": - "Date OAMT initiated" O - return O.value + true /* End of Date OAMT initiated */ /* @@ -14074,11 +13633,9 @@ define "Date OAMT initiated Value": */ // TODO: Replace placeholder with relevant CQL logic define "Currently on OAMT": - exists "Currently on OAMT Observation" -define "Currently on OAMT Observation": - [Observation: Concepts."Currently on OAMT"] O - where O.status in { 'final', 'amended', 'corrected' } - and O.value is true + [MedicationStatement] MS + where exists(MS.reasonCode C where C ~ Concepts."OAMT") + /* End of Currently on OAMT */ /* @@ -14095,6 +13652,26 @@ define "Retained on OAMT Observation": and O.value is true /* End of Retained on OAMT */ + +/* +@dataElement: HIV.PRV.DE22 - Client being inducted on OAMT +@activity: HIV.B6 Capture or update client history +@description: Client is retained on opioid agonist maintenance treatment (OAMT) at reporting date, defined according to country/program to account for medication dispensed and LTFU criterion +*/ + +define "Client being inducted on OAMT": + [Observation: Concepts."Client being inducted on OAMT"] + +/* +@dataElement: HIV.PRV.DE23 - Client on reducing doses of OAMT +@activity: HIV.B6 Capture or update client history +@description: Client is retained on opioid agonist maintenance treatment (OAMT) at reporting date, defined according to country/program to account for medication dispensed and LTFU criterion +*/ + +define "Client on reducing doses of OAMT": + [Observation: Concepts."Client on reducing doses of OAMT"] + + /* @dataElement: HIV.PRV.DE25 - Date of loss to follow-up or OAMT stopped @activity: HIV.B6 Capture or update client history @@ -14272,7 +13849,7 @@ define "Viral load test result SRV.DE13 Value": @activity: HIV.A2 Gather client details @description: The date and time of the client's visit */ -// TODO: MARK as visit? + define "Visit date SRV.DE15": [Encounter] E return E.period diff --git a/input/cql/HIVEncounterElements.cql b/input/cql/HIVEncounterElements.cql index 310c799031f..597f3bcda80 100644 --- a/input/cql/HIVEncounterElements.cql +++ b/input/cql/HIVEncounterElements.cql @@ -1344,13 +1344,9 @@ define "Date/time of suspected exposure to HIV C.DE9 Value": @activity: HIV.C3 Capture or update client history @description: The client is currently taking PrEP. Oral pre-exposure prophylaxis (PrEP) of HIV is the use of ARV drugs by people who are not infected with HIV to block the acquisition of HIV. */ -// TODO: Replace placeholder with relevant CQL logic define "Currently on PrEP": - exists "Currently on PrEP Observation" -define "Currently on PrEP Observation": - Elements."Currently on PrEP Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."Currently on PrEP" O + where O.effective.toInterval() starts on or before Today /* End of Currently on PrEP */ /* @@ -1372,17 +1368,8 @@ define "Current PrEP regimen Observation": @activity: HIV.C3 Capture or update client history @description: Treated with tenofovir disoproxil fumarate (TDF) and emtricitabine (FTC) pre-exposure prophylaxis (PrEP) regimen (oral PrEP) */ -// TODO: Replace placeholder with relevant CQL logic define "TDF + FTC C.DE18": - exists "TDF + FTC C.DE18 Condition" - or exists "TDF + FTC C.DE18 Observation" -define "TDF + FTC C.DE18 Condition": - Elements."TDF + FTC C.DE18 Condition" C - where C.prevalenceInterval() starts on or before Today -define "TDF + FTC C.DE18 Observation": - Elements."TDF + FTC C.DE18 Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + exists Elements."TDF + FTC C.DE18" /* End of TDF + FTC C.DE18 */ /* @@ -1390,35 +1377,18 @@ define "TDF + FTC C.DE18 Observation": @activity: HIV.C3 Capture or update client history @description: Treated with single-agent tenofovir disoproxil fumarate (TDF) pre-exposure prophylaxis (PrEP) regimen (oral PrEP) */ -// TODO: Replace placeholder with relevant CQL logic define "TDF C.DE19": - exists "TDF C.DE19 Condition" - or exists "TDF C.DE19 Observation" -define "TDF C.DE19 Condition": - Elements."TDF C.DE19 Condition" C - where C.prevalenceInterval() starts on or before Today -define "TDF C.DE19 Observation": - Elements."TDF C.DE19 Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today -/* End of TDF C.DE19 */ + Elements."TDF C.DE19" MS + where MS.effective.toInterval() starts on or before Today /* @dataElement: HIV.C.DE20 - TDF + 3TC @activity: HIV.C3 Capture or update client history @description: Treated with tenofovir disoproxil fumarate (TDF) and lamivudine (3TC) pre-exposure prophylaxis (PrEP) regimen (oral PrEP) */ -// TODO: Replace placeholder with relevant CQL logic define "TDF + 3TC C.DE20": - exists "TDF + 3TC C.DE20 Condition" - or exists "TDF + 3TC C.DE20 Observation" -define "TDF + 3TC C.DE20 Condition": - Elements."TDF + 3TC C.DE20 Condition" C - where C.prevalenceInterval() starts on or before Today -define "TDF + 3TC C.DE20 Observation": - Elements."TDF + 3TC C.DE20 Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."TDF + 3TC C.DE20" MS + where MS.effective.toInterval() starts on or before Today /* End of TDF + 3TC C.DE20 */ /* @@ -1426,17 +1396,9 @@ define "TDF + 3TC C.DE20 Observation": @activity: HIV.C3 Capture or update client history @description: Treated with other tenofovir disoproxil fumarate (TDF)-based regimen (oral PrEP) */ -// TODO: Replace placeholder with relevant CQL logic define "Other TDF-based regimen": - exists "Other TDF-based regimen Condition" - or exists "Other TDF-based regimen Observation" -define "Other TDF-based regimen Condition": - Elements."Other TDF-based regimen Condition" C - where C.prevalenceInterval() starts on or before Today -define "Other TDF-based regimen Observation": - Elements."Other TDF-based regimen Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."Other TDF-based regimen" MS + where MS.effective.toInterval() starts on or before Today /* End of Other TDF-based regimen */ /* @@ -1444,17 +1406,9 @@ define "Other TDF-based regimen Observation": @activity: HIV.C3 Capture or update client history @description: Dapivirine vaginal ring (DVR) for HIV prevention */ -// TODO: Replace placeholder with relevant CQL logic define "Dapivirine vaginal ring DVR C.DE22": - exists "Dapivirine vaginal ring DVR C.DE22 Condition" - or exists "Dapivirine vaginal ring DVR C.DE22 Observation" -define "Dapivirine vaginal ring DVR C.DE22 Condition": - Elements."Dapivirine vaginal ring DVR C.DE22 Condition" C - where C.prevalenceInterval() starts on or before Today -define "Dapivirine vaginal ring DVR C.DE22 Observation": - Elements."Dapivirine vaginal ring DVR C.DE22 Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."Dapivirine vaginal ring DVR C.DE22" MS + where MS.effective.toInterval() starts on or before Today /* End of Dapivirine vaginal ring DVR C.DE22 */ /* @@ -1462,17 +1416,9 @@ define "Dapivirine vaginal ring DVR C.DE22 Observation": @activity: HIV.C3 Capture or update client history @description: Long-acting injectable cabotegravir */ -// TODO: Replace placeholder with relevant CQL logic define "CAB-LA C.DE23": - exists "CAB-LA C.DE23 Condition" - or exists "CAB-LA C.DE23 Observation" -define "CAB-LA C.DE23 Condition": - Elements."CAB-LA C.DE23 Condition" C - where C.prevalenceInterval() starts on or before Today -define "CAB-LA C.DE23 Observation": - Elements."CAB-LA C.DE23 Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."CAB-LA C.DE23" MS + where MS.effective.toInterval() starts on or before Today /* End of CAB-LA C.DE23 */ /* @@ -2710,11 +2656,9 @@ define "Current ART regimen Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Preferred first-line ART regimen": - exists "Preferred first-line ART regimen Observation" -define "Preferred first-line ART regimen Observation": - Elements."Preferred first-line ART regimen Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."Preferred first-line ART regimen" MS + where MS.effective.toInterval() starts on or before Today + or MS.context.references(EncounterId) /* End of Preferred first-line ART regimen */ /* @@ -2724,11 +2668,9 @@ define "Preferred first-line ART regimen Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Alternative first-line ART regimen": - exists "Alternative first-line ART regimen Observation" -define "Alternative first-line ART regimen Observation": - Elements."Alternative first-line ART regimen Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."Alternative first-line ART regimen" MS + where MS.effective.toInterval() starts on or before Today + or MS.context.references(EncounterId) /* End of Alternative first-line ART regimen */ /* @@ -2738,11 +2680,9 @@ define "Alternative first-line ART regimen Observation": */ // TODO: Replace placeholder with relevant CQL logic define "First-line ART regimen under special circumstances": - exists "First-line ART regimen under special circumstances Observation" -define "First-line ART regimen under special circumstances Observation": - Elements."First-line ART regimen under special circumstances Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."First-line ART regimen under special circumstances" MS + where MS.effective.toInterval() starts on or before Today + or MS.context.references(EncounterId) /* End of First-line ART regimen under special circumstances */ /* @@ -2750,13 +2690,10 @@ define "First-line ART regimen under special circumstances Observation": @activity: HIV.D8 Capture or update client history @description: The preferred second-line ART regimen for the client according to WHO (or national) guidelines */ -// TODO: Replace placeholder with relevant CQL logic define "Preferred second-line ART regimen": - exists "Preferred second-line ART regimen Observation" -define "Preferred second-line ART regimen Observation": - Elements."Preferred second-line ART regimen Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."Preferred second-line ART regimen" MS + where MS.effective.toInterval() starts on or before Today + or MS.context.references(EncounterId) /* End of Preferred second-line ART regimen */ /* @@ -2764,13 +2701,10 @@ define "Preferred second-line ART regimen Observation": @activity: HIV.D8 Capture or update client history @description: The alternative second-line ART regimen for the client according to WHO (or national) guidelines */ -// TODO: Replace placeholder with relevant CQL logic define "Alternative second-line ART regimen": - exists "Alternative second-line ART regimen Observation" -define "Alternative second-line ART regimen Observation": - Elements."Alternative second-line ART regimen Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."Alternative second-line ART regimen" MS + where MS.effective.toInterval() starts on or before Today + or MS.context.references(EncounterId) /* End of Alternative second-line ART regimen */ /* @@ -4651,15 +4585,8 @@ define "Antivirals Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Buprenorphine D.DE552": - exists "Buprenorphine D.DE552 Condition" - or exists "Buprenorphine D.DE552 Observation" -define "Buprenorphine D.DE552 Condition": - Elements."Buprenorphine D.DE552 Condition" C - where C.prevalenceInterval() starts on or before Today -define "Buprenorphine D.DE552 Observation": - Elements."Buprenorphine D.DE552 Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."Buprenorphine D.DE552" MR + where MR.authoredOn.toInterval() starts on or before Today /* End of Buprenorphine D.DE552 */ /* @@ -4703,17 +4630,9 @@ define "Hormonal family planning method Observation": @activity: HIV.D8 Capture or update client history @description: Opioid substitution to treat opioid dependence */ -// TODO: Replace placeholder with relevant CQL logic define "Methadone D.DE555": - exists "Methadone D.DE555 Condition" - or exists "Methadone D.DE555 Observation" -define "Methadone D.DE555 Condition": - Elements."Methadone D.DE555 Condition" C - where C.prevalenceInterval() starts on or before Today -define "Methadone D.DE555 Observation": - Elements."Methadone D.DE555 Observation" O - where O.encounter.references(EncounterId) - or O.effective.toInterval() starts on or before Today + Elements."Methadone D.DE555" MR + where MR.authoredOn.toInterval() starts on or before Today /* End of Methadone D.DE555 */ /* @@ -5658,11 +5577,8 @@ define "Extrapulmonary TB D.DE937 Observation": @activity: HIV.D8 Capture or update client history @description: Final result of the TB investigation (bacteriological and/or clinical) */ -// TODO: Replace placeholder with relevant CQL logic define "TB diagnosis result": - exists "TB diagnosis result Observation" -define "TB diagnosis result Observation": - Elements."TB diagnosis result Observation" O + Elements."TB diagnosis result" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts on or before Today /* End of TB diagnosis result */ @@ -5674,13 +5590,7 @@ define "TB diagnosis result Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Diagnosed TB": - exists "Diagnosed TB Condition" - or exists "Diagnosed TB Observation" -define "Diagnosed TB Condition": - Elements."Diagnosed TB Condition" C - where C.prevalenceInterval() starts on or before Today -define "Diagnosed TB Observation": - Elements."Diagnosed TB Observation" O + Elements."Diagnosed TB" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts on or before Today /* End of Diagnosed TB */ @@ -5690,15 +5600,8 @@ define "Diagnosed TB Observation": @activity: HIV.D8 Capture or update client history @description: Client is not diagnosed with TB */ -// TODO: Replace placeholder with relevant CQL logic define "TB excluded": - exists "TB excluded Condition" - or exists "TB excluded Observation" -define "TB excluded Condition": - Elements."TB excluded Condition" C - where C.prevalenceInterval() starts on or before Today -define "TB excluded Observation": - Elements."TB excluded Observation" O + Elements."TB excluded" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts on or before Today /* End of TB excluded */ @@ -5708,11 +5611,8 @@ define "TB excluded Observation": @activity: HIV.D8 Capture or update client history @description: Client has signs or symptoms of tuberculosis (TB) without laboratory confirmation */ -// TODO: Replace placeholder with relevant CQL logic define "Presumptive TB D.DE945": - exists "Presumptive TB D.DE945 Observation" -define "Presumptive TB D.DE945 Observation": - Elements."Presumptive TB D.DE945 Observation" O + Elements."Presumptive TB D.DE945" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts on or before Today /* End of Presumptive TB D.DE945 */ @@ -6643,11 +6543,8 @@ define "EID test number 2 Observation": @activity: HIV.F8 Test infant/child for HIV using testing algorithm @description: Early infant diagnosis test number 1 test result */ -// TODO: Replace placeholder with relevant CQL logic define "EID test number 1 test result": - exists "EID test number 1 test result Observation" -define "EID test number 1 test result Observation": - Elements."EID test number 1 test result Observation" O + Elements."EID test number 1 test result" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts on or before Today /* End of EID test number 1 test result */ @@ -6659,13 +6556,7 @@ define "EID test number 1 test result Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Positive E.DE187": - exists "Positive E.DE187 Condition" - or exists "Positive E.DE187 Observation" -define "Positive E.DE187 Condition": - Elements."Positive E.DE187 Condition" C - where C.prevalenceInterval() starts on or before Today -define "Positive E.DE187 Observation": - Elements."Positive E.DE187 Observation" O + Elements."Positive E.DE187" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts on or before Today /* End of Positive E.DE187 */ @@ -6677,13 +6568,7 @@ define "Positive E.DE187 Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Negative E.DE188": - exists "Negative E.DE188 Condition" - or exists "Negative E.DE188 Observation" -define "Negative E.DE188 Condition": - Elements."Negative E.DE188 Condition" C - where C.prevalenceInterval() starts on or before Today -define "Negative E.DE188 Observation": - Elements."Negative E.DE188 Observation" O + Elements."Negative E.DE188" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts on or before Today /* End of Negative E.DE188 */ @@ -6695,13 +6580,7 @@ define "Negative E.DE188 Observation": */ // TODO: Replace placeholder with relevant CQL logic define "Indeterminate E.DE189": - exists "Indeterminate E.DE189 Condition" - or exists "Indeterminate E.DE189 Observation" -define "Indeterminate E.DE189 Condition": - Elements."Indeterminate E.DE189 Condition" C - where C.prevalenceInterval() starts on or before Today -define "Indeterminate E.DE189 Observation": - Elements."Indeterminate E.DE189 Observation" O + Elements."Indeterminate E.DE189" O where O.encounter.references(EncounterId) or O.effective.toInterval() starts on or before Today /* End of Indeterminate E.DE189 */ diff --git a/input/cql/HIVIND11Logic.cql b/input/cql/HIVIND11Logic.cql index ac6591bc57d..d77802385d3 100644 --- a/input/cql/HIVIND11Logic.cql +++ b/input/cql/HIVIND11Logic.cql @@ -57,6 +57,10 @@ * - method: Individual-level data obtained from programme records. | | The total population of people who are opioid dependent includes both people who inject drugs as well as people who consume opioids by other routes of administration. Not all OAMT recipients will have a history of injecting and not all people who inject drugs will use or be dependent on opioids. * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - Key Population Member Type + * - OAMT Treatment Status */ library HIVIND11Logic @@ -67,6 +71,9 @@ using FHIR version '4.0.1' include HIVCommon version '0.0.1' called HIC include FHIRHelpers version '4.0.1' +include HIVElements called HE +include HIVIndicatorElements called HIE + include WHOCommon called WCom // Indicator Definition @@ -90,8 +97,7 @@ define "Initial Population": */ define "Numerator": - true - + exists(HIE."People who inject drugs") and HIE."Currently on OAMT" /** * Denominator @@ -101,7 +107,7 @@ define "Numerator": */ define "Denominator": - true + HE."HIV prevention intervention" and exists(HIE."People who inject drugs") /* end Populations */ diff --git a/input/cql/HIVIND12Logic.cql b/input/cql/HIVIND12Logic.cql index 9110a420d51..1bcf445ed74 100644 --- a/input/cql/HIVIND12Logic.cql +++ b/input/cql/HIVIND12Logic.cql @@ -67,8 +67,11 @@ include FHIRHelpers version '4.0.1' include WHOCommon called WCom +include HIVElements called HE +include HIVIndicatorElements called HIE + // Indicator Definition -parameter "Measurement Period" Interval default Interval[@2023-01-01, @2023-01-30] +parameter "Measurement Period" Interval default Interval[@2023-01-01, @2023-01-30] context Patient /* Populations */ @@ -87,10 +90,31 @@ define "Initial Population": * Calculation: SUM of [DIFFERENCE in MIN("Date OAMT initiated", "Reporting period start date") and MAX("Date of loss to follow-up or OAMT stopped", "Reporting period end date")] for all clients with "Medications prescribed" IN 'Methadone', 'Buprenorphine' */ -define "Numerator": - true +define "Measure Population": + exists(HIE."buprenorphine_prescribed at date") or exists(HIE."methadone_prescribed at date") + +define "Measure Observation": + ( + difference in days between + Min( + { + ToDate(First(HIE."OAMT start")), + ToDate(start of "Measurement Period") + } + ) + and ToDate(start of "Measurement Period") + ) + + + ( + difference in days between end of "Measurement Period" + and Coalesce( + ToDate(First(HIE."OAMT end")), + end of "Measurement Period" + ) + ) + /** * Denominator * @@ -98,9 +122,5 @@ define "Numerator": * Calculation: Service level: Not calculated in DAK | | Population denominator: | *Estimated PYFU for all opioid-dependent people accessing service during defined reporting period | | Note: Can be reported only as numerator; by population or service level if these denominator estimates available. */ -define "Denominator": - true - - /* end Populations */ diff --git a/input/cql/HIVIND13Logic.cql b/input/cql/HIVIND13Logic.cql index 564474a5dd5..59ebf7e3644 100644 --- a/input/cql/HIVIND13Logic.cql +++ b/input/cql/HIVIND13Logic.cql @@ -45,6 +45,9 @@ * - method: Individual-level data obtained from programme records * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + + * Profiles: HivOamtTreatment + */ library HIVIND13Logic @@ -57,6 +60,8 @@ include FHIRHelpers version '4.0.1' include WHOCommon called WCom include HIVIndicatorElements called HIE +include HIVElements called HE + // Indicator Definition parameter "Measurement Period" Interval default Interval[@2023-01-01, @2023-01-30] @@ -78,7 +83,7 @@ define "Initial Population": */ define "Numerator": - HIE.OAMT_retained + exists(HE."OAMT" t where t starts during "Measurement Period" and t ends after (end of "Measurement Period" + 6 months)) /** @@ -89,7 +94,7 @@ define "Numerator": */ define "Denominator": - HIE.OAMT_initiated + HIE.OAMT /* end Populations */ @@ -107,9 +112,6 @@ define "Age Stratifier": define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" -define "patientGroups Stratifier": - HIE."patientGroups" - define "Setting": HIE."setting" @@ -117,7 +119,6 @@ define "Setting": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 3" + ':' + HIE."By Geographic Region Stratifier" -+ Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') + + ':' + HIE."setting".code diff --git a/input/cql/HIVIND14Logic.cql b/input/cql/HIVIND14Logic.cql index 3f4e1b05485..28c14268e2e 100644 --- a/input/cql/HIVIND14Logic.cql +++ b/input/cql/HIVIND14Logic.cql @@ -51,6 +51,8 @@ * - method: Individual-level data obtained from programme records * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + + * Profiles: HivTreatmentMedicationRequest, HivOamtEpisodeOfCare */ library HIVIND14Logic @@ -62,6 +64,9 @@ include HIVCommon version '0.0.1' called HIC include FHIRHelpers version '4.0.1' include WHOCommon called WCom +include HIVIndicatorElements called HIE +include HIVElements called HE + // Indicator Definition parameter "Measurement Period" Interval default Interval[@2023-01-01, @2023-01-30] @@ -83,7 +88,8 @@ define "Initial Population": */ define "Numerator": - true + First(HIE."Methadone D.DE555").dailyDose() >= System.Quantity{ value: 60, unit: 'mg' } + or First(HIE."Buprenorphine D.DE552").dailyDose() >= System.Quantity{ value: 8, unit: 'mg' } /** * Numerator Exclusions @@ -92,7 +98,7 @@ define "Numerator": */ define "Numerator Exclusions": - false + HIE."Client being inducted on OAMT" or HIE."Client on reducing doses of OAMT" /** * Denominator @@ -102,7 +108,7 @@ define "Numerator Exclusions": */ define "Denominator": - true + Exists(HIE."Methadone D.DE555") or Exists(HIE."Buprenorphine D.DE552") /** * Denominator Exclusions @@ -111,7 +117,31 @@ define "Denominator": */ define "Denominator Exclusions": - false + HIE."Client being inducted on OAMT" or HIE."Client on reducing doses of OAMT" /* end Populations */ + +/* + * Disaggregators + */ + +define "Administrative Gender Stratifier": + HIE."By Administrative Gender Stratifier" + +define "Age Stratifier": + HIE."By Age Stratifier 3" + +define "Geographic Region Stratifier": + HIE."By Geographic Region Stratifier" + +define "Setting": + HIE."setting" + +//provider type not provided? + +define "Stratification": + HIE."By Administrative Gender Stratifier".code + + ':' + HIE."By Age Stratifier 3" ++ ':' + HIE."By Geographic Region Stratifier" + + ':' + HIE."setting".code \ No newline at end of file diff --git a/input/cql/HIVIND15Logic.cql b/input/cql/HIVIND15Logic.cql index a8ce23b43a9..f8b8b1f0009 100644 --- a/input/cql/HIVIND15Logic.cql +++ b/input/cql/HIVIND15Logic.cql @@ -95,7 +95,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 3" + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -110,7 +110,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" -+ Combine(HIE.setting, ':') + + ':' + HIE."setting".code + ':' + HIE."HIV Status Stratifier".code \ No newline at end of file diff --git a/input/cql/HIVIND16Logic.cql b/input/cql/HIVIND16Logic.cql index 3e7642a4cdd..fb259dcda57 100644 --- a/input/cql/HIVIND16Logic.cql +++ b/input/cql/HIVIND16Logic.cql @@ -128,7 +128,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 3" + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -148,8 +148,8 @@ define "VMMC_adverse_event_timing": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" -+ Combine(HIE.setting, ':') + + ':' + HIE."setting".code + ':' + HIE."VMMC_adverse_event_type".code + ':' + HIE."VMMC_adverse_event_timing".code \ No newline at end of file diff --git a/input/cql/HIVIND18Logic.cql b/input/cql/HIVIND18Logic.cql index 2dee0a9cbbe..88312c41226 100644 --- a/input/cql/HIVIND18Logic.cql +++ b/input/cql/HIVIND18Logic.cql @@ -112,8 +112,8 @@ define "Geographic Region Stratifier": define "patientGroups Stratifier": HIE."patientGroups" -// define "ANC Stratifier": -// HIC."anc" + define "ANC Stratifier": + HIE."anc" define "Stratification": @@ -121,4 +121,4 @@ define "Stratification": + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -// + Combine(HIC."anc", ':') ++ ':' + HIE."anc".code diff --git a/input/cql/HIVIND19Logic.cql b/input/cql/HIVIND19Logic.cql index b5458b83470..4e4f7a3a950 100644 --- a/input/cql/HIVIND19Logic.cql +++ b/input/cql/HIVIND19Logic.cql @@ -105,28 +105,6 @@ define "denominator": Count(HIE."Non-Self HIV test with date and results returned in measurement period") -// exists(HE."HIV Positive Condition" C -// where C.onset during "Measurement Period") -// or -// exists(HIE."HIV Positive Observation" O -// where (O.issued before end of "Measurement Period" -// and O.issued after start of "Measurement Period") -// ) - -// define "numeratorExclusion": -// exists(HIC."HIV Positive Observation - HIV Self Test" O -// where (O.issued before end of "Measurement Period" -// and O.issued after start of "Measurement Period") -// ) - -// define "denominator": - - -// define "denominatorExclusion": -// exists(HIC."HIV Positive Observation - HIV Self Test" O -// where (O.issued before end of "Measurement Period" -// and O.issued after start of "Measurement Period") -// ) /* * Disaggregators @@ -147,13 +125,13 @@ define "patientGroups Stratifier": define "Setting": HIE."setting" -// define "TB Stratifier": -// HIC."tb" + define "TB Stratifier": + HIE."tb" define "Stratification": HIE."By Administrative Gender Stratifier".code + ':' + HIE."By Age Stratifier" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') -//+ Combine(HIC.tb, ':') + + ':' + HIE."setting".code ++ ':' + HIE."tb".code diff --git a/input/cql/HIVIND20Logic.cql b/input/cql/HIVIND20Logic.cql index a01b859ccd2..99c89f01f20 100644 --- a/input/cql/HIVIND20Logic.cql +++ b/input/cql/HIVIND20Logic.cql @@ -110,9 +110,11 @@ define "Initial Population": //Does this also filter out self HIV tests //right now using HIVIND19 definition which does define "numerator": - exists(HIE."HIV Status Positive Condition") + exists(HIE."HIV Status Positive Condition" C where C.onset.toInterval() during "Measurement Period") or - exists(HIE."HIV Status Positive Observation") + exists(HIE."HIV Status Positive Observation" O + where O.issued.toInterval() during "Measurement Period" + or O.effective.toInterval() during "Measurement Period") define "denominator": exists(HIE."HIV test results returned in measurement period") @@ -136,13 +138,13 @@ define "patientGroups Stratifier": define "Setting": HIE."setting" -// define "TB Stratifier": -// HIC."tb" + define "TB Stratifier": + HIE."tb" define "Stratification": HIE."By Administrative Gender Stratifier".code + ':' + HIE."By Age Stratifier" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') -//+ Combine(HIC.tb, ':') \ No newline at end of file + + ':' + HIE."setting".code ++ ':' + HIE."tb".code \ No newline at end of file diff --git a/input/cql/HIVIND21Logic.cql b/input/cql/HIVIND21Logic.cql index 0ce715d8ca0..800c134d206 100644 --- a/input/cql/HIVIND21Logic.cql +++ b/input/cql/HIVIND21Logic.cql @@ -95,19 +95,24 @@ define "Initial Population": define "numerator": - exists(HIE."HIV Status Positive Condition" C) - or - exists(HIE."HIV Status Positive Observation" O) - and exists(HE."On ART H.DE47" H - where H.effective starts before end of "Measurement Period" - and (H.effective ends after start of "Measurement Period" - or end of H.effective ~ null) - ) + exists(HIE."HIV Status Positive Condition" C where C.onset.toInterval() during "Measurement Period") + + or + + exists(HIE."HIV Status Positive Observation" O + where O.issued.toInterval() during "Measurement Period" + or O.effective.toInterval() during "Measurement Period") + + and HIE."On ART H.DE47" define "denominator": - exists(HE."HIV Status Positive Condition") - or - exists(HIE."HIV Status Positive Observation" O) + exists(HIE."HIV Status Positive Condition" C where C.onset.toInterval() during "Measurement Period") + + or + + exists(HIE."HIV Status Positive Observation" O + where O.issued.toInterval() during "Measurement Period" + or O.effective.toInterval() during "Measurement Period") /* * Disaggregators @@ -125,17 +130,16 @@ define "Geographic Region Stratifier": define "patientGroups Stratifier": HIE."patientGroups" -// define "TB Stratifier": -// HIC."tb" + define "TB Stratifier": + HIE."tb" define "Time to start ART": HE."Time to start ART" define "Stratification": HIE."By Administrative Gender Stratifier".code - //not working - //+ ':' + HIC."Time to start ART".code + + ':' + HE."Time to start ART".code + ':' + HIE."By Age Stratifier" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -//+ Combine(HIC.tb, ':') ++ ':' + HIE."tb".code diff --git a/input/cql/HIVIND22Logic.cql b/input/cql/HIVIND22Logic.cql index ee85e72c5f8..3fd2a9e5df3 100644 --- a/input/cql/HIVIND22Logic.cql +++ b/input/cql/HIVIND22Logic.cql @@ -109,16 +109,14 @@ define "Measure Population": such that IC.hasMember.references(DIP) with HIE."HIV test results returned in measurement period" HIV such that IC.hasMember.references(HIV) - and HIV.issued after start of "Measurement Period" - and HIV.issued before end of "Measurement Period") + and HIV.issued.toInterval() during "Measurement Period") or exists(HE."Partner or contact of an index case" IC with HE."Sexual partner" SP such that IC.hasMember.references(SP) with HIE."HIV test results returned in measurement period" HIV such that IC.hasMember.references(HIV) - and HIV.issued after start of "Measurement Period" - and HIV.issued before end of "Measurement Period") + and HIV.issued.toInterval() during "Measurement Period") diff --git a/input/cql/HIVIND24Logic.cql b/input/cql/HIVIND24Logic.cql index 4be77da1dcf..af2e8025903 100644 --- a/input/cql/HIVIND24Logic.cql +++ b/input/cql/HIVIND24Logic.cql @@ -159,7 +159,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 5" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -172,7 +172,7 @@ define "HIV prevention intervention": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 5" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + Combine(HIE."HIV prevention intervention", ':') \ No newline at end of file diff --git a/input/cql/HIVIND27Logic.cql b/input/cql/HIVIND27Logic.cql index 146697a7716..4c457b2a7e8 100644 --- a/input/cql/HIVIND27Logic.cql +++ b/input/cql/HIVIND27Logic.cql @@ -66,6 +66,7 @@ * - HIVStatusCondition * - HIVStatusObservation * - HIVAntiRetroviralTreatment +*/ library HIVIND27Logic diff --git a/input/cql/HIVIND28Logic.cql b/input/cql/HIVIND28Logic.cql index ba9a1faa215..c76f712d0f1 100644 --- a/input/cql/HIVIND28Logic.cql +++ b/input/cql/HIVIND28Logic.cql @@ -81,6 +81,8 @@ include FHIRHelpers version '4.0.1' include WHOCommon called WCom include HIVElements called HE include HIVIndicatorElements called HIE +include HIVConcepts called Concepts +include HIVConfig called Config // Indicator Definition parameter "Measurement Period" Interval default Interval[@2023-01-01, @2023-01-30] @@ -94,46 +96,40 @@ define "Initial Population": define "numerator": -//MINUS | COUNT of clients with "HIV status"='HIV-positive' AND "On ART"=True on the reporting period end date - ( - HIE."Has death documented" - or HIE."Has transferred out" - or HIE."Is lost to follow-up" - ) - and ((( - //saying needs to not be counted this measurement period but should have counted this period or last period - HIE."Has HIV-positive Status" - and HIE."On ART H.DE47" - ) - ) or - ( - //Accounts for end of last period - HIE."Has HIV-positive Status at last measurment period" - and exists(HE."On ART H.DE47" ART - where ART.effective starts before (end of "Measurement Period" - duration in days of "Measurement Period") - and ART.effective ends after (start of "Measurement Period" - duration in days of "Measurement Period") - ) - ) - ) +//HIV Positive +HIE."Has HIV-positive Status" + and exists(HE."On ART H.DE47" A + with [EpisodeOfCare] EOC + such that A.context.references(EOC) and + //On ART during last measurement period or started ART during this measurement period + ((A.effective.toInterval() starts before (end of "Measurement Period" - duration in days of "Measurement Period") + and A.effective.toInterval() ends after (start of "Measurement Period" - duration in days of "Measurement Period")) + or (date from start of HE."First On ART".effective.toInterval() during "Measurement Period")) + and + //and either Transferred out + (exists(EOC.type T where T ~ Concepts."On ART - HIV.H.DE47") + and EOC.status = 'finished' and EOC.period.toInterval() ends during "Measurement Period") + or exists ( + EOC.statusHistory H + where H.status = 'finished' + and H.period.toInterval() ends during "Measurement Period") + //or Lost to follow up + or (A.effective.toInterval() ends before (end of "Measurement Period" - Config."LTFU Days") + //or death + or HIE."Has death documented")) define "denominator": - ((( - //saying needs to not be counted this measurement period but should have counted this period or last period - HIE."Has HIV-positive Status" - and HIE."On ART H.DE47" - ) - ) or - ( - //Accounts for end of last period - HIE."Has HIV-positive Status at last measurment period" - and exists(HE."On ART H.DE47" ART - where ART.effective starts before (end of "Measurement Period" - duration in days of "Measurement Period") - and ART.effective ends after (start of "Measurement Period" - duration in days of "Measurement Period") - ) - ) - ) + //HIV Positive +HIE."Has HIV-positive Status" + and exists(HE."On ART H.DE47" A + with [EpisodeOfCare] EOC + such that A.context.references(EOC) and + //On ART during last measurement period or started ART during this measurement period + ((A.effective.toInterval() starts before (end of "Measurement Period" - duration in days of "Measurement Period") + and A.effective.toInterval() ends after (start of "Measurement Period" - duration in days of "Measurement Period")) + or (date from start of HE."First On ART".effective.toInterval() during "Measurement Period"))) diff --git a/input/cql/HIVIND29Logic.cql b/input/cql/HIVIND29Logic.cql index 3c71a6e09f2..82bc2774dcf 100644 --- a/input/cql/HIVIND29Logic.cql +++ b/input/cql/HIVIND29Logic.cql @@ -123,7 +123,6 @@ define "Numerator": where VL.value < 1000 ) - /** * Denominator * diff --git a/input/cql/HIVIND2Logic.cql b/input/cql/HIVIND2Logic.cql index 51701307d81..3fdd8262df5 100644 --- a/input/cql/HIVIND2Logic.cql +++ b/input/cql/HIVIND2Logic.cql @@ -83,7 +83,9 @@ /** * Profiles: - * + * - HivPrepTreatment + * - HivCurrentPrepRegimenPrescription + * - */ library HIVIND2Logic @@ -103,7 +105,7 @@ parameter "Measurement Period" Interval default Interval[@2023-01-01, @202 context Patient define "Measure Population": - HIE."HIV PREP Active" + HIE."PrEP for HIV prevention" /* * As defined by Member States @@ -151,10 +153,10 @@ define "prep_dosing": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 3" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') + + ':' + HIE."setting".code + Combine(HIE.prep_product, ':') + Combine(HIE.prep_experience, ':') + Combine(HIE.prep_dosing, ':') \ No newline at end of file diff --git a/input/cql/HIVIND30Logic.cql b/input/cql/HIVIND30Logic.cql index f797a3c5003..e880344fafc 100644 --- a/input/cql/HIVIND30Logic.cql +++ b/input/cql/HIVIND30Logic.cql @@ -108,8 +108,8 @@ define function "Measure Observation"(Patient "Patient"): define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" -define "Age Stratifier": - HIE."By Age Stratifier" +define "Age Stratifier 2": + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -119,6 +119,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') \ No newline at end of file diff --git a/input/cql/HIVIND31Logic.cql b/input/cql/HIVIND31Logic.cql index 6481eb776da..e549c743dab 100644 --- a/input/cql/HIVIND31Logic.cql +++ b/input/cql/HIVIND31Logic.cql @@ -134,8 +134,8 @@ define "Denominator": define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" -define "Age Stratifier": - HIE."By Age Stratifier" +define "Age Stratifier 2": + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -145,6 +145,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') \ No newline at end of file diff --git a/input/cql/HIVIND32Logic.cql b/input/cql/HIVIND32Logic.cql index 95a0701ad1a..5c4e7c11cd9 100644 --- a/input/cql/HIVIND32Logic.cql +++ b/input/cql/HIVIND32Logic.cql @@ -164,8 +164,8 @@ define "Denominator Exclusions": define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" -define "Age Stratifier": - HIE."By Age Stratifier" +define "Age Stratifier 2": + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -175,6 +175,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND33Logic.cql b/input/cql/HIVIND33Logic.cql index 17bd436413b..c2daef9b908 100644 --- a/input/cql/HIVIND33Logic.cql +++ b/input/cql/HIVIND33Logic.cql @@ -130,8 +130,8 @@ define "Denominator": define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" -define "Age Stratifier": - HIE."By Age Stratifier" +define "Age Stratifier 2": + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -141,6 +141,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') \ No newline at end of file diff --git a/input/cql/HIVIND34Logic.cql b/input/cql/HIVIND34Logic.cql index aa99d059c8e..4a74d838f5c 100644 --- a/input/cql/HIVIND34Logic.cql +++ b/input/cql/HIVIND34Logic.cql @@ -142,8 +142,8 @@ define "Denominator": define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" -define "Age Stratifier": - HIE."By Age Stratifier" +define "Age Stratifier 2": + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -153,7 +153,7 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND35Logic.cql b/input/cql/HIVIND35Logic.cql index 9fcf89aa589..63a382fdfd0 100644 --- a/input/cql/HIVIND35Logic.cql +++ b/input/cql/HIVIND35Logic.cql @@ -214,8 +214,8 @@ define "Denominator": define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" -define "Age Stratifier": - HIE."By Age Stratifier" +define "Age Stratifier 6": + HIE."By Age Stratifier 6" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -223,15 +223,21 @@ define "Geographic Region Stratifier": define "patientGroups Stratifier": HIE."patientGroups" +define "Current ART regimen": + HIE."Current ART regimen" + +define "pregnancy stratifier": + HIE."pregnancy stratifier" + +define "Type of treatment-limiting toxicity": + HIE."Type of treatment-limiting toxicity" + define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 6" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') ++ HIE."Current ART regimen".code ++ HIE."Type of treatment-limiting toxicity".code ++ HIE."pregnancy stratifier".code -/* -need to add -* • ART regimen - * • Pregnancy status - * • Type of toxicity (gastrointestinal, skin, peripheral neuropathy, central nervous system, weight gain, hepatic dysfunction, haematological, fatigue, headache, bone dysfunction, metabolic, kidney dysfunction) -*/ \ No newline at end of file diff --git a/input/cql/HIVIND37Logic.cql b/input/cql/HIVIND37Logic.cql index 95354a7c29a..9b78fdc699e 100644 --- a/input/cql/HIVIND37Logic.cql +++ b/input/cql/HIVIND37Logic.cql @@ -92,6 +92,7 @@ define "Initial Population": * Calculation: COUNT of clients with "HIV status"='HIV-positive' AND "Place of delivery" is a 'Health facility' AND "Delivery date" is in the reporting period AND "Date of viral load sample collection" is on "Delivery date" AND "Viral load test result" LESS THAN 1000 copies/mL */ +//health facility birth define "First Health facility": (First(HE."Health facility")) @@ -102,7 +103,7 @@ define "Numerator": and exists( HIE."Viral load test result D.DE387" VL with HE."viral load sample collection" P - such that VL.partOf.references(P) and start of P.performed.toInterval() = start of "First Health facility".performed.toInterval() + such that VL.partOf.references(P) and start of P.performed.toInterval() = start of "First Health facility".effective.toInterval() where VL.value < 1000 ) @@ -121,7 +122,7 @@ define "Denominator": and exists( HIE."Viral load test result D.DE387" VL with HE."viral load sample collection" P - such that VL.partOf.references(P) and start of P.performed.toInterval() = start of "First Health facility".performed.toInterval() + such that VL.partOf.references(P) and start of P.performed.toInterval() = start of "First Health facility".effective.toInterval() ) /* end Populations */ @@ -137,8 +138,10 @@ define "Age Stratifier": define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" +define "Timing of ART initiation": + HIE."Timing of ART initiation" + define "Stratification": HIE."By Age Stratifier 3" + ':' + HIE."By Geographic Region Stratifier" - - // need to add Timing of ART initiation (during pregnancy, on ART at first ANC visit) \ No newline at end of file ++ HIE."Timing of ART initiation".code diff --git a/input/cql/HIVIND38Logic.cql b/input/cql/HIVIND38Logic.cql index bc4ca9c233e..1dc82bf8bb2 100644 --- a/input/cql/HIVIND38Logic.cql +++ b/input/cql/HIVIND38Logic.cql @@ -120,6 +120,16 @@ define "Denominator": * Disaggregators */ +define "Age Stratifier": + HIE."By Age Stratifier 7" define "Geographic Region Stratifier": - HIE."By Geographic Region Stratifier" \ No newline at end of file + HIE."By Geographic Region Stratifier" + +define "EID test number 1 test result": + HIE."EID test number 1 test result" + +define "Stratification": + HIE."By Age Stratifier 7" ++ ':' + HIE."By Geographic Region Stratifier" ++ HIE."EID test number 1 test result".code \ No newline at end of file diff --git a/input/cql/HIVIND39Logic.cql b/input/cql/HIVIND39Logic.cql index 887ae62991f..d0f1b876719 100644 --- a/input/cql/HIVIND39Logic.cql +++ b/input/cql/HIVIND39Logic.cql @@ -51,6 +51,15 @@ * - method: For the numerator: Programme records (for example, PMTCT registers) | a) For the programme-based/service delivery denominator: Programme records, labour and delivery registers | b) For the population-based denominator: Modelling-based estimates (for example, Spectrum AIM). | | Note: The population-based denominator is a proxy measure for the number of infants born to HIV-infected women. | | The recommended reporting period is 12 months. * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - HivInfant + * - HivMother + * - HivChildDelivery + * - HivAntiRetroviralTreatment + * - HivStatus + * - HivOnArt + * */ library HIVIND39Logic @@ -63,6 +72,9 @@ include FHIRHelpers version '4.0.1' include WHOCommon called WCom +include HIVElements called HE +include HIVIndicatorElements called HIE + // Indicator Definition parameter "Measurement Period" Interval default Interval[@2023-01-01, @2023-01-30] @@ -84,8 +96,8 @@ define "Initial Population": */ define "Numerator": - true - + HIE."is HIV-exposed infant or child E.DE112" and + exists(HE."ART start date" d where date from d same day as Patient.birthDate) /** * Denominator @@ -95,8 +107,7 @@ define "Numerator": */ define "Denominator": - true - - + HIE."Has HIV-positive Status" and + HIE."Has Delivery in Health Facility" /* end Populations */ diff --git a/input/cql/HIVIND3Logic.cql b/input/cql/HIVIND3Logic.cql index 3b229eb3c33..274f794d7c3 100644 --- a/input/cql/HIVIND3Logic.cql +++ b/input/cql/HIVIND3Logic.cql @@ -87,6 +87,10 @@ * - method: Individual-level data obtained from programme records. | | If individual-level data are not available, the indicator can be reported using aggregate programme data. Because de-duplication is not possible, individuals prescribed multiple | PrEP products or formulations at different times during the reporting period may be counted multiple times, and the number reported may be greater than the number of unique individuals receiving PrEP during the reporting period. * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - HivPrepTreatment + * - HivPepTreatment */ library HIVIND3Logic @@ -114,11 +118,12 @@ define "Initial Population": /* Numerator Calculation: Count of clients with "Date medications prescribed" within reporting period AND "Medications prescribed"='PrEP for HIV prevention'*/ define "numerator": - HIE."HIV PREP Active" + HIE."PrEP for HIV prevention" and HIE."HIV-negative test result" and + HIE."At elevated risk for HIV acquisition B.DE225" /* * Denominator Calculation: Programme/service provider level: | COUNT of clients with "HIV test date" within reporting period AND "HIV test result"='HIV-negative' AND "At elevated risk for HIV acquisition"=True † | | Population level: *Estimate of the number of people who would benefit from PrEP */ define "denominator": - exists(HIE."Negative HIV test within measurement period") and + HIE."HIV-negative test result" and HIE."At elevated risk for HIV acquisition B.DE225" @@ -157,7 +162,7 @@ define "Stratification": + ':' + HIE."By Age Stratifier 3" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') + + ':' + HIE."setting".code + Combine(HIE.prep_product, ':') + Combine(HIE.prep_experience, ':') + Combine(HIE.prep_dosing, ':') \ No newline at end of file diff --git a/input/cql/HIVIND40Logic.cql b/input/cql/HIVIND40Logic.cql index 0e32bab4a00..65b83c6d3d0 100644 --- a/input/cql/HIVIND40Logic.cql +++ b/input/cql/HIVIND40Logic.cql @@ -67,6 +67,9 @@ include FHIRHelpers version '4.0.1' include WHOCommon called WCom +include HIVElements called HE +include HIVIndicatorElements called HIE + // Indicator Definition parameter "Measurement Period" Interval default Interval[@2023-01-01, @2023-01-30] @@ -87,8 +90,14 @@ define "Initial Population": * Calculation: COUNT of women with "HIV status"='HIV-positive' AND "Delivery date" in the reporting period AND (("On ART"=True at labour and delivery) OR ("On ART"=True during pregnancy, for this pregnancy)) */ +// TODO: figure out how do we indicate this vs. another pregnancy, and this labor/delivery vs. another, and how this relates to measurement period + define "Numerator": - true + HIE."Has HIV-positive Status" and + exists(HIE."Live Birth Delivery" BirthDelivery + where BirthDelivery.effective.toInterval() during "Measurement Period" + ) + /** diff --git a/input/cql/HIVIND45Logic.cql b/input/cql/HIVIND45Logic.cql index 79399fbdbe5..17de5318b74 100644 --- a/input/cql/HIVIND45Logic.cql +++ b/input/cql/HIVIND45Logic.cql @@ -117,7 +117,7 @@ define "Numerator": */ define "Denominator": - HIE."Has HIV-positive Status" and HIE."On ART" and exists(HIE."TB preventive treatment TPT start date in measurement period") + HIE."Has HIV-positive Status" and HIE."On ART" and exists(HIE."TB preventive treatment TPT start date in previous measurement period") /* end Populations */ diff --git a/input/cql/HIVIND46Logic.cql b/input/cql/HIVIND46Logic.cql index 2201988621e..caec60103e4 100644 --- a/input/cql/HIVIND46Logic.cql +++ b/input/cql/HIVIND46Logic.cql @@ -158,10 +158,12 @@ define "Geographic Region Stratifier": define "patientGroups Stratifier": HIE."patientGroups" +define "pregnancy stratifier": + HIE."pregnancy stratifier" + define "Stratification": HIE."By Administrative Gender Stratifier".code + ':' + HIE."By Age Stratifier" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') - -//add Pregnant or breastfeeding women \ No newline at end of file ++ HIE."pregnancy stratifier".code diff --git a/input/cql/HIVIND47Logic.cql b/input/cql/HIVIND47Logic.cql index 5372e2ddc3a..cbe1f1fb464 100644 --- a/input/cql/HIVIND47Logic.cql +++ b/input/cql/HIVIND47Logic.cql @@ -138,10 +138,12 @@ define "Geographic Region Stratifier": define "patientGroups Stratifier": HIE."patientGroups" +define "pregnancy stratifier": + HIE."pregnancy stratifier" + define "Stratification": HIE."By Administrative Gender Stratifier".code + ':' + HIE."By Age Stratifier" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') - -//add Pregnant or breastfeeding women \ No newline at end of file ++ HIE."pregnancy stratifier".code diff --git a/input/cql/HIVIND48Logic.cql b/input/cql/HIVIND48Logic.cql index 5c8ab070be2..a405a6afc36 100644 --- a/input/cql/HIVIND48Logic.cql +++ b/input/cql/HIVIND48Logic.cql @@ -118,14 +118,14 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" diff --git a/input/cql/HIVIND49Logic.cql b/input/cql/HIVIND49Logic.cql index 59fc10a7434..74bd80524d5 100644 --- a/input/cql/HIVIND49Logic.cql +++ b/input/cql/HIVIND49Logic.cql @@ -122,12 +122,12 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" \ No newline at end of file diff --git a/input/cql/HIVIND4Logic.cql b/input/cql/HIVIND4Logic.cql index 5df89d315ed..642166bd5b2 100644 --- a/input/cql/HIVIND4Logic.cql +++ b/input/cql/HIVIND4Logic.cql @@ -68,6 +68,10 @@ * - method: Individual-level data obtained from programme records. Either the volume of PrEP prescribed or the volume of product dispensed can be used if this is available, for example from pharmacy data. | | The total volume of PrEP product prescribed (or dispensed) can then be used to derive the total number of days (or months/years) of product use based on the duration of HIV prevention provided by each unit of product. Such an indicator could be described, for example, as | the number of person-years of PrEP protection provided. This measure can then be used to examine the level of PrEP availability to monitor trends and for modelling the impact of PrEP at the population level. It can also be used to derive the following additional indicators useful for understanding the quantity of PrEP product available relative to need: | | a) numerator:total number of days available for product use; denominator: total number of PrEP recipients | b) numerator:total number of days available for product use; denominator: estimates of the total number of people who would benefit from PrEP * * Suggested Scoring Method: continuous-variable | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cv-measure-cqfm + * + * Profiles: + * - HivPrepTreatment + * - HivPepTreatment (4 types) */ library HIVIND4Logic @@ -139,5 +143,5 @@ define "Stratification": + ':' + HIE."By Age Stratifier 3" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') + + ':' + HIE."setting".code + Combine(HIE.prep_product, ':') diff --git a/input/cql/HIVIND50Logic.cql b/input/cql/HIVIND50Logic.cql index e97867593e5..f6e44616df3 100644 --- a/input/cql/HIVIND50Logic.cql +++ b/input/cql/HIVIND50Logic.cql @@ -139,12 +139,12 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" diff --git a/input/cql/HIVIND51Logic.cql b/input/cql/HIVIND51Logic.cql index 158c9caf3f1..31fa4f8276a 100644 --- a/input/cql/HIVIND51Logic.cql +++ b/input/cql/HIVIND51Logic.cql @@ -147,12 +147,12 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" \ No newline at end of file diff --git a/input/cql/HIVIND52Logic.cql b/input/cql/HIVIND52Logic.cql index b773390a043..c838ab4db9c 100644 --- a/input/cql/HIVIND52Logic.cql +++ b/input/cql/HIVIND52Logic.cql @@ -151,12 +151,12 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 2" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 2" + ':' + HIE."By Geographic Region Stratifier" \ No newline at end of file diff --git a/input/cql/HIVIND53Logic.cql b/input/cql/HIVIND53Logic.cql index 0f7f887a780..62fa40d2de0 100644 --- a/input/cql/HIVIND53Logic.cql +++ b/input/cql/HIVIND53Logic.cql @@ -84,10 +84,11 @@ parameter "Measurement Period" Interval default Interval[@2023-01-01, @202 context Patient /* Populations */ +//use the last ART presciption authored before end of measurement period define "Last ART prescribed before end of measurement period": Last([MedicationRequest: HCC."ART medication"] MR where (MR.authoredOn.toInterval() before end of "Measurement Period") - and Common.MedicationRequestPeriod(MR) overlaps "Measurement Period" + and MR.MedicationRequestPeriod() overlaps "Measurement Period" sort by start of authoredOn.toInterval()) @@ -108,7 +109,7 @@ define "Initial Population": define "Numerator": HIE."Has HIV-positive Status" and HIE."On ART H.DE47" - and (duration in months of Common.MedicationRequestPeriod("Last ART prescribed before end of measurement period") >= 3 months) + and (duration in months of "Last ART prescribed before end of measurement period".MedicationRequestPeriod() >= 3 months) /** @@ -133,7 +134,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 8" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -143,6 +144,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 8" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') \ No newline at end of file diff --git a/input/cql/HIVIND54Logic.cql b/input/cql/HIVIND54Logic.cql index 70b7115dc05..14eb1e44f4e 100644 --- a/input/cql/HIVIND54Logic.cql +++ b/input/cql/HIVIND54Logic.cql @@ -137,7 +137,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 8" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -145,10 +145,13 @@ define "Geographic Region Stratifier": define "patientGroups Stratifier": HIE."patientGroups" +define "DSD ART models": + HIE."DSD ART models" + define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 8" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') ++ HIE."DSD ART models".code -//need DSD group \ No newline at end of file diff --git a/input/cql/HIVIND55Logic.cql b/input/cql/HIVIND55Logic.cql index 1deee2352c8..635d21fea20 100644 --- a/input/cql/HIVIND55Logic.cql +++ b/input/cql/HIVIND55Logic.cql @@ -137,7 +137,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 8" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -145,10 +145,12 @@ define "Geographic Region Stratifier": define "patientGroups Stratifier": HIE."patientGroups" +define "DSD ART models": + HIE."DSD ART models" + define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 8" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') - -//need DSD group \ No newline at end of file ++ HIE."DSD ART models".code diff --git a/input/cql/HIVIND56Logic.cql b/input/cql/HIVIND56Logic.cql index 24bb914c8a5..231b6787a68 100644 --- a/input/cql/HIVIND56Logic.cql +++ b/input/cql/HIVIND56Logic.cql @@ -146,7 +146,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 8" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -156,6 +156,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 8" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND57Logic.cql b/input/cql/HIVIND57Logic.cql index 10d525c5095..fe6a33be626 100644 --- a/input/cql/HIVIND57Logic.cql +++ b/input/cql/HIVIND57Logic.cql @@ -168,7 +168,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 8" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -178,6 +178,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 8" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND58Logic.cql b/input/cql/HIVIND58Logic.cql index 65735146ec9..7e4f2f7ecc7 100644 --- a/input/cql/HIVIND58Logic.cql +++ b/input/cql/HIVIND58Logic.cql @@ -130,7 +130,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -146,7 +146,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + Combine(HIE."HIV prevention intervention", ':') diff --git a/input/cql/HIVIND59Logic.cql b/input/cql/HIVIND59Logic.cql index 4561bbad097..16b7c17511f 100644 --- a/input/cql/HIVIND59Logic.cql +++ b/input/cql/HIVIND59Logic.cql @@ -125,7 +125,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -135,6 +135,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND5Logic.cql b/input/cql/HIVIND5Logic.cql index b06130f4207..ed3e2e3c515 100644 --- a/input/cql/HIVIND5Logic.cql +++ b/input/cql/HIVIND5Logic.cql @@ -87,9 +87,7 @@ parameter "Measurement Period" Interval default Interval[@2023-01-01, @202 context Patient define "Measure Population": - exists(HE."PEP Prescription" MR - where MR.authoredOn before end of "Measurement Period" - and MR.authoredOn after start of "Measurement Period") + HIE."PEP for HIV prevention" /* * As defined by Member States @@ -136,6 +134,6 @@ define "Stratification": + ':' + HIE."By Age Stratifier 3" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') + + ':' + HIE."setting".code + Combine(HIE.prep_product, ':') + Combine(HIE."hiv_exposure_type", ':') diff --git a/input/cql/HIVIND60Logic.cql b/input/cql/HIVIND60Logic.cql index ce19b1f1cf2..12e356b6ab9 100644 --- a/input/cql/HIVIND60Logic.cql +++ b/input/cql/HIVIND60Logic.cql @@ -109,7 +109,7 @@ define "Denominator": define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -118,6 +118,6 @@ define "HIV Status": HIE."HIV Status Stratifier" define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + ':' + HIE."HIV Status Stratifier".code \ No newline at end of file diff --git a/input/cql/HIVIND61Logic.cql b/input/cql/HIVIND61Logic.cql index 634495c9c87..48dcfa9b46f 100644 --- a/input/cql/HIVIND61Logic.cql +++ b/input/cql/HIVIND61Logic.cql @@ -109,7 +109,7 @@ define "Denominator": define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -118,6 +118,6 @@ define "HIV Status": HIE."HIV Status Stratifier" define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + ':' + HIE."HIV Status Stratifier".code \ No newline at end of file diff --git a/input/cql/HIVIND62Logic.cql b/input/cql/HIVIND62Logic.cql index e2adb5c48e5..292bef9f388 100644 --- a/input/cql/HIVIND62Logic.cql +++ b/input/cql/HIVIND62Logic.cql @@ -149,7 +149,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -165,7 +165,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + Combine(HIE."HIV prevention intervention", ':') diff --git a/input/cql/HIVIND63Logic.cql b/input/cql/HIVIND63Logic.cql index 79f2892474c..aebb64c6ef7 100644 --- a/input/cql/HIVIND63Logic.cql +++ b/input/cql/HIVIND63Logic.cql @@ -137,7 +137,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -147,7 +147,7 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND64Logic.cql b/input/cql/HIVIND64Logic.cql index 7b91b6357ce..489cbdacd2f 100644 --- a/input/cql/HIVIND64Logic.cql +++ b/input/cql/HIVIND64Logic.cql @@ -128,7 +128,7 @@ define "Denominator": define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -137,6 +137,6 @@ define "HIV Status": HIE."HIV Status Stratifier" define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + ':' + HIE."HIV Status Stratifier".code \ No newline at end of file diff --git a/input/cql/HIVIND65Logic.cql b/input/cql/HIVIND65Logic.cql index 691bc846ad2..a7c59da3331 100644 --- a/input/cql/HIVIND65Logic.cql +++ b/input/cql/HIVIND65Logic.cql @@ -121,7 +121,7 @@ define "Denominator": define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -130,6 +130,6 @@ define "HIV Status": HIE."HIV Status Stratifier" define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + ':' + HIE."HIV Status Stratifier".code diff --git a/input/cql/HIVIND66Logic.cql b/input/cql/HIVIND66Logic.cql index d9702ad822c..8194ab3cc9c 100644 --- a/input/cql/HIVIND66Logic.cql +++ b/input/cql/HIVIND66Logic.cql @@ -151,7 +151,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -164,7 +164,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + ':' + HIE."HIV Status Stratifier".code diff --git a/input/cql/HIVIND67Logic.cql b/input/cql/HIVIND67Logic.cql index f64b4e3d848..2e407529800 100644 --- a/input/cql/HIVIND67Logic.cql +++ b/input/cql/HIVIND67Logic.cql @@ -144,7 +144,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -154,6 +154,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') \ No newline at end of file diff --git a/input/cql/HIVIND68Logic.cql b/input/cql/HIVIND68Logic.cql index fd39694ee2f..12f4a8ccb51 100644 --- a/input/cql/HIVIND68Logic.cql +++ b/input/cql/HIVIND68Logic.cql @@ -129,7 +129,7 @@ define "Denominator": define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -138,6 +138,6 @@ define "HIV Status": HIE."HIV Status Stratifier" define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + ':' + HIE."HIV Status Stratifier".code \ No newline at end of file diff --git a/input/cql/HIVIND69Logic.cql b/input/cql/HIVIND69Logic.cql index 25e3bd14f4f..b6217e29888 100644 --- a/input/cql/HIVIND69Logic.cql +++ b/input/cql/HIVIND69Logic.cql @@ -125,7 +125,7 @@ define "Denominator": define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -134,6 +134,6 @@ define "HIV Status": HIE."HIV Status Stratifier" define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + ':' + HIE."HIV Status Stratifier".code \ No newline at end of file diff --git a/input/cql/HIVIND6Logic.cql b/input/cql/HIVIND6Logic.cql index e50bd8c8297..309c3661a15 100644 --- a/input/cql/HIVIND6Logic.cql +++ b/input/cql/HIVIND6Logic.cql @@ -95,15 +95,10 @@ define "Initial Population": define "numerator": - exists(HIE."PEP Prescribed before start of Measurement Period and Completed" MS - where (MS.effective ends during "Measurement Period") - ) - + HIE."PEP for HIV prevention" and HIE."Date client completes PEP course" define "denominator": - exists(HIE."PEP Prescribed during Measurement Period and Completed" MS - where not (MS.effective ends after end of "Measurement Period") - ) + HIE."PEP for HIV prevention" /* * Disaggregators @@ -137,7 +132,7 @@ define "Stratification": + ':' + HIE."By Age Stratifier 3" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') + + ':' + HIE."setting".code + Combine(HIE.prep_product, ':') + Combine(HIE."hiv_exposure_type", ':') diff --git a/input/cql/HIVIND70Logic.cql b/input/cql/HIVIND70Logic.cql index 226fa5f45d4..cbe0703e4c5 100644 --- a/input/cql/HIVIND70Logic.cql +++ b/input/cql/HIVIND70Logic.cql @@ -138,8 +138,8 @@ define "Initial Population": */ define "Numerator": - HIE."Gonorrhoea test result B.DE256" - and HIE."Date accessed HIV prevention intervention" + exists(HIE."Gonorrhoea test result B.DE256") + and exists(HIE."Date accessed HIV prevention intervention") /** @@ -150,7 +150,7 @@ define "Numerator": */ define "Denominator": - HIE."Date accessed HIV prevention intervention" + exists(HIE."Date accessed HIV prevention intervention") /* end Populations */ @@ -163,7 +163,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -177,12 +177,18 @@ define "HIV prevention intervention": define "HIV Status": HIE."HIV Status Stratifier" +define "Neisseria gonorrhoeae test type B.DE276": + HIE."Neisseria gonorrhoeae test type B.DE276" + +define "Type of specimen B.DE261": + HIE."Type of specimen B.DE261" + define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + Combine(HIE."HIV prevention intervention", ':') + ':' + HIE."HIV Status Stratifier".code - -//need to add Diagnostic test used and anatomic site sampled \ No newline at end of file ++ ':' + HIE."Neisseria gonorrhoeae test type B.DE276".code ++ ':' + HIE."Type of specimen B.DE261".code diff --git a/input/cql/HIVIND71Logic.cql b/input/cql/HIVIND71Logic.cql index 59704556fd4..2fdafbecf88 100644 --- a/input/cql/HIVIND71Logic.cql +++ b/input/cql/HIVIND71Logic.cql @@ -133,7 +133,7 @@ define "Initial Population": define "Numerator": HIE."Has HIV-positive Status" and - HIE."Gonorrhoea test result B.DE256" + exists(HIE."Gonorrhoea test result B.DE256") /** @@ -145,7 +145,7 @@ define "Numerator": define "Denominator": HIE."Has HIV-positive Status" and - HIE."Visit date" + exists(HIE."Visit date") /* end Populations */ @@ -158,7 +158,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -166,11 +166,16 @@ define "Geographic Region Stratifier": define "patientGroups Stratifier": HIE."patientGroups" +define "Neisseria gonorrhoeae test type B.DE276": + HIE."Neisseria gonorrhoeae test type B.DE276" + +define "Type of specimen B.DE261": + HIE."Type of specimen B.DE261" + define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') - - -//need to add Diagnostic test used and anatomic site sampled \ No newline at end of file ++ ':' + HIE."Neisseria gonorrhoeae test type B.DE276".code ++ ':' + HIE."Type of specimen B.DE261".code diff --git a/input/cql/HIVIND72Logic.cql b/input/cql/HIVIND72Logic.cql index 71d78af000c..57aaff5c93c 100644 --- a/input/cql/HIVIND72Logic.cql +++ b/input/cql/HIVIND72Logic.cql @@ -149,7 +149,7 @@ define "Initial Population": */ define "Numerator": - exists(HIE."Positive B.DE257") + HIE."Positive B.DE257" /** @@ -160,11 +160,9 @@ define "Numerator": */ define "Denominator": - exists(HE."Gonorrhoea test date B.DE255" d - where d during "Measurement Period" - and exists (HE."Date accessed HIV prevention intervention" t where t = d)) + exists(HIE."Gonorrhoea test date B.DE255" d + where exists(HE."Date accessed HIV prevention intervention" t where t = d)) - /* end Populations */ /* @@ -175,7 +173,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -189,12 +187,18 @@ define "HIV prevention intervention": define "HIV Status": HIE."HIV Status Stratifier" +define "Neisseria gonorrhoeae test type B.DE276": + HIE."Neisseria gonorrhoeae test type B.DE276" + +define "Type of specimen B.DE261": + HIE."Type of specimen B.DE261" + define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + Combine(HIE."HIV prevention intervention", ':') + ':' + HIE."HIV Status Stratifier".code - -//need to add Diagnostic test used and anatomic site sampled \ No newline at end of file ++ ':' + HIE."Neisseria gonorrhoeae test type B.DE276".code ++ ':' + HIE."Type of specimen B.DE261".code \ No newline at end of file diff --git a/input/cql/HIVIND73Logic.cql b/input/cql/HIVIND73Logic.cql index 9e9dd396fd5..e1a77fc9c25 100644 --- a/input/cql/HIVIND73Logic.cql +++ b/input/cql/HIVIND73Logic.cql @@ -139,7 +139,7 @@ define "Initial Population": define "Numerator": HIE."Has HIV-positive Status" and - exists(HIE."Positive B.DE257" G) + HIE."Positive B.DE257" /** * Denominator @@ -150,7 +150,7 @@ define "Numerator": define "Denominator": HIE."Has HIV-positive Status" and - HIE."Gonorrhoea test result B.DE256": + exists(HIE."Gonorrhoea test result B.DE256") /* end Populations */ @@ -163,7 +163,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -171,11 +171,16 @@ define "Geographic Region Stratifier": define "patientGroups Stratifier": HIE."patientGroups" +define "Neisseria gonorrhoeae test type B.DE276": + HIE."Neisseria gonorrhoeae test type B.DE276" + +define "Type of specimen B.DE261": + HIE."Type of specimen B.DE261" + define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') - - -//need to add Diagnostic test used and anatomic site sampled \ No newline at end of file ++ ':' + HIE."Neisseria gonorrhoeae test type B.DE276".code ++ ':' + HIE."Type of specimen B.DE261".code \ No newline at end of file diff --git a/input/cql/HIVIND74Logic.cql b/input/cql/HIVIND74Logic.cql index 09e16806aa1..894dcf7a087 100644 --- a/input/cql/HIVIND74Logic.cql +++ b/input/cql/HIVIND74Logic.cql @@ -152,7 +152,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -162,6 +162,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') \ No newline at end of file diff --git a/input/cql/HIVIND75Logic.cql b/input/cql/HIVIND75Logic.cql index 16d44a1da3a..22000e8e2ec 100644 --- a/input/cql/HIVIND75Logic.cql +++ b/input/cql/HIVIND75Logic.cql @@ -116,8 +116,10 @@ define "Initial Population": */ define "Numerator": -HIE."Has HIV-positive Status" - and HIE."Positive B.DE257" +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" @@ -130,8 +132,10 @@ HIE."Has HIV-positive Status" */ define "Denominator": - HIE."Has HIV-positive Status" - and HIE."Positive B.DE257" +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 */ @@ -144,7 +148,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -154,6 +158,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + 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 d433ed35eb6..1650c62b6d4 100644 --- a/input/cql/HIVIND76Logic.cql +++ b/input/cql/HIVIND76Logic.cql @@ -122,9 +122,10 @@ define "Initial Population": */ define "Numerator": - 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())) + exists(HIE."Syndrome/STI diagnosed B.DE226 Condition" C) + and exists(HIE."Syndrome/STI diagnosed B.DE226 Condition" C + where exists (HE."Date accessed HIV prevention intervention" t where t = start of C.prevalenceInterval()) + ) /** @@ -135,7 +136,7 @@ define "Numerator": */ define "Denominator": - HIE."Date accessed HIV prevention intervention" + exists(HIE."Date accessed HIV prevention intervention") /* end Populations */ @@ -148,7 +149,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -168,7 +169,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + Combine(HIE."HIV prevention intervention", ':') diff --git a/input/cql/HIVIND77Logic.cql b/input/cql/HIVIND77Logic.cql index 303b179286b..7a754fdcf94 100644 --- a/input/cql/HIVIND77Logic.cql +++ b/input/cql/HIVIND77Logic.cql @@ -116,9 +116,9 @@ define "Initial Population": define "Numerator": 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())) + and exists(HIE."Syndrome/STI diagnosed B.DE226 Condition" C + where exists (HE."Visit date SRV.DE15" t where start of t.toInterval() = start of C.prevalenceInterval()) + ) /** @@ -144,7 +144,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -163,7 +163,7 @@ define "HIV prevention intervention": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + Combine(HIE."HIV prevention intervention", ':') diff --git a/input/cql/HIVIND78Logic.cql b/input/cql/HIVIND78Logic.cql index d8a933cc5c3..f84ca9dc030 100644 --- a/input/cql/HIVIND78Logic.cql +++ b/input/cql/HIVIND78Logic.cql @@ -122,10 +122,13 @@ define "Initial Population": */ define "Numerator": - 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 - + Count( + (HIE."Syndrome/STI diagnosed B.DE226 Condition" C + where exists ( + HE."Date accessed HIV prevention intervention" t + where t = start of C.prevalenceInterval() + )) + ) > 1 /** * Denominator @@ -135,9 +138,7 @@ define "Numerator": */ define "Denominator": - 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())) + exists(HIE."Date accessed HIV prevention intervention") /* end Populations */ @@ -151,7 +152,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -171,7 +172,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + Combine(HIE."HIV prevention intervention", ':') diff --git a/input/cql/HIVIND79Logic.cql b/input/cql/HIVIND79Logic.cql index ba9d9887758..b77c7a23dea 100644 --- a/input/cql/HIVIND79Logic.cql +++ b/input/cql/HIVIND79Logic.cql @@ -82,6 +82,10 @@ THE DEFINITION IS INCONSISTENT WITH THE CONTEXT - no mention of HIV prevention services. + * Profiles: + * HivHtsVisit + * HivStatus + * HivSyndromeStiDiagnosisCondition */ library HIVIND79Logic @@ -118,10 +122,14 @@ define "Initial Population": */ define "Numerator": -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 + HIE."Has HIV-positive Status" + and Count( + (HIE."Syndrome/STI diagnosed B.DE226 Condition" C + where exists ( + HE."Visit date SRV.DE15" t + where start of t.toInterval() = start of C.prevalenceInterval() + )) + ) > 1 /** @@ -147,7 +155,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -162,7 +170,7 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + Combine(HIE."STI syndrome", ':') diff --git a/input/cql/HIVIND7Logic.cql b/input/cql/HIVIND7Logic.cql index 525d8b747b6..be8cd566ae2 100644 --- a/input/cql/HIVIND7Logic.cql +++ b/input/cql/HIVIND7Logic.cql @@ -104,16 +104,13 @@ define "Initial Population": define "numerator": - exists(HIE."HIV Test Positive After PEP Prescribed during Measurement Period" O - where (O.issued after start of "Measurement Period") - ) + HIE."PEP for HIV prevention" and + exists (HE."HIV-positive test result" O + where start of O.effective.toInterval() in Interval[start of First(HE."PEP for HIV prevention").MedicationRequestPeriod(),end of "Measurement Period" + 3 months]) define "denominator": - exists(HE."PEP Prescription" MR - where (MR.authoredOn after start of "Measurement Period" - and MR.authoredOn before end of "Measurement Period") - ) + HIE."PEP for HIV prevention" @@ -151,6 +148,6 @@ define "Stratification": + ':' + HIE."By Age Stratifier 3" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') + + ':' + HIE."setting".code + Combine(HIE.prep_product, ':') + Combine(HIE."hiv_exposure_type", ':') diff --git a/input/cql/HIVIND80Logic.cql b/input/cql/HIVIND80Logic.cql index 42fd005e53a..98db027a467 100644 --- a/input/cql/HIVIND80Logic.cql +++ b/input/cql/HIVIND80Logic.cql @@ -62,6 +62,11 @@ * - method: Patient monitoring tools (electronic or paper), for example, hepatitis and HIV testing service records, lab registers, logbooks and reporting forms at facility and community levels, EMR/electronic information systems * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - HivStatus + * - HivHbsAgTest + * - HivPreventionIntervention */ library HIVIND80Logic @@ -99,7 +104,7 @@ define "Initial Population": define "Numerator": HIE."HBsAg test date D.DE161" and - HIE."Date accessed HIV prevention intervention" + exists(HIE."Date accessed HIV prevention intervention") /** * Denominator @@ -109,7 +114,7 @@ define "Numerator": */ define "Denominator": - HIE."Date accessed HIV prevention intervention" + exists(HIE."Date accessed HIV prevention intervention") /* end Populations */ @@ -123,7 +128,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -137,7 +142,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + ':' + HIE."HIV Status Stratifier".code diff --git a/input/cql/HIVIND81Logic.cql b/input/cql/HIVIND81Logic.cql index 369cce3824e..362135b0930 100644 --- a/input/cql/HIVIND81Logic.cql +++ b/input/cql/HIVIND81Logic.cql @@ -64,6 +64,11 @@ * - method: Patient monitoring tools (electronic or paper), for example, hepatitis and HIV testing service records, lab registers, logbooks and reporting forms at facility and community levels, EMR/electronic information systems * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - HivStatus + * - HivHtsVisit + * - HivHbsAgTest */ library HIVIND81Logic @@ -126,7 +131,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -140,6 +145,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND82Logic.cql b/input/cql/HIVIND82Logic.cql index 2c08ae83f79..25180dca6f9 100644 --- a/input/cql/HIVIND82Logic.cql +++ b/input/cql/HIVIND82Logic.cql @@ -61,6 +61,12 @@ * - method: Patient monitoring tools (electronic or paper), for example, hepatitis and HIV testing service records, lab registers, logbooks and reporting forms at facility and community levels, EMR/electronic information systems * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - HivStatus + * - HivPregnancyCondition + * - HivHbsAgTest + * - HivAncEncounter */ library HIVIND82Logic @@ -121,7 +127,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -135,7 +141,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + ':' + HIE."HIV Status Stratifier".code diff --git a/input/cql/HIVIND83Logic.cql b/input/cql/HIVIND83Logic.cql index 643e1b33bac..bf1f83d86db 100644 --- a/input/cql/HIVIND83Logic.cql +++ b/input/cql/HIVIND83Logic.cql @@ -62,6 +62,11 @@ * - method: Patient monitoring tools (electronic or paper), for example, hepatitis and HIV testing service records, lab registers, logbooks and reporting forms at facility and community levels, EMR/electronic information systems * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - HivStatus + * - HivHcvTest + * - HivPreventionIntervention */ library HIVIND83Logic @@ -99,9 +104,8 @@ define "Initial Population": */ define "Numerator": - HIE."HCV test date D.DE169" and - HIE."Date accessed HIV prevention intervention" - + exists(HIE."HCV test date D.DE169") and + exists(HIE."Date accessed HIV prevention intervention") /** * Denominator @@ -111,7 +115,7 @@ define "Numerator": */ define "Denominator": - HIE."Date accessed HIV prevention intervention" + exists(HIE."Date accessed HIV prevention intervention") /* end Populations */ @@ -125,7 +129,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -139,7 +143,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + ':' + HIE."HIV Status Stratifier".code diff --git a/input/cql/HIVIND84Logic.cql b/input/cql/HIVIND84Logic.cql index 7e176b4d48e..539ba279a14 100644 --- a/input/cql/HIVIND84Logic.cql +++ b/input/cql/HIVIND84Logic.cql @@ -63,6 +63,11 @@ * - method: Patient monitoring tools (electronic or paper), for example, hepatitis and HIV testing service records, lab registers, logbooks and reporting forms at facility and community levels, EMR/electronic information systems * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - HivStatus + * - HivHcvTest + * - HivHtsVisit */ library HIVIND84Logic @@ -99,7 +104,7 @@ define "Initial Population": */ define "Numerator": - HIE."Has HIV-positive Status" and HIE."HCV test date D.DE169" + HIE."Has HIV-positive Status" and exists(HIE."HCV test date D.DE169") /** @@ -124,7 +129,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -138,6 +143,6 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND85Logic.cql b/input/cql/HIVIND85Logic.cql index ac8b290d94e..43c9b18ca8f 100644 --- a/input/cql/HIVIND85Logic.cql +++ b/input/cql/HIVIND85Logic.cql @@ -71,6 +71,10 @@ * - method: Patient monitoring tools (electronic or paper), for example, hepatitis and HIV testing service records, lab registers, logbooks and reporting forms at facility and community levels, EMR/electronic information systems * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - HivStatus + * - HivHbsAgTest */ library HIVIND85Logic @@ -109,7 +113,8 @@ define "Initial Population": define "Numerator": 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") + 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())) /** @@ -135,7 +140,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -149,7 +154,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + ':' + HIE."HIV Status Stratifier".code diff --git a/input/cql/HIVIND86Logic.cql b/input/cql/HIVIND86Logic.cql index 2e5b098d0d5..aa03315b9ca 100644 --- a/input/cql/HIVIND86Logic.cql +++ b/input/cql/HIVIND86Logic.cql @@ -70,6 +70,10 @@ * - method: Patient monitoring tools (electronic or paper), for example, hepatitis and HIV testing service records, lab registers, logbooks and reporting forms at facility and community levels, EMR/electronic information systems * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * + * Profiles: + * - HivStatus + * - HivHbsAgTest */ library HIVIND86Logic @@ -133,7 +137,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -147,7 +151,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + ':' + HIE."HIV Status Stratifier".code diff --git a/input/cql/HIVIND87Logic.cql b/input/cql/HIVIND87Logic.cql index 6945bb2a793..2e9a80b594a 100644 --- a/input/cql/HIVIND87Logic.cql +++ b/input/cql/HIVIND87Logic.cql @@ -69,6 +69,10 @@ * - method: Patient monitoring tools (electronic or paper), for example, hepatitis and HIV testing service records, lab registers, logbooks and reporting forms at facility and community levels, EMR/electronic information systems * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + + * Profiles: + * - HivStatus + * - HivHbsAgTest */ library HIVIND87Logic @@ -138,7 +142,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -152,7 +156,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + ':' + HIE."HIV Status Stratifier".code diff --git a/input/cql/HIVIND88Logic.cql b/input/cql/HIVIND88Logic.cql index c0d4a133002..5223231647a 100644 --- a/input/cql/HIVIND88Logic.cql +++ b/input/cql/HIVIND88Logic.cql @@ -75,6 +75,7 @@ /* * Profiles: + * - HivStatus * - HivHcvTest * - HivPreventionIntervention */ @@ -139,7 +140,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -153,7 +154,7 @@ define "HIV Status": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') + ':' + HIE."HIV Status Stratifier".code diff --git a/input/cql/HIVIND89Logic.cql b/input/cql/HIVIND89Logic.cql index 56287e9ac5a..b8a65cf1a25 100644 --- a/input/cql/HIVIND89Logic.cql +++ b/input/cql/HIVIND89Logic.cql @@ -73,6 +73,7 @@ /* * Profiles: + * - HivStatus * - HivHcvTest */ @@ -122,7 +123,7 @@ define "Numerator": */ define "Denominator": - HIE."Has HIV-positive Status" and HIE."HCV test date D.DE169" + HIE."Has HIV-positive Status" and exists(HIE."HCV test date D.DE169") /* end Populations */ @@ -135,7 +136,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -146,7 +147,7 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND8Logic.cql b/input/cql/HIVIND8Logic.cql index 38cf333cc43..14c31dad439 100644 --- a/input/cql/HIVIND8Logic.cql +++ b/input/cql/HIVIND8Logic.cql @@ -82,13 +82,11 @@ define "Initial Population": define "numerator": - exists(HE."Needle Syringe Dispensed" DUS - where (DUS.timing during "Measurement Period") - ) + HIE."People who inject drugs" and HIE."Date injecting equipment provided" define "denominator": - exists(HIE."People who inject drugs") + HIE."People who inject drugs" /* * Disaggregators @@ -98,7 +96,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 3" + HIE."By Age Stratifier 4" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -113,7 +111,7 @@ define "Setting": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier" + + ':' + HIE."By Age Stratifier 4" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') -+ Combine(HIE.setting, ':') \ No newline at end of file + + ':' + HIE."setting".code \ No newline at end of file diff --git a/input/cql/HIVIND90Logic.cql b/input/cql/HIVIND90Logic.cql index 01e021f3d52..a53624253d0 100644 --- a/input/cql/HIVIND90Logic.cql +++ b/input/cql/HIVIND90Logic.cql @@ -72,8 +72,15 @@ * - method: Patient monitoring tools (electronic or paper), EMR/electronic information systems * * Suggested Scoring Method: proportion | http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/proportion-measure-cqfm + * Profiles: + * - HivHbsAgTest + * - HivHbsAgTestResult + * - HivStatus + */ + + library HIVIND90Logic // Included Libraries @@ -143,7 +150,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -154,7 +161,7 @@ define "patientGroups Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + Combine(HIE.patientGroups, ':') diff --git a/input/cql/HIVIND91Logic.cql b/input/cql/HIVIND91Logic.cql index 14ad0f0e374..f20e6f26578 100644 --- a/input/cql/HIVIND91Logic.cql +++ b/input/cql/HIVIND91Logic.cql @@ -118,9 +118,7 @@ define "Initial Population": define "Numerator": 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 + exists(HIE."Positive D.DE171" O where O.effective.toInterval() during "Measurement Period") and HIE."HCV treatment start date" @@ -134,9 +132,7 @@ define "Numerator": define "Denominator": 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") + exists(HIE."Positive D.DE171" O where O.effective.toInterval() during "Measurement Period") /* end Populations */ @@ -150,7 +146,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -164,7 +160,7 @@ define "By HCV medicine type Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + 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 b6e88c66f9b..f7b887afc4d 100644 --- a/input/cql/HIVIND92Logic.cql +++ b/input/cql/HIVIND92Logic.cql @@ -116,7 +116,7 @@ define "Initial Population": define "Numerator": HIE."Has HIV-positive Status" and - exists(HIE."HCV treatment completion date" d) and + HIE."HCV treatment completion date" and exists( HE."Not detected D.DE181" O with HE."HCV viral load test date D.DE178" P @@ -134,12 +134,8 @@ define "Numerator": define "Denominator": 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 + 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) ) @@ -156,7 +152,7 @@ define "Administrative Gender Stratifier": HIE."By Administrative Gender Stratifier" define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -170,7 +166,7 @@ define "By HCV medicine type Stratifier": define "Stratification": HIE."By Administrative Gender Stratifier".code - + ':' + HIE."By Age Stratifier 2" + + ':' + HIE."By Age Stratifier 9" + ':' + 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 182d8d412b5..697f95a7996 100644 --- a/input/cql/HIVIND93Logic.cql +++ b/input/cql/HIVIND93Logic.cql @@ -102,7 +102,7 @@ define function "Measure Observation"(Patient "Patient"): */ define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -112,7 +112,7 @@ define "Lifetime screening test number Statifier": define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + ':' + (HIE."Lifetime screening test number Value") diff --git a/input/cql/HIVIND94Logic.cql b/input/cql/HIVIND94Logic.cql index fa476423570..306f52fd4c4 100644 --- a/input/cql/HIVIND94Logic.cql +++ b/input/cql/HIVIND94Logic.cql @@ -92,10 +92,9 @@ define "Initial Population": define "Numerator": 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)) + exists(HE."Positive for cervical precancer lesions" O + where O.effective.toInterval() during "Measurement Period" + and exists(HE."Date of treatment for cervical precancer lesions" T where months between start of T.performed.toInterval() and start of O.effective.toInterval() < 6 months)) /** @@ -107,9 +106,8 @@ define "Numerator": define "Denominator": 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") + exists(HE."Positive for cervical precancer lesions" O + where O.effective.toInterval() during "Measurement Period") /* end Populations */ @@ -119,7 +117,7 @@ define "Denominator": */ define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -128,7 +126,7 @@ define "Geographic Region Stratifier": define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + 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 94972b50599..f0eab29d8f7 100644 --- a/input/cql/HIVIND95Logic.cql +++ b/input/cql/HIVIND95Logic.cql @@ -103,9 +103,9 @@ define "Initial Population": define "Numerator": HIE."Has HIV-positive Status" and - HIE."Invasive cervical cancer" C and - exists HIE."Invasive cervical cancer treatment method" P - where P.performed after start of C.prevalenceInterval() + exists(HE."Invasive cervical cancer" C + where exists (HE."Invasive cervical cancer treatment method" P + where P.performed.toInterval() after start of C.prevalenceInterval())) /** * Denominator @@ -117,7 +117,7 @@ define "Numerator": define "Denominator": HIE."Has HIV-positive Status" and - HIE."Invasive cervical cancer" + exists HIE."Invasive cervical cancer" /* end Populations */ @@ -127,7 +127,7 @@ define "Denominator": */ define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -135,10 +135,14 @@ define "Geographic Region Stratifier": define "Invasive cervical cancer treatment episode Statifier": HIE."Invasive cervical cancer treatment episode Value" +// define "Invasive cervical cancer treatment method stratifier": +// HIE."Invasive cervical cancer treatment method stratifier" + define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + HIE."By Geographic Region Stratifier" + ':' + (HIE."Invasive cervical cancer treatment episode Value") +//+ ':' + HIE."Invasive cervical cancer treatment method stratifier".code //treatment type not specified \ No newline at end of file diff --git a/input/cql/HIVIND96Logic.cql b/input/cql/HIVIND96Logic.cql index 36db6c0c7e4..468a7f930b2 100644 --- a/input/cql/HIVIND96Logic.cql +++ b/input/cql/HIVIND96Logic.cql @@ -95,7 +95,8 @@ define "Initial Population": define "Numerator": HIE."Has HIV-positive Status" and - exists (HIE."Invasive cervical cancer in the last 12 months" C) + exists(HE."Invasive cervical cancer" C + where C.prevalenceInterval() during Interval[start of "Measurement Period" - 12 months, start of "Measurement Period"]) /** @@ -105,7 +106,8 @@ define "Numerator": */ define "Numerator Exclusions": - exists (HIE."Invasive cervical cancer in the last 12 months" C where +exists(HE."Invasive cervical cancer" C + where ( HE."Death documented" after start of C.prevalenceInterval() and HE."Death documented" before (start of C.prevalenceInterval() + 12 months)) ) @@ -120,7 +122,9 @@ define "Numerator Exclusions": define "Denominator": HIE."Has HIV-positive Status" and - exists(HIE."Invasive cervical cancer in the last 12 months" C) + exists(HE."Invasive cervical cancer" C + where C.prevalenceInterval() during Interval[start of "Measurement Period" - 12 months, start of "Measurement Period"]) + /* end Populations */ @@ -129,7 +133,7 @@ define "Denominator": */ define "Age Stratifier": - HIE."By Age Stratifier 2" + HIE."By Age Stratifier 9" define "Geographic Region Stratifier": HIE."By Geographic Region Stratifier" @@ -139,6 +143,6 @@ define "Cervical cancer stage at diagnosis of cervical cancer Stratifier": define "Stratification": -HIE."By Age Stratifier 2" +HIE."By Age Stratifier 9" + ':' + 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 c344d5d1da6..c3e2922d8bf 100644 --- a/input/cql/HIVIndicatorElements.cql +++ b/input/cql/HIVIndicatorElements.cql @@ -69,8 +69,29 @@ define "methadone_prescribed at date": and MR.intent = 'order' and MR.medication ~ ConceptsCustom."methadone" //and "GetMedicationDailyDose"(MR.dosageInstruction, "DosesPerDay"(singleton from MR.dosageInstruction.timing.repeat.frequencyMax)) >= 60 'mg/d' - and Common.MedicationRequestPeriod(MR) starts before start of "Measurement Period" - and Common.MedicationRequestPeriod(MR) ends after end of "Measurement Period" + and MR.MedicationRequestPeriod() starts before start of "Measurement Period" + and MR.MedicationRequestPeriod() ends after end of "Measurement Period" + +define "methadone_prescribed >= 60mg": + "methadone_prescribed at date" MR + where exists(MR.dosageInstruction d + where exists d.doseAndRate dr + where dr.dose.value >= 60) + +define "buprenorphine_prescribed at date": +[MedicationRequest] MR + where MR.status = 'completed' + and MR.intent = 'order' + and MR.medication ~ ConceptsCustom."buprenorphine" + //and "GetMedicationDailyDose"(MR.dosageInstruction, "DosesPerDay"(singleton from MR.dosageInstruction.timing.repeat.frequencyMax)) >= 60 'mg/d' + and MR.MedicationRequestPeriod() starts before start of "Measurement Period" + and MR.MedicationRequestPeriod() ends after end of "Measurement Period" + +define "buprenorphine_prescribed >= 8mg": + "buprenorphine_prescribed at date" MR + where exists(MR.dosageInstruction d + where exists d.doseAndRate dr + where dr.dose.value >= 60) define "OAMT_initiated": exists( @@ -107,7 +128,6 @@ exists( ) ) - define "PEP Prescribed before start of Measurement Period and Completed": [MedicationStatement] MS with [MedicationRequest] MR @@ -193,7 +213,7 @@ define "Lost to Follow Up during the measurement period": define "ART Medication Statement": Elements."ART Medication Statement" MS - where MS.effective.toInterval() overlaps "Measurement Period" + where MS.effective.toInterval() during "Measurement Period" sort by start of effective.toInterval() define "On ART": @@ -229,41 +249,46 @@ define hiv_exposure_type: } define setting: - List{ - if Community_testing then 'Community-level testing' else null, - if Facility_testing then 'Facility-level testing' else null - } + case + when Community_testing then Concepts."Community-level testing" + when Facility_testing then Concepts."Facility-level testing" + else null + end define anc: - List{ - if ANC_case then 'ANC case' else null - } + case + when "ANC contact date E.DE85" then ConceptsCustom."Antenatal care contact" + else null + end define tb: - List{ - if TB_diagnosed then 'Diagnosed TB' else null, - if TB_presumptive then 'Presumptive TB' else null - } + case + when "Diagnosed TB" then Concepts."Diagnosed TB" + when "Presumptive TB D.DE945" then Concepts."Presumptive TB - HIV.D.DE945" + when "TB excluded" then Concepts."TB excluded" + else null + end + define prep_product: List{ - if Elements."PREP Product Oral" then 'PREP Product Oral' else null, - if Elements."PREP Product long-acting device" then 'PREP Product long-acting device' else null, - if Elements."PREP Product long-acting injectable" then 'PREP Product long-acting injectable' else null + if "TDF + FTC C.DE18" or "TDF C.DE19" or "TDF + 3TC C.DE20" or "Other TDF-based regimen" then 'PREP Product Oral' else null, + if "Dapivirine vaginal ring DVR C.DE22" then 'PREP Product long-acting device' else null, + if "CAB-LA C.DE23" then 'PREP Product long-acting injectable' else null } define prep_experience: List{ - if Elements."PREP first time" then 'PREP first time' else null, - if Elements."PREP Continuing user" then 'PREP Continuing user' else null, - if Elements."PREP Restarting" then 'PREP Restarting' else null + if "First-time user C.DE25" then 'PREP first time' else null, + if "Continuing user" then 'PREP Continuing user' else null, + if "Restarting following a period of not taking PrEP" then 'PREP Restarting' else null } define prep_dosing: List{ - if Elements."Daily_oral_PrEP" then 'Daily oral PrEP' else null, - if Elements."Event_driven_PrEP" then 'Event driven PrEP' else null, - if Elements."other_dosing_PrEP" then 'Other PrEP dosing type' else null + if "Daily oral PrEP" then 'Daily oral PrEP' else null, + if "Event-driven PrEP 2+1+1" then 'Event driven PrEP' else null, + if "Other PrEP dosing type" then 'Other PrEP dosing type' else null } define "Treatment outcome category": @@ -370,10 +395,61 @@ define "By Age Stratifier 3": /* End of Age */ +define "By Age Stratifier 4": + case + when "Age In Years" < 25 then '<25' + when "Age In Years" >= 25 then '25+' + else null + end + +define "By Age Stratifier 5": + case + when "Age In Years" < 15 and "Age In Years"<= 19 then '<15' + when "Age In Years" >= 15 and "Age In Years"<= 19 then '15-19' + when "Age In Years" <= 24 then '20-24' + when "Age In Years" <= 49 then '25–49' + when "Age In Years" >= 50 then '50+' + else null + end +//(<0–4, 5–9, 10–14, 15-19, >19 years) +define "By Age Stratifier 6": + case + when "Age In Years" < 5 then '<0–4' + when "Age In Years"<= 9 then '5–9' + when "Age In Years" <= 14 then '10–14' + when "Age In Years" <= 19 then '15-19' + when "Age In Years" >= 20 then '>19' + else null + end + //<2 months, 2-12 months +define "By Age Stratifier 7": + case + when "Age In Months" < 2 then '<2 months' + when "Age In Months"<= 12 then '2-12 months' + else null + end +//(0–4, 5–14, 15–24, 25+ years) +define "By Age Stratifier 8": + case + when "Age In Years" <= 4 then '0-4' + when "Age In Years" <= 14 then '5-14' + when "Age In Years" <= 24 then '15-24' + when "Age In Years" >= 25 then '25+' + else null + end +define "By Age Stratifier 9": + case + when "Age In Years" >= 15 and "Age In Years"<= 19 then '15-19' + when "Age In Years" <= 24 then '20-24' + when "Age In Years" <= 29 then '25–29' + when "Age In Years" <= 49 then '30–49' + when "Age In Years" >= 50 then '50+' + else null + end /* @dataElement: HIV.A.DE18 - Gender @@ -427,8 +503,7 @@ define "Partner or contact of an HIV testing client non-index case": or exists "Partner or contact of an HIV testing client non-index case Observation" define "Partner or contact of an HIV testing client non-index case Condition": Elements."Partner or contact of an HIV testing client non-index case Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Partner or contact of an HIV testing client non-index case Observation": Elements."Partner or contact of an HIV testing client non-index case Observation" O where O.effective.toInterval() during "Measurement Period" @@ -458,8 +533,7 @@ define "Biological child": or exists "Biological child Observation" define "Biological child Condition": Elements."Biological child Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Biological child Observation": Elements."Biological child Observation" O where O.effective.toInterval() during "Measurement Period" @@ -476,8 +550,7 @@ define "Drug-injecting partner B.DE10": or exists "Drug-injecting partner B.DE10 Observation" define "Drug-injecting partner B.DE10 Condition": Elements."Drug-injecting partner B.DE10 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Drug-injecting partner B.DE10 Observation": Elements."Drug-injecting partner B.DE10 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -494,8 +567,7 @@ define "Sexual partner B.DE11": or exists "Sexual partner B.DE11 Observation" define "Sexual partner B.DE11 Condition": Elements."Sexual partner B.DE11 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Sexual partner B.DE11 Observation": Elements."Sexual partner B.DE11 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -512,8 +584,7 @@ define "Social contact B.DE12": or exists "Social contact B.DE12 Observation" define "Social contact B.DE12 Condition": Elements."Social contact B.DE12 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Social contact B.DE12 Observation": Elements."Social contact B.DE12 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -543,8 +614,7 @@ define "Community-level testing": or exists "Community-level testing Observation" define "Community-level testing Condition": Elements."Community-level testing Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Community-level testing Observation": Elements."Community-level testing Observation" O where O.effective.toInterval() during "Measurement Period" @@ -561,8 +631,7 @@ define "Facility-level testing": or exists "Facility-level testing Observation" define "Facility-level testing Condition": Elements."Facility-level testing Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Facility-level testing Observation": Elements."Facility-level testing Observation" O where O.effective.toInterval() during "Measurement Period" @@ -577,6 +646,15 @@ define "Facility-level testing Observation": define "Currently pregnant B.DE29": Elements."Currently pregnant B.DE29" C where C.prevalenceInterval() during "Measurement Period" + + +define "pregnancy stratifier": + case + when exists("Currently pregnant B.DE29") then Concepts."Currently pregnant - HIV.B.DE29" + when exists("Breastfeeding B.DE32") then Concepts."Breastfeeding - HIV.B.DE32" + else null + end + /* End of Currently pregnant B.DE29 */ /* @@ -584,11 +662,9 @@ define "Currently pregnant B.DE29": @activity: HIV.B6 Capture or update client history @description: Infant is being breastfed by mother */ -// TODO: Replace placeholder with relevant CQL logic + define "Breastfeeding B.DE32": - exists "Breastfeeding B.DE32 Observation" -define "Breastfeeding B.DE32 Observation": - Elements."Breastfeeding B.DE32 Observation" O + Elements."Breastfeeding B.DE32" O where O.effective.toInterval() during "Measurement Period" /* End of Breastfeeding B.DE32 */ @@ -616,8 +692,7 @@ define "HIV-positive B.DE34": or exists "HIV-positive B.DE34 Observation" define "HIV-positive B.DE34 Condition": Elements."HIV-positive B.DE34 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "HIV-positive B.DE34 Observation": Elements."HIV-positive B.DE34 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -634,8 +709,7 @@ define "HIV-negative B.DE35": or exists "HIV-negative B.DE35 Observation" define "HIV-negative B.DE35 Condition": Elements."HIV-negative B.DE35 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "HIV-negative B.DE35 Observation": Elements."HIV-negative B.DE35 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -652,8 +726,7 @@ define "Unknown B.DE36": or exists "Unknown B.DE36 Observation" define "Unknown B.DE36 Condition": Elements."Unknown B.DE36 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Unknown B.DE36 Observation": Elements."Unknown B.DE36 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -685,7 +758,8 @@ define patientGroups: */ define "Sex worker": exists("Key population member type Observation" O - where O.value ~ Concepts."Sex worker - HIV.B.DE51") + where O.value ~ Concepts."Sex worker - HIV.B.DE51" + and O.effective.toInterval() during "Measurement Period") /* End of Sex worker B.DE51 */ /* @@ -695,7 +769,8 @@ define "Sex worker": */ define "Men who have sex with men": exists("Key population member type Observation" O - where O.value ~ Concepts."Men who have sex with men") + where O.value ~ Concepts."Men who have sex with men" + and O.effective.toInterval() during "Measurement Period") /* End of Men who have sex with men */ /* @@ -705,7 +780,8 @@ define "Men who have sex with men": */ define "Trans and gender-diverse people": exists("Key population member type Observation" O - where O.value ~ Concepts."Trans and gender-diverse people - HIV.B.DE53") + where O.value ~ Concepts."Trans and gender-diverse people - HIV.B.DE53" + and O.effective.toInterval() during "Measurement Period") /* End of Trans and gender-diverse people B.DE53 */ /* @@ -714,8 +790,9 @@ define "Trans and gender-diverse people": @description: Client is a person who injects drugs */ define "People who inject drugs": - "Key population member type Observation" O + exists("Key population member type Observation" O where O.value ~ Concepts."People who inject drugs - HIV.B.DE54" + and O.effective.toInterval() during "Measurement Period") /* End of People who inject drugs B.DE54 */ @@ -726,7 +803,8 @@ define "People who inject drugs": */ define "People living in prisons and other closed settings": exists("Key population member type Observation" O - where O.value ~ Concepts."People living in prisons and other closed settings") + where O.value ~ Concepts."People living in prisons and other closed settings" + and O.effective.toInterval() during "Measurement Period") /* End of People living in prisons and other closed settings */ /* @@ -766,8 +844,7 @@ define "Occupational": or exists "Occupational Observation" define "Occupational Condition": Elements."Occupational Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Occupational Observation": Elements."Occupational Observation" O where O.effective.toInterval() during "Measurement Period" @@ -784,8 +861,7 @@ define "Non-occupational violent": or exists "Non-occupational violent Observation" define "Non-occupational violent Condition": Elements."Non-occupational violent Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Non-occupational violent Observation": Elements."Non-occupational violent Observation" O where O.effective.toInterval() during "Measurement Period" @@ -802,8 +878,7 @@ define "Non-occupational consensual sex": or exists "Non-occupational consensual sex Observation" define "Non-occupational consensual sex Condition": Elements."Non-occupational consensual sex Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Non-occupational consensual sex Observation": Elements."Non-occupational consensual sex Observation" O where O.effective.toInterval() during "Measurement Period" @@ -876,12 +951,17 @@ define "Non-Self HIV test with date and results returned in measurement period": /* End of HIV test date B.DE110 */ + /* @dataElement: HIV.B.DE112 - HIV-positive @activity: HIV.B7 Test for HIV using testing algorithm @description: Test result is HIV-positive */ +define "HIV-positive test result": + exists (Elements."HIV-positive test result" O + where O.effective.toInterval() during "Measurement Period") + define "Non-Self HIV test date and results returned within measurement period for HIV-positive result": "Non-Self HIV test with date and results returned in measurement period" O where O.value ~ Concepts."HIV-positive - HIV.B.DE112" @@ -890,20 +970,28 @@ define "Non-Self HIV test date and results returned within measurement period fo /* HIV-negative test */ define "Negative HIV test within measurement period": Elements."HIV test" O - where O.effective.toInterval() overlaps "Measurement Period" + where O.effective.toInterval() during "Measurement Period" and O.value ~ Concepts."HIV-negative - HIV.B.DE113" + +/* +@dataElement: HIV.B.DE113 - HIV-negative +@activity: HIV.B7 Test for HIV using testing algorithm +@description: Test result is HIV-negative +*/ +define "HIV-negative test result": + exists (Elements."HIV-negative test result" O + where O.effective.toInterval() during "Measurement Period") + + +/* End of HIV-negative B.DE113 */ + /* @dataElement: HIV.B.DE115 - HIV status @activity: HIV.B7 Test for HIV using testing algorithm @description: HIV status reported after applying the national HIV testing algorithm. No single HIV test can provide an HIV-positive diagnosis. */ -// define "HIV Status": -// case -// when exists("HIV Positive Condition") then Concepts."HIV-positive - HIV.B.DE116" -// when not exists("HIV Positive Condition") and exists(Elements."HIV Negative Observation" O where O.issued before end of "Measurement Period") then Concepts."HIV-negative - HIV.B.DE117" -// else Concepts."Unknown - HIV.B.DE118" -// end + define "HIV Status Stratifier": case @@ -981,8 +1069,7 @@ define "Heterosexual sex": or exists "Heterosexual sex Observation" define "Heterosexual sex Condition": Elements."Heterosexual sex Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Heterosexual sex Observation": Elements."Heterosexual sex Observation" O where O.effective.toInterval() during "Measurement Period" @@ -999,8 +1086,7 @@ define "Sex between men": or exists "Sex between men Observation" define "Sex between men Condition": Elements."Sex between men Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Sex between men Observation": Elements."Sex between men Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1017,8 +1103,7 @@ define "Unprotected intercourse during sex work": or exists "Unprotected intercourse during sex work Observation" define "Unprotected intercourse during sex work Condition": Elements."Unprotected intercourse during sex work Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Unprotected intercourse during sex work Observation": Elements."Unprotected intercourse during sex work Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1035,8 +1120,7 @@ define "Injecting drug use with unsterile equipment": or exists "Injecting drug use with unsterile equipment Observation" define "Injecting drug use with unsterile equipment Condition": Elements."Injecting drug use with unsterile equipment Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Injecting drug use with unsterile equipment Observation": Elements."Injecting drug use with unsterile equipment Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1053,8 +1137,7 @@ define "Nosocomial": or exists "Nosocomial Observation" define "Nosocomial Condition": Elements."Nosocomial Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Nosocomial Observation": Elements."Nosocomial Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1071,8 +1154,7 @@ define "Vertical": or exists "Vertical Observation" define "Vertical Condition": Elements."Vertical Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Vertical Observation": Elements."Vertical Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1089,8 +1171,7 @@ define "Other B.DE128": or exists "Other B.DE128 Observation" define "Other B.DE128 Condition": Elements."Other B.DE128 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other B.DE128 Observation": Elements."Other B.DE128 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1101,13 +1182,9 @@ define "Other B.DE128 Observation": @activity: HIV.B21 Offer prevention options @description: Date on which a voluntary medical male circumcision procedure was performed */ -// TODO: Replace placeholder with relevant CQL logic + define "VMMC procedure date": - Elements."VMMC procedure date" O - where O.effective.toInterval() during "Measurement Period" -define "VMMC procedure date Value": - "VMMC procedure date" O - return O.value + exists(Elements."VMMC" V where V.performed.toInterval() during "Measurement Period") /* End of VMMC procedure date */ /* @@ -1120,9 +1197,8 @@ define "VMMC_adverse_event": [AdverseEvent] AE with [Procedure] P such that AE.suspectEntity.instance.references(P) and P.status = 'completed' - and P.code ~ Concepts."Voluntary medical male circumcision VMMC referral" - and P.performed after start of "Measurement Period" - and P.performed before end of "Measurement Period" + and P.code ~ Concepts."VMMC" + and P.performed during "Measurement Period" and AE.date <= (P.performed + 30 days) and AE.date >= (P.performed) where AE.actuality = 'actual' @@ -1174,12 +1250,9 @@ define "VMMC_adverse_event_timing": else null end -// TODO: Replace placeholder with relevant CQL logic + define "Adverse event severity": - exists "Adverse event severity Observation" -define "Adverse event severity Observation": - Elements."Adverse event severity Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Adverse event severity" /* End of Adverse event severity */ /* @@ -1187,17 +1260,9 @@ define "Adverse event severity Observation": @activity: HIV.B21 Offer prevention options @description: Severity of the adverse event associated with VMMC procedure was moderate */ -// TODO: Replace placeholder with relevant CQL logic + define "Moderate": - exists "Moderate Condition" - or exists "Moderate Observation" -define "Moderate Condition": - Elements."Moderate Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Moderate Observation": - Elements."Moderate Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Moderate" /* End of Moderate */ /* @@ -1205,17 +1270,9 @@ define "Moderate Observation": @activity: HIV.B21 Offer prevention options @description: Severity of the adverse event associated with VMMC procedure was severe */ -// TODO: Replace placeholder with relevant CQL logic + define "Severe": - exists "Severe Condition" - or exists "Severe Observation" -define "Severe Condition": - Elements."Severe Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Severe Observation": - Elements."Severe Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Severe" /* End of Severe */ /* @@ -1242,8 +1299,7 @@ define "Intraoperative": or exists "Intraoperative Observation" define "Intraoperative Condition": Elements."Intraoperative Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Intraoperative Observation": Elements."Intraoperative Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1260,8 +1316,7 @@ define "Postoperative": or exists "Postoperative Observation" define "Postoperative Condition": Elements."Postoperative Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Postoperative Observation": Elements."Postoperative Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1291,8 +1346,7 @@ define "Abnormal pain": or exists "Abnormal pain Observation" define "Abnormal pain Condition": Elements."Abnormal pain Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Abnormal pain Observation": Elements."Abnormal pain Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1309,8 +1363,7 @@ define "Anaesthesia-related effects": or exists "Anaesthesia-related effects Observation" define "Anaesthesia-related effects Condition": Elements."Anaesthesia-related effects Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Anaesthesia-related effects Observation": Elements."Anaesthesia-related effects Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1327,8 +1380,7 @@ define "Bleeding": or exists "Bleeding Observation" define "Bleeding Condition": Elements."Bleeding Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Bleeding Observation": Elements."Bleeding Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1345,8 +1397,7 @@ define "Damage to the penis": or exists "Damage to the penis Observation" define "Damage to the penis Condition": Elements."Damage to the penis Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Damage to the penis Observation": Elements."Damage to the penis Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1363,8 +1414,7 @@ define "Difficulty urinating": or exists "Difficulty urinating Observation" define "Difficulty urinating Condition": Elements."Difficulty urinating Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Difficulty urinating Observation": Elements."Difficulty urinating Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1381,8 +1431,7 @@ define "Excessive bleeding": or exists "Excessive bleeding Observation" define "Excessive bleeding Condition": Elements."Excessive bleeding Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Excessive bleeding Observation": Elements."Excessive bleeding Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1399,8 +1448,7 @@ define "Excessive skin removal": or exists "Excessive skin removal Observation" define "Excessive skin removal Condition": Elements."Excessive skin removal Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Excessive skin removal Observation": Elements."Excessive skin removal Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1417,8 +1465,7 @@ define "Excessive swelling": or exists "Excessive swelling Observation" define "Excessive swelling Condition": Elements."Excessive swelling Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Excessive swelling Observation": Elements."Excessive swelling Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1435,8 +1482,7 @@ define "Haematoma": or exists "Haematoma Observation" define "Haematoma Condition": Elements."Haematoma Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Haematoma Observation": Elements."Haematoma Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1453,8 +1499,7 @@ define "Infection": or exists "Infection Observation" define "Infection Condition": Elements."Infection Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Infection Observation": Elements."Infection Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1471,8 +1516,7 @@ define "Injury to glans": or exists "Injury to glans Observation" define "Injury to glans Condition": Elements."Injury to glans Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Injury to glans Observation": Elements."Injury to glans Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1489,8 +1533,7 @@ define "Scar or disfigurement": or exists "Scar or disfigurement Observation" define "Scar or disfigurement Condition": Elements."Scar or disfigurement Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Scar or disfigurement Observation": Elements."Scar or disfigurement Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1507,8 +1550,7 @@ define "Sharps injury to personnel": or exists "Sharps injury to personnel Observation" define "Sharps injury to personnel Condition": Elements."Sharps injury to personnel Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Sharps injury to personnel Observation": Elements."Sharps injury to personnel Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1525,8 +1567,7 @@ define "Wound disruption": or exists "Wound disruption Observation" define "Wound disruption Condition": Elements."Wound disruption Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Wound disruption Observation": Elements."Wound disruption Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1543,8 +1584,7 @@ define "Other B.DE222": or exists "Other B.DE222 Observation" define "Other B.DE222 Condition": Elements."Other B.DE222 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other B.DE222 Observation": Elements."Other B.DE222 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -1559,6 +1599,7 @@ define "Other B.DE222 Observation": define "At elevated risk for HIV acquisition B.DE225": exists(Elements."At elevated risk for HIV acquisition B.DE225" C where C.prevalenceInterval() overlaps "Measurement Period") + /* End of At elevated risk for HIV acquisition B.DE225 */ /* @@ -1569,21 +1610,20 @@ define "At elevated risk for HIV acquisition B.DE225": 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 + if exists("Urethral discharge syndrome B.DE227") then 'Urethral Discharge' else null, + if exists("Vaginal discharge syndrome B.DE228") then 'Vaginal Discharge' else null, + if exists("Lower Abdominal pain B.DE229") then 'Lower Abdominal Pain' else null, + if exists("Genital ulcer disease syndrome B.DE230") then 'Genital Ulcer' else null, + if exists("Anorectal discharge B.DE231") then 'Anorectal discharge ' else null } - define "Syndrome/STI diagnosed B.DE226": - "Urethral discharge syndrome B.DE227" or "Vaginal discharge syndrome B.DE228" or "Lower Abdominal pain B.DE229" or "Genital ulcer disease syndrome B.DE230" or - "Anorectal discharge B.DE231" + exists("Urethral discharge syndrome B.DE227") or exists("Vaginal discharge syndrome B.DE228") or exists("Lower Abdominal pain B.DE229") or exists("Genital ulcer disease syndrome B.DE230") or + exists("Anorectal discharge B.DE231") -define "Syndrome/STI diagnosed B.DE226 Observation": - Elements."Syndrome/STI diagnosed B.DE226 Observation" O - where O.effective.toInterval() during "Measurement Period" +define "Syndrome/STI diagnosed B.DE226 Condition": + Elements."Syndrome/STI diagnosed B.DE226 Condition" C + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Syndrome/STI diagnosed B.DE226 */ /* @@ -1591,17 +1631,9 @@ define "Syndrome/STI diagnosed B.DE226 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Client diagnosed with urethral discharge syndrome */ - define "Urethral discharge syndrome B.DE227": - exists "Urethral discharge syndrome B.DE227 Condition" - or exists "Urethral discharge syndrome B.DE227 Observation" -define "Urethral discharge syndrome B.DE227 Condition": - Elements."Urethral discharge syndrome B.DE227 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Urethral discharge syndrome B.DE227 Observation": - Elements."Urethral discharge syndrome B.DE227 Observation" O - where O.effective.toInterval() during "Measurement Period" + Elements."Urethral discharge syndrome B.DE227" C + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Urethral discharge syndrome B.DE227 */ /* @@ -1609,17 +1641,9 @@ define "Urethral discharge syndrome B.DE227 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Client diagnosed with vaginal discharge syndrome */ - define "Vaginal discharge syndrome B.DE228": - exists "Vaginal discharge syndrome B.DE228 Condition" - or exists "Vaginal discharge syndrome B.DE228 Observation" -define "Vaginal discharge syndrome B.DE228 Condition": - Elements."Vaginal discharge syndrome B.DE228 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Vaginal discharge syndrome B.DE228 Observation": - Elements."Vaginal discharge syndrome B.DE228 Observation" O - where O.effective.toInterval() during "Measurement Period" + Elements."Vaginal discharge syndrome B.DE228" C + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Vaginal discharge syndrome B.DE228 */ /* @@ -1627,13 +1651,9 @@ define "Vaginal discharge syndrome B.DE228 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Client diagnosed with lower abdominal pain */ - define "Lower Abdominal pain B.DE229": - exists "Lower Abdominal pain B.DE229 Observation" - -define "Lower Abdominal pain B.DE229 Observation": - Elements."Lower Abdominal pain B.DE229 Observation" O - where O.effective.toInterval() during "Measurement Period" + Elements."Lower Abdominal pain B.DE229" C + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Lower Abdominal pain B.DE229 */ /* @@ -1641,17 +1661,9 @@ define "Lower Abdominal pain B.DE229 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Client diagnosed with genital ulcer disease syndrome */ - define "Genital ulcer disease syndrome B.DE230": - exists "Genital ulcer disease syndrome B.DE230 Condition" - or exists "Genital ulcer disease syndrome B.DE230 Observation" -define "Genital ulcer disease syndrome B.DE230 Condition": - Elements."Genital ulcer disease syndrome B.DE230 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Genital ulcer disease syndrome B.DE230 Observation": - Elements."Genital ulcer disease syndrome B.DE230 Observation" O - where O.effective.toInterval() during "Measurement Period" + Elements."Genital ulcer disease syndrome B.DE230" C + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Genital ulcer disease syndrome B.DE230 */ /* @@ -1659,13 +1671,9 @@ define "Genital ulcer disease syndrome B.DE230 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Client diagnosed with anorectal discharge */ - define "Anorectal discharge B.DE231": - exists "Anorectal discharge B.DE231 Observation" - -define "Anorectal discharge B.DE231 Observation": - Elements."Anorectal discharge B.DE231 Observation" O - where O.effective.toInterval() during "Measurement Period" + Elements."Anorectal discharge B.DE231" C + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Anorectal discharge B.DE231 */ /* @@ -1673,17 +1681,9 @@ define "Anorectal discharge B.DE231 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Specimen sent for testing */ -// TODO: Replace placeholder with relevant CQL logic define "Sent for testing B.DE232": - exists "Sent for testing B.DE232 Condition" - or exists "Sent for testing B.DE232 Observation" -define "Sent for testing B.DE232 Condition": - Elements."Sent for testing B.DE232 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Sent for testing B.DE232 Observation": - Elements."Sent for testing B.DE232 Observation" O - where O.effective.toInterval() during "Measurement Period" + Elements."Sent for testing B.DE232" C + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Sent for testing B.DE232 */ /* @@ -1691,17 +1691,9 @@ define "Sent for testing B.DE232 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Other syndrome/STI diagnosed */ -// TODO: Replace placeholder with relevant CQL logic define "Other B.DE233": - exists "Other B.DE233 Condition" - or exists "Other B.DE233 Observation" -define "Other B.DE233 Condition": - Elements."Other B.DE233 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Other B.DE233 Observation": - Elements."Other B.DE233 Observation" O - where O.effective.toInterval() during "Measurement Period" + Elements."Other B.DE233" C + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Other B.DE233 */ /* @@ -1856,12 +1848,18 @@ define "Gonorrhoea treatment start date B.DE260": @activity: HIV.B23 Offer sexual and reproductive health services @description: Type of specimen to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Type of specimen B.DE261": - exists "Type of specimen B.DE261 Observation" -define "Type of specimen B.DE261 Observation": - Elements."Type of specimen B.DE261 Observation" O - where O.effective.toInterval() during "Measurement Period" + case + when "Blood B.DE262"then Concepts."Blood - HIV.B.DE262" + when "Urine B.DE263" then Concepts."Urine - HIV.B.DE263" + when "Cervical or vaginal swab B.DE264" then Concepts."Cervical or vaginal swab - HIV.B.DE264" + when "Urethral or penile swab B.DE265" then Concepts."Urethral or penile swab - HIV.B.DE265" + when "Rectal swab B.DE266" then Concepts."Rectal swab - HIV.B.DE266" + when "Other B.DE267" then Concepts."Other - HIV.B.DE267" + else null + end + /* End of Type of specimen B.DE261 */ /* @@ -1869,17 +1867,9 @@ define "Type of specimen B.DE261 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Blood specimen to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Blood B.DE262": - exists "Blood B.DE262 Condition" - or exists "Blood B.DE262 Observation" -define "Blood B.DE262 Condition": - Elements."Blood B.DE262 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Blood B.DE262 Observation": - Elements."Blood B.DE262 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Blood B.DE262" O where O.effective.toInterval() during "Measurement Period") /* End of Blood B.DE262 */ /* @@ -1887,17 +1877,9 @@ define "Blood B.DE262 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Urine specimen to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Urine B.DE263": - exists "Urine B.DE263 Condition" - or exists "Urine B.DE263 Observation" -define "Urine B.DE263 Condition": - Elements."Urine B.DE263 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Urine B.DE263 Observation": - Elements."Urine B.DE263 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Urine B.DE263" O where O.effective.toInterval() during "Measurement Period") /* End of Urine B.DE263 */ /* @@ -1905,17 +1887,10 @@ define "Urine B.DE263 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Cervical or vaginal swab to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Cervical or vaginal swab B.DE264": - exists "Cervical or vaginal swab B.DE264 Condition" - or exists "Cervical or vaginal swab B.DE264 Observation" -define "Cervical or vaginal swab B.DE264 Condition": - Elements."Cervical or vaginal swab B.DE264 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Cervical or vaginal swab B.DE264 Observation": - Elements."Cervical or vaginal swab B.DE264 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Cervical or vaginal swab B.DE264" O where O.effective.toInterval() during "Measurement Period") + /* End of Cervical or vaginal swab B.DE264 */ /* @@ -1923,17 +1898,10 @@ define "Cervical or vaginal swab B.DE264 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Urethral or penile swab to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Urethral or penile swab B.DE265": - exists "Urethral or penile swab B.DE265 Condition" - or exists "Urethral or penile swab B.DE265 Observation" -define "Urethral or penile swab B.DE265 Condition": - Elements."Urethral or penile swab B.DE265 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Urethral or penile swab B.DE265 Observation": - Elements."Urethral or penile swab B.DE265 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Urethral or penile swab B.DE265" O where O.effective.toInterval() during "Measurement Period") + /* End of Urethral or penile swab B.DE265 */ /* @@ -1941,17 +1909,10 @@ define "Urethral or penile swab B.DE265 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Rectal swab to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Rectal swab B.DE266": - exists "Rectal swab B.DE266 Condition" - or exists "Rectal swab B.DE266 Observation" -define "Rectal swab B.DE266 Condition": - Elements."Rectal swab B.DE266 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Rectal swab B.DE266 Observation": - Elements."Rectal swab B.DE266 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Rectal swab B.DE266" O where O.effective.toInterval() during "Measurement Period") + /* End of Rectal swab B.DE266 */ /* @@ -1959,17 +1920,10 @@ define "Rectal swab B.DE266 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Other specimen type to be collected */ -// TODO: Replace placeholder with relevant CQL logic + define "Other B.DE267": - exists "Other B.DE267 Condition" - or exists "Other B.DE267 Observation" -define "Other B.DE267 Condition": - Elements."Other B.DE267 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Other B.DE267 Observation": - Elements."Other B.DE267 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Other B.DE267"O where O.effective.toInterval() during "Measurement Period") + /* End of Other B.DE267 */ /* @@ -1977,12 +1931,16 @@ define "Other B.DE267 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Type of diagnostic test used for Neisseria gonorrhoeae */ -// TODO: Replace placeholder with relevant CQL logic + define "Neisseria gonorrhoeae test type B.DE276": - exists "Neisseria gonorrhoeae test type B.DE276 Observation" -define "Neisseria gonorrhoeae test type B.DE276 Observation": - Elements."Neisseria gonorrhoeae test type B.DE276 Observation" O - where O.effective.toInterval() during "Measurement Period" + case + when "NAAT B.DE277" then Concepts."NAAT - HIV.B.DE277" + when "POC Test B.DE278" then Concepts."POC Test - HIV.B.DE278" + when "Culture B.DE279" then Concepts."Culture - HIV.B.DE279" + when "Microscopy B.DE280" then Concepts."Microscopy - HIV.B.DE280" + when "Other B.DE281" then Concepts."Other - HIV.B.DE281" + else null + end /* End of Neisseria gonorrhoeae test type B.DE276 */ /* @@ -1990,17 +1948,10 @@ define "Neisseria gonorrhoeae test type B.DE276 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Nucleic Acid Amplification Test (NAAT) used */ -// TODO: Replace placeholder with relevant CQL logic + define "NAAT B.DE277": - exists "NAAT B.DE277 Condition" - or exists "NAAT B.DE277 Observation" -define "NAAT B.DE277 Condition": - Elements."NAAT B.DE277 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "NAAT B.DE277 Observation": - Elements."NAAT B.DE277 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists(Elements."NAAT B.DE277" O + where O.effective.toInterval() during "Measurement Period") /* End of NAAT B.DE277 */ /* @@ -2008,17 +1959,10 @@ define "NAAT B.DE277 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Point-of-care (POC) test used */ -// TODO: Replace placeholder with relevant CQL logic + define "POC Test B.DE278": - exists "POC Test B.DE278 Condition" - or exists "POC Test B.DE278 Observation" -define "POC Test B.DE278 Condition": - Elements."POC Test B.DE278 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "POC Test B.DE278 Observation": - Elements."POC Test B.DE278 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists(Elements."POC Test B.DE278" O + where O.effective.toInterval() during "Measurement Period") /* End of POC Test B.DE278 */ /* @@ -2026,17 +1970,10 @@ define "POC Test B.DE278 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Culture test used */ -// TODO: Replace placeholder with relevant CQL logic + define "Culture B.DE279": - exists "Culture B.DE279 Condition" - or exists "Culture B.DE279 Observation" -define "Culture B.DE279 Condition": - Elements."Culture B.DE279 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Culture B.DE279 Observation": - Elements."Culture B.DE279 Observation" O - where O.effective.toInterval() during "Measurement Period" +exists(Elements."Culture B.DE279" O + where O.effective.toInterval() during "Measurement Period") /* End of Culture B.DE279 */ /* @@ -2044,17 +1981,10 @@ define "Culture B.DE279 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Microscopy test used */ -// TODO: Replace placeholder with relevant CQL logic + define "Microscopy B.DE280": - exists "Microscopy B.DE280 Condition" - or exists "Microscopy B.DE280 Observation" -define "Microscopy B.DE280 Condition": - Elements."Microscopy B.DE280 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Microscopy B.DE280 Observation": - Elements."Microscopy B.DE280 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists(Elements."Microscopy B.DE280" O + where O.effective.toInterval() during "Measurement Period") /* End of Microscopy B.DE280 */ /* @@ -2062,19 +1992,26 @@ define "Microscopy B.DE280 Observation": @activity: HIV.B23 Offer sexual and reproductive health services @description: Other type of test used */ -// TODO: Replace placeholder with relevant CQL logic + define "Other B.DE281": - exists "Other B.DE281 Condition" - or exists "Other B.DE281 Observation" -define "Other B.DE281 Condition": - Elements."Other B.DE281 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Other B.DE281 Observation": - Elements."Other B.DE281 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Other B.DE281" O + where O.effective.toInterval() during "Measurement Period") /* End of Other B.DE281 */ +/* +@dataElement: HIV.C.DE10 - Currently on PrEP +@activity: HIV.C3 Capture or update client history +@description: The client is currently taking PrEP. Oral pre-exposure prophylaxis (PrEP) of HIV is the use of ARV drugs by people who are not infected with HIV to block the acquisition of HIV. +*/ + +/*@triggeredBy Encounter with location = community level testing*/ + +define "Currently on PrEP": + exists (Elements."Currently on PrEP" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") + +/* End of Currently on PrEP */ + /* @dataElement: HIV.C.DE11 - PrEP dosing type @activity: HIV.C3 Capture or update client history @@ -2093,17 +2030,11 @@ define "PrEP dosing type Observation": @activity: HIV.C3 Capture or update client history @description: Pre-exposure prophylaxis (PrEP) is taken every day */ -// TODO: Replace placeholder with relevant CQL logic + define "Daily oral PrEP": - exists "Daily oral PrEP Condition" - or exists "Daily oral PrEP Observation" -define "Daily oral PrEP Condition": - Elements."Daily oral PrEP Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Daily oral PrEP Observation": - Elements."Daily oral PrEP Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Daily oral PrEP" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") + /* End of Daily oral PrEP */ /* @@ -2111,17 +2042,10 @@ define "Daily oral PrEP Observation": @activity: HIV.C3 Capture or update client history @description: Event-driven pre-exposure prophylaxis (PrEP) is taken on an even-driven basis (2+1+1) */ -// TODO: Replace placeholder with relevant CQL logic + define "Event-driven PrEP 2+1+1": - exists "Event-driven PrEP 2+1+1 Condition" - or exists "Event-driven PrEP 2+1+1 Observation" -define "Event-driven PrEP 2+1+1 Condition": - Elements."Event-driven PrEP 2+1+1 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Event-driven PrEP 2+1+1 Observation": - Elements."Event-driven PrEP 2+1+1 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Event-driven PrEP 2+1+1" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") /* End of Event-driven PrEP 2+1+1 */ /* @@ -2129,19 +2053,78 @@ define "Event-driven PrEP 2+1+1 Observation": @activity: HIV.C3 Capture or update client history @description: Other PrEP dosing type */ -// TODO: Replace placeholder with relevant CQL logic + define "Other PrEP dosing type": - exists "Other PrEP dosing type Condition" - or exists "Other PrEP dosing type Observation" -define "Other PrEP dosing type Condition": - Elements."Other PrEP dosing type Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Other PrEP dosing type Observation": - Elements."Other PrEP dosing type Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Other PrEP dosing type" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") /* End of Other PrEP dosing type */ +/* +@dataElement: HIV.C.DE18 - TDF + FTC +@activity: HIV.C3 Capture or update client history +@description: Treated with tenofovir disoproxil fumarate (TDF) and emtricitabine (FTC) pre-exposure prophylaxis (PrEP) regimen (oral PrEP) +*/ + +define "TDF + FTC C.DE18": + exists (Elements."TDF + FTC C.DE18" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") +/* End of TDF + FTC C.DE18 */ + +/* +@dataElement: HIV.C.DE19 - TDF +@activity: HIV.C3 Capture or update client history +@description: Treated with single-agent tenofovir disoproxil fumarate (TDF) pre-exposure prophylaxis (PrEP) regimen (oral PrEP) +*/ + +define "TDF C.DE19": + exists (Elements."TDF C.DE19" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") + +/* End of TDF C.DE19 */ + +/* +@dataElement: HIV.C.DE20 - TDF + 3TC +@activity: HIV.C3 Capture or update client history +@description: Treated with tenofovir disoproxil fumarate (TDF) and lamivudine (3TC) pre-exposure prophylaxis (PrEP) regimen (oral PrEP) +*/ + +define "TDF + 3TC C.DE20": + exists (Elements."TDF + 3TC C.DE20" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") +/* End of TDF + 3TC C.DE20 */ + +/* +@dataElement: HIV.C.DE21 - Other TDF-based regimen +@activity: HIV.C3 Capture or update client history +@description: Treated with other tenofovir disoproxil fumarate (TDF)-based regimen (oral PrEP) +*/ + +define "Other TDF-based regimen": + exists (Elements."Other TDF-based regimen" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") +/* End of Other TDF-based regimen */ + +/* +@dataElement: HIV.C.DE22 - Dapivirine vaginal ring DVR +@activity: HIV.C3 Capture or update client history +@description: Dapivirine vaginal ring (DVR) for HIV prevention +*/ + +define "Dapivirine vaginal ring DVR C.DE22": + exists (Elements."Dapivirine vaginal ring DVR C.DE22" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") + +/* +@dataElement: HIV.C.DE23 - CAB-LA +@activity: HIV.C3 Capture or update client history +@description: Long-acting injectable cabotegravir +*/ + +define "CAB-LA C.DE23": + exists (Elements."CAB-LA C.DE23" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") +/* End of CAB-LA C.DE23 */ + /* @dataElement: HIV.C.DE24 - Experience with PrEP @activity: HIV.C3 Capture or update client history @@ -2160,17 +2143,10 @@ define "Experience with PrEP Observation": @activity: HIV.C3 Capture or update client history @description: The client has never used pre-exposure prophylaxis (PrEP) before (naive) */ -// TODO: Replace placeholder with relevant CQL logic + define "First-time user C.DE25": - exists "First-time user C.DE25 Condition" - or exists "First-time user C.DE25 Observation" -define "First-time user C.DE25 Condition": - Elements."First-time user C.DE25 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "First-time user C.DE25 Observation": - Elements."First-time user C.DE25 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."First-time user C.DE25" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") /* End of First-time user C.DE25 */ /* @@ -2178,17 +2154,10 @@ define "First-time user C.DE25 Observation": @activity: HIV.C3 Capture or update client history @description: The client has used PrEP before and is continuing to use PrEP */ -// TODO: Replace placeholder with relevant CQL logic + define "Continuing user": - exists "Continuing user Condition" - or exists "Continuing user Observation" -define "Continuing user Condition": - Elements."Continuing user Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Continuing user Observation": - Elements."Continuing user Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Continuing user" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") /* End of Continuing user */ /* @@ -2196,17 +2165,10 @@ define "Continuing user Observation": @activity: HIV.C3 Capture or update client history @description: The client is restarting PrEP following a period of not taking PrEP */ -// TODO: Replace placeholder with relevant CQL logic + define "Restarting following a period of not taking PrEP": - exists "Restarting following a period of not taking PrEP Condition" - or exists "Restarting following a period of not taking PrEP Observation" -define "Restarting following a period of not taking PrEP Condition": - Elements."Restarting following a period of not taking PrEP Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Restarting following a period of not taking PrEP Observation": - Elements."Restarting following a period of not taking PrEP Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."Restarting following a period of not taking PrEP" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") /* End of Restarting following a period of not taking PrEP */ /* @@ -2214,13 +2176,11 @@ define "Restarting following a period of not taking PrEP Observation": @activity: HIV.C3 Capture or update client history @description: Date client completes PEP course */ -// TODO: Replace placeholder with relevant CQL logic + define "Date client completes PEP course": - Elements."Date client completes PEP course" O - where O.effective.toInterval() during "Measurement Period" -define "Date client completes PEP course Value": - "Date client completes PEP course" O - return O.value + exists(Elements."Date client completes PEP course" MS + where MS.effective.toInterval() during "Measurement Period") + /* End of Date client completes PEP course */ /* @@ -2261,17 +2221,10 @@ define "HIV PREP Active": and (H.effective ends after start of "Measurement Period" or end of H.effective ~ null) ) -// TODO: Replace placeholder with relevant CQL logic + define "PrEP for HIV prevention": - exists "PrEP for HIV prevention Condition" - or exists "PrEP for HIV prevention Observation" -define "PrEP for HIV prevention Condition": - Elements."PrEP for HIV prevention Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "PrEP for HIV prevention Observation": - Elements."PrEP for HIV prevention Observation" O - where O.effective.toInterval() during "Measurement Period" + exists (Elements."PrEP for HIV prevention" MS + where MS.status = 'completed' and MS.effective.toInterval() during "Measurement Period") /* End of PrEP for HIV prevention */ /* @@ -2279,17 +2232,10 @@ define "PrEP for HIV prevention Observation": @activity: HIV.C23 Prescribe or administer PrEP or PEP @description: Client was prescribed post-exposure prophylaxis (PEP) for HIV prevention */ -// TODO: Replace placeholder with relevant CQL logic + define "PEP for HIV prevention": - exists "PEP for HIV prevention Condition" - or exists "PEP for HIV prevention Observation" -define "PEP for HIV prevention Condition": - Elements."PEP for HIV prevention Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "PEP for HIV prevention Observation": - Elements."PEP for HIV prevention Observation" O - where O.effective.toInterval() during "Measurement Period" + exists(Elements."PEP for HIV prevention" MR + where MR.MedicationRequestPeriod() during "Measurement Period") /* End of PEP for HIV prevention */ /* @@ -2303,8 +2249,7 @@ define "Other C.DE78": or exists "Other C.DE78 Observation" define "Other C.DE78 Condition": Elements."Other C.DE78 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other C.DE78 Observation": Elements."Other C.DE78 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2334,8 +2279,7 @@ define "Oral PrEP": or exists "Oral PrEP Observation" define "Oral PrEP Condition": Elements."Oral PrEP Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Oral PrEP Observation": Elements."Oral PrEP Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2352,8 +2296,7 @@ define "Dapivirine vaginal ring DVR C.DE82": or exists "Dapivirine vaginal ring DVR C.DE82 Observation" define "Dapivirine vaginal ring DVR C.DE82 Condition": Elements."Dapivirine vaginal ring DVR C.DE82 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Dapivirine vaginal ring DVR C.DE82 Observation": Elements."Dapivirine vaginal ring DVR C.DE82 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2370,8 +2313,7 @@ define "CAB-LA C.DE83": or exists "CAB-LA C.DE83 Observation" define "CAB-LA C.DE83 Condition": Elements."CAB-LA C.DE83 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "CAB-LA C.DE83 Observation": Elements."CAB-LA C.DE83 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2388,8 +2330,7 @@ define "Other C.DE84": or exists "Other C.DE84 Observation" define "Other C.DE84 Condition": Elements."Other C.DE84 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other C.DE84 Observation": Elements."Other C.DE84 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2433,8 +2374,7 @@ define "Male condom": or exists "Male condom Observation" define "Male condom Condition": Elements."Male condom Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Male condom Observation": Elements."Male condom Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2451,8 +2391,7 @@ define "Female condom": or exists "Female condom Observation" define "Female condom Condition": Elements."Female condom Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Female condom Observation": Elements."Female condom Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2496,8 +2435,7 @@ define "Self": or exists "Self Observation" define "Self Condition": Elements."Self Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Self Observation": Elements."Self Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2514,8 +2452,7 @@ define "Family member": or exists "Family member Observation" define "Family member Condition": Elements."Family member Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Family member Observation": Elements."Family member Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2532,8 +2469,7 @@ define "Drug-injecting partner C.DE146": or exists "Drug-injecting partner C.DE146 Observation" define "Drug-injecting partner C.DE146 Condition": Elements."Drug-injecting partner C.DE146 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Drug-injecting partner C.DE146 Observation": Elements."Drug-injecting partner C.DE146 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2550,8 +2486,7 @@ define "Sexual partner C.DE147": or exists "Sexual partner C.DE147 Observation" define "Sexual partner C.DE147 Condition": Elements."Sexual partner C.DE147 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Sexual partner C.DE147 Observation": Elements."Sexual partner C.DE147 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2568,8 +2503,7 @@ define "Social contact C.DE148": or exists "Social contact C.DE148 Observation" define "Social contact C.DE148 Condition": Elements."Social contact C.DE148 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Social contact C.DE148 Observation": Elements."Social contact C.DE148 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2609,9 +2543,8 @@ define "Breastfeeding D.DE32 Observation": define "On ART D.DE38": exists(Elements."On ART D.DE38" ART - where ART.effective.toInterval() starts before end of "Measurement Period" - and (ART.effective.toInterval() ends after start of "Measurement Period") - ) + where ART.effective.toInterval() during "Measurement Period") + /* End of On ART D.DE38 */ /* @@ -2671,12 +2604,18 @@ define "Restarting ART": @activity: HIV.D8 Capture or update client history @description: The current ART regimen the client is taking */ -// TODO: Replace placeholder with relevant CQL logic + define "Current ART regimen": - exists "Current ART regimen Observation" -define "Current ART regimen Observation": - Elements."Current ART regimen Observation" O - where O.effective.toInterval() during "Measurement Period" + case + when exists(Elements."Preferred first-line ART regimen" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."Preferred first-line ART regimen" + when exists(Elements."Alternative first-line ART regimen" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."Alternative first-line ART regimen" + when exists(Elements."First-line ART regimen under special circumstances" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."First-line ART regimen under special circumstances" + when exists(Elements."Preferred second-line ART regimen" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."Preferred second-line ART regimen" + when exists(Elements."Alternative second-line ART regimen" MS where MS.effective.toInterval() during "Measurement Period") then Concepts."Alternative second-line ART regimen" + else null + end + + /* End of Current ART regimen */ /* @@ -2684,7 +2623,7 @@ define "Current ART regimen Observation": @activity: HIV.D12 Determine recommended screenings and tests @description: Date client was tested for hepatitis B virus (HBV) */ - +//TODO - verify define "HBsAg test date D.DE161": exists(Elements."HBsAg test date D.DE161" P where P.performed.toInterval() during "Measurement Period") @@ -2964,8 +2903,7 @@ define "Toxicity/side effects D.DE218": or exists "Toxicity/side effects D.DE218 Observation" define "Toxicity/side effects D.DE218 Condition": Elements."Toxicity/side effects D.DE218 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Toxicity/side effects D.DE218 Observation": Elements."Toxicity/side effects D.DE218 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -2982,8 +2920,7 @@ define "Severe illness, hospitalization D.DE219": or exists "Severe illness, hospitalization D.DE219 Observation" define "Severe illness, hospitalization D.DE219 Condition": Elements."Severe illness, hospitalization D.DE219 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Severe illness, hospitalization D.DE219 Observation": Elements."Severe illness, hospitalization D.DE219 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3000,8 +2937,7 @@ define "Drugs out of stock": or exists "Drugs out of stock Observation" define "Drugs out of stock Condition": Elements."Drugs out of stock Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Drugs out of stock Observation": Elements."Drugs out of stock Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3018,8 +2954,7 @@ define "Client lacks finances": or exists "Client lacks finances Observation" define "Client lacks finances Condition": Elements."Client lacks finances Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Client lacks finances Observation": Elements."Client lacks finances Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3036,8 +2971,7 @@ define "Excluded HIV infection in infant D.DE222": or exists "Excluded HIV infection in infant D.DE222 Observation" define "Excluded HIV infection in infant D.DE222 Condition": Elements."Excluded HIV infection in infant D.DE222 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Excluded HIV infection in infant D.DE222 Observation": Elements."Excluded HIV infection in infant D.DE222 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3054,8 +2988,7 @@ define "Other reason for stopping ART D.DE223": or exists "Other reason for stopping ART D.DE223 Observation" define "Other reason for stopping ART D.DE223 Condition": Elements."Other reason for stopping ART D.DE223 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other reason for stopping ART D.DE223 Observation": Elements."Other reason for stopping ART D.DE223 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3085,8 +3018,7 @@ define "Presumptive TB D.DE282": or exists "Presumptive TB D.DE282 Observation" define "Presumptive TB D.DE282 Condition": Elements."Presumptive TB D.DE282 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Presumptive TB D.DE282 Observation": Elements."Presumptive TB D.DE282 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3158,8 +3090,7 @@ define "Routine viral load test": or exists "Routine viral load test Observation" define "Routine viral load test Condition": Elements."Routine viral load test Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Routine viral load test Observation": Elements."Routine viral load test Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3176,8 +3107,7 @@ define "Targeted viral load monitoring": or exists "Targeted viral load monitoring Observation" define "Targeted viral load monitoring Condition": Elements."Targeted viral load monitoring Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Targeted viral load monitoring Observation": Elements."Targeted viral load monitoring Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3194,8 +3124,7 @@ define "Initial viral load test": or exists "Initial viral load test Observation" define "Initial viral load test Condition": Elements."Initial viral load test Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Initial viral load test Observation": Elements."Initial viral load test Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3212,8 +3141,7 @@ define "Follow-up viral load test after receiving enhanced adherence counselling or exists "Follow-up viral load test after receiving enhanced adherence counselling Observation" define "Follow-up viral load test after receiving enhanced adherence counselling Condition": Elements."Follow-up viral load test after receiving enhanced adherence counselling Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Follow-up viral load test after receiving enhanced adherence counselling Observation": Elements."Follow-up viral load test after receiving enhanced adherence counselling Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3257,8 +3185,7 @@ define "Toxicity/side effects D.DE419": or exists "Toxicity/side effects D.DE419 Observation" define "Toxicity/side effects D.DE419 Condition": Elements."Toxicity/side effects D.DE419 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Toxicity/side effects D.DE419 Observation": Elements."Toxicity/side effects D.DE419 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3275,8 +3202,7 @@ define "Drug-drug interaction": or exists "Drug-drug interaction Observation" define "Drug-drug interaction Condition": Elements."Drug-drug interaction Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Drug-drug interaction Observation": Elements."Drug-drug interaction Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3293,8 +3219,7 @@ define "Pregnancy": or exists "Pregnancy Observation" define "Pregnancy Condition": Elements."Pregnancy Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Pregnancy Observation": Elements."Pregnancy Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3311,8 +3236,7 @@ define "New TB": or exists "New TB Observation" define "New TB Condition": Elements."New TB Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "New TB Observation": Elements."New TB Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3329,8 +3253,7 @@ define "New drug available": or exists "New drug available Observation" define "New drug available Condition": Elements."New drug available Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "New drug available Observation": Elements."New drug available Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3347,8 +3270,7 @@ define "Drug out of stock": or exists "Drug out of stock Observation" define "Drug out of stock Condition": Elements."Drug out of stock Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Drug out of stock Observation": Elements."Drug out of stock Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3365,8 +3287,7 @@ define "Other reason for regimen substitution": or exists "Other reason for regimen substitution Observation" define "Other reason for regimen substitution Condition": Elements."Other reason for regimen substitution Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other reason for regimen substitution Observation": Elements."Other reason for regimen substitution Observation" O where O.effective.toInterval() during "Measurement Period" @@ -3404,13 +3325,12 @@ define "Date medications prescribed D.DE458 Value": @activity: HIV.D23 Prescribe @description: Number of doses (quantity taken at a single point in time) of drugs prescribed/dispensed */ -// TODO: Replace placeholder with relevant CQL logic + define "Dose of medications prescribed": - Elements."Dose of medications prescribed" O - where O.effective.toInterval() during "Measurement Period" -define "Dose of medications prescribed Value": - "Dose of medications prescribed" O - return O.value + [MedicationRequest] P + return P.dailyDose() + + /* End of Dose of medications prescribed */ /* @@ -3432,12 +3352,24 @@ define "Number of days medications prescribed Value": @activity: HIV.D21 Determine regimen and treatment options @description: Type of treatment-limiting toxicity experienced by client. Treatment-limiting toxicity is defined as a serious adverse drug reaction that results in drug discontinuation or substitution. In addition, any reaction that leads to treatment interruption or requires changing the drug or regimen because of an adverse drug reaction is also considered a serious adverse drug reaction. */ -// TODO: Replace placeholder with relevant CQL logic + define "Type of treatment-limiting toxicity": - exists "Type of treatment-limiting toxicity Observation" -define "Type of treatment-limiting toxicity Observation": - Elements."Type of treatment-limiting toxicity Observation" O - where O.effective.toInterval() during "Measurement Period" + case + when "Gastrointestinal" then Concepts."Gastrointestinal" + when "Skin issues" then Concepts."Skin issues" + when "Peripheral neuropathy" then Concepts."Peripheral neuropathy" + when "Central nervous system symptoms" then Concepts."Central nervous system symptoms" + when "Weight gain" then Concepts."Weight gain" + when "Hepatic dysfunction" then Concepts."Hepatic dysfunction" + when "Haematological disorders" then Concepts."Haematological disorders" + when "Fatigue" then Concepts."Fatigue" + when "Headache D.DE475" then Concepts."Headache - HIV.D.DE475" + when "Bone dysfunction" then Concepts."Bone dysfunction" + when "Metabolic symptoms" then Concepts."Metabolic symptoms" + when "Kidney dysfunction" then Concepts."Kidney dysfunction" + when "Unexpected adverse drug reaction" then Concepts."Unexpected adverse drug reaction" + else null + end /* End of Type of treatment-limiting toxicity */ /* @@ -3445,17 +3377,9 @@ define "Type of treatment-limiting toxicity Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to GI issues (nausea, diarrhoea, abdominal pain, vomiting) */ -// TODO: Replace placeholder with relevant CQL logic + define "Gastrointestinal": - exists "Gastrointestinal Condition" - or exists "Gastrointestinal Observation" -define "Gastrointestinal Condition": - Elements."Gastrointestinal Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Gastrointestinal Observation": - Elements."Gastrointestinal Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Gastrointestinal" AE where AE.date during "Measurement Period" /* End of Gastrointestinal */ /* @@ -3463,17 +3387,9 @@ define "Gastrointestinal Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to skin issues (rash, hypersensitivity reaction) */ -// TODO: Replace placeholder with relevant CQL logic + define "Skin issues": - exists "Skin issues Condition" - or exists "Skin issues Observation" -define "Skin issues Condition": - Elements."Skin issues Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Skin issues Observation": - Elements."Skin issues Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Skin issues" AE where AE.date during "Measurement Period" /* End of Skin issues */ /* @@ -3481,17 +3397,9 @@ define "Skin issues Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to peripheral neuropathy (burning/numbness/ tingling) */ -// TODO: Replace placeholder with relevant CQL logic + define "Peripheral neuropathy": - exists "Peripheral neuropathy Condition" - or exists "Peripheral neuropathy Observation" -define "Peripheral neuropathy Condition": - Elements."Peripheral neuropathy Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Peripheral neuropathy Observation": - Elements."Peripheral neuropathy Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Peripheral neuropathy" AE where AE.date during "Measurement Period" /* End of Peripheral neuropathy */ /* @@ -3499,17 +3407,9 @@ define "Peripheral neuropathy Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to central nervous system symptoms (dizzy, anxiety, nightmare, depression, seizures) */ -// TODO: Replace placeholder with relevant CQL logic + define "Central nervous system symptoms": - exists "Central nervous system symptoms Condition" - or exists "Central nervous system symptoms Observation" -define "Central nervous system symptoms Condition": - Elements."Central nervous system symptoms Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Central nervous system symptoms Observation": - Elements."Central nervous system symptoms Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Central nervous system symptoms" AE where AE.date during "Measurement Period" /* End of Central nervous system symptoms */ /* @@ -3517,17 +3417,9 @@ define "Central nervous system symptoms Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to weight gain */ -// TODO: Replace placeholder with relevant CQL logic + define "Weight gain": - exists "Weight gain Condition" - or exists "Weight gain Observation" -define "Weight gain Condition": - Elements."Weight gain Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Weight gain Observation": - Elements."Weight gain Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Weight gain" AE where AE.date during "Measurement Period" /* End of Weight gain */ /* @@ -3535,17 +3427,9 @@ define "Weight gain Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to hepatic dysfunction (jaundice) */ -// TODO: Replace placeholder with relevant CQL logic + define "Hepatic dysfunction": - exists "Hepatic dysfunction Condition" - or exists "Hepatic dysfunction Observation" -define "Hepatic dysfunction Condition": - Elements."Hepatic dysfunction Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Hepatic dysfunction Observation": - Elements."Hepatic dysfunction Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Hepatic dysfunction" AE where AE.date during "Measurement Period" /* End of Hepatic dysfunction */ /* @@ -3553,17 +3437,9 @@ define "Hepatic dysfunction Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to haematological (anaemia, neutropenia) disorders */ -// TODO: Replace placeholder with relevant CQL logic + define "Haematological disorders": - exists "Haematological disorders Condition" - or exists "Haematological disorders Observation" -define "Haematological disorders Condition": - Elements."Haematological disorders Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Haematological disorders Observation": - Elements."Haematological disorders Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Haematological disorders" AE where AE.date during "Measurement Period" /* End of Haematological disorders */ /* @@ -3571,17 +3447,9 @@ define "Haematological disorders Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to fatigue */ -// TODO: Replace placeholder with relevant CQL logic + define "Fatigue": - exists "Fatigue Condition" - or exists "Fatigue Observation" -define "Fatigue Condition": - Elements."Fatigue Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Fatigue Observation": - Elements."Fatigue Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Fatigue" AE where AE.date during "Measurement Period" /* End of Fatigue */ /* @@ -3589,17 +3457,9 @@ define "Fatigue Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to headache */ -// TODO: Replace placeholder with relevant CQL logic + define "Headache D.DE475": - exists "Headache D.DE475 Condition" - or exists "Headache D.DE475 Observation" -define "Headache D.DE475 Condition": - Elements."Headache D.DE475 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Headache D.DE475 Observation": - Elements."Headache D.DE475 Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Headache D.DE475" AE where AE.date during "Measurement Period" /* End of Headache D.DE475 */ /* @@ -3607,17 +3467,9 @@ define "Headache D.DE475 Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to bone dysfunction (fractures, osteopenia) */ -// TODO: Replace placeholder with relevant CQL logic + define "Bone dysfunction": - exists "Bone dysfunction Condition" - or exists "Bone dysfunction Observation" -define "Bone dysfunction Condition": - Elements."Bone dysfunction Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Bone dysfunction Observation": - Elements."Bone dysfunction Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Bone dysfunction" AE where AE.date during "Measurement Period" /* End of Bone dysfunction */ /* @@ -3625,17 +3477,9 @@ define "Bone dysfunction Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to metabolic symptoms (body fat changes, hyperglycaemia, dyslipidaemia) */ -// TODO: Replace placeholder with relevant CQL logic + define "Metabolic symptoms": - exists "Metabolic symptoms Condition" - or exists "Metabolic symptoms Observation" -define "Metabolic symptoms Condition": - Elements."Metabolic symptoms Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Metabolic symptoms Observation": - Elements."Metabolic symptoms Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Metabolic symptoms" AE where AE.date during "Measurement Period" /* End of Metabolic symptoms */ /* @@ -3643,17 +3487,9 @@ define "Metabolic symptoms Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Treatment-limiting toxicity due to kidney dysfunction (nephrolithiasis, renal insufficiency) */ -// TODO: Replace placeholder with relevant CQL logic + define "Kidney dysfunction": - exists "Kidney dysfunction Condition" - or exists "Kidney dysfunction Observation" -define "Kidney dysfunction Condition": - Elements."Kidney dysfunction Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Kidney dysfunction Observation": - Elements."Kidney dysfunction Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Kidney dysfunction" AE where AE.date during "Measurement Period" /* End of Kidney dysfunction */ /* @@ -3661,17 +3497,9 @@ define "Kidney dysfunction Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client experienced an unexpected adverse drug reaction */ -// TODO: Replace placeholder with relevant CQL logic + define "Unexpected adverse drug reaction": - exists "Unexpected adverse drug reaction Condition" - or exists "Unexpected adverse drug reaction Observation" -define "Unexpected adverse drug reaction Condition": - Elements."Unexpected adverse drug reaction Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Unexpected adverse drug reaction Observation": - Elements."Unexpected adverse drug reaction Observation" O - where O.effective.toInterval() during "Measurement Period" + exists Elements."Unexpected adverse drug reaction" AE where AE.date during "Measurement Period" /* End of Unexpected adverse drug reaction */ /* @@ -3734,6 +3562,31 @@ define "Enhanced adherence counselling provided Observation": where O.effective.toInterval() during "Measurement Period" /* End of Enhanced adherence counselling provided */ +/* +@dataElement: HIV.D.DE552 - Buprenorphine +@activity: HIV.D8 Capture or update client history +@description: Opioid substitution to treat opioid dependence +*/ + +define "Buprenorphine D.DE552": + Elements."Buprenorphine D.DE552" MR + where MR.status = 'completed' + and MR.MedicationRequestPeriod() during "Measurement Period" + + +/* +@dataElement: HIV.D.DE555 - Methadone +@activity: HIV.D8 Capture or update client history +@description: Opioid substitution to treat opioid dependence +*/ +define "Methadone D.DE555": + Elements."Methadone D.DE555" MR + where MR.status = 'completed' + and MR.MedicationRequestPeriod() during "Measurement Period" + + +/* End of Methadone D.DE555 */ + /* @dataElement: HIV.D.DE656 - Date of cervical cancer screening test @activity: HIV.D28 Offer other services @@ -3842,7 +3695,7 @@ define "Cervical precancer lesions": */ define "Invasive cervical cancer": - exists Elements."Invasive cervical cancer" C + Elements."Invasive cervical cancer" C where C.prevalenceInterval() overlaps "Measurement Period" define "Invasive cervical cancer diagnosis in the last 12 months": @@ -3968,7 +3821,7 @@ define "Invasive cervical cancer treatment episode Value": */ define "Invasive cervical cancer treatment method": - exists Elements."Invasive cervical cancer treatment method" P + Elements."Invasive cervical cancer treatment method" P where P.performed during "Measurement Period" /* End of Invasive cervical cancer treatment method */ @@ -4017,8 +3870,7 @@ define "Management of invasive cervical cancer": 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" + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Management of invasive cervical cancer */ @@ -4033,8 +3885,7 @@ define "Radiotherapy": define "Radiotherapy Condition": Elements."Radiotherapy Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Radiotherapy */ @@ -4049,8 +3900,7 @@ define "Chemotherapy": define "Chemotherapy Condition": Elements."Chemotherapy Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Chemotherapy */ @@ -4065,8 +3915,7 @@ define "Chemoradiation": define "Chemoradiation Condition": Elements."Chemoradiation Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Chemoradiation */ @@ -4081,8 +3930,7 @@ define "Other D.DE739": 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" + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Other D.DE739 */ @@ -4146,12 +3994,18 @@ define "DSD ART start date": @activity: HIV.D21 Determine regimen and treatment options @description: Type of DSD ART model client is enrolled in (country-specific) */ -// TODO: Replace placeholder with relevant CQL logic + define "DSD ART models": - exists "DSD ART models Observation" -define "DSD ART models Observation": - Elements."DSD ART models Observation" O - where O.effective.toInterval() during "Measurement Period" + case + when "Fast track ART refill" then Concepts."Fast track ART refill" + when "Facility adherence club" then Concepts."Facility adherence club" + when "Community ART distribution point" then Concepts."Community ART distribution point" + when "CHW/peer educator community ART group" then Concepts."CHW/peer educator community ART group" + when "Patient/client community ART group" then Concepts."Patient/client community ART group" + when "Other DSD ART model" then Concepts."Other DSD ART model" + else null + end + /* End of DSD ART models */ /* @@ -4159,17 +4013,22 @@ define "DSD ART models Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in fast track ART refill (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "Fast track ART refill": - exists "Fast track ART refill Condition" - or exists "Fast track ART refill Observation" -define "Fast track ART refill Condition": - Elements."Fast track ART refill Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Fast track ART refill Observation": - Elements."Fast track ART refill Observation" O - where O.effective.toInterval() during "Measurement Period" + exists( + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Fast track ART refill") + and (exists ( + EOC.statusHistory H + where H.period starts after start of "Measurement Period" + and H.period starts before end of "Measurement Period" + ) + or ( + EOC.period starts after start of "Measurement Period" + and EOC.period starts before end of "Measurement Period" + ) + ) + ) /* End of Fast track ART refill */ /* @@ -4177,17 +4036,22 @@ define "Fast track ART refill Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in facility adherence club (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "Facility adherence club": - exists "Facility adherence club Condition" - or exists "Facility adherence club Observation" -define "Facility adherence club Condition": - Elements."Facility adherence club Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Facility adherence club Observation": - Elements."Facility adherence club Observation" O - where O.effective.toInterval() during "Measurement Period" + exists( + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Facility adherence club") + and (exists ( + EOC.statusHistory H + where H.period starts after start of "Measurement Period" + and H.period starts before end of "Measurement Period" + ) + or ( + EOC.period starts after start of "Measurement Period" + and EOC.period starts before end of "Measurement Period" + ) + ) + ) /* End of Facility adherence club */ /* @@ -4195,17 +4059,22 @@ define "Facility adherence club Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in community ART distribution point (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "Community ART distribution point": - exists "Community ART distribution point Condition" - or exists "Community ART distribution point Observation" -define "Community ART distribution point Condition": - Elements."Community ART distribution point Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Community ART distribution point Observation": - Elements."Community ART distribution point Observation" O - where O.effective.toInterval() during "Measurement Period" + exists( + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Community ART distribution point") + and (exists ( + EOC.statusHistory H + where H.period starts after start of "Measurement Period" + and H.period starts before end of "Measurement Period" + ) + or ( + EOC.period starts after start of "Measurement Period" + and EOC.period starts before end of "Measurement Period" + ) + ) + ) /* End of Community ART distribution point */ /* @@ -4213,17 +4082,22 @@ define "Community ART distribution point Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in community health worker/peer educator community ART group (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "CHW/peer educator community ART group": - exists "CHW/peer educator community ART group Condition" - or exists "CHW/peer educator community ART group Observation" -define "CHW/peer educator community ART group Condition": - Elements."CHW/peer educator community ART group Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "CHW/peer educator community ART group Observation": - Elements."CHW/peer educator community ART group Observation" O - where O.effective.toInterval() during "Measurement Period" + exists( + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."CHW/peer educator community ART group") + and (exists ( + EOC.statusHistory H + where H.period starts after start of "Measurement Period" + and H.period starts before end of "Measurement Period" + ) + or ( + EOC.period starts after start of "Measurement Period" + and EOC.period starts before end of "Measurement Period" + ) + ) + ) /* End of CHW/peer educator community ART group */ /* @@ -4231,17 +4105,22 @@ define "CHW/peer educator community ART group Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in patient/client community ART group (DSD ART model) */ -// TODO: Replace placeholder with relevant CQL logic + define "Patient/client community ART group": - exists "Patient/client community ART group Condition" - or exists "Patient/client community ART group Observation" -define "Patient/client community ART group Condition": - Elements."Patient/client community ART group Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Patient/client community ART group Observation": - Elements."Patient/client community ART group Observation" O - where O.effective.toInterval() during "Measurement Period" + exists( + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Patient/client community ART group") + and (exists ( + EOC.statusHistory H + where H.period starts after start of "Measurement Period" + and H.period starts before end of "Measurement Period" + ) + or ( + EOC.period starts after start of "Measurement Period" + and EOC.period starts before end of "Measurement Period" + ) + ) + ) /* End of Patient/client community ART group */ /* @@ -4249,17 +4128,22 @@ define "Patient/client community ART group Observation": @activity: HIV.D21 Determine regimen and treatment options @description: Client is enrolled in another DSD ART model */ -// TODO: Replace placeholder with relevant CQL logic + define "Other DSD ART model": - exists "Other DSD ART model Condition" - or exists "Other DSD ART model Observation" -define "Other DSD ART model Condition": - Elements."Other DSD ART model Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Other DSD ART model Observation": - Elements."Other DSD ART model Observation" O - where O.effective.toInterval() during "Measurement Period" + exists( + [EpisodeOfCare] EOC + where exists(EOC.type T where T ~ Concepts."Other DSD ART model") + and (exists ( + EOC.statusHistory H + where H.period starts after start of "Measurement Period" + and H.period starts before end of "Measurement Period" + ) + or ( + EOC.period starts after start of "Measurement Period" + and EOC.period starts before end of "Measurement Period" + ) + ) + ) /* End of Other DSD ART model */ /* @@ -4286,8 +4170,7 @@ define "Urethral discharge syndrome D.DE779": or exists "Urethral discharge syndrome D.DE779 Observation" define "Urethral discharge syndrome D.DE779 Condition": Elements."Urethral discharge syndrome D.DE779 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Urethral discharge syndrome D.DE779 Observation": Elements."Urethral discharge syndrome D.DE779 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4304,8 +4187,7 @@ define "Vaginal discharge syndrome D.DE780": or exists "Vaginal discharge syndrome D.DE780 Observation" define "Vaginal discharge syndrome D.DE780 Condition": Elements."Vaginal discharge syndrome D.DE780 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Vaginal discharge syndrome D.DE780 Observation": Elements."Vaginal discharge syndrome D.DE780 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4322,8 +4204,7 @@ define "Lower Abdominal pain D.DE781": or exists "Lower Abdominal pain D.DE781 Observation" define "Lower Abdominal pain D.DE781 Condition": Elements."Lower Abdominal pain D.DE781 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Lower Abdominal pain D.DE781 Observation": Elements."Lower Abdominal pain D.DE781 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4340,8 +4221,7 @@ define "Genital ulcer disease syndrome D.DE782": or exists "Genital ulcer disease syndrome D.DE782 Observation" define "Genital ulcer disease syndrome D.DE782 Condition": Elements."Genital ulcer disease syndrome D.DE782 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Genital ulcer disease syndrome D.DE782 Observation": Elements."Genital ulcer disease syndrome D.DE782 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4358,8 +4238,7 @@ define "Anorectal discharge D.DE783": or exists "Anorectal discharge D.DE783 Observation" define "Anorectal discharge D.DE783 Condition": Elements."Anorectal discharge D.DE783 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Anorectal discharge D.DE783 Observation": Elements."Anorectal discharge D.DE783 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4376,8 +4255,7 @@ define "Sent for testing D.DE784": or exists "Sent for testing D.DE784 Observation" define "Sent for testing D.DE784 Condition": Elements."Sent for testing D.DE784 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Sent for testing D.DE784 Observation": Elements."Sent for testing D.DE784 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4394,8 +4272,7 @@ define "Other D.DE785": or exists "Other D.DE785 Observation" define "Other D.DE785 Condition": Elements."Other D.DE785 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other D.DE785 Observation": Elements."Other D.DE785 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4452,8 +4329,7 @@ define "Positive D.DE803": or exists "Positive D.DE803 Observation" define "Positive D.DE803 Condition": Elements."Positive D.DE803 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Positive D.DE803 Observation": Elements."Positive D.DE803 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4470,8 +4346,7 @@ define "Negative D.DE804": or exists "Negative D.DE804 Observation" define "Negative D.DE804 Condition": Elements."Negative D.DE804 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Negative D.DE804 Observation": Elements."Negative D.DE804 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4488,8 +4363,7 @@ define "Inconclusive D.DE805": or exists "Inconclusive D.DE805 Observation" define "Inconclusive D.DE805 Condition": Elements."Inconclusive D.DE805 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Inconclusive D.DE805 Observation": Elements."Inconclusive D.DE805 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4547,8 +4421,7 @@ define "Positive D.DE809": or exists "Positive D.DE809 Observation" define "Positive D.DE809 Condition": Elements."Positive D.DE809 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Positive D.DE809 Observation": Elements."Positive D.DE809 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4565,8 +4438,7 @@ define "Negative D.DE810": or exists "Negative D.DE810 Observation" define "Negative D.DE810 Condition": Elements."Negative D.DE810 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Negative D.DE810 Observation": Elements."Negative D.DE810 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4583,8 +4455,7 @@ define "Inconclusive D.DE811": or exists "Inconclusive D.DE811 Observation" define "Inconclusive D.DE811 Condition": Elements."Inconclusive D.DE811 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Inconclusive D.DE811 Observation": Elements."Inconclusive D.DE811 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4628,8 +4499,7 @@ define "Blood D.DE814": or exists "Blood D.DE814 Observation" define "Blood D.DE814 Condition": Elements."Blood D.DE814 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Blood D.DE814 Observation": Elements."Blood D.DE814 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4646,8 +4516,7 @@ define "Urine D.DE815": or exists "Urine D.DE815 Observation" define "Urine D.DE815 Condition": Elements."Urine D.DE815 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Urine D.DE815 Observation": Elements."Urine D.DE815 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4664,8 +4533,7 @@ define "Cervical or vaginal swab D.DE816": or exists "Cervical or vaginal swab D.DE816 Observation" define "Cervical or vaginal swab D.DE816 Condition": Elements."Cervical or vaginal swab D.DE816 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Cervical or vaginal swab D.DE816 Observation": Elements."Cervical or vaginal swab D.DE816 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4682,8 +4550,7 @@ define "Urethral or penile swab D.DE817": or exists "Urethral or penile swab D.DE817 Observation" define "Urethral or penile swab D.DE817 Condition": Elements."Urethral or penile swab D.DE817 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Urethral or penile swab D.DE817 Observation": Elements."Urethral or penile swab D.DE817 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4700,8 +4567,7 @@ define "Rectal swab D.DE818": or exists "Rectal swab D.DE818 Observation" define "Rectal swab D.DE818 Condition": Elements."Rectal swab D.DE818 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Rectal swab D.DE818 Observation": Elements."Rectal swab D.DE818 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4718,8 +4584,7 @@ define "Other D.DE819": or exists "Other D.DE819 Observation" define "Other D.DE819 Condition": Elements."Other D.DE819 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other D.DE819 Observation": Elements."Other D.DE819 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4749,8 +4614,7 @@ define "NAAT D.DE829": or exists "NAAT D.DE829 Observation" define "NAAT D.DE829 Condition": Elements."NAAT D.DE829 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "NAAT D.DE829 Observation": Elements."NAAT D.DE829 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4767,8 +4631,7 @@ define "POC Test D.DE830": or exists "POC Test D.DE830 Observation" define "POC Test D.DE830 Condition": Elements."POC Test D.DE830 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "POC Test D.DE830 Observation": Elements."POC Test D.DE830 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4785,8 +4648,7 @@ define "Culture D.DE831": or exists "Culture D.DE831 Observation" define "Culture D.DE831 Condition": Elements."Culture D.DE831 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Culture D.DE831 Observation": Elements."Culture D.DE831 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4803,8 +4665,7 @@ define "Microscopy D.DE832": or exists "Microscopy D.DE832 Observation" define "Microscopy D.DE832 Condition": Elements."Microscopy D.DE832 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Microscopy D.DE832 Observation": Elements."Microscopy D.DE832 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4821,8 +4682,7 @@ define "Other D.DE833": or exists "Other D.DE833 Observation" define "Other D.DE833 Condition": Elements."Other D.DE833 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other D.DE833 Observation": Elements."Other D.DE833 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -4833,11 +4693,9 @@ define "Other D.DE833 Observation": @activity: HIV.D8 Capture or update client history @description: Final result of the TB investigation (bacteriological and/or clinical) */ -// TODO: Replace placeholder with relevant CQL logic + define "TB diagnosis result": - exists "TB diagnosis result Observation" -define "TB diagnosis result Observation": - Elements."TB diagnosis result Observation" O + exists Elements."TB diagnosis result" O where O.effective.toInterval() during "Measurement Period" /* End of TB diagnosis result */ @@ -4846,25 +4704,9 @@ define "TB diagnosis result Observation": @activity: HIV.D8 Capture or update client history @description: Client is diagnosed with TB disease */ -define TB_diagnosed: - exists( - ([Condition] C - where C.clinicalStatus ~ ConceptsCustom."active" - and exists(C.category CC where CC ~ ConceptsCustom."encounter-diagnosis") - and C.code ~ Concepts."Diagnosed TB" - and C.onset during "Measurement Period") - ) -// TODO: Replace placeholder with relevant CQL logic define "Diagnosed TB": - exists "Diagnosed TB Condition" - or exists "Diagnosed TB Observation" -define "Diagnosed TB Condition": - Elements."Diagnosed TB Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Diagnosed TB Observation": - Elements."Diagnosed TB Observation" O + exists Elements."Diagnosed TB" O where O.effective.toInterval() during "Measurement Period" /* End of Diagnosed TB */ @@ -4873,16 +4715,9 @@ define "Diagnosed TB Observation": @activity: HIV.D8 Capture or update client history @description: Client is not diagnosed with TB */ -// TODO: Replace placeholder with relevant CQL logic + define "TB excluded": - exists "TB excluded Condition" - or exists "TB excluded Observation" -define "TB excluded Condition": - Elements."TB excluded Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "TB excluded Observation": - Elements."TB excluded Observation" O + exists Elements."TB excluded" O where O.effective.toInterval() during "Measurement Period" /* End of TB excluded */ @@ -4891,20 +4726,9 @@ define "TB excluded Observation": @activity: HIV.D8 Capture or update client history @description: Client has signs or symptoms of tuberculosis (TB) without laboratory confirmation */ -define TB_presumptive: - exists( - ([Condition] C - where C.clinicalStatus ~ ConceptsCustom."active" - and exists(C.category CC where CC ~ ConceptsCustom."encounter-diagnosis") - and C.code ~ Concepts."Presumptive TB - HIV.D.DE945" - and C.onset during "Measurement Period") - ) -// TODO: Replace placeholder with relevant CQL logic define "Presumptive TB D.DE945": - exists "Presumptive TB D.DE945 Observation" -define "Presumptive TB D.DE945 Observation": - Elements."Presumptive TB D.DE945 Observation" O + exists Elements."Presumptive TB D.DE945" O where O.effective.toInterval() during "Measurement Period" /* End of Presumptive TB D.DE945 */ @@ -4915,7 +4739,7 @@ define "Presumptive TB D.DE945 Observation": */ define "Date of TB diagnosis": - start of First(Elements."Date of TB diagnosis") during "Measurement Period" + exists(Elements."Date of TB diagnosis" C where C during "Measurement Period") /* End of Date of TB diagnosis */ @@ -4928,6 +4752,11 @@ define "TB preventive treatment TPT start date in measurement period": Elements."TB preventive treatment TPT start date" D where D in "Measurement Period" +define "TB preventive treatment TPT start date in previous measurement period": + Elements."TB preventive treatment TPT start date" D + where D before (end of "Measurement Period" - duration in days of "Measurement Period") + and D after (start of "Measurement Period" - duration in days of "Measurement Period") + define "TB preventive treatment TPT completed in measurement period": Elements."TPT regimen" MS where start of MS.effective.toInterval() in "Measurement Period" @@ -5119,8 +4948,7 @@ define "Not started": or exists "Not started Observation" define "Not started Condition": Elements."Not started Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Not started Observation": Elements."Not started Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5137,8 +4965,7 @@ define "On TPT": or exists "On TPT Observation" define "On TPT Condition": Elements."On TPT Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "On TPT Observation": Elements."On TPT Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5155,8 +4982,7 @@ define "On TPT with interruptions": or exists "On TPT with interruptions Observation" define "On TPT with interruptions Condition": Elements."On TPT with interruptions Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "On TPT with interruptions Observation": Elements."On TPT with interruptions Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5173,8 +4999,7 @@ define "On hold": or exists "On hold Observation" define "On hold Condition": Elements."On hold Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "On hold Observation": Elements."On hold Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5191,8 +5016,7 @@ define "Completed": or exists "Completed Observation" define "Completed Condition": Elements."Completed Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Completed Observation": Elements."Completed Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5203,12 +5027,14 @@ define "Completed Observation": @activity: HIV.E1 Capture or update mother's history @description: When the pregnant woman or mother initiated ART, for women living with HIV. */ -// TODO: Replace placeholder with relevant CQL logic + define "Timing of ART initiation": - exists "Timing of ART initiation Observation" -define "Timing of ART initiation Observation": - Elements."Timing of ART initiation Observation" O - where O.effective.toInterval() during "Measurement Period" + case + when "Already on ART at first antenatal care visit" then Concepts."Already on ART at first antenatal care visit" + when "Newly on ART during pregnancy" then Concepts."Newly on ART during pregnancy" + when "Newly on ART during labour and delivery" then Concepts."Newly on ART during labour and delivery" + else null + end /* End of Timing of ART initiation */ /* @@ -5216,16 +5042,9 @@ define "Timing of ART initiation Observation": @activity: HIV.E1 Capture or update mother's history @description: The pregnant woman was already on antiretroviral therapy (ART) at first antenatal care visit */ -// TODO: Replace placeholder with relevant CQL logic + define "Already on ART at first antenatal care visit": - exists "Already on ART at first antenatal care visit Condition" - or exists "Already on ART at first antenatal care visit Observation" -define "Already on ART at first antenatal care visit Condition": - Elements."Already on ART at first antenatal care visit Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Already on ART at first antenatal care visit Observation": - Elements."Already on ART at first antenatal care visit Observation" O + exists Elements."Already on ART at first antenatal care visit" O where O.effective.toInterval() during "Measurement Period" /* End of Already on ART at first antenatal care visit */ @@ -5234,16 +5053,9 @@ define "Already on ART at first antenatal care visit Observation": @activity: HIV.E1 Capture or update mother's history @description: The pregnant woman started ART during her pregnancy */ -// TODO: Replace placeholder with relevant CQL logic + define "Newly on ART during pregnancy": - exists "Newly on ART during pregnancy Condition" - or exists "Newly on ART during pregnancy Observation" -define "Newly on ART during pregnancy Condition": - Elements."Newly on ART during pregnancy Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Newly on ART during pregnancy Observation": - Elements."Newly on ART during pregnancy Observation" O + exists Elements."Newly on ART during pregnancy" O where O.effective.toInterval() during "Measurement Period" /* End of Newly on ART during pregnancy */ @@ -5252,16 +5064,9 @@ define "Newly on ART during pregnancy Observation": @activity: HIV.E1 Capture or update mother's history @description: The woman started ART during labour and delivery */ -// TODO: Replace placeholder with relevant CQL logic + define "Newly on ART during labour and delivery": - exists "Newly on ART during labour and delivery Condition" - or exists "Newly on ART during labour and delivery Observation" -define "Newly on ART during labour and delivery Condition": - Elements."Newly on ART during labour and delivery Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" -define "Newly on ART during labour and delivery Observation": - Elements."Newly on ART during labour and delivery Observation" O + exists Elements."Newly on ART during labour and delivery" O where O.effective.toInterval() during "Measurement Period" /* End of Newly on ART during labour and delivery */ @@ -5270,13 +5075,19 @@ define "Newly on ART during labour and delivery Observation": @activity: HIV.E1 Capture or update mother's history @description: Date on which the woman delivered */ -// TODO: Replace placeholder with relevant CQL logic -define "Delivery date": - Elements."Delivery date" O +define "Live Birth Delivery": + Elements."Live Birth Delivery" O where O.effective.toInterval() during "Measurement Period" -define "Delivery date Value": - "Delivery date" O - return O.value +define "Delivery date": + "Live Birth Delivery" O + return O.effective + +define "Has Delivery in Health Facility": + exists ( + "Live Birth Delivery" O + where O.value is CodeableConcept + and O.value as CodeableConcept = Concepts."Health facility" + ) /* End of Delivery date */ /* @@ -5286,8 +5097,8 @@ define "Delivery date Value": */ // TODO: Replace placeholder with relevant CQL logic define "Place of delivery": - exists (Elements."Place of delivery" P - where P.performed.toInterval() during "Measurement Period") + exists (Elements."Place of delivery" O + where O.effective.toInterval() during "Measurement Period") /* End of Place of delivery */ /* @@ -5297,8 +5108,8 @@ define "Place of delivery": */ // TODO: Replace placeholder with relevant CQL logic define "Health facility": - exists (Elements."Health facility" P - where P.performed.toInterval() during "Measurement Period") + exists (Elements."Health facility" O + where O.effective.toInterval() during "Measurement Period") /* End of Health facility */ /* @@ -5308,8 +5119,8 @@ define "Health facility": */ // TODO: Replace placeholder with relevant CQL logic define "Home": - exists (Elements."Health facility" P - where P.performed.toInterval() during "Measurement Period") + exists (Elements."Health facility" O + where O.effective.toInterval() during "Measurement Period") /* End of Home */ /* @@ -5319,8 +5130,8 @@ define "Home": */ // TODO: Replace placeholder with relevant CQL logic define "Other E.DE70": - exists (Elements."Other E.DE70" P - where P.performed.toInterval() during "Measurement Period") + exists (Elements."Other E.DE70" O + where O.effective.toInterval() during "Measurement Period") /* End of Other E.DE70 */ /* @@ -5368,6 +5179,11 @@ define "Age of infant in weeks": define "Age of infant in years": "Infant date of birth Value" bd return CalculateAgeInYearsAt(bd, start of "Measurement Period") + +define "Is Infant Patient": + Patient.birthDate is not null + and difference in years between Patient.birthDate and start of "Measurement Period" < 1 + /* End of Age of infant */ /* @@ -5375,12 +5191,14 @@ define "Age of infant in years": @activity: HIV.F6 Check whether infant/child had HIV exposure @description: Whether the infant or child was determined to have had HIV exposure */ -// TODO: Replace placeholder with relevant CQL logic +define "is HIV-exposed infant or child E.DE112": + "Is Infant Patient" and + exists(Elements."HIV-exposed infant or child E.DE112" O + where O.effective.toInterval() during "Measurement Period") + define "HIV-exposed infant or child E.DE112": Elements."HIV-exposed infant or child E.DE112" O where O.effective.toInterval() during "Measurement Period" -define "is HIV-exposed infant or child E.DE112": - exists "HIV-exposed infant or child E.DE112" /* End of HIV-exposed infant or child E.DE112 */ /* @@ -5420,8 +5238,7 @@ define "Rapid diagnostic test for HIV E.DE169": or exists "Rapid diagnostic test for HIV E.DE169 Observation" define "Rapid diagnostic test for HIV E.DE169 Condition": Elements."Rapid diagnostic test for HIV E.DE169 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Rapid diagnostic test for HIV E.DE169 Observation": Elements."Rapid diagnostic test for HIV E.DE169 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5438,8 +5255,7 @@ define "Enzyme immunoassay for HIV E.DE170": or exists "Enzyme immunoassay for HIV E.DE170 Observation" define "Enzyme immunoassay for HIV E.DE170 Condition": Elements."Enzyme immunoassay for HIV E.DE170 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Enzyme immunoassay for HIV E.DE170 Observation": Elements."Enzyme immunoassay for HIV E.DE170 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5456,8 +5272,7 @@ define "Nucleic acid test for HIV E.DE171": or exists "Nucleic acid test for HIV E.DE171 Observation" define "Nucleic acid test for HIV E.DE171 Condition": Elements."Nucleic acid test for HIV E.DE171 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Nucleic acid test for HIV E.DE171 Observation": Elements."Nucleic acid test for HIV E.DE171 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5474,8 +5289,7 @@ define "Dual HIV/syphilis rapid diagnostic test E.DE172": or exists "Dual HIV/syphilis rapid diagnostic test E.DE172 Observation" define "Dual HIV/syphilis rapid diagnostic test E.DE172 Condition": Elements."Dual HIV/syphilis rapid diagnostic test E.DE172 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Dual HIV/syphilis rapid diagnostic test E.DE172 Observation": Elements."Dual HIV/syphilis rapid diagnostic test E.DE172 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5505,8 +5319,7 @@ define "12-month visit": or exists "12-month visit Observation" define "12-month visit Condition": Elements."12-month visit Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "12-month visit Observation": Elements."12-month visit Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5523,8 +5336,7 @@ define "24-month visit": or exists "24-month visit Observation" define "24-month visit Condition": Elements."24-month visit Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "24-month visit Observation": Elements."24-month visit Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5541,8 +5353,7 @@ define "First visit after the end of breastfeeding": or exists "First visit after the end of breastfeeding Observation" define "First visit after the end of breastfeeding Condition": Elements."First visit after the end of breastfeeding Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "First visit after the end of breastfeeding Observation": Elements."First visit after the end of breastfeeding Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5561,6 +5372,43 @@ define "Registered in birth cohort Observation": where O.effective.toInterval() during "Measurement Period" /* End of Registered in birth cohort */ +/* +@dataElement: HIV.E.DE186 - EID test number 1 test result +@activity: HIV.F8 Test infant/child for HIV using testing algorithm +@description: Early infant diagnosis test number 1 test result +*/ + +define "EID test number 1 test result": + case + when "Positive E.DE187" then Concepts."Positive - HIV.E.DE187" + when "Negative E.DE188" then Concepts."Negative - HIV.E.DE188" + when "Indeterminate E.DE189"then Concepts."Indeterminate - HIV.E.DE189" + else null + end + +define "Positive E.DE187": +exists( + Elements."Positive E.DE187" O + with [Patient] Pt + such that O.subject.references(Pt) + and months between start of O.effective.toInterval() and FHIRHelpers.ToDate(Pt.birthDate) < 2 months) + +define "Negative E.DE188": +exists( + Elements."Negative E.DE188" O + with [Patient] Pt + such that O.subject.references(Pt) + and months between start of O.effective.toInterval() and FHIRHelpers.ToDate(Pt.birthDate) < 2 months) + +define "Indeterminate E.DE189": +exists( + Elements."Indeterminate E.DE189" O + with [Patient] Pt + such that O.subject.references(Pt) + and months between start of O.effective.toInterval() and FHIRHelpers.ToDate(Pt.birthDate) < 2 months) + + + /* @dataElement: HIV.E.DE224 - HIV test date @activity: HIV.F8 Test infant/child for HIV using testing algorithm @@ -5599,8 +5447,7 @@ define "HIV-positive E.DE226": or exists "HIV-positive E.DE226 Observation" define "HIV-positive E.DE226 Condition": Elements."HIV-positive E.DE226 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "HIV-positive E.DE226 Observation": Elements."HIV-positive E.DE226 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5617,8 +5464,7 @@ define "HIV-negative E.DE227": or exists "HIV-negative E.DE227 Observation" define "HIV-negative E.DE227 Condition": Elements."HIV-negative E.DE227 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "HIV-negative E.DE227 Observation": Elements."HIV-negative E.DE227 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5635,8 +5481,7 @@ define "Unknown E.DE228": or exists "Unknown E.DE228 Observation" define "Unknown E.DE228 Condition": Elements."Unknown E.DE228 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Unknown E.DE228 Observation": Elements."Unknown E.DE228 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5680,8 +5525,7 @@ define "HIV-positive E.DE231": or exists "HIV-positive E.DE231 Observation" define "HIV-positive E.DE231 Condition": Elements."HIV-positive E.DE231 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "HIV-positive E.DE231 Observation": Elements."HIV-positive E.DE231 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5698,8 +5542,7 @@ define "HIV-negative and no longer breastfeeding": or exists "HIV-negative and no longer breastfeeding Observation" define "HIV-negative and no longer breastfeeding Condition": Elements."HIV-negative and no longer breastfeeding Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "HIV-negative and no longer breastfeeding Observation": Elements."HIV-negative and no longer breastfeeding Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5716,8 +5559,7 @@ define "HIV status unknown": or exists "HIV status unknown Observation" define "HIV status unknown Condition": Elements."HIV status unknown Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "HIV status unknown Observation": Elements."HIV status unknown Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5803,8 +5645,7 @@ define "Positive G.DE19": or exists "Positive G.DE19 Observation" define "Positive G.DE19 Condition": Elements."Positive G.DE19 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Positive G.DE19 Observation": Elements."Positive G.DE19 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5821,8 +5662,7 @@ define "Negative G.DE20": or exists "Negative G.DE20 Observation" define "Negative G.DE20 Condition": Elements."Negative G.DE20 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Negative G.DE20 Observation": Elements."Negative G.DE20 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5839,8 +5679,7 @@ define "Indeterminate G.DE21": or exists "Indeterminate G.DE21 Observation" define "Indeterminate G.DE21 Condition": Elements."Indeterminate G.DE21 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Indeterminate G.DE21 Observation": Elements."Indeterminate G.DE21 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5884,8 +5723,7 @@ define "Positive G.DE44": or exists "Positive G.DE44 Observation" define "Positive G.DE44 Condition": Elements."Positive G.DE44 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Positive G.DE44 Observation": Elements."Positive G.DE44 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5902,8 +5740,7 @@ define "Negative G.DE45": or exists "Negative G.DE45 Observation" define "Negative G.DE45 Condition": Elements."Negative G.DE45 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Negative G.DE45 Observation": Elements."Negative G.DE45 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5920,8 +5757,7 @@ define "Indeterminate G.DE46": or exists "Indeterminate G.DE46 Observation" define "Indeterminate G.DE46 Condition": Elements."Indeterminate G.DE46 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Indeterminate G.DE46 Observation": Elements."Indeterminate G.DE46 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5965,8 +5801,7 @@ define "Detected G.DE49": or exists "Detected G.DE49 Observation" define "Detected G.DE49 Condition": Elements."Detected G.DE49 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Detected G.DE49 Observation": Elements."Detected G.DE49 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -5983,8 +5818,7 @@ define "Not detected G.DE50": or exists "Not detected G.DE50 Observation" define "Not detected G.DE50 Condition": Elements."Not detected G.DE50 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Not detected G.DE50 Observation": Elements."Not detected G.DE50 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6028,8 +5862,7 @@ define "Positive G.DE71": or exists "Positive G.DE71 Observation" define "Positive G.DE71 Condition": Elements."Positive G.DE71 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Positive G.DE71 Observation": Elements."Positive G.DE71 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6046,8 +5879,7 @@ define "Negative G.DE72": or exists "Negative G.DE72 Observation" define "Negative G.DE72 Condition": Elements."Negative G.DE72 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Negative G.DE72 Observation": Elements."Negative G.DE72 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6064,8 +5896,7 @@ define "Inconclusive G.DE73": or exists "Inconclusive G.DE73 Observation" define "Inconclusive G.DE73 Condition": Elements."Inconclusive G.DE73 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Inconclusive G.DE73 Observation": Elements."Inconclusive G.DE73 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6165,8 +5996,7 @@ define "Refused stopped treatment": */ define "On ART H.DE47": exists(Elements."On ART H.DE47" ART - where ART.effective.toInterval() starts before end of "Measurement Period" - and (ART.effective.toInterval() ends after start of "Measurement Period") + where ART.effective.toInterval() during "Measurement Period" ) /* End of On ART H.DE47 */ @@ -6222,8 +6052,7 @@ define "Severe illness, hospitalization H.DE76": or exists "Severe illness, hospitalization H.DE76 Observation" define "Severe illness, hospitalization H.DE76 Condition": Elements."Severe illness, hospitalization H.DE76 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Severe illness, hospitalization H.DE76 Observation": Elements."Severe illness, hospitalization H.DE76 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6240,8 +6069,7 @@ define "Drugs out of stock ": or exists "Drugs out of stock Observation" define "Drugs out of stock Condition": Elements."Drugs out of stock Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Drugs out of stock Observation": Elements."Drugs out of stock Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6258,8 +6086,7 @@ define "Client lacks finances ": or exists "Client lacks finances Observation" define "Client lacks finances Condition": Elements."Client lacks finances Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Client lacks finances Observation": Elements."Client lacks finances Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6276,8 +6103,7 @@ define "Excluded HIV infection in infant H.DE79": or exists "Excluded HIV infection in infant H.DE79 Observation" define "Excluded HIV infection in infant H.DE79 Condition": Elements."Excluded HIV infection in infant H.DE79 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Excluded HIV infection in infant H.DE79 Observation": Elements."Excluded HIV infection in infant H.DE79 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6294,8 +6120,7 @@ define "Other reason for stopping ART H.DE80": or exists "Other reason for stopping ART H.DE80 Observation" define "Other reason for stopping ART H.DE80 Condition": Elements."Other reason for stopping ART H.DE80 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "Other reason for stopping ART H.DE80 Observation": Elements."Other reason for stopping ART H.DE80 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6432,8 +6257,7 @@ define "HIV-positive PRV.DE12": or exists "HIV-positive PRV.DE12 Observation" define "HIV-positive PRV.DE12 Condition": Elements."HIV-positive PRV.DE12 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "HIV-positive PRV.DE12 Observation": Elements."HIV-positive PRV.DE12 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6450,8 +6274,7 @@ define "HIV-negative PRV.DE13": or exists "HIV-negative PRV.DE13 Observation" define "HIV-negative PRV.DE13 Condition": Elements."HIV-negative PRV.DE13 Condition" C - where C.prevalenceInterval() overlaps before "Measurement Period" - or C.prevalenceInterval() overlaps after "Measurement Period" + where C.prevalenceInterval() overlaps "Measurement Period" define "HIV-negative PRV.DE13 Observation": Elements."HIV-negative PRV.DE13 Observation" O where O.effective.toInterval() during "Measurement Period" @@ -6470,13 +6293,10 @@ define "HIV-negative PRV.DE13 Observation": @activity: HIV.B21 Offer prevention options @description: Date client was provided with injecting equipment */ -// TODO: Replace placeholder with relevant CQL logic + define "Date injecting equipment provided": - Elements."Date injecting equipment provided" O - where O.effective.toInterval() during "Measurement Period" -define "Date injecting equipment provided Value": - "Date injecting equipment provided" O - return O.value + exists(Elements."Date injecting equipment provided" DUS + where DUS.timing.toInterval() during "Measurement Period") /* End of Date injecting equipment provided */ /* @@ -6485,12 +6305,7 @@ define "Date injecting equipment provided Value": @description: Date client initiated opioid agonist maintenance treatment (OAMT) */ // TODO: Replace placeholder with relevant CQL logic -define "Date OAMT initiated": - Elements."Date OAMT initiated" O - where O.effective.toInterval() during "Measurement Period" -define "Date OAMT initiated Value": - "Date OAMT initiated" O - return O.value + /* End of Date OAMT initiated */ /* @@ -6498,14 +6313,21 @@ define "Date OAMT initiated Value": @activity: HIV.B6 Capture or update client history @description: Client is currently on opioid agonist maintenance treatment (OAMT) at reporting date, defined according to country/program to account for medication dispensed and LTFU criterion */ -// TODO: Replace placeholder with relevant CQL logic define "Currently on OAMT": - exists "Currently on OAMT Observation" -define "Currently on OAMT Observation": - Elements."Currently on OAMT Observation" O - where O.effective.toInterval() during "Measurement Period" + exists(Elements."OAMT status" p + where p.toInterval() overlaps "Measurement Period") /* End of Currently on OAMT */ +define "OAMT status": + Elements."OAMT status" p + where p.toInterval() overlaps "Measurement Period" +define "OAMT start": + "OAMT status" p + return start of p + +define "OAMT end": + "OAMT status" p + return end of p /* @dataElement: HIV.PRV.DE21 - Retained on OAMT @activity: HIV.B6 Capture or update client history @@ -6519,6 +6341,33 @@ define "Retained on OAMT Observation": where O.effective.toInterval() during "Measurement Period" /* End of Retained on OAMT */ + +/* +@dataElement: HIV.PRV.DE22 - Client being inducted on OAMT +@activity: HIV.B6 Capture or update client history +@description: Client is retained on opioid agonist maintenance treatment (OAMT) at reporting date, defined according to country/program to account for medication dispensed and LTFU criterion +*/ + +define "Client being inducted on OAMT": +exists (Elements."Client being inducted on OAMT" O +where O.effective.toInterval() during "Measurement Period") + +/* End of Retained on OAMT */ + +/* +@dataElement: HIV.PRV.DE23 - Client on reducing doses of OAMT +@activity: HIV.B6 Capture or update client history +@description: Client is retained on opioid agonist maintenance treatment (OAMT) at reporting date, defined according to country/program to account for medication dispensed and LTFU criterion +*/ + +define "Client on reducing doses of OAMT": +exists(Elements."Client on reducing doses of OAMT" O +where O.effective.toInterval() during "Measurement Period") + + +/* End of Retained on OAMT */ + + /* @dataElement: HIV.PRV.DE25 - Date of loss to follow-up or OAMT stopped @activity: HIV.B6 Capture or update client history @@ -6634,8 +6483,7 @@ define "Currently pregnant SRV.DE7": 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" + where C.prevalenceInterval() overlaps "Measurement Period" /* End of Currently pregnant SRV.DE7 */ /* @@ -6673,8 +6521,8 @@ define "Viral load test result SRV.DE13 Value": */ define "Visit date SRV.DE15": - exists(Elements."Visit date SRV.DE15" p - where start of p during "Measurement Period") + exists(Elements."Visit date SRV.DE15" E + where start of E during "Measurement Period") /* End of Visit date SRV.DE15 */ /* diff --git a/input/fsh/examples/HivHcvTest.fsh b/input/fsh/examples/HivHcvTest.fsh index 17c20c33da9..ed4d6a88e23 100644 --- a/input/fsh/examples/HivHcvTest.fsh +++ b/input/fsh/examples/HivHcvTest.fsh @@ -8,4 +8,4 @@ Description: "An example of an HCV test observation based on the HivHcvTest prof * subject = Reference(Patient/ExampleHivPatient) * effectiveDateTime = "2023-11-01T10:00:00Z" * issued = "2023-11-02T15:00:00Z" -* valueCodeableConcept = HIVConcepts#HIV.D.DE170 +* valueCodeableConcept = HIVConcepts#HIV.D.DE171 "Positive" \ No newline at end of file diff --git a/input/fsh/examples/HivPatient.fsh b/input/fsh/examples/HivPatient.fsh index bc911a6f83f..3c4ea8780c8 100644 --- a/input/fsh/examples/HivPatient.fsh +++ b/input/fsh/examples/HivPatient.fsh @@ -1,3 +1,8 @@ Instance: ExampleHivPatient InstanceOf: HivPatient * id = "ExampleHivPatient" +* active = true +* gender = #male +* birthDate = "1980-01-01" +* address.text = "Sample" +* address.country = "US" diff --git a/input/fsh/profiles/HIvTreatmentMedicationRequest.fsh b/input/fsh/profiles/HIvTreatmentMedicationRequest.fsh new file mode 100644 index 00000000000..87f72f729fa --- /dev/null +++ b/input/fsh/profiles/HIvTreatmentMedicationRequest.fsh @@ -0,0 +1,10 @@ +Profile: HivTreatmentMedicationRequest +Parent: MedicationRequest +Description: "Core profile for HIV IG Treatment Medication Statments" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "HIV Treatment Medication Statement" +* medication[x] only CodeableConcept +* medicationCodeableConcept from HIV.D.DE537 (required) + diff --git a/input/fsh/profiles/HivAncEncounter.fsh b/input/fsh/profiles/HivAncEncounter.fsh new file mode 100644 index 00000000000..e92e90ecf1a --- /dev/null +++ b/input/fsh/profiles/HivAncEncounter.fsh @@ -0,0 +1,8 @@ +Profile: HivAncEncounter +Parent: HivEncounter +Description: "Client encounter for Antenatal care services" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "ANC Encounter" + diff --git a/input/fsh/profiles/HivChildDeliveryObservation.fsh b/input/fsh/profiles/HivChildDeliveryObservation.fsh new file mode 100644 index 00000000000..dc1145e6ea4 --- /dev/null +++ b/input/fsh/profiles/HivChildDeliveryObservation.fsh @@ -0,0 +1,16 @@ +Profile: ChildDeliveryObservation +Parent: Observation +Title: "Child Delivery Observation" +Description: "Represents an observation indicating a child was delivered, including date/time and place of delivery." +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* status 1..1 MS +* code 1..1 MS +* code.coding 1..1 +* code = HIVConcepts#HIV.E.DE48 +* effective[x] only dateTime +* effectiveDateTime 1..1 MS +* value[x] only CodeableConcept +* valueCodeableConcept 1..1 MS +* valueCodeableConcept from HIV.E.DE67 diff --git a/input/fsh/profiles/HivEncouner.fsh b/input/fsh/profiles/HivEncouner.fsh new file mode 100644 index 00000000000..dd7cac5c126 --- /dev/null +++ b/input/fsh/profiles/HivEncouner.fsh @@ -0,0 +1,8 @@ +Profile: HivEncounter +Parent: Encounter +Description: "Client encounter for HIV-related services" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "HIV Encounter" + diff --git a/input/fsh/profiles/HivHBsAgTest.fsh b/input/fsh/profiles/HivHBsAgTest.fsh index beda50940d9..9886d19cdfd 100644 --- a/input/fsh/profiles/HivHBsAgTest.fsh +++ b/input/fsh/profiles/HivHBsAgTest.fsh @@ -1,4 +1,4 @@ -Profile: HivHBsAgTest +Profile: HivHBsAgTestD Parent: HivLabTestObservation Description: "A DAK-specific Hepatitis B virus test observation with possible results" * ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" @@ -7,3 +7,13 @@ Description: "A DAK-specific Hepatitis B virus test observation with possible re * ^title = "HBsAg Test" * code = HIVConcepts#HIV.D.DE162 "HBsAg test result" * valueCodeableConcept from HIV.D.DE162 (required) + +Profile: HivHBsAgTest +Parent: HivLabTestObservation +Description: "A DAK-specific Hepatitis B virus test observation with possible results" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "HBsAg Test" +* code = HIVConcepts#HIV.G.DE18 "HBsAg test result" +* valueCodeableConcept from HIV.G.DE18 (required) diff --git a/input/fsh/profiles/HivHcvTest.fsh b/input/fsh/profiles/HivHcvTest.fsh index cddfc312dd5..6532fe5d2e2 100644 --- a/input/fsh/profiles/HivHcvTest.fsh +++ b/input/fsh/profiles/HivHcvTest.fsh @@ -1,6 +1,19 @@ Profile: HivHcvTest Parent: HivLabTestObservation Description: "A DAK-specific Hepatitis C test observation with possible results" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true * ^title = "HCV Test" * code = HIVConcepts#HIV.D.DE170 "HCV test result" * valueCodeableConcept from HIV.D.DE170 (required) + +Profile: HivHcvTestD +Parent: HivLabTestObservation +Description: "A DAK-specific Hepatitis C test observation with possible results" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "HCV Test" +* code = HIVConcepts#HIV.G.DE43 "HCV test result" +* valueCodeableConcept from HIV.G.DE43 (required) \ No newline at end of file diff --git a/input/fsh/profiles/HivHcvViralLoadTest copy.fsh b/input/fsh/profiles/HivHcvViralLoadTest copy.fsh new file mode 100644 index 00000000000..287703cc48b --- /dev/null +++ b/input/fsh/profiles/HivHcvViralLoadTest copy.fsh @@ -0,0 +1,20 @@ +Profile: HivHcvViralLoadTest +Parent: HivLabTestObservation +Description: "A DAK-specific HCV Viral Load observation with possible results" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^title = "HCV Viral Load Test" +* code = HIVConcepts#HIV.D.DE179 "HCV test result" +* valueCodeableConcept from HIV.D.DE179 (required) + +Profile: HcvViralLoadTestG +Parent: HivLabTestObservation +Description: "Hepatitis C viral load result" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "Hepatitis C Viral Load Result" +* code = HIVConcepts#HIV.G.DE48 +* valueCodeableConcept from HIV.G.DE48 (required) + + diff --git a/input/fsh/profiles/HivHcvViralLoadTest.fsh b/input/fsh/profiles/HivHcvViralLoadTest.fsh index 486f59f4a14..2232468c5b3 100644 --- a/input/fsh/profiles/HivHcvViralLoadTest.fsh +++ b/input/fsh/profiles/HivHcvViralLoadTest.fsh @@ -1,6 +1,20 @@ -Profile: HivHcvViralLoadTest +Profile: HivHcvViralLoadTestD Parent: HivLabTestObservation Description: "A DAK-specific HCV Viral Load observation with possible results" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" * ^title = "HCV Viral Load Test" * code = HIVConcepts#HIV.D.DE179 "HCV test result" * valueCodeableConcept from HIV.D.DE179 (required) + +Profile: HcvViralLoadTest +Parent: HivLabTestObservation +Description: "Hepatitis C viral load result" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "Hepatitis C Viral Load Result" +* code = HIVConcepts#HIV.G.DE48 +* valueCodeableConcept from HIV.G.DE48 (required) + + diff --git a/input/fsh/profiles/HivHtsVisit.fsh b/input/fsh/profiles/HivHtsVisit.fsh index 2f2a1223e99..0939d5d2734 100644 --- a/input/fsh/profiles/HivHtsVisit.fsh +++ b/input/fsh/profiles/HivHtsVisit.fsh @@ -1,5 +1,5 @@ Profile: HivHtsVisit -Parent: Encounter +Parent: HivEncounter Description: "Encounter for HIV testing services visit" * ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" * ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" diff --git a/input/fsh/profiles/HivInfant.fsh b/input/fsh/profiles/HivInfant.fsh new file mode 100644 index 00000000000..6a504c8d2f1 --- /dev/null +++ b/input/fsh/profiles/HivInfant.fsh @@ -0,0 +1,17 @@ +Profile: HivInfantPatient +Parent: HivPatient +Title: "Infant Patient Profile" +Description: "Sub-profile of Patient specifically for infants." +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true + + +// Invariant: infantBirthDateConstraint +// Description: "Infant's birthDate should not be more than 12 months in the past." +// Expression: "today() - birthDate <= 1 'year'" +// XPath: "some equivalent if needed" +// Severity: error + +// * ^extension[0].url = "http://example.org/fhir/StructureDefinition/infant-birthdate-invariant" +// * ^extension[0].value[x] = invariant#infantBirthDateConstraint \ No newline at end of file diff --git a/input/fsh/profiles/HivMother.fsh b/input/fsh/profiles/HivMother.fsh new file mode 100644 index 00000000000..3cbea4a5e64 --- /dev/null +++ b/input/fsh/profiles/HivMother.fsh @@ -0,0 +1,7 @@ +Profile: HivMother +Parent: HivPatient +Title: "Mother Patient Profile" +Description: "Sub-profile of Patient for delivering mothers." +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true \ No newline at end of file diff --git a/input/fsh/profiles/HivOamtEpisodeOfCare.fsh b/input/fsh/profiles/HivOamtEpisodeOfCare.fsh new file mode 100644 index 00000000000..406c8a815c7 --- /dev/null +++ b/input/fsh/profiles/HivOamtEpisodeOfCare.fsh @@ -0,0 +1,37 @@ + +// +// define "OAMT": +// flatten{"OAMT status","OAMT statusHistory".statusHistory.period} + +// define "OAMT status": +// [EpisodeOfCare] EOC +// where exists(EOC.type T where T ~ Concepts."OAMT") +// return EOC.period + +// define "OAMT statusHistory": +// [EpisodeOfCare] EOC +// where exists(EOC.type T where T ~ Concepts."OAMT") +// and (exists ( +// EOC.statusHistory H +// where H.period is not null)) + +// define "OAMT status date": +// [EpisodeOfCare] EOC +// where exists(EOC.type T where T ~ Concepts."OAMT") +// return start of EOC.period + +// define "OAMT statusHistory date": +// [EpisodeOfCare] EOC +// where exists(EOC.type T where T ~ Concepts."OAMT") +// and (exists ( +// EOC.statusHistory H +// where H.period is not null)) + +Profile: HivOamTreatment +Parent: EpisodeOfCare +Description: "Episode of care for opioid agonist maintenance treatment (OAMT)" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "Opioid Agonist Maintenance Treatment (OAMT)" +// diff --git a/input/fsh/profiles/HivOamtTreatment.fsh b/input/fsh/profiles/HivOamtTreatment.fsh new file mode 100644 index 00000000000..f564553feb5 --- /dev/null +++ b/input/fsh/profiles/HivOamtTreatment.fsh @@ -0,0 +1,36 @@ + +// +// define "OAMT": +// flatten{"OAMT status","OAMT statusHistory".statusHistory.period} + +// define "OAMT status": +// [EpisodeOfCare] EOC +// where exists(EOC.type T where T ~ Concepts."OAMT") +// return EOC.period + +// define "OAMT statusHistory": +// [EpisodeOfCare] EOC +// where exists(EOC.type T where T ~ Concepts."OAMT") +// and (exists ( +// EOC.statusHistory H +// where H.period is not null)) + +// define "OAMT status date": +// [EpisodeOfCare] EOC +// where exists(EOC.type T where T ~ Concepts."OAMT") +// return start of EOC.period + +// define "OAMT statusHistory date": +// [EpisodeOfCare] EOC +// where exists(EOC.type T where T ~ Concepts."OAMT") +// and (exists ( +// EOC.statusHistory H +// where H.period is not null)) + +Profile: HivTreatment +Parent: HivTreatmentMedicationRequest +Description: "Medication Request for opioid agonist maintenance treatment (OAMT)" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "Opioid Agonist Maintenance Treatment (OAMT)" diff --git a/input/fsh/profiles/HivPatient.fsh b/input/fsh/profiles/HivPatient.fsh index 0892f2985bf..0b03fdeb39e 100644 --- a/input/fsh/profiles/HivPatient.fsh +++ b/input/fsh/profiles/HivPatient.fsh @@ -1,10 +1,12 @@ Profile: HivPatient Parent: Patient - - -// Gender -// Geographic Region -// Date of Birth - - - +Description: "Profile for patients requiring gender, date of birth, and geographic region." +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* gender 1..1 MS + // MS = Must Support; you can also set binding, cardinalities, etc. if desired +* birthDate 1..1 MS +* address 1..* MS + // Ensure at least one address is present +* address.country 1..1 MS diff --git a/input/fsh/profiles/HivPregnancyCondition.fsh b/input/fsh/profiles/HivPregnancyCondition.fsh new file mode 100644 index 00000000000..1c0a1e1c44f --- /dev/null +++ b/input/fsh/profiles/HivPregnancyCondition.fsh @@ -0,0 +1,8 @@ +Profile: HivPregnancyCondition +Parent: HivCondition +Description: "A condition to indicate that a patient is pregnant" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "Pregnancy Condition" +// * code from HIVConcepts where codes are HIVConcepts#HIV.D.DE31 and HIVConcepts#HIV.SRV.DE7 and HIVConcepts#HIV.B.DE29 \ No newline at end of file diff --git a/input/fsh/profiles/HivSyndromeStiDiagnosisCondition.fsh b/input/fsh/profiles/HivSyndromeStiDiagnosisCondition.fsh new file mode 100644 index 00000000000..9e5d52dbe4f --- /dev/null +++ b/input/fsh/profiles/HivSyndromeStiDiagnosisCondition.fsh @@ -0,0 +1,11 @@ +Profile: HivSyndromeStiDiagnosis +Parent: HivCondition +Description: "A condition to indicate that a patient has been diagnosed with a sexually transmitted infection (STI) or syndrome" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition" +* ^meta.profile[+] = "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition" +* ^experimental = true +* ^title = "STI / Syndrome Diagnosis Condition" +* code from HIV.B.DE226 (required) + + + diff --git a/input/fsh/profiles/HivTimingOfArtForPregnantMothers.fsh b/input/fsh/profiles/HivTimingOfArtForPregnantMothers.fsh new file mode 100644 index 00000000000..e69de29bb2d diff --git a/todo.md b/todo.md index a7a9468c28b..83f90832588 100644 --- a/todo.md +++ b/todo.md @@ -62,4 +62,16 @@ Can we just have a single profile for a MS that has any of these choices? ## Visit Date We need to profile visit date and mark it as a specific type of encounter? -## Medication Request vs. Medication Statement: Guidelines? \ No newline at end of file +## Medication Request vs. Medication Statement: Guidelines? + + +# PROFILES: +- HivStatusObservation +- HivStatusCondition +- HivPatient +- HivInvasiveCervicalCancerDiagnosis +- HivInvasiveCervicalCancerTreatment +- HivCervicalCancerScreeningOutcome +- HivCervicalCancerScreening +- HivHcvTest +- HivHbsAgTest \ No newline at end of file