Skip to content

Commit

Permalink
Updated measures to be continuous variable since the denominator isn'…
Browse files Browse the repository at this point in the history
…t calculable. Only includes clients receiving the dose within the measurement period.
  • Loading branch information
lukeaduncan committed Oct 6, 2023
1 parent 8755fbd commit 3caffc8
Show file tree
Hide file tree
Showing 9 changed files with 734 additions and 542 deletions.
53 changes: 31 additions & 22 deletions input/cql/IMMZIND08.cql → input/cql/IMMZINDMeasles.cql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Library: IMMZ.IND.08
* Library: IMMZ.IND.Measles
* Immunization coverage for Measles containing vaccine (Estimated Denominator)
* Compares the administered doses of measles containing vaccines (MCV) with the estimated number of surviving infants (if dose 1) or a country supplied denominator (if dose 2) expressed as a percentage.
*
Expand All @@ -17,7 +17,7 @@
* References: WHO Immunization Facility Analysis Guide (1), WHO / UNICEF Joint Reporting Form (3 - elements 4240 and 4260 )
*/

library IMMZIND08
library IMMZINDMeasles

// Start Skeleton CQL
using FHIR version '4.0.1'
Expand All @@ -28,41 +28,50 @@ include IMMZConfig called IMMZCon
include IMMZIndicatorCommon called IMMZIndCom
include IMMZVaccineLibrary called IMMZvl
include FHIRCommon called FC
include IMMZD2DTMeasles called Measles
// End Skeleton CQL
parameter "Measurement Period" Interval<Date>

context Patient

/*
* Numerator: Number of administrations of vaccinations containing a Measles component during reporting period
* Numerator Computation: COUNT immunization events WHERE administered product is a Measles vaccine (IMMZ.A1.DE9) during reporting period
*/
define "measure-population":
exists(IMMZIndCom."MCV Doses Administered to Patient During Measurement Period")
define "MCV Doses Administered to Patient During Measurement Period":
Measles."MCV Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"
*/

define function "Measure Observation" (Patient "Patient"):
1

/*
* Disaggregator: Dose Sequence (1, 2)
*/
define "Dose Sequence Stratifier":
IMMZIndCom."MCV Doses Administered to Patient During Measurement Period" I
return (singleton from I.protocolApplied).doseNumber
* Target population for first dose: Any one over 9 (in high transmission area) or 12 (in low transmission area) months old
*/
define "Initial Population 05":
Measles."First MCV Dose Administered to Patient" I where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/*
* Disaggregator: Age Group (<24H of Birth, < 2 weeks)
* Numerator for first dose: Anyone having received the first dose
*/
define "Age Group Stratifier":
IMMZIndCom."Infant By Age Stratifier"
define "Measure Population 05":
"Initial Population 05"

/*
* Disaggregator: Geographic Region
* Target population for second dose: Any one over 15 months
*/
define "Initial Population 40":
Measles."Second MCV Dose Administered to Patient" I where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/*
* Numerator for second dose: Anyone having received the first dose
*/
define "Geographic Region Stratifier":
IMMZIndCom."By Geographic Region Stratifier"
define "Measure Population 40":
"Initial Population 40"


/*
* Disaggregator: Administrative Gender (or Biological Sex)
* Combined stratifiers
*/
define "Administrative Gender Stratifier":
IMMZIndCom."By Administrative Gender Stratifier"
define "Stratification":
IMMZIndCom."By Administrative Gender Stratifier".code + ':' + IMMZIndCom."Toddler By Age Stratifier".code + ':' + IMMZIndCom."By Geographic Region Stratifier"


/* End of IMMZ.IND.08 */
226 changes: 3 additions & 223 deletions input/cql/IMMZIndicatorCommon.cql
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ code "P1Y--P9999Y": 'P1Y--P9999Y' from "ISO-8601-Derived Periods" display '> 1 y

// Age Groups for Vaccines for Toddlers
code "P0Y--P2Y": 'P0Y--P2Y' from "ISO-8601-Derived Periods" display '< 2 years'
code "P1Y--P2Y": 'P1Y--P2Y' from "ISO-8601-Derived Periods" display '1 year'
code "P2Y--P9999Y": 'P2Y--P9999Y' from "ISO-8601-Derived Periods" display '> 2 years'

// Age groups for newborns
Expand Down Expand Up @@ -83,7 +84,8 @@ define "Infant By Age Stratifier":
*/
define "Toddler By Age Stratifier":
case
when AgeInYearsAt(start of "Measurement Period") < 2 then "P0Y--P2Y"
when AgeInYearsAt(start of "Measurement Period") < 1 then "P0Y--P1Y"
when AgeInYearsAt(start of "Measurement Period") < 2 then "P1Y--P2Y"
when AgeInYearsAt(start of "Measurement Period") >= 2 then "P2Y--P9999Y"
else null
end
Expand Down Expand Up @@ -137,228 +139,6 @@ define "Seasonal Influenza By Age Stratifier":
when AgeInYearsAt(start of "Measurement Period") >= 60 then "P60Y--P9999Y"
else null
end
/*
* BCG Doses administered to the patient during the measurement period
*/
define "BCG Doses Administered to Patient During Measurement Period":
IMMZCom."BCG Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/*
* DTP Doses administered to the patient during the measurement period
*/
define "DTP Doses Administered to Patient During Measurement Period":
IMMZCom."DTP Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/*
* HepB Doses administered to the patient during the measurement period
*/
define "HepB Birth Doses Administered to Patient During Measurement Period":
IMMZCom."HepB Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"
and (singleton from I.protocolApplied).doseNumber = 0

/**
* Non-Birth HepB doses administered to patient
*/
define "HepB Non-Birth Doses Administered to Patient During Measurement Period":
IMMZCom."HepB Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"
and (singleton from I.protocolApplied).doseNumber > 0

/**
* IPV Doses Administered to Patient
*/
define "IPV Doses Administered to Patient During Measurement Period":
IMMZCom."IPV Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

define "Seasonal Influenza Doses Administered to Patient During Reporting Period":
IMMZCom."Seasonal Influenza Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* OPV Birth Doses Administered to Patient
*/
define "bOPV Birth Doses Administered to Patient During Measurement Period":
IMMZCom."bOPV Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"
and (singleton from I.protocolApplied).doseNumber = 0

/**
* OPV Non-Birth Doses Administered to Patient
*/
define "bOPV Non-Birth Doses Administered to Patient During Measurement Period":
IMMZCom."bOPV Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"
and (singleton from I.protocolApplied).doseNumber > 0


/**
* MCV Doses Administered to Patient
*/
define "MCV Doses Administered to Patient During Measurement Period":
IMMZCom."MCV Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* HPV Doses Administered to Patient
*/
define "HPV Doses Administered to Patient During Measurement Period":
IMMZCom."HPV Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* Meningococcal Doses Administered to Patient
*/
define "Meningococcal Doses Administered to Patient During Measurement Period":
IMMZCom."Meningococcal Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* Pneumococcal Doses Administered to Patient
*/
define "Pneumococcal Doses Administered to Patient During Measurement Period":
IMMZCom."Pneumococcal Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* HIB Doses Administered to Patient
*/
define "Hib Doses Administered to Patient During Measurement Period":
IMMZCom."Hib Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* Rotavirus Doses Administered to Patient
*/
define "Rotavirus Doses Administered to Patient During Measurement Period":
IMMZCom."Rotavirus Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* RCV Doses Administered to Patient
*/
define "Rubella Doses Administered to Patient During Measurement Period":
IMMZCom."Rubella Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* Varicella Doses Administered to Patient
*/
define "Varicella Doses Administered to Patient During Measurement Period":
IMMZCom."Varicella Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"


/**
* Diptheria Doses Administered to Patient
*/
define "Diphtheria Booster Doses Administered to Patient During Measurement Period":
IMMZCom."Diphtheria Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"
and (singleton from I.protocolApplied).doseNumber > 3

/**
* Pertussis Doses Administered to Patient
*/
define "Pertussis Booster Doses Administered to Patient During Measurement Period":
IMMZCom."Diphtheria Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"
and (singleton from I.protocolApplied).doseNumber > 3


/**
* Tetanus Doses Administered to Patient
*/
define "Tetanus Booster Doses Administered to Patient During Measurement Period":
IMMZCom."Tetanus Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"
and (singleton from I.protocolApplied).doseNumber > 4


/**
* Yellow Fever Doses Administered to Patient
*/
define "Yellow Fever Doses Administered to Patient During Measurement Period":
IMMZCom."Yellow Fever Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"


/**
* Japanese Encephalitis Doses Administered to Patient
*/
define "JE Doses Administered to Patient During Measurement Period":
IMMZCom."JE Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* Typhoid Encephalitis Doses Administered to Patient
*/
define "Typhoid Doses Administered to Patient During Measurement Period":
IMMZCom."Typhoid Doses Administered to Patient" I
where IMMZCom.ToDate(I.occurrence) during "Measurement Period"

/**
* HPV Doses recommended during reporting period -
* This is used since the country should define the rules which recommend an HPV dose (age, sex, etc.)
*/
define "HPV Doses Recommended During Reporting Period":
[ImmunizationRecommendation] IR
where exists(IR.recommendation RC where exists(RC.dateCriterion DC where date from DC.value during "Measurement Period")
and RC.vaccineCode in IMMZc."HPV Vaccine")


/**
* Rubella Doses recommended during reporting period -
* This is used since the country should define the rules which recommend an Rubella dose (configuration, age, sex, etc.)
*/
define "Rubella Doses Recommended During Reporting Period":
[ImmunizationRecommendation] IR
where exists(IR.recommendation RC where exists(RC.dateCriterion DC where date from DC.value during "Measurement Period")
and RC.vaccineCode in IMMZc."Rubella Vaccine")

/**
* Varicella Doses recommended during reporting period -
* This is used since the country should define the rules which recommend an Varicella dose (configuration, age, sex, etc.)
*/
define "Varicella Doses Recommended During Reporting Period":
[ImmunizationRecommendation] IR
where exists(IR.recommendation RC where exists(RC.dateCriterion DC where date from DC.value during "Measurement Period")
and RC.vaccineCode in IMMZc."Varicella Vaccine")

/**
* Diphtheria Booster Doses recommended during reporting period -
* This is used since the country should define the rules which recommend an Diphtheria booster dose (configuration, age, sex, etc.)
*/
define "Diphtheria Booster Doses Recommended During Reporting Period":
[ImmunizationRecommendation] IR
where exists(IR.recommendation RC where exists(RC.dateCriterion DC where date from DC.value during "Measurement Period")
and RC.doseNumber > 3
and RC.vaccineCode in IMMZc."Diphtheria Vaccine")

/**
* Pertussis Booster Doses recommended during reporting period -
* This is used since the country should define the rules which recommend an Pertussis booster dose (configuration, age, sex, etc.)
*/
define "Pertussis Booster Doses Recommended During Reporting Period":
[ImmunizationRecommendation] IR
where exists(IR.recommendation RC where exists(RC.dateCriterion DC where date from DC.value during "Measurement Period")
and RC.doseNumber > 3
and RC.vaccineCode in IMMZc."Pertussis Vaccine")


/**
* Tetanus Booster Doses recommended during reporting period -
* This is used since the country should define the rules which recommend an Tetanus booster dose (configuration, age, sex, etc.)
*/
define "Tetanus Booster Doses Recommended During Reporting Period":
[ImmunizationRecommendation] IR
where exists(IR.recommendation RC where exists(RC.dateCriterion DC where date from DC.value during "Measurement Period")
and RC.doseNumber > 3
and RC.vaccineCode in IMMZc."Tetanus Vaccine")


/**
* By Administrative Gender of Patient Stratifier
Expand Down
5 changes: 4 additions & 1 deletion input/fsh/Aliases.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ Alias: $LNC = http://loinc.org
Alias: $ICD11 = http://hl7.org/fhir/sid/icd-11
Alias: $ICD10 = http://hl7.org/fhir/sid/icd-10
Alias: $CVX = http://hl7.org/fhir/sid/cvx
Alias: $GENDER = http://hl7.org/fhir/administrative-gender
Alias: $GENDER = http://hl7.org/fhir/administrative-gender

Alias: $measure-scoring = http://terminology.hl7.org/CodeSystem/measure-scoring
Alias: $measure-population = http://terminology.hl7.org/CodeSystem/measure-population
Loading

0 comments on commit 3caffc8

Please sign in to comment.