Skip to content

Commit

Permalink
Integration of various profiling and indicator work (#64) (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Piotr Mankowski <pmanko@uw.edu>
  • Loading branch information
ibacher and pmanko authored Jan 13, 2025
1 parent 5671ed9 commit b36cb5b
Show file tree
Hide file tree
Showing 110 changed files with 1,985 additions and 2,247 deletions.
33 changes: 30 additions & 3 deletions input/cql/HIVCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)



Expand Down
5 changes: 5 additions & 0 deletions input/cql/HIVConcepts.cql
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
36 changes: 21 additions & 15 deletions input/cql/HIVConceptsCustom.cql
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Loading

0 comments on commit b36cb5b

Please sign in to comment.