Id: HybridHospitalWideReadmissionFHIR Url: http://ecqi.healthit.gov/ecqms/Library/HybridHospitalWideReadmissionFHIR Version: 0.0.001 Identifier: value: HybridHospitalWideReadmissionFHIR Name: HybridHospitalWideReadmissionFHIR Title: HybridHospitalWideReadmissionFHIR Status: active Experimental: false Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2023-08-14T15:23:42+00:00 Description: HybridHospitalWideReadmissionFHIR Related Artifacts: Dependencies Data Requirements: Type Profile MS Code Filter Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Patient http://hl7.org/fhir/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 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 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 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 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.113883.3.666.5.307 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.113762.1.4.1104.10 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient 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.1045.149 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.1045.163 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.1045.130 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.1045.152 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.1045.151 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.1045.159 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.1045.114 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.1045.129 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.1045.117 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.1045.119 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.1045.139 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.113883.3.666.5.2363 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.1045.134 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 uri http://hl7.org/fhir/uri ; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; 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 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Content: text/cql library HybridHospitalWideReadmissionFHIR version '0.0.001' /*This FHIR-based measure has been derived from CMS529 v4.0.0- QDM 5.6 Specifications*/#xD; #xD; #xD; using QICore version '4.1.1'#xD; #xD; include FHIRHelpers version '4.3.000' called FHIRHelpers#xD; include SupplementalDataElements version '3.4.000' called SDE#xD; include CQMCommon version '1.4.000' called CQMCommon#xD; include QICoreCommon version '1.5.000' called QICoreCommon#xD; #xD; codesystem "LOINC:2.69": 'http://loinc.org' version '2.69'#xD; codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'#xD; codesystem "Source of Payment Typology": 'https://nahdo.org/sopt'#xD; #xD; valueset "Acute care hospital Inpatient Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.2289'#xD; valueset "Bicarbonate lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.139'#xD; valueset "Body temperature": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.152'#xD; valueset "Body weight": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.159'#xD; valueset "Creatinine lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.2363'#xD; valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'#xD; valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'#xD; valueset "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837'#xD; valueset "Glucose lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.134'#xD; valueset "Heart Rate": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.149'#xD; valueset "Hematocrit lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114'#xD; valueset "Medicare payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1104.10'#xD; valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'#xD; valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1'#xD; valueset "Oxygen Saturation by Pulse Oximetry": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.151'#xD; valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591'#xD; valueset "Potassium lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.117'#xD; valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836'#xD; valueset "Respiratory Rate": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.130'#xD; valueset "Sodium lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.119'#xD; valueset "Systolic Blood Pressure": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.163'#xD; valueset "White blood cells count lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129'#xD; #xD; code "Birth date": '21112-8' from "LOINC:2.69" display 'Birth date'#xD; code "IMP": 'IMP' from "ActCode" display 'Inpatient'#xD; code "ACUTE": 'ACUTE' from "ActCode" display 'Acute'#xD; code "NONAC": 'NONAC' from "ActCode" display 'Nonacute'#xD; code "OBSENC": 'OBSENC' from "ActCode" display 'Observation Encounter'#xD; #xD; parameter "Measurement Period" Interval<DateTime>#xD; #xD; context Patient#xD; #xD; define "SDE Ethnicity":#xD; SDE."SDE Ethnicity"#xD; #xD; define "SDE Payer":#xD; SDE."SDE Payer"#xD; #xD; define "SDE Race":#xD; SDE."SDE Race"#xD; #xD; define "SDE Sex":#xD; SDE."SDE Sex"#xD; #xD; define "Initial Population":#xD; "Inpatient Encounters"#xD; #xD; define "Inpatient Encounters":#xD; from#xD; ["Encounter": "Encounter Inpatient"] InpatientEncounter,#xD; ["Coverage": "Medicare payer"] Payer#xD; where InpatientEncounter.status = 'finished'#xD; and ( InpatientEncounter.class ~ "IMP"#xD; or InpatientEncounter.class ~ "ACUTE"#xD; or InpatientEncounter.class ~ "NONAC"#xD; or InpatientEncounter.class ~ "OBSENC"#xD; )#xD; and InpatientEncounter.hospitalizationWithObservationLengthofStay ( ) < 365#xD; and InpatientEncounter.period ends during "Measurement Period"#xD; and AgeInYearsAt(date from start of InpatientEncounter.period) >= 65#xD; return InpatientEncounter#xD; #xD; define "Results":#xD; flatten { // First physical exams (vital signs)#xD; "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#xD; "FirstPhysicalExamWithEncounterIdUsingLabTiming"([Observation: "Body weight"], 'FirstWeight'), //First lab tests#xD; "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') }#xD; #xD; define function "FirstPhysicalExamWithEncounterId"(ExamList List<Observation>, CCDE String):#xD; "Inpatient Encounters" Encounter#xD; let firstexam: First(ExamList Exam#xD; where start of QICoreCommon."ToInterval"(Exam.effective) is not null#xD; and start of QICoreCommon."ToInterval"(Exam.effective) during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 120 minutes]#xD; and Exam.status in { 'final', 'amended', 'preliminary' }#xD; and Exam.value is not null#xD; sort by start of QICoreCommon."ToInterval"(effective)#xD; )#xD; return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstexam.value as Quantity) ) & ',' & ToString(start of QICoreCommon."ToInterval"(firstexam.effective))#xD; #xD; define function "FirstPhysicalExamWithEncounterIdUsingLabTiming"(ExamList List<Observation>, CCDE String):#xD; "Inpatient Encounters" Encounter#xD; let firstexamwithlabtiming: First(ExamList Exam#xD; where start of QICoreCommon."ToInterval"(Exam.effective) is not null#xD; and start of QICoreCommon."ToInterval"(Exam.effective) during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 1440 minutes]#xD; and Exam.status in { 'final', 'amended', 'preliminary' }#xD; and Exam.value is not null#xD; sort by start of QICoreCommon."ToInterval"(effective)#xD; )#xD; return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstexamwithlabtiming.value as Quantity) ) & ',' & ToString(start of QICoreCommon."ToInterval"(firstexamwithlabtiming.effective))#xD; #xD; define function "FirstLabTestWithEncounterId"(LabList List<Observation>, CCDE String):#xD; "Inpatient Encounters" Encounter#xD; let firstlab: First(LabList Lab#xD; where Lab.issued is not null#xD; and Lab.issued during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 1440 minutes]#xD; and Lab.status in { 'final', 'amended', 'preliminary' }#xD; and Lab.value is not null#xD; sort by issued#xD; )#xD; return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstlab.value as Quantity) ) & ',' & ToString(firstlab.issued) Content: application/elm+xml Encoded data (378464 characters) Content: application/elm+json Encoded data (560936 characters)
Value set Acute care hospital Inpatient Encounter
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