eCQM QICore Content Implementation Guide
2024.0.0 - CI Build

eCQM QICore Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2024.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/ecqm-content-qicore-2024/ and changes regularly. See the Directory of published versions

Library:

Official URL: http://ecqi.healthit.gov/ecqms/Library/HospitalHarmSevereHypoglycemiaFHIR Version: 0.1.000
Draft as of 2024-12-19 Computable Name: HospitalHarmSevereHypoglycemiaFHIR
Id: HospitalHarmSevereHypoglycemiaFHIR
Version: 0.1.000
Url: HospitalHarmSevereHypoglycemiaFHIR
Status: draft
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2024-12-19 20:05:53+0000
Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
Measurement PeriodPeriod01In
PatientResource01Out
Qualifying EncounterResource0*Out
Hypoglycemic Medication AdministrationResource0*Out
Encounter with Hypoglycemic Medication AdministrationResource0*Out
Initial PopulationResource0*Out
DenominatorResource0*Out
Glucose Test with Result Less Than 40Resource0*Out
Low Glucose Test Followed By Glucose Test Result Greater Than 80Resource0*Out
Severe Hypoglycemic Harm EventResource0*Out
Encounter with Severe Hypoglycemic Harm EventResource0*Out
NumeratorResource0*Out
SDE EthnicityResource01Out
SDE PayerResource0*Out
SDE RaceResource01Out
SDE SexCoding01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;;
Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143 code filter:
path: status.value

code: finished

Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292 code filter:
path: status.value

code: finished

Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 code filter:
path: status.value

code: finished

MedicationAdministration http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationadministration ;;;; code filter:
path: medication
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.393
Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ;;;;;;; code filter:
path: code
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34
Coverage http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage ;; code filter:
path: type
value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
Content: text/cql
library HospitalHarmSevereHypoglycemiaFHIR version '0.1.000'

using QICore version '4.1.1'

include SupplementalDataElements version '3.5.000' called SDE
include CQMCommon version '2.2.000' called CQMCommon
include QICoreCommon version '2.1.000' called QICoreCommon
include FHIRHelpers version '4.4.000' called FHIRHelpers

valueset "birth date": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.560.100.4'
valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'
valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
valueset "Glucose Lab Test Mass Per Volume": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.34'
valueset "Hypoglycemics Severe Hypoglycemia": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1196.393'
valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'

parameter "Measurement Period" Interval<DateTime>
  default Interval[@2025-01-01T00:00:00.000Z, @2025-12-31T23:59:59.999Z]

context Patient

define "Denominator":
  "Initial Population"

define "Encounter with Severe Hypoglycemic Harm Event":
  from
    "Denominator" QualifyingEncounter,
    "Severe Hypoglycemic Harm Event" HypoglycemicEvent
    let GlucoseTestTime: QICoreCommon."Earliest" ( HypoglycemicEvent.effective ),
    HospitalizationInterval: CQMCommon."HospitalizationWithObservation" ( QualifyingEncounter )
    where GlucoseTestTime during HospitalizationInterval
    return QualifyingEncounter

define "Glucose Test with Result Less Than 40":
  from
    "Denominator" QualifyingEncounter,
    "Hypoglycemic Medication Administration" HypoglycemicMedication,
    ["Observation": "Glucose Lab Test Mass Per Volume"] GlucoseTest
    let HospitalizationInterval: CQMCommon."HospitalizationWithObservation" ( QualifyingEncounter ),
    HypoglycemicMedicationStart: QICoreCommon."ToInterval" ( HypoglycemicMedication.effective ),
    GlucoseTestTime: QICoreCommon."Earliest" ( GlucoseTest.effective )
    where GlucoseTestTime during HospitalizationInterval
      and GlucoseTest.status in { 'final', 'amended', 'corrected' }
      and GlucoseTest.value < 40 'mg/dL'
      and HypoglycemicMedicationStart starts 24 hours or less before or on GlucoseTestTime
    return GlucoseTest

define "Hypoglycemic Medication Administration":
  ["MedicationAdministration": "Hypoglycemics Severe Hypoglycemia"] HypoMedication
    where HypoMedication.status = 'completed'
      and HypoMedication.status != 'not-done'

define "Initial Population":
  "Encounter with Hypoglycemic Medication Administration"

define "Numerator":
  "Encounter with Severe Hypoglycemic Harm Event"

define "Qualifying Encounter":
  ["Encounter": "Encounter Inpatient"] InpatientEncounter
    where AgeInYearsAt(date from start of InpatientEncounter.period) >= 18
      and InpatientEncounter.period ends during day of "Measurement Period"
      and InpatientEncounter.status = 'finished'

define "SDE Ethnicity":
  SDE."SDE Ethnicity"

define "SDE Payer":
  SDE."SDE Payer"

define "SDE Race":
  SDE."SDE Race"

define "SDE Sex":
  SDE."SDE Sex"

define "Encounter with Hypoglycemic Medication Administration":
  "Qualifying Encounter" InpatientHospitalization
    with "Hypoglycemic Medication Administration" HypoglycemicMedication
      such that QICoreCommon."ToInterval" ( HypoglycemicMedication.effective ) starts during CQMCommon."HospitalizationWithObservation" ( InpatientHospitalization )

define "Low Glucose Test Followed By Glucose Test Result Greater Than 80":
  from
    "Denominator" QualifyingEncounter,
    "Glucose Test with Result Less Than 40" LowGlucoseTest,
    ["Observation": "Glucose Lab Test Mass Per Volume"] FollowupGlucoseTest
    let GlucoseTestTime: QICoreCommon."Earliest" ( LowGlucoseTest.effective ),
    FollowupGlucoseTestTime: QICoreCommon."Earliest" ( FollowupGlucoseTest.effective )
  //    FollowupInterval: duration in minutes between LowGlucoseTestResultTime and FollowupGlucoseTestTime//
    
    where FollowupGlucoseTestTime 5 minutes or less after GlucoseTestTime
      and GlucoseTestTime during CQMCommon."HospitalizationWithObservation" ( QualifyingEncounter )
      and FollowupGlucoseTestTime during CQMCommon."HospitalizationWithObservation" ( QualifyingEncounter )
      and FollowupGlucoseTest.id !~ LowGlucoseTest.id
      and FollowupGlucoseTest.status in { 'final', 'amended', 'corrected' }
      and FollowupGlucoseTest.value > 80 'mg/dL'
    return LowGlucoseTest

define "Severe Hypoglycemic Harm Event":
  "Glucose Test with Result Less Than 40" LowGlucoseTest
    where not ( LowGlucoseTest.id in "Low Glucose Test Followed By Glucose Test Result Greater Than 80".id )
Content: application/elm+xml
Encoded data (134248 characters)
Content: application/elm+json
Encoded data (263960 characters)