Id: HRDMeasure Version: 1.0.0 Url: HRDMeasure urn:oid:2.16.840.1.113883.4.642.40.53.28.5 Status: draft Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2026-04-01 03:04:13+1100 Publisher: HL7 International / Public Health Jurisdiction: US Related Artifacts: Dependencies http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1 SNOMED CT (all versions) Location typeversion: null2.0.1) Healthcare Bed Capacity Reporting Code System Observation Category Codesversion: null2.0.0) Time Period Ranges COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)version: null20250218) COVID_19 (Tests for SARS_CoV_2 Antigen)version: null20240123) Influenza (Tests for influenza A or B virus Nucleic Acid)version: null20250218) Influenza (Tests for influenza A or B virus Antigen) RSV (Tests for RSV Antigen) RSV (Tests for RSV Nucleic Acid)version: null20250218) Parameters: Name Type Min Max In/Out Measurement Period Period 0 1 In Location Location 0 1 Out IsBedLocation boolean 0 1 Out LocationIsHOSP boolean 0 1 Out LocationIsIPF boolean 0 1 Out LocationIsIRF boolean 0 1 Out LocationIsCHLD boolean 0 1 Out Inpatient Beds Initial Population boolean 0 1 Out Encounters Encounter 0 * Out EncounterCheck boolean 0 1 Out Occupied Inpatient Beds Initial Population boolean 0 1 Out Adult Inpatient Beds Initial Population boolean 0 1 Out Occupied Adult Inpatient Beds Initial Population boolean 0 1 Out Pediatric Inpatient Beds Initial Population boolean 0 1 Out Occupied Pediatric Inpatient Beds Initial Population boolean 0 1 Out LocationIsOTH boolean 0 1 Out ICU Beds Initial Population boolean 0 1 Out Occupied ICU Beds Initial Population boolean 0 1 Out Adult ICU Beds Initial Population boolean 0 1 Out Occupied Adult ICU Beds Initial Population boolean 0 1 Out Pediatric ICU Beds Initial Population boolean 0 1 Out Occupied Pediatric ICU Beds Initial Population boolean 0 1 Out COVID_19 Observations Observation 0 * Out Count Confirmed COVID_19 Patients in Bed Location integer 0 1 Out Adult Inpatient COVID_19 Patients Stratifier integer 0 1 Out Pediatric Inpatient COVID_19 Patients Stratifier integer 0 1 Out Adult ICU COVID_19 Patients Stratifier integer 0 1 Out Pediatric ICU COVID_19 Patients Stratifier integer 0 1 Out Newly Admitted Encounters Encounter 0 * Out Newly Admitted COVID_19 Patient IDs Reference 0 * Out Patients Patient 0 * Out New Pediatric COVID_19 Patients Between 0 to 4 Stratifier integer 0 1 Out New Pediatric COVID_19 Patients Between 5 to 17 Stratifier integer 0 1 Out New Adult COVID_19 Patients Between 18 to 49 Stratifier integer 0 1 Out New Adult COVID_19 Patients Between 50 to 64 Stratifier integer 0 1 Out New Adult COVID_19 Patients Between 65 to 74 Stratifier integer 0 1 Out New Adult COVID_19 Patients 75 and Above Stratifier integer 0 1 Out New COVID_19 Patients with Unknown Age Stratifier integer 0 1 Out Influenza Observations Observation 0 * Out Count Confirmed Influenza Patients in Bed Location integer 0 1 Out Adult Inpatient Influenza Patients Stratifier integer 0 1 Out Pediatric Inpatient Influenza Patients Stratifier integer 0 1 Out Adult ICU Influenza Patients Stratifier integer 0 1 Out Pediatric ICU Influenza Patients Stratifier integer 0 1 Out Newly Admitted Influenza Patient IDs Reference 0 * Out New Pediatric Influenza Patients Between 0 to 4 Stratifier integer 0 1 Out New Pediatric Influenza Patients Between 5 to 17 Stratifier integer 0 1 Out New Adult Influenza Patients Between 18 to 49 Stratifier integer 0 1 Out New Adult Influenza Patients Between 50 to 64 Stratifier integer 0 1 Out New Adult Influenza Patients Between 65 to 74 Stratifier integer 0 1 Out New Adult Influenza Patients 75 and Above Stratifier integer 0 1 Out New Influenza Patients with Unknown Age Stratifier integer 0 1 Out RSV Observations Observation 0 * Out Count Confirmed RSV Patients in Bed Location integer 0 1 Out Adult Inpatient RSV Patients Stratifier integer 0 1 Out Pediatric Inpatient RSV Patients Stratifier integer 0 1 Out Adult ICU RSV Patients Stratifier integer 0 1 Out Pediatric ICU RSV Patients Stratifier integer 0 1 Out Newly Admitted RSV Patient IDs Reference 0 * Out New Pediatric RSV Patients Between 0 to 4 Stratifier integer 0 1 Out New Pediatric RSV Patients Between 5 to 17 Stratifier integer 0 1 Out New Adult RSV Patients Between 18 to 49 Stratifier integer 0 1 Out New Adult RSV Patients Between 50 to 64 Stratifier integer 0 1 Out New Adult RSV Patients Between 65 to 74 Stratifier integer 0 1 Out New Adult RSV Patients 75 and Above Stratifier integer 0 1 Out New RSV Patients with Unknown Age Stratifier integer 0 1 Out Devices Device 0 * Out N95 Mask Supply in Days integer 0 1 Out N95 Mask Supply in Days Stratifier Coding 0 1 Out N95 Mask 3 Day Supply Stratifier string 0 1 Out OR Surgical Mask Supply in Days integer 0 1 Out OR Surgical Mask Supply in Days Stratifier Coding 0 1 Out OR Surgical Mask 3 Day Supply Stratifier string 0 1 Out Face Shield Supply in Days integer 0 1 Out Face Shield Supply in Days Stratifier Coding 0 1 Out Face Shield 3 Day Supply Stratifier string 0 1 Out Gown Supply in Days integer 0 1 Out Gown Supply in Days Stratifier Coding 0 1 Out Gown 3 Day Supply Stratifier string 0 1 Out Glove Supply in Days integer 0 1 Out Glove Supply in Days Stratifier Coding 0 1 Out Glove 3 Day Supply Stratifier string 0 1 Out Data Requirements: Type Profile MS Code Filter Location http://hl7.org/fhir/StructureDefinition/Location Location http://hl7.org/fhir/StructureDefinition/Location Location http://hl7.org/fhir/StructureDefinition/Location Location http://hl7.org/fhir/StructureDefinition/Location Location http://hl7.org/fhir/StructureDefinition/Location Encounter http://hl7.org/fhir/StructureDefinition/Encounter Encounter http://hl7.org/fhir/StructureDefinition/Encounter ; Location http://hl7.org/fhir/StructureDefinition/Location Observation http://hl7.org/fhir/StructureDefinition/Observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1142|20250218 Observation http://hl7.org/fhir/StructureDefinition/Observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1158|20240123 Encounter http://hl7.org/fhir/StructureDefinition/Encounter Encounter http://hl7.org/fhir/StructureDefinition/Encounter ; Encounter http://hl7.org/fhir/StructureDefinition/Encounter ; Patient http://hl7.org/fhir/StructureDefinition/Patient ;; Patient http://hl7.org/fhir/StructureDefinition/Patient Patient http://hl7.org/fhir/StructureDefinition/Patient ;; Patient http://hl7.org/fhir/StructureDefinition/Patient ;; Observation http://hl7.org/fhir/StructureDefinition/Observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.336|20250218 Observation http://hl7.org/fhir/StructureDefinition/Observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.337 Encounter http://hl7.org/fhir/StructureDefinition/Encounter Encounter http://hl7.org/fhir/StructureDefinition/Encounter ; Observation http://hl7.org/fhir/StructureDefinition/Observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1311 Observation http://hl7.org/fhir/StructureDefinition/Observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1312|20250218 Encounter http://hl7.org/fhir/StructureDefinition/Encounter Encounter http://hl7.org/fhir/StructureDefinition/Encounter ; Device http://hl7.org/fhir/StructureDefinition/Device Device http://hl7.org/fhir/StructureDefinition/Device ; Device http://hl7.org/fhir/StructureDefinition/Device ; Device http://hl7.org/fhir/StructureDefinition/Device ; Device http://hl7.org/fhir/StructureDefinition/Device ; Device http://hl7.org/fhir/StructureDefinition/Device ; Condition http://hl7.org/fhir/StructureDefinition/Condition ; Content: text/cql library HRDMeasure version '1.0.0'#xD; #xD; using FHIR version '4.0.1'#xD; #xD; include FHIRHelpers version '4.0.1' called FHIRHelpers#xD; #xD; // Terminology definitions#xD; codesystem "SNOMEDCT": 'http://snomed.info/sct'#xD; codesystem "LocationPhysicalType": 'http://terminology.hl7.org/CodeSystem/location-physical-type'#xD; codesystem "HealthcareCapacity": 'http://hl7.org/fhir/us/safr/CodeSystem/us-safr-bed-capacity-example-codes'#xD; codesystem "Observation Category": 'http://terminology.hl7.org/CodeSystem/observation-category'#xD; codesystem "Time Period Ranges": 'http://terminology.hl7.org/CodeSystem/time-period-ranges'#xD; #xD; // Value sets#xD; valueset "COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1142'#xD; valueset "COVID_19 (Tests for SARS_CoV_2 Antigen)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1158'#xD; valueset "Influenza (Tests for influenza A or B virus Nucleic Acid)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.336'#xD; valueset "Influenza (Tests for influenza A or B virus Antigen)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.337'#xD; valueset "RSV (Tests for RSV Antigen)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1311'#xD; valueset "RSV (Tests for RSV Nucleic Acid)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1312'#xD; #xD; //Codes#xD; code "Bed": 'bd' from "LocationPhysicalType" display 'Bed'#xD; #xD; code "HOSP": 'HOSP' from "HealthcareCapacity" display 'Hospital'#xD; code "IRF": 'IRF' from "HealthcareCapacity" display 'Inpatient Rehabilitation'#xD; code "IPF": 'IPF' from "HealthcareCapacity" display 'Inpatient Psychiatric'#xD; code "CHLD": 'CHLD' from "HealthcareCapacity" display 'Children\'s or Pediatric'#xD; code "OTH": 'OTH' from "HealthcareCapacity" display 'Other facility-within-facility or subunit'#xD; #xD; code "laboratory": 'laboratory' from "Observation Category" display 'Laboratory'#xD; #xD; code "detected": '260373001' from "SNOMEDCT" display 'Detected'#xD; code "N95 mask": '409533008' from "SNOMEDCT" display 'Air-purifying respirator (physical object)'#xD; code "Surgical mask": '409528009' from "SNOMEDCT" display 'Surgical face mask (physical object)'#xD; code "Face shield": '706724001' from "SNOMEDCT" display 'Face shield (physical object)'#xD; code "Patient gown": '1141676007' from "SNOMEDCT" display 'Patient gown (physical object)'#xD; code "Surgical glove": '462245005' from "SNOMEDCT" display 'Nitrile surgical glove, powdered (physical object)'#xD; #xD; code "0 Days": 'P0D--0D' from "Time Period Ranges" display '0 DAYS'#xD; code "1-3 Days": 'P1D--3D' from "Time Period Ranges" display '1-3 DAYS'#xD; code "4-6 Days": 'P4D--6D' from "Time Period Ranges" display '4-6 DAYS'#xD; code "7-14 Days": 'P7D--14D' from "Time Period Ranges" display '7-14 DAYS'#xD; code "15-30 Days": 'P15D--30D' from "Time Period Ranges" display '15-30 DAYS'#xD; code ">30 Days": 'P30D--9999D' from "Time Period Ranges" display '0 DAYS'#xD; #xD; // Parameter for measurement period#xD; parameter "Measurement Period" Interval<Date>#xD; default Interval[@2025-03-01, @2025-03-07]#xD; #xD; context Location#xD; #xD; //Initial Populations#xD; define "Inpatient Beds Initial Population":#xD; IsBedLocation#xD; and LocationIsHOSP#xD; and (#xD; LocationIsIPF#xD; or LocationIsIRF#xD; or LocationIsCHLD#xD; )#xD; #xD; define "Occupied Inpatient Beds Initial Population":#xD; "Inpatient Beds Initial Population"#xD; and EncounterCheck#xD; #xD; define "Adult Inpatient Beds Initial Population":#xD; IsBedLocation#xD; and LocationIsHOSP#xD; and (#xD; LocationIsIPF#xD; or LocationIsIRF#xD; )#xD; and not LocationIsCHLD#xD; #xD; define "Occupied Adult Inpatient Beds Initial Population":#xD; "Adult Inpatient Beds Initial Population"#xD; and EncounterCheck#xD; #xD; define "Pediatric Inpatient Beds Initial Population":#xD; IsBedLocation#xD; and LocationIsHOSP#xD; and LocationIsCHLD#xD; and not (#xD; LocationIsIPF#xD; or LocationIsIRF#xD; )#xD; #xD; define "Occupied Pediatric Inpatient Beds Initial Population":#xD; "Pediatric Inpatient Beds Initial Population"#xD; and EncounterCheck#xD; #xD; define "ICU Beds Initial Population":#xD; IsBedLocation#xD; and (#xD; LocationIsHOSP#xD; or LocationIsOTH#xD; )#xD; #xD; define "Occupied ICU Beds Initial Population":#xD; "ICU Beds Initial Population"#xD; and EncounterCheck#xD; #xD; define "Adult ICU Beds Initial Population":#xD; IsBedLocation#xD; and (#xD; LocationIsHOSP#xD; or LocationIsOTH#xD; )#xD; and not LocationIsCHLD#xD; #xD; define "Occupied Adult ICU Beds Initial Population":#xD; "Adult ICU Beds Initial Population"#xD; and EncounterCheck#xD; #xD; define "Pediatric ICU Beds Initial Population":#xD; IsBedLocation#xD; and LocationIsCHLD#xD; and (#xD; LocationIsHOSP#xD; or LocationIsOTH#xD; )#xD; #xD; define "Occupied Pediatric ICU Beds Initial Population":#xD; "Pediatric ICU Beds Initial Population"#xD; and EncounterCheck#xD; #xD; //Stratifiers#xD; //COVID_19#xD; define "Adult Inpatient COVID_19 Patients Stratifier":#xD; if "Adult Inpatient Beds Initial Population" then#xD; "Count Confirmed COVID_19 Patients in Bed Location"#xD; else 0#xD; #xD; define "Pediatric Inpatient COVID_19 Patients Stratifier":#xD; if "Pediatric Inpatient Beds Initial Population" then#xD; "Count Confirmed COVID_19 Patients in Bed Location"#xD; else 0#xD; #xD; define "Adult ICU COVID_19 Patients Stratifier":#xD; if "Adult ICU Beds Initial Population" then#xD; "Count Confirmed COVID_19 Patients in Bed Location"#xD; else 0#xD; #xD; define "Pediatric ICU COVID_19 Patients Stratifier":#xD; if "Pediatric ICU Beds Initial Population" then#xD; "Count Confirmed COVID_19 Patients in Bed Location"#xD; else 0#xD; #xD; define "New Pediatric COVID_19 Patients Between 0 to 4 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted COVID_19 Patient IDs" , 0, 4 )#xD; )#xD; #xD; define "New Pediatric COVID_19 Patients Between 5 to 17 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted COVID_19 Patient IDs", 5, 17 )#xD; )#xD; #xD; define "New Adult COVID_19 Patients Between 18 to 49 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted COVID_19 Patient IDs", 18, 49 )#xD; )#xD; #xD; define "New Adult COVID_19 Patients Between 50 to 64 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted COVID_19 Patient IDs", 50, 64 )#xD; )#xD; #xD; define "New Adult COVID_19 Patients Between 65 to 74 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted COVID_19 Patient IDs", 65, 74 )#xD; )#xD; #xD; define "New Adult COVID_19 Patients 75 and Above Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Above Specified Age"( "Newly Admitted COVID_19 Patient IDs", 75 )#xD; )#xD; #xD; define "New COVID_19 Patients with Unknown Age Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location and Unknown Age"( "Newly Admitted COVID_19 Patient IDs" )#xD; )#xD; #xD; //Influenza#xD; define "Adult Inpatient Influenza Patients Stratifier":#xD; if "Adult Inpatient Beds Initial Population" then#xD; "Count Confirmed Influenza Patients in Bed Location"#xD; else 0#xD; #xD; define "Pediatric Inpatient Influenza Patients Stratifier":#xD; if "Pediatric Inpatient Beds Initial Population" then#xD; "Count Confirmed Influenza Patients in Bed Location"#xD; else 0#xD; #xD; define "Adult ICU Influenza Patients Stratifier":#xD; if "Adult ICU Beds Initial Population" then#xD; "Count Confirmed Influenza Patients in Bed Location"#xD; else 0#xD; #xD; define "Pediatric ICU Influenza Patients Stratifier":#xD; if "Pediatric ICU Beds Initial Population" then#xD; "Count Confirmed Influenza Patients in Bed Location"#xD; else 0#xD; #xD; define "New Pediatric Influenza Patients Between 0 to 4 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted Influenza Patient IDs" , 0, 4 )#xD; )#xD; #xD; define "New Pediatric Influenza Patients Between 5 to 17 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted Influenza Patient IDs", 5, 17 )#xD; )#xD; #xD; define "New Adult Influenza Patients Between 18 to 49 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted Influenza Patient IDs", 18, 49 )#xD; )#xD; #xD; define "New Adult Influenza Patients Between 50 to 64 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted Influenza Patient IDs", 50, 64 )#xD; )#xD; #xD; define "New Adult Influenza Patients Between 65 to 74 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted Influenza Patient IDs", 65, 74 )#xD; )#xD; #xD; define "New Adult Influenza Patients 75 and Above Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Above Specified Age"( "Newly Admitted Influenza Patient IDs", 75 )#xD; )#xD; #xD; define "New Influenza Patients with Unknown Age Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location and Unknown Age"( "Newly Admitted Influenza Patient IDs" )#xD; )#xD; #xD; //RSV#xD; define "Adult Inpatient RSV Patients Stratifier":#xD; if "Adult Inpatient Beds Initial Population" then#xD; "Count Confirmed RSV Patients in Bed Location"#xD; else 0#xD; #xD; define "Pediatric Inpatient RSV Patients Stratifier":#xD; if "Pediatric Inpatient Beds Initial Population" then#xD; "Count Confirmed RSV Patients in Bed Location"#xD; else 0#xD; #xD; define "Adult ICU RSV Patients Stratifier":#xD; if "Adult ICU Beds Initial Population" then#xD; "Count Confirmed RSV Patients in Bed Location"#xD; else 0#xD; #xD; define "Pediatric ICU RSV Patients Stratifier":#xD; if "Pediatric ICU Beds Initial Population" then#xD; "Count Confirmed RSV Patients in Bed Location"#xD; else 0#xD; #xD; define "New Pediatric RSV Patients Between 0 to 4 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted RSV Patient IDs" , 0, 4 )#xD; )#xD; #xD; define "New Pediatric RSV Patients Between 5 to 17 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted RSV Patient IDs", 5, 17 )#xD; )#xD; #xD; define "New Adult RSV Patients Between 18 to 49 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted RSV Patient IDs", 18, 49 )#xD; )#xD; #xD; define "New Adult RSV Patients Between 50 to 64 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted RSV Patient IDs", 50, 64 )#xD; )#xD; #xD; define "New Adult RSV Patients Between 65 to 74 Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( "Newly Admitted RSV Patient IDs", 65, 74 )#xD; )#xD; #xD; define "New Adult RSV Patients 75 and Above Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location Above Specified Age"( "Newly Admitted RSV Patient IDs", 75 )#xD; )#xD; #xD; define "New RSV Patients with Unknown Age Stratifier":#xD; Count(#xD; "Get Confirmed Patient IDs in Bed Location and Unknown Age"( "Newly Admitted RSV Patient IDs" )#xD; )#xD; #xD; //Devices (Supply is divided by average used per day (estimated))#xD; define "N95 Mask Supply in Days Stratifier":#xD; GetDayCode( "N95 Mask Supply in Days" )#xD; #xD; define "N95 Mask Supply in Days":#xD; Floor( Count(#xD; "Devices" Devices#xD; where Devices.type ~ "N95 mask"#xD; ) / 10 )#xD; #xD; define "N95 Mask 3 Day Supply Stratifier":#xD; if "N95 Mask Supply in Days" > 3 then 'y'#xD; else 'n'#xD; #xD; define "OR Surgical Mask Supply in Days Stratifier":#xD; GetDayCode( "OR Surgical Mask Supply in Days" )#xD; #xD; define "OR Surgical Mask Supply in Days":#xD; Floor( Count(#xD; "Devices" Devices#xD; where Devices.type ~ "Surgical mask"#xD; ) / 10 )#xD; #xD; define "OR Surgical Mask 3 Day Supply Stratifier":#xD; if "OR Surgical Mask Supply in Days" > 3 then 'y'#xD; else 'n'#xD; #xD; define "Face Shield Supply in Days Stratifier":#xD; GetDayCode( "Face Shield Supply in Days" )#xD; #xD; define "Face Shield Supply in Days":#xD; Floor( Count(#xD; "Devices" Devices#xD; where Devices.type ~ "Face shield"#xD; ) / 10 )#xD; #xD; define "Face Shield 3 Day Supply Stratifier":#xD; if "Face Shield Supply in Days" > 3 then 'y'#xD; else 'n'#xD; #xD; define "Gown Supply in Days Stratifier":#xD; GetDayCode( "Gown Supply in Days" )#xD; #xD; define "Gown Supply in Days":#xD; Floor( Count(#xD; "Devices" Devices#xD; where Devices.type ~ "Patient gown"#xD; ) / 5 )#xD; #xD; define "Gown 3 Day Supply Stratifier":#xD; if "Gown Supply in Days" > 3 then 'y'#xD; else 'n'#xD; #xD; define "Glove Supply in Days Stratifier":#xD; GetDayCode( "Glove Supply in Days" )#xD; #xD; define "Glove Supply in Days":#xD; Floor( Count(#xD; "Devices" Devices#xD; where Devices.type ~ "Surgical glove"#xD; ) / 15 )#xD; #xD; define "Glove 3 Day Supply Stratifier":#xD; if "Glove Supply in Days" > 3 then 'y'#xD; else 'n'#xD; #xD; //Functions and Helpers#xD; define "COVID_19 Observations":#xD; [Observation: "COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)"] #xD; union [Observation: "COVID_19 (Tests for SARS_CoV_2 Antigen)"]#xD; #xD; define "Newly Admitted COVID_19 Patient IDs":#xD; "Get Confirmed Patient IDs"( "Newly Admitted Encounters", "COVID_19 Observations" )#xD; #xD; define "Count Confirmed COVID_19 Patients in Bed Location":#xD; Count(#xD; "Get Confirmed Patient IDs"( "Encounters", "COVID_19 Observations" )#xD; )#xD; #xD; define "Influenza Observations":#xD; [Observation: "Influenza (Tests for influenza A or B virus Nucleic Acid)"] #xD; union [Observation: "Influenza (Tests for influenza A or B virus Antigen)"]#xD; #xD; define "Newly Admitted Influenza Patient IDs":#xD; "Get Confirmed Patient IDs"( "Newly Admitted Encounters", "Influenza Observations" )#xD; #xD; define "Count Confirmed Influenza Patients in Bed Location":#xD; Count(#xD; "Get Confirmed Patient IDs"( "Encounters", "Influenza Observations" )#xD; )#xD; #xD; define "RSV Observations":#xD; [Observation: "RSV (Tests for RSV Antigen)"] #xD; union [Observation: "RSV (Tests for RSV Nucleic Acid)"]#xD; #xD; define "Newly Admitted RSV Patient IDs":#xD; "Get Confirmed Patient IDs"( "Newly Admitted Encounters", "RSV Observations" )#xD; #xD; define "Count Confirmed RSV Patients in Bed Location":#xD; Count(#xD; "Get Confirmed Patient IDs"( "Encounters", "RSV Observations" )#xD; )#xD; #xD; define "IsBedLocation":#xD; Location.physicalType ~ "Bed"#xD; #xD; define "Encounters":#xD; [Encounter]#xD; #xD; define "Devices":#xD; [Device]#xD; #xD; define "Newly Admitted Encounters":#xD; "Encounters" Encounters#xD; where Encounters.status in { 'in-progress', 'arrived', 'triaged' }#xD; #xD; define "Patients":#xD; [Patient]#xD; #xD; define function GetDayCode(count Integer):#xD; case#xD; when count = 0 then "0 Days"#xD; when count >= 1 and count <= 3 then "1-3 Days"#xD; when count >= 4 and count <= 6 then "4-6 Days"#xD; when count >= 7 and count <= 14 then "7-14 Days"#xD; when count >= 15 and count <= 30 then "15-30 Days"#xD; when count > 30 then ">30 Days"#xD; else null#xD; end#xD; #xD; define function "Get Confirmed Patient IDs"( Encounters List<FHIR.Encounter>, Observations List<FHIR.Observation> ):#xD; Distinct(#xD; Encounters Encounter#xD; where exists(#xD; Observations Labs#xD; where exists(#xD; Labs.category category#xD; where category ~ "laboratory"#xD; )#xD; and Encounter.subject = Labs.subject#xD; and Labs.value ~ "detected"#xD; and "Normalize Interval"( Labs.effective ) overlaps Encounter.period#xD; )#xD; return Encounter.subject#xD; )#xD; #xD; define function "Get Confirmed Patient IDs in Bed Location Between Specified Ages"( PatientIDs List<FHIR.Reference>, low System.Integer, high System.Integer ):#xD; PatientIDs PatientID#xD; where exists(#xD; "Patients" Patients#xD; let PatientAge: CalculateAgeInYearsAt( Patients.birthDate, start of "Measurement Period" )#xD; where Patients.id = GetId( PatientID.reference )#xD; and PatientAge >= low#xD; and PatientAge <= high#xD; )#xD; #xD; define function "Get Confirmed Patient IDs in Bed Location Above Specified Age"( PatientIDs List<FHIR.Reference>, age System.Integer ):#xD; PatientIDs PatientID#xD; where exists(#xD; "Patients" Patients#xD; let PatientAge: CalculateAgeInYearsAt( Patients.birthDate, start of "Measurement Period" )#xD; where Patients.id = GetId( PatientID.reference )#xD; and PatientAge >= age#xD; )#xD; #xD; define function "Get Confirmed Patient IDs in Bed Location and Unknown Age"( PatientIDs List<FHIR.Reference> ):#xD; PatientIDs PatientID#xD; where exists(#xD; "Patients" Patients#xD; where Patients.id = GetId( PatientID.reference )#xD; and Patients.birthDate = null#xD; )#xD; #xD; define function "GetCondition"( reference Reference ):#xD; singleton from (#xD; [Condition] Conditions#xD; where Conditions.id = GetId( reference.reference )#xD; )#xD; #xD; define function "GetId"( uri String ):#xD; Last(Split(uri, '/'))#xD; #xD; define function "Normalize Interval"( choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant> ):#xD; case#xD; when choice is FHIR.dateTime then#xD; Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]#xD; when choice is FHIR.Period then#xD; FHIRHelpers.ToInterval(choice as FHIR.Period)#xD; when choice is FHIR.instant then#xD; Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]#xD; when choice is FHIR.Timing then#xD; Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute a single interval from a Timing type')#xD; else#xD; null as Interval<DateTime>#xD; end#xD; #xD; define "EncounterCheck":#xD; exists("Encounters" Encounters#xD; where Encounters.period overlaps "Measurement Period")#xD; #xD; define "LocationIsHOSP":#xD; exists(#xD; Location.type types#xD; where types ~ "HOSP"#xD; )#xD; #xD; define "LocationIsIPF":#xD; exists(#xD; Location.type types#xD; where types ~ "IPF"#xD; )#xD; #xD; define "LocationIsIRF":#xD; exists(#xD; Location.type types#xD; where types ~ "IRF"#xD; )#xD; #xD; define "LocationIsCHLD":#xD; exists(#xD; Location.type types#xD; where types ~ "CHLD"#xD; )#xD; #xD; define "LocationIsOTH":#xD; exists(#xD; Location.type types#xD; where types ~ "OTH"#xD; ) Content: application/elm+json Encoded data (694560 characters)
Value set COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)
Value set COVID_19 (Tests for SARS_CoV_2 Antigen)
Value set Influenza (Tests for influenza A or B virus Nucleic Acid)
Value set Influenza (Tests for influenza A or B virus Antigen)
Value set RSV (Tests for RSV Nucleic Acid)
Occupied Inpatient Beds Initial Population
Occupied Adult Inpatient Beds Initial Population
Pediatric Inpatient Beds Initial Population
Occupied Pediatric Inpatient Beds Initial Population
Occupied Adult ICU Beds Initial Population
Occupied Pediatric ICU Beds Initial Population
Count Confirmed COVID_19 Patients in Bed Location
Adult Inpatient COVID_19 Patients Stratifier
Pediatric Inpatient COVID_19 Patients Stratifier
Pediatric ICU COVID_19 Patients Stratifier
New Pediatric COVID_19 Patients Between 0 to 4 Stratifier
New Pediatric COVID_19 Patients Between 5 to 17 Stratifier
New Adult COVID_19 Patients Between 18 to 49 Stratifier
New Adult COVID_19 Patients Between 50 to 64 Stratifier
New Adult COVID_19 Patients Between 65 to 74 Stratifier
New Adult COVID_19 Patients 75 and Above Stratifier
New COVID_19 Patients with Unknown Age Stratifier
Count Confirmed Influenza Patients in Bed Location
Adult Inpatient Influenza Patients Stratifier
Pediatric Inpatient Influenza Patients Stratifier
Pediatric ICU Influenza Patients Stratifier
New Pediatric Influenza Patients Between 0 to 4 Stratifier
New Pediatric Influenza Patients Between 5 to 17 Stratifier
New Adult Influenza Patients Between 18 to 49 Stratifier
New Adult Influenza Patients Between 50 to 64 Stratifier
New Adult Influenza Patients Between 65 to 74 Stratifier
New Adult Influenza Patients 75 and Above Stratifier
New Influenza Patients with Unknown Age Stratifier
Count Confirmed RSV Patients in Bed Location
Pediatric Inpatient RSV Patients Stratifier
New Pediatric RSV Patients Between 0 to 4 Stratifier
New Pediatric RSV Patients Between 5 to 17 Stratifier
New Adult RSV Patients Between 18 to 49 Stratifier
New Adult RSV Patients Between 50 to 64 Stratifier
New Adult RSV Patients Between 65 to 74 Stratifier
New Adult RSV Patients 75 and Above Stratifier
New RSV Patients with Unknown Age Stratifier
OR Surgical Mask Supply in Days Stratifier
OR Surgical Mask 3 Day Supply Stratifier