Title: Core Clinical Data Elements for the Hybrid Hospital-Wide Readmission (HWR) Measure with Claims and Electronic Health Record Data FHIR Id: HybridHospitalWideReadmissionFHIR Download cql: HybridHospitalWideReadmissionFHIR.cql Version: 0.0.001 Url: Core Clinical Data Elements for the Hybrid Hospital-Wide Readmission (HWR) Measure with Claims and Electronic Health Record Data FHIR short-name identifier: CMS529FHIR version-independent identifier: urn:uuid:66842e26-2256-4a2d-8dac-dd014c425748 version-specific identifier: urn:uuid:2c92808482113ece0182c5d39df62f0e endorser (NQF) identifier: 2879 publisher (CMS) identifier: 529FHIR Effective Period: 2024-07-01 ..2025-06-30 Status: draft Date: 2023-10-27 08:12:32+0000 Approval Date: 2023-08-14 Last Review Date: 2023-08-14 Name: HybridHospitalWideReadmissionFHIR Publisher: Centers for Medicare & Medicaid Services (CMS) Author: Yale New Haven Health Service Corporation/ Center for Outcomes Research and Evaluation: https://medicine.yale.edu/core/ Description: This logic is intended to extract electronic clinical data. This is not an electronic clinical quality measure and this logic will not produce measure results. Instead, it will produce a file containing the data that CMS will link with administrative claims to risk adjust the Hybrid HWR outcome measure. It is designed to extract the first resulted set of vital signs and basic laboratory results obtained from encounters for adult Medicare Fee-For-Service patients admitted to acute care short stay hospitals. Purpose: UNKNOWN Copyright: Limited proprietary coding is contained in these specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2021 International Health Terminology Standards Development Organisation. All rights reserved. LOINC(R) copyright 2004-2021 Regenstrief Institute, Inc. Disclaimer: These performance specifications are not clinical guidelines and do not establish a standard of medical care, and have not been tested for all potential applications. THE MEASURES AND SPECIFICATIONS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM]. Rationale: The intent of this logic is to extract the FIRST set of clinical data elements from hospital electronic health records (EHRs) for all qualifying encounters. The data will be linked with administrative claims to risk adjust the Hybrid HWR outcome measure. This work addresses stakeholder concerns that clinical data garnered from patients, and used by clinicians to guide diagnostic decisions and treatment, are preferable to administrative claims data when profiling hospitals' case mix. We are calling the list of data elements for extraction the "HWR-specific core clinical data elements". The core clinical data elements are the first set of vital signs and basic laboratory tests resulted from encounters for adult Medicare Fee-For-Service patients, age 65 or older (Initial Population), after they arrive at the hospital to which they are subsequently admitted. For example, this first set of data values are often captured in the emergency department or in the pre-operative area, sometimes hours before a patient is admitted to that same facility. These data elements were selected because they: 1. reflect patients' clinical status when they first present to the hospital, 2. are clinically and statistically relevant to patient outcomes, 3. are consistently obtained on adult inpatient encounters based on current clinical practice, 4. are captured with a standard definition and recorded in a standard format across providers, and 5. are entered in structured fields that are feasibly retrieved from current EHR systems (YNHHS/CORE, 2015). Additional data called Linking Variables are used to link EHR data files with administrative claims data for CMS to calculate results for the Hybrid HWR measure, which are: CMS Certification Number, Health Insurance Claim Number (HICN) or Medicare Beneficiary Identifier (MBI), date of birth, sex, admission date, and discharge date. Clinical recommendation statement: The logic is not meant to guide or alter the care patients receive. The purpose of this core clinical data elements logic is to extract clinical data that are already routinely captured in EHRs from encounters for hospitalized adult patients. It is not intended to require that clinical staff perform additional measurements or tests that are not needed for diagnostic assessment or treatment of patients. Guidance (Usage): This FHIR-based measure has been derived from the QDM-based measure: CMS529v3.1 (QDM 5.6)Please refer to the HL7 QI-Core Implementation Guide (http://hl7.org/fhir/us/qicore/index.html) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (http://hl7.org/fhir/us/qicore/qdm-to-qicore.html). These specifications are for use for data with discharges that occur between July 1, 2023 and June 30, 2024. This logic guides the user to extract the FIRST resulted HWR-specific core clinical data elements for all Medicare Fee-For-Service encounters for patients age 65 or older (Initial Population) directly admitted to the hospital or admitted to the same facility after being treated in another area such as the emergency department or hospital outpatient location. The logic supports extraction of the FIRST set of HWR-specific core clinical data elements in two different ways depending on if the patient was a direct admission, meaning that the patient was admitted directly to an inpatient unit without first receiving care in the emergency department or other hospital outpatient locations within the same admitting facility: 1. If the patient was a direct admission, the logic supports extraction of the FIRST resulted vital signs within 2 hours (120 minutes) after the start of the inpatient admission, and the FIRST resulted laboratory tests within 24 hours (1440 minutes) after the start of the inpatient admission. 2. If the patient has values captured prior to admission, for example from the emergency department, pre-operative, or other outpatient area within the hospital, the logic supports extraction of the FIRST resulted vital signs and laboratory tests within 24 hours (1440 minutes) PRIOR to the start of the inpatient admission. All clinical systems used in inpatient and outpatient locations within the hospital facility should be queried when looking for core clinical data element values related to a patient who is subsequently admitted. Value sets for the laboratory tests represent the LOINC codes currently available for these tests. If the institution is using local codes to capture and store relevant laboratory test data, those sites should map that information to the LOINC code for reporting of the core clinical data elements. NOTE: Do not report ALL values on an encounter during their entire admission. Only report the FIRST resulted value for EACH core clinical data element collected in the appropriate timeframe, if available. For each core clinical data element, please report values using one of the appropriate units of measurement listed below, which represent valid UCUM codes: Core Clinical Data Element UCUM Unit Bicarbonate----------------------------------meq/L mmol/L Creatinine------------------------------------mg/dL umol/L Glucose--------------------------------------mg/dL mmol/L Heart rate------------------------------------{Beats}/min Hematocrit -----------------------------------% Oxygen saturation (by pulse oximetry)-----%{Oxygen} Potassium------------------------------------meq/L mmol/L Respiratory rate------------------------------{Breaths}/min Sodium---------------------------------------meq/L mmol/L Systolic blood pressure----------------------mm[Hg] Temperature----------------------------------Cel [degF] Weight-----------------------------------------kg [lb_av] g White blood cell count ----------------------{Cells}/uL 10*3/uL 10*9/L /mm3 For each encounter please also submit the following Linking Variables: CMS Certification Number, Health Insurance Claim Number (HICN) or Medicare Beneficiary Identifier (MBI), Date of Birth, Sex, Inpatient Admission Date, and Discharge Date. The initial population includes patients with inpatient hospitalizations and patients from Acute Hospital Care at Home programs, who are treated and billed as inpatients but receive care in their home. Population Criteria: 638501714ba3d47c885c02ac Initial Population: All Medicare Fee-For-Service encounters age 65 and older at the start of an inpatient admission, who are discharged during the measurement period (length of stay <365 days). NOTE: All Medicare Fee-For-Service encounters meeting the above criteria should be included, regardless if Medicare Fee-For-Service is the primary, secondary, or tertiary payer. Supplemental Data Guidance : Supplemental Data Elements: Results SDE Ethnicity SDE Payer SDE Race SDE Sex Libraries: HybridHospitalWideReadmissionFHIR Related Artifact Dependencies: SupplementalDataElements version: 3.4.000 FHIRHelpers version: 4.3.000 CQMCommon version: 1.4.000 QICoreCommon version: 1.5.000 http://hl7.org/fhir/v3/AdministrativeGender ActCode Encounter Inpatient Medicare payer Observation Services Emergency Department Visit Heart Rate LOINC Systolic Blood Pressure LOINC Respiratory Rate LOINC Body temperature Oxygen Saturation in Arterial Blood by Pulse Oximetry Body weight Hematocrit lab test White blood cells count lab test Potassium lab test Sodium lab test Bicarbonate lab test Creatinine lab test Glucose lab test Payer Parameters: name use min max type Measurement Period In 0 1 Period SDE Sex Out 0 1 Coding Results Out 0 * string SDE Payer Out 0 * Resource Initial Population Out 0 * Resource SDE Ethnicity Out 0 1 Resource SDE Race Out 0 1 Resource DataRequirements: Type Elements Valueset Name Valueset Patient(QICorePatient) ethnicity race Encounter(QICoreEncounter) type status status.value period id id.value Observation Services Observation Services Encounter(QICoreEncounter) type status status.value period id id.value Emergency Department Visit Emergency Department Visit Encounter(QICoreEncounter) type status status.value class period id id.value Encounter Inpatient Encounter Inpatient Coverage(QICoreCoverage) type Medicare payer Medicare payer Coverage(QICoreCoverage) type period Payer Type Payer Observation(QICoreObservation) code effective status status.value value issued issued.value Heart Rate Heart Rate LOINC Observation(QICoreObservation) code effective status status.value value issued issued.value Systolic Blood Pressure Systolic Blood Pressure LOINC Observation(QICoreObservation) code effective status status.value value issued issued.value Respiratory Rate Respiratory Rate LOINC Observation(QICoreObservation) code effective status status.value value issued issued.value Body temperature Body temperature Observation(QICoreObservation) code effective status status.value value issued issued.value Oxygen Saturation by Pulse Oximetry Oxygen Saturation in Arterial Blood by Pulse Oximetry Observation(QICoreObservation) code effective status status.value value issued issued.value Body weight Body weight Observation(QICoreObservation) code effective status status.value value issued issued.value Hematocrit lab test Hematocrit lab test Observation(QICoreObservation) code effective status status.value value issued issued.value White blood cells count lab test White blood cells count lab test Observation(QICoreObservation) code effective status status.value value issued issued.value Potassium lab test Potassium lab test Observation(QICoreObservation) code effective status status.value value issued issued.value Sodium lab test Sodium lab test Observation(QICoreObservation) code effective status status.value value issued issued.value Bicarbonate lab test Bicarbonate lab test Observation(QICoreObservation) code effective status status.value value issued issued.value Creatinine lab test Creatinine lab test Observation(QICoreObservation) code effective status status.value value issued issued.value Glucose lab test Glucose lab test Direct Reference Codes: display code system Male M http://hl7.org/fhir/v3/AdministrativeGender Female F http://hl7.org/fhir/v3/AdministrativeGender Inpatient IMP http://terminology.hl7.org/CodeSystem/v3-ActCode Acute ACUTE http://terminology.hl7.org/CodeSystem/v3-ActCode Nonacute NONAC http://terminology.hl7.org/CodeSystem/v3-ActCode Observation Encounter OBSENC http://terminology.hl7.org/CodeSystem/v3-ActCode Logic Definitions: Group Scoring Population Criteria Expression 638501714ba3d47c885c02ac Group scoring: cohort Initial Population define "Initial Population": "Inpatient Encounters" Library Name Name SupplementalDataElements SDE Sex define "SDE Sex": case when Patient.gender = 'male' then "M" when Patient.gender = 'female' then "F" else null end Library Name Name HybridHospitalWideReadmissionFHIR SDE Sex define "SDE Sex": SDE."SDE Sex" Library Name Name HybridHospitalWideReadmissionFHIR Inpatient Encounters define "Inpatient Encounters": from ["Encounter": "Encounter Inpatient"] InpatientEncounter, ["Coverage": "Medicare payer"] Payer where InpatientEncounter.status = 'finished' and ( InpatientEncounter.class ~ "IMP" or InpatientEncounter.class ~ "ACUTE" or InpatientEncounter.class ~ "NONAC" or InpatientEncounter.class ~ "OBSENC" ) and InpatientEncounter.hospitalizationWithObservationLengthofStay ( ) < 365 and InpatientEncounter.period ends during "Measurement Period" and AgeInYearsAt(date from start of InpatientEncounter.period) >= 65 return InpatientEncounter Library Name Name HybridHospitalWideReadmissionFHIR Results define "Results": flatten { // First physical exams (vital signs) "FirstPhysicalExamWithEncounterId"([Observation: "Heart Rate"], 'FirstHeartRate'), "FirstPhysicalExamWithEncounterId"([Observation: "Systolic Blood Pressure"], 'FirstSystolicBP'), "FirstPhysicalExamWithEncounterId"([Observation: "Respiratory Rate"], 'FirstRespRate'), "FirstPhysicalExamWithEncounterId"([Observation: "Body temperature"], 'FirstTemperature'), "FirstPhysicalExamWithEncounterId"([Observation: "Oxygen Saturation by Pulse Oximetry"], 'FirstO2Saturation'), // First weight using lab test timing "FirstPhysicalExamWithEncounterIdUsingLabTiming"([Observation: "Body weight"], 'FirstWeight'), //First lab tests "FirstLabTestWithEncounterId"([Observation: "Hematocrit lab test"], 'FirstHematocrit'), "FirstLabTestWithEncounterId"([Observation: "White blood cells count lab test"], 'FirstWhiteBloodCell'), "FirstLabTestWithEncounterId"([Observation: "Potassium lab test"], 'FirstPotassium'), "FirstLabTestWithEncounterId"([Observation: "Sodium lab test"], 'FirstSodium'), "FirstLabTestWithEncounterId"([Observation: "Bicarbonate lab test"], 'FirstBicarbonate'), "FirstLabTestWithEncounterId"([Observation: "Creatinine lab test"], 'FirstCreatinine'), "FirstLabTestWithEncounterId"([Observation: "Glucose lab test"], 'FirstGlucose') } Library Name Name SupplementalDataElements SDE Payer define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period } Library Name Name HybridHospitalWideReadmissionFHIR SDE Payer define "SDE Payer": SDE."SDE Payer" Library Name Name HybridHospitalWideReadmissionFHIR Initial Population define "Initial Population": "Inpatient Encounters" Library Name Name SupplementalDataElements SDE Ethnicity define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text } Library Name Name HybridHospitalWideReadmissionFHIR SDE Ethnicity define "SDE Ethnicity": SDE."SDE Ethnicity" Library Name Name SupplementalDataElements SDE Race define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text } Library Name Name HybridHospitalWideReadmissionFHIR SDE Race define "SDE Race": SDE."SDE Race" Library Name Name HybridHospitalWideReadmissionFHIR FirstPhysicalExamWithEncounterId define function "FirstPhysicalExamWithEncounterId"(ExamList List<Observation>, CCDE String): "Inpatient Encounters" Encounter let firstexam: First(ExamList Exam where start of QICoreCommon."ToInterval"(Exam.effective) is not null and start of QICoreCommon."ToInterval"(Exam.effective) during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 120 minutes] and Exam.status in { 'final', 'amended', 'preliminary' } and Exam.value is not null sort by start of QICoreCommon."ToInterval"(effective) ) return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstexam.value as Quantity) ) & ',' & ToString(start of QICoreCommon."ToInterval"(firstexam.effective)) Library Name Name CQMCommon hospitalizationWithObservationLengthofStay /* @description: Hospitalization with Observation Length of Stay returns the length in days from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter */ define fluent function hospitalizationWithObservationLengthofStay(TheEncounter "Encounter" ): ((TheEncounter."hospitalizationWithObservation"(). "lengthInDays"())) Library Name Name CQMCommon lengthInDays /* @description: Calculates the difference in calendar days between the start and end of the given interval. */ define fluent function lengthInDays(Value Interval<DateTime> ): difference in days between start of Value and end of Value Library Name Name CQMCommon hospitalizationWithObservation /* @description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter */ define fluent function hospitalizationWithObservation(TheEncounter Encounter ): TheEncounter Visit let ObsVisit: Last([Encounter: "Observation Services"] LastObs where LastObs.status = 'finished' and LastObs.period ends 1 hour or less on or before start of Visit.period sort by end of period ), VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period), EDVisit: Last([Encounter: "Emergency Department Visit"] LastED where LastED.status = 'finished' and LastED.period ends 1 hour or less on or before VisitStart sort by end of period ) return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period] Library Name Name QICoreCommon ToInterval /* @description: Normalizes a value that is a choice of timing-valued types to an equivalent interval @comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible representations for timing-valued elements in QICore, allowing this function to be used across any resource. The input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>. The intent of this function is to provide a clear and concise mechanism to treat single elements that have multiple possible representations as intervals so that logic doesn't have to account for the variability. More complex calculations (such as medication request period or dispense period calculation) need specific guidance and consideration. That guidance may make use of this function, but the focus of this function is on single element calculations where the semantics are unambiguous. If the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime. If the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age, and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later. If the input is a DateTime Interval, the result is the input. If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending immediately before one year later than the date the patient turned the age given as the end of the quantity interval. Any other input will reslt in a null DateTime Interval @deprecated: This function is deprecated. Use the fluent function `toInterval()` instead */ define function ToInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>>): case when choice is DateTime then Interval[choice as DateTime, choice as DateTime] when choice is Interval<DateTime> then choice as Interval<DateTime> when choice is Quantity then Interval[Patient.birthDate + (choice as Quantity), Patient.birthDate + (choice as Quantity) + 1 year) when choice is Interval<Quantity> then Interval[Patient.birthDate + (choice.low as Quantity), Patient.birthDate + (choice.high as Quantity) + 1 year) when choice is QICore.Timing then null as Interval<DateTime> else null as Interval<DateTime> end Library Name Name HybridHospitalWideReadmissionFHIR FirstPhysicalExamWithEncounterIdUsingLabTiming define function "FirstPhysicalExamWithEncounterIdUsingLabTiming"(ExamList List<Observation>, CCDE String): "Inpatient Encounters" Encounter let firstexamwithlabtiming: First(ExamList Exam where start of QICoreCommon."ToInterval"(Exam.effective) is not null and start of QICoreCommon."ToInterval"(Exam.effective) during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 1440 minutes] and Exam.status in { 'final', 'amended', 'preliminary' } and Exam.value is not null sort by start of QICoreCommon."ToInterval"(effective) ) return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstexamwithlabtiming.value as Quantity) ) & ',' & ToString(start of QICoreCommon."ToInterval"(firstexamwithlabtiming.effective)) Library Name Name HybridHospitalWideReadmissionFHIR FirstLabTestWithEncounterId define function "FirstLabTestWithEncounterId"(LabList List<Observation>, CCDE String): "Inpatient Encounters" Encounter let firstlab: First(LabList Lab where Lab.issued is not null and Lab.issued during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 1440 minutes] and Lab.status in { 'final', 'amended', 'preliminary' } and Lab.value is not null sort by issued ) return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstlab.value as Quantity) ) & ',' & ToString(firstlab.issued) Library Name Name FHIRHelpers ToString define function ToString(value uri): value.value Library Name Name FHIRHelpers ToCode /* @description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code. */ define function ToCode(coding FHIR.Coding): if coding is null then null else System.Code { code: coding.code.value, system: coding.system.value, version: coding.version.value, display: coding.display.value }
define "SDE Sex": case when Patient.gender = 'male' then "M" when Patient.gender = 'female' then "F" else null end
define "Inpatient Encounters": from ["Encounter": "Encounter Inpatient"] InpatientEncounter, ["Coverage": "Medicare payer"] Payer where InpatientEncounter.status = 'finished' and ( InpatientEncounter.class ~ "IMP" or InpatientEncounter.class ~ "ACUTE" or InpatientEncounter.class ~ "NONAC" or InpatientEncounter.class ~ "OBSENC" ) and InpatientEncounter.hospitalizationWithObservationLengthofStay ( ) < 365 and InpatientEncounter.period ends during "Measurement Period" and AgeInYearsAt(date from start of InpatientEncounter.period) >= 65 return InpatientEncounter
define "Results": flatten { // First physical exams (vital signs) "FirstPhysicalExamWithEncounterId"([Observation: "Heart Rate"], 'FirstHeartRate'), "FirstPhysicalExamWithEncounterId"([Observation: "Systolic Blood Pressure"], 'FirstSystolicBP'), "FirstPhysicalExamWithEncounterId"([Observation: "Respiratory Rate"], 'FirstRespRate'), "FirstPhysicalExamWithEncounterId"([Observation: "Body temperature"], 'FirstTemperature'), "FirstPhysicalExamWithEncounterId"([Observation: "Oxygen Saturation by Pulse Oximetry"], 'FirstO2Saturation'), // First weight using lab test timing "FirstPhysicalExamWithEncounterIdUsingLabTiming"([Observation: "Body weight"], 'FirstWeight'), //First lab tests "FirstLabTestWithEncounterId"([Observation: "Hematocrit lab test"], 'FirstHematocrit'), "FirstLabTestWithEncounterId"([Observation: "White blood cells count lab test"], 'FirstWhiteBloodCell'), "FirstLabTestWithEncounterId"([Observation: "Potassium lab test"], 'FirstPotassium'), "FirstLabTestWithEncounterId"([Observation: "Sodium lab test"], 'FirstSodium'), "FirstLabTestWithEncounterId"([Observation: "Bicarbonate lab test"], 'FirstBicarbonate'), "FirstLabTestWithEncounterId"([Observation: "Creatinine lab test"], 'FirstCreatinine'), "FirstLabTestWithEncounterId"([Observation: "Glucose lab test"], 'FirstGlucose') }
define "SDE Payer": [Coverage: type in "Payer Type"] Payer return { code: Payer.type, period: Payer.period }
define "Initial Population": "Inpatient Encounters"
define "SDE Ethnicity": Patient.ethnicity E return Tuple { codes: { E.ombCategory } union E.detailed, display: E.text }
define "SDE Ethnicity": SDE."SDE Ethnicity"
define "SDE Race": Patient.race R return Tuple { codes: R.ombCategory union R.detailed, display: R.text }
define function "FirstPhysicalExamWithEncounterId"(ExamList List<Observation>, CCDE String): "Inpatient Encounters" Encounter let firstexam: First(ExamList Exam where start of QICoreCommon."ToInterval"(Exam.effective) is not null and start of QICoreCommon."ToInterval"(Exam.effective) during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 120 minutes] and Exam.status in { 'final', 'amended', 'preliminary' } and Exam.value is not null sort by start of QICoreCommon."ToInterval"(effective) ) return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstexam.value as Quantity) ) & ',' & ToString(start of QICoreCommon."ToInterval"(firstexam.effective))
/* @description: Hospitalization with Observation Length of Stay returns the length in days from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter */ define fluent function hospitalizationWithObservationLengthofStay(TheEncounter "Encounter" ): ((TheEncounter."hospitalizationWithObservation"(). "lengthInDays"()))
/* @description: Calculates the difference in calendar days between the start and end of the given interval. */ define fluent function lengthInDays(Value Interval<DateTime> ): difference in days between start of Value and end of Value
/* @description: Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter */ define fluent function hospitalizationWithObservation(TheEncounter Encounter ): TheEncounter Visit let ObsVisit: Last([Encounter: "Observation Services"] LastObs where LastObs.status = 'finished' and LastObs.period ends 1 hour or less on or before start of Visit.period sort by end of period ), VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period), EDVisit: Last([Encounter: "Emergency Department Visit"] LastED where LastED.status = 'finished' and LastED.period ends 1 hour or less on or before VisitStart sort by end of period ) return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]
/* @description: Normalizes a value that is a choice of timing-valued types to an equivalent interval @comment: Normalizes a choice type of DateTime, Quanitty, Interval<DateTime>, or Interval<Quantity> types to an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible representations for timing-valued elements in QICore, allowing this function to be used across any resource. The input can be provided as a DateTime, Quantity, Interval<DateTime> or Interval<Quantity>. The intent of this function is to provide a clear and concise mechanism to treat single elements that have multiple possible representations as intervals so that logic doesn't have to account for the variability. More complex calculations (such as medication request period or dispense period calculation) need specific guidance and consideration. That guidance may make use of this function, but the focus of this function is on single element calculations where the semantics are unambiguous. If the input is a DateTime, the result a DateTime Interval beginning and ending on that DateTime. If the input is a Quantity, the quantity is expected to be a calendar-duration interpreted as an Age, and the result is a DateTime Interval beginning on the Date the patient turned that age and ending immediately before one year later. If the input is a DateTime Interval, the result is the input. If the input is a Quantity Interval, the quantities are expected to be calendar-durations interpreted as an Age, and the result is a DateTime Interval beginning on the date the patient turned the age given as the start of the quantity interval, and ending immediately before one year later than the date the patient turned the age given as the end of the quantity interval. Any other input will reslt in a null DateTime Interval @deprecated: This function is deprecated. Use the fluent function `toInterval()` instead */ define function ToInterval(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>>): case when choice is DateTime then Interval[choice as DateTime, choice as DateTime] when choice is Interval<DateTime> then choice as Interval<DateTime> when choice is Quantity then Interval[Patient.birthDate + (choice as Quantity), Patient.birthDate + (choice as Quantity) + 1 year) when choice is Interval<Quantity> then Interval[Patient.birthDate + (choice.low as Quantity), Patient.birthDate + (choice.high as Quantity) + 1 year) when choice is QICore.Timing then null as Interval<DateTime> else null as Interval<DateTime> end
define function "FirstPhysicalExamWithEncounterIdUsingLabTiming"(ExamList List<Observation>, CCDE String): "Inpatient Encounters" Encounter let firstexamwithlabtiming: First(ExamList Exam where start of QICoreCommon."ToInterval"(Exam.effective) is not null and start of QICoreCommon."ToInterval"(Exam.effective) during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 1440 minutes] and Exam.status in { 'final', 'amended', 'preliminary' } and Exam.value is not null sort by start of QICoreCommon."ToInterval"(effective) ) return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstexamwithlabtiming.value as Quantity) ) & ',' & ToString(start of QICoreCommon."ToInterval"(firstexamwithlabtiming.effective))
define function "FirstLabTestWithEncounterId"(LabList List<Observation>, CCDE String): "Inpatient Encounters" Encounter let firstlab: First(LabList Lab where Lab.issued is not null and Lab.issued during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 1440 minutes] and Lab.status in { 'final', 'amended', 'preliminary' } and Lab.value is not null sort by issued ) return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstlab.value as Quantity) ) & ',' & ToString(firstlab.issued)
define function ToString(value uri): value.value
/* @description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code. */ define function ToCode(coding FHIR.Coding): if coding is null then null else System.Code { code: coding.code.value, system: coding.system.value, version: coding.version.value, display: coding.display.value }
Value set Oxygen Saturation by Pulse Oximetry
Value set White blood cells count lab test
Error attempting to determine filter value: toFhirValue not implemented for Subtract
Core Clinical Data Elements for the Hybrid Hospital-Wide Readmission (HWR) Measure with Claims and Electronic Health Record Data FHIR
Centers for Medicare & Medicaid Services (CMS)
This logic is intended to extract electronic clinical data. This is not an electronic clinical quality measure and this logic will not produce measure results. Instead, it will produce a file containing the data that CMS will link with administrative claims to risk adjust the Hybrid HWR outcome measure. It is designed to extract the first resulted set of vital signs and basic laboratory results obtained from encounters for adult Medicare Fee-For-Service patients admitted to acute care short stay hospitals.
This FHIR-based measure has been derived from the QDM-based measure: CMS529v3.1 (QDM 5.6)Please refer to the HL7 QI-Core Implementation Guide (http://hl7.org/fhir/us/qicore/index.html) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (http://hl7.org/fhir/us/qicore/qdm-to-qicore.html). These specifications are for use for data with discharges that occur between July 1, 2023 and June 30, 2024. This logic guides the user to extract the FIRST resulted HWR-specific core clinical data elements for all Medicare Fee-For-Service encounters for patients age 65 or older (Initial Population) directly admitted to the hospital or admitted to the same facility after being treated in another area such as the emergency department or hospital outpatient location. The logic supports extraction of the FIRST set of HWR-specific core clinical data elements in two different ways depending on if the patient was a direct admission, meaning that the patient was admitted directly to an inpatient unit without first receiving care in the emergency department or other hospital outpatient locations within the same admitting facility: 1. If the patient was a direct admission, the logic supports extraction of the FIRST resulted vital signs within 2 hours (120 minutes) after the start of the inpatient admission, and the FIRST resulted laboratory tests within 24 hours (1440 minutes) after the start of the inpatient admission. 2. If the patient has values captured prior to admission, for example from the emergency department, pre-operative, or other outpatient area within the hospital, the logic supports extraction of the FIRST resulted vital signs and laboratory tests within 24 hours (1440 minutes) PRIOR to the start of the inpatient admission. All clinical systems used in inpatient and outpatient locations within the hospital facility should be queried when looking for core clinical data element values related to a patient who is subsequently admitted. Value sets for the laboratory tests represent the LOINC codes currently available for these tests. If the institution is using local codes to capture and store relevant laboratory test data, those sites should map that information to the LOINC code for reporting of the core clinical data elements. NOTE: Do not report ALL values on an encounter during their entire admission. Only report the FIRST resulted value for EACH core clinical data element collected in the appropriate timeframe, if available. For each core clinical data element, please report values using one of the appropriate units of measurement listed below, which represent valid UCUM codes: Core Clinical Data Element UCUM Unit Bicarbonate----------------------------------meq/L mmol/L Creatinine------------------------------------mg/dL umol/L Glucose--------------------------------------mg/dL mmol/L Heart rate------------------------------------{Beats}/min Hematocrit -----------------------------------% Oxygen saturation (by pulse oximetry)-----%{Oxygen} Potassium------------------------------------meq/L mmol/L Respiratory rate------------------------------{Breaths}/min Sodium---------------------------------------meq/L mmol/L Systolic blood pressure----------------------mm[Hg] Temperature----------------------------------Cel [degF] Weight-----------------------------------------kg [lb_av] g White blood cell count ----------------------{Cells}/uL 10*3/uL 10*9/L /mm3 For each encounter please also submit the following Linking Variables: CMS Certification Number, Health Insurance Claim Number (HICN) or Medicare Beneficiary Identifier (MBI), Date of Birth, Sex, Inpatient Admission Date, and Discharge Date. The initial population includes patients with inpatient hospitalizations and patients from Acute Hospital Care at Home programs, who are treated and billed as inpatients but receive care in their home.
Limited proprietary coding is contained in these specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2021 International Health Terminology Standards Development Organisation. All rights reserved. LOINC(R) copyright 2004-2021 Regenstrief Institute, Inc.
Yale New Haven Health Service Corporation/ Center for Outcomes Research and Evaluation
These performance specifications are not clinical guidelines and do not establish a standard of medical care, and have not been tested for all potential applications. THE MEASURES AND SPECIFICATIONS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND. Due to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].
The intent of this logic is to extract the FIRST set of clinical data elements from hospital electronic health records (EHRs) for all qualifying encounters. The data will be linked with administrative claims to risk adjust the Hybrid HWR outcome measure. This work addresses stakeholder concerns that clinical data garnered from patients, and used by clinicians to guide diagnostic decisions and treatment, are preferable to administrative claims data when profiling hospitals' case mix. We are calling the list of data elements for extraction the "HWR-specific core clinical data elements". The core clinical data elements are the first set of vital signs and basic laboratory tests resulted from encounters for adult Medicare Fee-For-Service patients, age 65 or older (Initial Population), after they arrive at the hospital to which they are subsequently admitted. For example, this first set of data values are often captured in the emergency department or in the pre-operative area, sometimes hours before a patient is admitted to that same facility. These data elements were selected because they: 1. reflect patients' clinical status when they first present to the hospital, 2. are clinically and statistically relevant to patient outcomes, 3. are consistently obtained on adult inpatient encounters based on current clinical practice, 4. are captured with a standard definition and recorded in a standard format across providers, and 5. are entered in structured fields that are feasibly retrieved from current EHR systems (YNHHS/CORE, 2015). Additional data called Linking Variables are used to link EHR data files with administrative claims data for CMS to calculate results for the Hybrid HWR measure, which are: CMS Certification Number, Health Insurance Claim Number (HICN) or Medicare Beneficiary Identifier (MBI), date of birth, sex, admission date, and discharge date.
The logic is not meant to guide or alter the care patients receive. The purpose of this core clinical data elements logic is to extract clinical data that are already routinely captured in EHRs from encounters for hospitalized adult patients. It is not intended to require that clinical staff perform additional measurements or tests that are not needed for diagnostic assessment or treatment of patients.
All Medicare Fee-For-Service encounters age 65 and older at the start of an inpatient admission, who are discharged during the measurement period (length of stay <365 days). NOTE: All Medicare Fee-For-Service encounters meeting the above criteria should be included, regardless if Medicare Fee-For-Service is the primary, secondary, or tertiary payer.