FHIR © HL7.org  |  Server Home  |  XIG Home  |  XIG Stats  |  Server Source  |  FHIR  

FHIR IG Statistics: Measure/ComputableCDCPatientImpactAndHospitalCapacity

Packagehl7.fhir.uv.saner
Resource TypeMeasure
IdComputableCDCPatientImpactAndHospitalCapacity
FHIR VersionR4
Sourcehttp://hl7.org/fhir/uv/saner/https://build.fhir.org/ig/HL7/fhir-saner/Measure-ComputableCDCPatientImpactAndHospitalCapacity.html
URLhttp://hl7.org/fhir/uv/saner/Measure/ComputableCDCPatientImpactAndHospitalCapacity
Version1.0.1
Statusdraft
Date2024-05-18T21:25:01+00:00
NameComputableCDCPatientImpactAndHospitalCapacity
TitlePatient Impact and Hospital Capacity
Realmuv
Authorityhl7
DescriptionThis measure demonstrates automated reporting on bed availability and use at a facility location based on CDC/NHSN reporting requirements. It is used to illustrate automation of measure reporting using the SANER Implementation guide.

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

Patient Impact and Hospital Capacity

The url for this measure is http://hl7.org/fhir/uv/saner/Measure/ComputableCDCPatientImpactAndHospitalCapacity.

This measure demonstrates automated reporting on bed availability and use at a facility location based on CDC/NHSN reporting requirements. It is used to illustrate automation of measure reporting using the SANER Implementation guide.

Frequency
This measure is expected to be reported every 1 day.
Publisher
HL7 International
Contacts
HL7 Public Health Workgroup (http://hl7.org/Special/committees/pher/index.cfm)
Keith W. Boone (mailto:kboone@ainq.com)
Status
draft

Definitions

Ventilator
Any device used to support, assist or control respiration (inclusive of the weaning period) through the application of positive pressure to the airway when delivered via an artificial airway, specifically an oral/nasal endotracheal or tracheostomy tube. Note: Ventilation and lung expansion devices that deliver positive pressure to the airway (for example: CPAP, BiPAP, bi-level, IPPB and PEEP) via non-invasive means (for example: nasal prongs, nasal mask, full face mask, total mask, etc.) are not considered ventilators unless positive pressure is delivered via an artificial airway (oral/nasal endotracheal or tracheostomy tube).
Beds
Baby beds in mom's room count as 1 bed, even if there are multiple baby beds Follow-up in progress if staffed is less than licensed. Total includes all beds, even if with surge beds it exceeds licensed beds.
ICU beds
Include NICU

Group: Hospital COVID-19 Patient Encounters Reporting

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem#Encounters Encounters
subject
Patient in room
scoring
queue-length
type
structure
improvementNotation
decrease
Population: Patients with suspected or confirmed COVID-19 in any location.

Active encounters where the encounter diagnosis is suspected or confirmed COVID-19, or a Condition of suspected or confirmed COVID-19 was created during that encounter. This includes the patients with laboratory-confirmed or clinically diagnosed COVID-19.

Confirmed
A patient with a laboratory confirmed COVID-19 diagnosis
Suspected
A patient without a laboratory confirmed COVID-19 diagnosis who, in accordance with CDC’s Interim Public Health Guidance for Evaluating Persons Under Investigation (PUIs), has signs and symptoms compatible with COVID-19 (most patients with confirmed COVID-19 have developed fever and/or symptoms of acute respiratory illness, such as cough, shortness of breath or myalgia/fatigue).

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numC19Pats All COVID-19 Confirmed or Suspected Patients
  • http://terminology.hl7.org/CodeSystem/measure-population#initial-population
Expression: NumC19Pats

This expression finds encounters that were active or finished in the reporting period, and their referenced Patient, Condition and Observation resources. It filters these based on cases where Encounter reports a reason or condition in the SuspectedOrDiagnosedCOVID19 value set, or where a positive lab test from the Covid19Labs valueset, or where the patient has any such associated Condition or Observation resources in the prior two weeks.

Language
text/fhirpath
 ( %Base + 'Encounter?' + '_include=Encounter:subject&_include=Encounter:Condition&' + '_include=Encounter:reasonReference' + '&status=in-progress,finished' + '&date=ge' + %ReportingPeriod.start.toString() + '&date=lt' + %ReportingPeriod.end.toString() ).resolve().select(entry.resource). where( iif(myMemberOf((Encounter.reasonCode | Condition.code), %SuspectedOrConfirmedCOVID19Diagnoses.url) | Observation.where((myMemberOf(code, %Covid19Labs.url) and myMemberOf(value, %PositiveResults.url)) ), true, iif( Patient.distinct().where( %Base + 'Observation?_count=1' + '&status=registered,preliminary,final,amended,corrected' + '&patient=' + $this.id + '&date=gt' + (dateSubtract(%ReportingPeriod.start, 14 'days')).toString() + '&code:in=' + %Covid19Labs.url + '&value-concept:in=' + %PositiveResults.url ).resolve().select(entry.resource as Observation).exists(), true, Patient.distinct().where( %Base + 'Condition?_count=1'+ '&status:not=refuted&status:not=entered-in-error' + '&patient=' + $this.id + '&verificationStatus:not=refuted,entered-in-error' + '&date=gt' + (dateSubtract(%ReportingPeriod.start, 14 'days')).toString() + '&code:in=' + SuspectedOrConfirmedCOVID19Diagnoses.url ).resolve().select(entry.resource as Condition).exists() ) ) ) .distinct() .aggregate( iif($total.subject contains $this.subject, $total, $total | $this ) )
Stratifier: By Location and Ventilator Status

Stratifies the population by Location (inpatient vs ED/Overflow/Other) and Ventilator Status (Ventilated vs Not Ventilated)

Expression
Language
text/fhirpath
iif(%NumVentUse.id contains Encounter.subject, iif(myMemberOf(Encounter.location.location.resolve().type, %InpatientLocations.url), 'InpVentilated', 'OFVentilated'), iif(myMemberOf(Encounter.location.location.resolve().type, %InpatientLocations.url), 'InpNotVentilated', 'OFNotVentilated') )

Group: Hospital Onset COVID-19 Patient Encounters Reporting

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem#AcquiredCovid Acquired COVID-19 in Hospital
subject
Hospital Acquired COVID-19
scoring
event-growth
type
outcome
improvementNotation
decrease
Population: Patients with suspected or confirmed COVID-19 in an inpatient location

Patients with suspected or confirmed COVID-19 in an inpatient location

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numC19HospPats Hospitalized COVID-19 Patients
  • http://terminology.hl7.org/CodeSystem/measure-population#initial-population
Expression: NumC19HospPats

Uses the value of NumC19Pat as the initial population

Language
text/fhirpath
%NumC19Pats.entry.resource.location.location.resolve().where(myMemberOf(type, %InpatientLocations.url))
Population: Hospital Onset COVID-19 Patients

Hospital Onset COVID-19 Patients

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numC19HOPats Hospital Onset COVID-19 Patients
  • http://terminology.hl7.org/CodeSystem/measure-population#numerator
Expression: NumC19HOPats

Filters the initial population by ruling out those patients whose first suspected or confirmed diagnosis or lab result appears less than 14 days from admission.

Language
text/fhirpath
Encounter.where( iif(dateAdd(period.start,14 'days') > today(), false, iif( (%Base + 'Condition?_count=1'+ '&status:not=refuted&status:not=entered-in-error' + '&patient=' + $this.subject + '&verificationStatus:not=refuted,entered-in-error' + '&date=gt' + (dateAdd($this.period.start,14 'days')).toString() + '&date=le' + (dateSubtract($this.period.start,14 'days')).toString() + '&code:in=' + %SuspectedOrConfirmedCOVID19Diagnoses.url ).resolve().select(entry.resource as Condition).exists(), false, (%Base + 'Observation?_count=1' + '&status=registered,preliminary,final,amended,corrected' + '&patient=' + $this.subject + '&date=gt' + (dateSubtract($this.period.start, 14 'days')).toString() + '&date=le' + (dateAdd($this.period.start,14 'days')).toString() + '&code:in=' + %Covid19Labs.url + '&value-concept:in=' + %PositiveResults.url ).resolve().select(entry.resource as Observation) .empty() ) ) ).select(patient).resolve().trace('patients', id)
Population: Cumulative Hospital Onset COVID-19 Patients

Cumulative Hospital Onset COVID-19 Patients

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#cumC19HOPats Cumulative Hospital Onset COVID-19 Patients
  • http://terminology.hl7.org/CodeSystem/measure-population#denominator
Expression: CumC19HOPats

omputes the cumulative total from the prior measure report and the number of new infections detected in the current reporting period.

Language
text/fhirpath
iif(%PriorReport.empty(), 0, %PriorReport.group[1].population[2].count + %NumC19HOPats.total)
Stratifier: By Age Group

Stratifies the population by Age Group

Expression
Language
text/fhirpath
Patient.select( iif(dateAdd(birthDate, 20 'years') < today(), 'P0Y--P20Y', iif(dateAdd(birthDate, 30 'years') < today(), 'P20Y--P30Y', iif(dateAdd(birthDate, 40 'years') < today(), 'P30Y--P40Y', iif(dateAdd(birthDate, 50 'years') < today(), 'P40Y--P50Y', iif(dateAdd(birthDate, 60 'years') < today(), 'P50Y--P60Y', iif(dateAdd(birthDate, 70 'years') < today(), 'P60Y--P70Y', iif(dateAdd(birthDate, 80 'years') < today(), 'P70Y--P80Y', 'P80Y-P9999Y') ) ) ) ) ) ) )
Stratifier: By Gender

Stratifies the population by Gender

Expression
Language
text/fhirpath
Patient.gender
Stratifier: By Ethnicity

Stratifies the population by Ethnicity

Expression
Language
text/fhirpath
Patient.extension('http://hl7.org/fhir/us/core/StructureDefinition/us-ethnicity-category').extension('ombCategory').valueCoding.code
Stratifier: By Race

Stratifies the population by Race

Expression
Language
text/fhirpath
Patient .extension('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race') .extension('ombCategory') .select( iif(valueCoding.count() > 1, 'Mixed', iif(valueCoding.system = 'http://terminology.hl7.org/CodeSystem/v3-NullFlavor', 'Unknown', valueCoding.code ) ) )

Group: COVID-19 Patient Death Reporting

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem#CovidDeaths COVID-19 Deaths
subject
Patients with conformed or suspected COVID-19 who have died
scoring
event-growth
type
outcome
improvementNotation
decrease
Population: Patients with suspected or confirmed COVID-19 in any location.

Patients with suspected or confirmed COVID-19 in any location.

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numC19Pats All COVID-19 Confirmed or Suspected Patients
  • http://terminology.hl7.org/CodeSystem/measure-population#initial-population
Expression

COVID-19 Patients in an inpatient setting

Language
text/fhirpath
%NumC19Pats.entry.resource
Population: Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location

Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numC19Died COVID-19 Patient Deaths
  • http://terminology.hl7.org/CodeSystem/measure-population#numerator
Expression: NumC19Died

Filters the initial population by selecting those who have died.

Language
text/fhirpath
Encounter.where( iif( hospitalization.where( myMemberOf(dispositionCode, %PatientExpired) ), true, subject.resolve().where(deceasedBoolean = true | deceasedDateTime.exists()) ) ).select(subject).resolve()
Population: Cumulative total of Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location

Cumulative total of Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#cumC19Died Cumulative COVID-19 Patient Deaths
  • http://terminology.hl7.org/CodeSystem/measure-population#denominator
Expression: CumC19Died

Computes the cumulative total from the prior measure report and the number of new deaths in the current reporting period.

Language
text/fhirpath
iif(%PriorReport.empty(), 0, %PriorReport.group[2].population[2].count + %NumC29Died.count())
Stratifier: By Age Group

Stratifies the population by Age Group

Expression
Language
text/fhirpath
Patient.select( iif(dateAdd(birthDate, 20 'years') < today(), 'P0Y--P20Y', iif(dateAdd(birthDate, 30 'years') < today(), 'P20Y--P30Y', iif(dateAdd(birthDate, 40 'years') < today(), 'P30Y--P40Y', iif(dateAdd(birthDate, 50 'years') < today(), 'P40Y--P50Y', iif(dateAdd(birthDate, 60 'years') < today(), 'P50Y--P60Y', iif(dateAdd(birthDate, 70 'years') < today(), 'P60Y--P70Y', iif(dateAdd(birthDate, 80 'years') < today(), 'P70Y--P80Y', 'P80Y-P9999Y') ) ) ) ) ) ) )
Stratifier: By Gender

Stratifies the population by Gender

Expression
Language
text/fhirpath
Patient.gender
Stratifier: By Ethnicity

Stratifies the population by Ethnicity

Expression
Language
text/fhirpath
Patient.extension('http://hl7.org/fhir/us/core/StructureDefinition/us-ethnicity-category').extension('ombCategory').valueCoding.code
Stratifier: By Race

Stratifies the population by Race

Expression
Language
text/fhirpath
Patient .extension('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race') .extension('ombCategory') .select( iif(valueCoding.code contains '1992-5', 'A', ' ') + iif(valueCoding.code contains '2054-5', 'B', ' ') + iif(valueCoding.code contains '2076-8', 'H', ' ') + iif(valueCoding.code contains '2028-9', 'S', ' ') + iif(valueCoding.code contains '2106-3', 'W', ' ') )

Group: Ventilator Reporting

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem#Ventilators Ventilators
subject
Ventilator capacity
scoring
capacity
type
structure
improvementNotation
decrease
Population: Total number of ventilators

Count of all ventilators that can support patient care, whether or not they are presently in use.

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numVent Mechanical Ventilators
  • http://terminology.hl7.org/CodeSystem/measure-population#denominator
Expression: NumVent

Computes the total number of ventilators from the previously reported MeasureReport

Language
text/fhirpath
iif(trace('PriorReport exists:', %PriorReport.exists()), %PriorReport.group[3].population[0].count, 0)
Population: Total number of ventilators in use

Count of all ventilators in use.

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numVentUse Mechanical Ventilators in Use
  • http://terminology.hl7.org/CodeSystem/measure-population#numerator
Expression: NumVentUse

dentifies the number of ventilators in use by counting Patient with an Observation or Procedure resource from an appropriate value set indicating ventilator use.

Language
text/fhirpath
( %Base + 'Encounter?' + 'status=in-progress,finished' + '&_include=Encounter:subject' + '&date=ge' + %ReportingPeriod.start.toString() + '&date=lt' + %ReportingPeriod.end.toString() ).resolve() .select(entry.resource as Patient) .where( iif( ( %Base + 'Observation?_count=1'+ '&status=registered,preliminary,final,amended,corrected' + '&patient=' + $this.id + '&verificationStatus:not=refuted,entered-in-error' + '&date=gt' + %ReportingPeriod.start.toString() + '&date=le' + %ReportingPeriod.end.toString() + '&code:in=' + %VentilatorObservations.url ).resolve().select(entry.resource as Observation).exists(), true, ( %Base + 'Procedure?_count=1'+ '&status=in-progress,competed' + '&patient=' + $this.id + '&date=gt' + %ReportingPeriod.start.toString() + '&date=le' + %ReportingPeriod.end.toString() + '&code:in=' + %VentilatorProcedures.url ).resolve().select(entry.resource as Procedure).exists() ) )
Population: Total number of ventilators not presently in use.

Count of all ventilators not presently in use.

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numVentAvail Mechanical Ventilators Available
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasurePopulationSystem#numerator-complement
Expression: NumVentAvail

omputes the number of ventilators available by substracting the number of ventilators in use determined by population 1 from thee total number of ventilators given in population 0

Language
text/fhirpath
%NumVent - %NumVentUse.total.toInteger()

Group: Bed Reporting

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem#Beds Beds
subject
Bed capacity
scoring
capacity
type
structure
improvementNotation
decrease
Population: Total number of beds

Total number of all Inpatient and outpatient beds, including all staffed, ICU, licensed, and overflow (surge) beds used for inpatients or outpatients

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numTotBeds All Hospital Beds
  • http://terminology.hl7.org/CodeSystem/measure-population#denominator
Expression: NumTotBeds

Computes the total number of beds from the previously reported MeasureReport

Language
text/fhirpath
iif(%PriorReport.exists(),%PriorReport.group[3].population[0].count,0)
Population: Total number of beds in use

Total number of all Inpatient and outpatient beds that are occupied

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numTotBedsOcc Hospital Beds Occupied
  • http://terminology.hl7.org/CodeSystem/measure-population#numerator
Expression: NumTotBedsOcc

Identifies the number of beds in use by counting the most recent Encounter for each patient where the encounter was in-progress or finished within the period.

Language
text/fhirpath
( %Base + 'Encounter?' + 'status=in-progress' + '&date=ge' + %ReportingPeriod.start.toString() + '&date=lt' + %ReportingPeriod.end.toString() ).resolve().select(entry.resource as Encounter) .aggregate( iif($total.select(location[0]).location contains $this.location.location.first(), $total, $total | $this ) )
Population: Total number of hospital beds available

Total number of all hospital inpatient and outpatient beds that are available

Codes
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues#numTotBedsAvail Hospital Beds Available
  • http://hl7.org/fhir/uv/saner/CodeSystem/MeasurePopulationSystem#numerator-complement
Expression: NumTotBedsAvail

omputes the number of beds available by substracting the number of beds in use determined by population 1 from the total number of beds given in population 0

Language
text/fhirpath
%NumTotBeds - %NumTotBedsOcc.count()
Stratifier: By Type of Location

Inpatient Non-ICU, Inpatient ICU, Other

Expression

Determines the location of the encounter based on the membership of location.type in the InpatientLocations and ICULocations ValueSet resources. When location.type is assigned to any other value, it is reported to be Other

Language
text/fhirpath
Encounter.location.location.resolve() .iif(myMemberOf(type, %InpatientLocations.url), iif (myMemberOf(type, %ICULocations.url), 'Inpatient ICU', 'Inpatient Non-ICU' ), 'Other' )
References

Source

{
  "resourceType": "Measure",
  "id": "ComputableCDCPatientImpactAndHospitalCapacity",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/uv/saner/StructureDefinition/PublicHealthMeasure"
    ]
  },
  "text": {
    "status": "generated",
    "div": "<!-- snip (see above) -->"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/uv/saner/StructureDefinition/ReportingPeriod",
      "valueTiming": {
        "repeat": {
          "frequency": 1,
          "period": 1,
          "periodUnit": "d"
        }
      }
    }
  ],
  "url": "http://hl7.org/fhir/uv/saner/Measure/ComputableCDCPatientImpactAndHospitalCapacity",
  "identifier": [
    {
      "system": "urn:ietf:rfc:3986",
      "value": "urn:oid:2.16.840.1.113883.4.642.40.42.29.4"
    }
  ],
  "version": "1.0.1",
  "name": "ComputableCDCPatientImpactAndHospitalCapacity",
  "title": "Patient Impact and Hospital Capacity",
  "status": "draft",
  "experimental": true,
  "date": "2024-05-18T21:25:01+00:00",
  "publisher": "HL7 International / Public Health",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/pher"
        }
      ]
    },
    {
      "telecom": [
        {
          "system": "email",
          "value": "pher@lists.hl7.org"
        }
      ]
    },
    {
      "name": "Keith W. Boone",
      "telecom": [
        {
          "system": "email",
          "value": "mailto:kboone@ainq.com"
        }
      ]
    }
  ],
  "description": "This measure demonstrates automated reporting on bed availability and use at a facility location based on CDC/NHSN reporting requirements.\nIt is used to illustrate automation of measure reporting using the SANER Implementation guide.",
  "useContext": [
    {
      "code": {
        "system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
        "code": "focus"
      },
      "valueCodeableConcept": {
        "coding": [
          {
            "system": "http://snomed.info/sct",
            "code": "840539006",
            "display": "COVID-19"
          }
        ]
      }
    }
  ],
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code": "001",
          "display": "World"
        }
      ]
    }
  ],
  "author": [
    {
      "name": "Centers for Disease Control/National Healthcare Safety Network (CDC/NHSN)",
      "telecom": [
        {
          "system": "email",
          "value": "mailto:nhsn@cdc.gov"
        }
      ]
    }
  ],
  "relatedArtifact": [
    {
      "type": "documentation",
      "label": "NHSN COVID-19 Reporting",
      "display": "CDC/NHSN COVID-19 Patient Impact & Hospital Capacity Module Home Page",
      "url": "https://web.archive.org/web/20200501215043/https://www.cdc.gov/nhsn/acute-care-hospital/covid19/",
      "document": {
        "url": "https://web.archive.org/web/20200501215043/https://www.cdc.gov/nhsn/acute-care-hospital/covid19/"
      }
    },
    {
      "type": "documentation",
      "label": "How to import COVID-19 Summary Data",
      "display": "Importing COVID-19 Patient Module Denominator data for Patient Safety Component",
      "url": "https://web.archive.org/web/20200501215043/https://www.cdc.gov/nhsn/pdfs/covid19/import-covid19-data-508.pdf",
      "document": {
        "url": "https://web.archive.org/web/20200501215043/https://www.cdc.gov/nhsn/pdfs/covid19/import-covid19-data-508.pdf"
      }
    },
    {
      "type": "documentation",
      "label": "Table of Instructions",
      "display": "Instructions for Completion of the COVID-19 Patient Impact and Hospital Capacity Module Form (CDC 57.130)",
      "url": "https://web.archive.org/web/20200501215043/https://www.cdc.gov/nhsn/pdfs/covid19/57.130-toi-508.pdf",
      "document": {
        "url": "https://web.archive.org/web/20200501215043/https://www.cdc.gov/nhsn/pdfs/covid19/57.130-toi-508.pdf"
      }
    },
    {
      "type": "documentation",
      "label": "CSV File Template",
      "display": "CDC/NHSN COVID-19 Reporting CSV File Template",
      "url": "https://web.archive.org/web/20200501215043/https://www.cdc.gov/nhsn/pdfs/covid19/covid19-test-csv-import.csv",
      "document": {
        "url": "https://web.archive.org/web/20200501215043/https://www.cdc.gov/nhsn/pdfs/covid19/covid19-test-csv-import.csv"
      }
    }
  ],
  "library": [
    "http://hl7.org/fhir/uv/saner/Library/ComputableNHSNMeasureLibrary"
  ],
  "definition": [
    "Ventilator: Any device used to support, assist or control respiration (inclusive of the weaning period) through the application of positive\npressure to the airway when delivered via an artificial airway, specifically an oral/nasal endotracheal or tracheostomy tube.\nNote: Ventilation and lung expansion devices that deliver positive pressure to the airway (for example: CPAP, BiPAP, bi-level, IPPB and\nPEEP) via non-invasive means (for example: nasal prongs, nasal mask, full face mask, total mask, etc.) are not considered ventilators\nunless positive pressure is delivered via an artificial airway (oral/nasal endotracheal or tracheostomy tube).\n\nBeds: Baby beds in mom's room count as 1 bed, even if there are multiple baby beds. Follow-up in progress if staffed is less than licensed.\nTotal includes all beds, even if with surge beds it exceeds licensed beds.\n\nICU beds: Include NICU"
  ],
  "group": [
    {
      "extension": [
        {
          "extension": [
            {
              "url": "subject",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/resource-types",
                    "code": "Encounter"
                  },
                  {
                    "system": "http://snomed.info/sct",
                    "code": "398284004",
                    "display": "Patient in room"
                  }
                ],
                "text": "Patient in room"
              }
            },
            {
              "url": "scoring",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/uv/saner/CodeSystem/PublicHealthMeasureScoring",
                    "code": "queue-length"
                  }
                ]
              }
            },
            {
              "url": "type",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-type",
                    "code": "structure"
                  }
                ]
              }
            },
            {
              "url": "improvementNotation",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
                    "code": "decrease"
                  }
                ]
              }
            },
            {
              "url": "rateAggregation",
              "valueString": "point-in-time"
            }
          ],
          "url": "http://hl7.org/fhir/uv/saner/StructureDefinition/MeasureGroupAttributes"
        }
      ],
      "code": {
        "coding": [
          {
            "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem",
            "code": "Encounters",
            "display": "Encounters"
          }
        ],
        "text": "Hospital COVID-19 Patient Encounters Reporting"
      },
      "population": [
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numC19Pats",
                "display": "All COVID-19 Confirmed or Suspected Patients"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "initial-population"
              }
            ],
            "text": "Patients with suspected or confirmed COVID-19 in any location."
          },
          "description": "Active encounters where the encounter diagnosis is suspected or confirmed COVID-19,  or a Condition of suspected or confirmed COVID-19 was created during that encounter.  This includes the patients with laboratory-confirmed\n or clinically diagnosed COVID-19.\n\nConfirmed: A patient with a laboratory confirmed COVID-19 diagnosis\n\nSuspected: A patient without a laboratory confirmed COVID-19 diagnosis who, in accordance with CDC’s Interim Public Health Guidance\nfor Evaluating Persons Under Investigation (PUIs), has signs and symptoms compatible with COVID-19 (most patients with confirmed\nCOVID-19 have developed fever and/or symptoms of acute respiratory illness, such as cough, shortness of breath or myalgia/fatigue).",
          "criteria": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/uv/saner/StructureDefinition/MeasureAlternateCriteria",
                "valueExpression": {
                  "description": "Alternate definition for Active encounters using CQL",
                  "name": "NumC19Pats",
                  "language": "text/cql",
                  "expression": "NumberOfCOVID19Patients"
                }
              }
            ],
            "description": "This expression finds encounters that were active or finished in the reporting period, and their referenced Patient, Condition and Observation resources.\nIt filters these based on cases where Encounter reports a reason or condition in the SuspectedOrConfirmedCOVID19Diagnoses value set, or\nwhere a positive lab test from the Covid19Labs valueset, or where the patient has any such associated Condition or Observation resources\nin the prior two weeks.",
            "name": "NumC19Pats",
            "language": "text/fhirpath",
            "expression": "findAll('Encounter',\n        including('subject','condition','reasonReference'),\n        with('status').equalTo('in-progress'|'finished'),\n        with('date').within(%ReportingPeriod)\n     ).onServers(%Base).\n     where(\n       iif(myMemberOf((Encounter.reasonCode | Condition.code), %SuspectedOrConfirmedCOVID19Diagnoses.url) |\n           Observation.where((myMemberOf(code, %Covid19Labs.url) and myMemberOf(value, %PositiveResults.url))\n         ), true,\n         iif(\n           Patient.distinct()\n              .whereExists('Observation',\n                for('patient', $this),\n                with('status').equalTo(\n                    'registered' | 'preliminary' | 'final' | 'amended' | 'corrected'),\n                with('date').greaterThan(%ReportingPeriod.start - 14 'days'),\n                with('code').in(%Covid19Labs),\n                with('value-concept).in(%PositiveResults)\n           ).onServers(%Base), true,\n           Patient.distinct()\n              .whereExists('Condition',\n                for('patient', $this),\n                with('verification-status').notEqualTo('refuted'|'entered-in-error').\n                with('date').greaterThan(%ReportingPeriod.start - 14 'days'),\n                with('code').in(%SuspectedOrConfirmedCOVID19Diagnoses.url)\n           ).exists()\n         )\n      )\n    )\n    .distinct()\n    .aggregate(\n      iif($total.subject contains $this.subject,\n          $total, $total | $this\n      )\n    )"
          }
        }
      ],
      "stratifier": [
        {
          "code": {
            "text": "By Location and Ventilator Status"
          },
          "description": "Stratifies the population by Location (inpatient vs ED/Overflow/Other) and Ventilator Status (Ventilated vs Not Ventilated)",
          "criteria": {
            "description": "For each Encounter,\n  if the encounter subject has been ventilated\n    if the Encounter location is an inpatient loocation,\n      return InpVentilated\n    Otherwise\n      return OFVentilated\n  else\n    if the Encounter location is an inpatient loocation,\n      return InpNotVentilated\n    Otherwise\n      return OFNotVentilated\n  end if",
            "language": "text/fhirpath",
            "expression": "iif(%NumVentUse.id contains Encounter.subject,\n    iif(myMemberOf(Encounter.location.location.resolve().type, %InpatientLocations.url), 'InpVentilated', 'OFVentilated'),\n    iif(myMemberOf(Encounter.location.location.resolve().type, %InpatientLocations.url), 'InpNotVentilated', 'OFNotVentilated')\n)"
          }
        }
      ]
    },
    {
      "extension": [
        {
          "extension": [
            {
              "url": "subject",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/resource-types",
                    "code": "Patient"
                  },
                  {
                    "system": "http://snomed.info/sct",
                    "code": "116154003|Patient|: 20401003|With| = (840539006|Disease caused by 2019 novel coronavirus|: 246512002|Timing| = 277056009|Hospital Acquired|)",
                    "display": "Patient where With = Disease caused by 2019 novel coronavirus where Timing = Hospital acquired"
                  }
                ],
                "text": "Hospital Acquired COVID-19"
              }
            },
            {
              "url": "scoring",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/uv/saner/CodeSystem/PublicHealthMeasureScoring",
                    "code": "event-growth"
                  }
                ]
              }
            },
            {
              "url": "type",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-type",
                    "code": "outcome"
                  }
                ]
              }
            },
            {
              "url": "improvementNotation",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
                    "code": "decrease"
                  }
                ]
              }
            },
            {
              "url": "rateAggregation",
              "valueString": "cumulative"
            }
          ],
          "url": "http://hl7.org/fhir/uv/saner/StructureDefinition/MeasureGroupAttributes"
        }
      ],
      "code": {
        "coding": [
          {
            "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem",
            "code": "AcquiredCovid",
            "display": "Acquired COVID-19 in Hospital"
          }
        ],
        "text": "Hospital Onset COVID-19 Patient Encounters Reporting"
      },
      "population": [
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numC19HospPats",
                "display": "Hospitalized COVID-19 Patients"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "initial-population"
              }
            ],
            "text": "Patients with suspected or confirmed COVID-19 in an inpatient location"
          },
          "description": "Patients with suspected or confirmed COVID-19 in an inpatient location",
          "criteria": {
            "description": "Uses the value of NumC19Pat as the initial population",
            "name": "NumC19HospPats",
            "language": "text/fhirpath",
            "expression": "%NumC19Pats.entry.resource.location.location.resolve().where(myMemberOf(type, %InpatientLocations.url))"
          }
        },
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numC19HOPats",
                "display": "Hospital Onset COVID-19 Patients"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "numerator"
              }
            ],
            "text": "Hospital Onset COVID-19 Patients"
          },
          "description": "Hospital Onset COVID-19 Patients",
          "criteria": {
            "description": "Filters the initial population by ruling out those patients whose first suspected or\nconfirmed diagnosis or lab result appears less than 14 days from admission.",
            "name": "NumC19HOPats",
            "language": "text/fhirpath",
            "expression": "Encounter.where(\n  iif(dateAdd(period.start,14 'days') > today(),\n    false,\n    iif(\n      whereExists('Condition',\n        with('status').notEqualTo('refuted'|'entered-in-error'),\n        with('patient').equalTo($this.subject),\n        with('verificationStatus').notEqualTo('refuted'|'entered-in-error'),\n        with('date').greaterThan($this.period.start - 14 'days'),\n        with('date').lessThanOrEqualTo($this.period.start - 14 'days'),\n        with('code').in(%SuspectedOrConfirmedCOVID19Diagnoses.url)\n      ).onServers(%Base),\n      false,\n      whereExists('Observation',\n        with('status').equalTo('registered'|'preliminary'|'final'|'amended'|'corrected'),\n        with('patient').equalTo($this.subject),\n        with('date').greaterThan($this.period.start - 14 'days'),\n        with('date').lessThanOrEqualTo($this.period.start - 14 'days'),\n        with('code').in(%Covid19Labs.url)\n        with('value-concept').in(%PositiveResults.url)\n      ).onServers(%Base).not()\n    )\n  )\n).select(patient).resolve().trace('patients', id)"
          }
        },
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "cumC19HOPats",
                "display": "Cumulative Hospital Onset COVID-19 Patients"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "denominator"
              }
            ],
            "text": "Cumulative Hospital Onset COVID-19 Patients"
          },
          "description": "Cumulative Hospital Onset COVID-19 Patients",
          "criteria": {
            "description": "Computes the cumulative total from the prior measure report and the number of new\n infections detected in the current reporting period.",
            "name": "CumC19HOPats",
            "language": "text/fhirpath",
            "expression": "iif(%PriorReport.empty(), 0, %PriorReport.group[1].population[2].count + %NumC19HOPats.total)"
          }
        }
      ],
      "stratifier": [
        {
          "code": {
            "text": "By Age Group"
          },
          "description": "Stratifies the population by Age Group",
          "criteria": {
            "description": "If birth date + N years < today, return the code for the patient < N Years of age for values\n of N from 20, 30, 40, 50, 60, 70 and 80, otherise return the code for over 80",
            "language": "text/fhirpath",
            "expression": "Patient.select(\n  iif(dateAdd(birthDate, 20 'years') < today(), 'P0Y--P20Y',\n    iif(dateAdd(birthDate, 30 'years') < today(), 'P20Y--P30Y',\n      iif(dateAdd(birthDate, 40 'years') < today(), 'P30Y--P40Y',\n        iif(dateAdd(birthDate, 50 'years') < today(), 'P40Y--P50Y',\n          iif(dateAdd(birthDate, 60 'years') < today(), 'P50Y--P60Y',\n            iif(dateAdd(birthDate, 70 'years') < today(), 'P60Y--P70Y',\n              iif(dateAdd(birthDate, 80 'years') < today(), 'P70Y--P80Y', 'P80Y-P9999Y')\n            )\n          )\n        )\n      )\n    )\n  )\n)"
          }
        },
        {
          "code": {
            "text": "By Gender"
          },
          "description": "Stratifies the population by Gender",
          "criteria": {
            "description": "Return the patient gender",
            "language": "text/fhirpath",
            "expression": "Patient.gender"
          }
        },
        {
          "code": {
            "text": "By Ethnicity"
          },
          "description": "Stratifies the population by Ethnicity",
          "criteria": {
            "description": "Return the patient enthnicity code",
            "language": "text/fhirpath",
            "expression": "Patient.extension('http://hl7.org/fhir/us/core/StructureDefinition/us-ethnicity-category').extension('ombCategory').valueCoding.code"
          }
        },
        {
          "code": {
            "text": "By Race"
          },
          "description": "Stratifies the population by Race",
          "criteria": {
            "description": "Return the patient race code",
            "language": "text/fhirpath",
            "expression": "Patient\n.extension('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race')\n.extension('ombCategory')\n.select(\n  iif(valueCoding.count() > 1,\n     'Mixed',\n     iif(valueCoding.system = 'http://terminology.hl7.org/CodeSystem/v3-NullFlavor',\n         'Unknown',\n         valueCoding.code\n     )\n  )\n)"
          }
        }
      ]
    },
    {
      "extension": [
        {
          "extension": [
            {
              "url": "subject",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/resource-types",
                    "code": "Patient"
                  },
                  {
                    "system": "http://snomed.info/sct",
                    "code": "419620001",
                    "display": "Death"
                  }
                ],
                "text": "Patients with conformed or suspected COVID-19 who have died"
              }
            },
            {
              "url": "scoring",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/uv/saner/CodeSystem/PublicHealthMeasureScoring",
                    "code": "event-growth"
                  }
                ]
              }
            },
            {
              "url": "type",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-type",
                    "code": "outcome"
                  }
                ]
              }
            },
            {
              "url": "improvementNotation",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
                    "code": "decrease"
                  }
                ]
              }
            },
            {
              "url": "rateAggregation",
              "valueString": "cumulative"
            }
          ],
          "url": "http://hl7.org/fhir/uv/saner/StructureDefinition/MeasureGroupAttributes"
        }
      ],
      "code": {
        "coding": [
          {
            "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem",
            "code": "CovidDeaths",
            "display": "COVID-19 Deaths"
          }
        ],
        "text": "COVID-19 Patient Death Reporting"
      },
      "population": [
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numC19Pats",
                "display": "All COVID-19 Confirmed or Suspected Patients"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "initial-population"
              }
            ],
            "text": "Patients with suspected or confirmed COVID-19 in any location."
          },
          "description": "Patients with suspected or confirmed COVID-19 in any location.",
          "criteria": {
            "description": "COVID-19 Patients in an inpatient setting",
            "language": "text/fhirpath",
            "expression": "%NumC19Pats.entry.resource"
          }
        },
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numC19Died",
                "display": "COVID-19 Patient Deaths"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "numerator"
              }
            ],
            "text": "Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location"
          },
          "description": "Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location",
          "criteria": {
            "description": "Filters the initial population by selecting those who have died.",
            "name": "NumC19Died",
            "language": "text/fhirpath",
            "expression": "Encounter.where(\n  iif(\n    hospitalization.where(\n      myMemberOf(dispositionCode, %PatientExpired)\n    ),\n    true,\n    subject.resolve().where(deceasedBoolean = true | deceasedDateTime.exists())\n  )\n).select(subject).resolve()"
          }
        },
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "cumC19Died",
                "display": "Cumulative COVID-19 Patient Deaths"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "denominator"
              }
            ],
            "text": "Cumulative total of Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location"
          },
          "description": "Cumulative total of Patients with suspected or confirmed COVID-19 who died in the hospital, ED, or any overflow location",
          "criteria": {
            "description": "Computes the cumulative total from the prior measure report and the number of new deaths in the current reporting period.",
            "name": "CumC19Died",
            "language": "text/fhirpath",
            "expression": "iif(%PriorReport.empty(), 0, %PriorReport.group[2].population[2].count + %NumC29Died.count())"
          }
        }
      ],
      "stratifier": [
        {
          "code": {
            "text": "By Age Group"
          },
          "description": "Stratifies the population by Age Group",
          "criteria": {
            "description": "If birth date + N years < today, return the code for the patient < N Years of age for values\n of N from 20, 30, 40, 50, 60, 70 and 80, otherise return the code for over 80",
            "language": "text/fhirpath",
            "expression": "Patient.select(\n  iif(dateAdd(birthDate, 20 'years') < today(), 'P0Y--P20Y',\n    iif(dateAdd(birthDate, 30 'years') < today(), 'P20Y--P30Y',\n      iif(dateAdd(birthDate, 40 'years') < today(), 'P30Y--P40Y',\n        iif(dateAdd(birthDate, 50 'years') < today(), 'P40Y--P50Y',\n          iif(dateAdd(birthDate, 60 'years') < today(), 'P50Y--P60Y',\n            iif(dateAdd(birthDate, 70 'years') < today(), 'P60Y--P70Y',\n              iif(dateAdd(birthDate, 80 'years') < today(), 'P70Y--P80Y', 'P80Y-P9999Y')\n            )\n          )\n        )\n      )\n    )\n  )\n)"
          }
        },
        {
          "code": {
            "text": "By Gender"
          },
          "description": "Stratifies the population by Gender",
          "criteria": {
            "description": "Return the patient gender",
            "language": "text/fhirpath",
            "expression": "Patient.gender"
          }
        },
        {
          "code": {
            "text": "By Ethnicity"
          },
          "description": "Stratifies the population by Ethnicity",
          "criteria": {
            "description": "Return the patient ethnicity code",
            "language": "text/fhirpath",
            "expression": "Patient.extension('http://hl7.org/fhir/us/core/StructureDefinition/us-ethnicity-category').extension('ombCategory').valueCoding.code"
          }
        },
        {
          "code": {
            "text": "By Race"
          },
          "description": "Stratifies the population by Race",
          "criteria": {
            "description": "Return the patient race code",
            "language": "text/fhirpath",
            "expression": "Patient\n.extension('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race')\n.extension('ombCategory')\n.select(\n  iif(valueCoding.code contains '1992-5', 'A', ' ') +\n  iif(valueCoding.code contains '2054-5', 'B', ' ') +\n  iif(valueCoding.code contains '2076-8', 'H', ' ') +\n  iif(valueCoding.code contains '2028-9', 'S', ' ') +\n  iif(valueCoding.code contains '2106-3', 'W', ' ')\n)"
          }
        }
      ]
    },
    {
      "extension": [
        {
          "url": "http://hl7.org/fhir/uv/saner/StructureDefinition/MeasureExpectation",
          "valueCode": "SHOULD"
        },
        {
          "extension": [
            {
              "url": "subject",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/resource-types",
                    "code": "Device"
                  },
                  {
                    "system": "http://snomed.info/sct",
                    "code": "257463002",
                    "display": "Ventilator Outlet"
                  }
                ],
                "text": "Ventilator capacity"
              }
            },
            {
              "url": "scoring",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/uv/saner/CodeSystem/PublicHealthMeasureScoring",
                    "code": "capacity"
                  }
                ]
              }
            },
            {
              "url": "type",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-type",
                    "code": "structure"
                  }
                ]
              }
            },
            {
              "url": "improvementNotation",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
                    "code": "decrease"
                  }
                ]
              }
            },
            {
              "url": "rateAggregation",
              "valueString": "point-in-time"
            }
          ],
          "url": "http://hl7.org/fhir/uv/saner/StructureDefinition/MeasureGroupAttributes"
        }
      ],
      "code": {
        "coding": [
          {
            "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem",
            "code": "Ventilators",
            "display": "Ventilators"
          }
        ],
        "text": "Ventilator Reporting"
      },
      "population": [
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numVent",
                "display": "Mechanical Ventilators"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "denominator"
              }
            ],
            "text": "Total number of ventilators"
          },
          "description": "Count of all ventilators that can support patient care, whether or not they are presently in use.",
          "criteria": {
            "description": "Computes the total number of ventilators from the previously reported MeasureReport",
            "name": "NumVent",
            "language": "text/fhirpath",
            "expression": "iif(trace('PriorReport exists:', %PriorReport.exists()), %PriorReport.group[3].population[0].count, 0)"
          }
        },
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numVentUse",
                "display": "Mechanical Ventilators in Use"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "numerator"
              }
            ],
            "text": "Total number of ventilators in use"
          },
          "description": "Count of all ventilators in use.",
          "criteria": {
            "description": "Identifies the number of ventilators in use by counting Patient with an Observation\n or Procedure resource from an appropriate value set indicating ventilator use.",
            "name": "NumVentUse",
            "language": "text/fhirpath",
            "expression": "findAll('Encounter',\n including('subject'),\n with('status').equalTo('in-progress'|'finished'),\n with('date').within(%ReportingPeriod)\n).onServers(%Base)\n.select(entry.resource as Patient)\n.where(\n  iif(\n    whereExists('Observation',\n      with('status').equalTo('registered'|'preliminary'|'final'|'amended'|'corrected'),\n      with('patient').equalTo($this.id),\n      with('verificationStatus').notEqualTo('refuted'|'entered-in-error'),\n      with('date').within(%ReportingPeriod),\n      with('code').in(%VentilatorObservations.url)\n    ).onServers(%Base)\n    true,\n    whereExists('Procedure',\n      with('status').equalTo('in-progress'|'completed'),\n      with('patient').equalTo($this.id),\n      with('date').within(%ReportingPeriod),\n      with('code').in(%VentilatorProcedures.url)\n    ).onServers(%Base)\n  )\n)"
          }
        },
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numVentAvail",
                "display": "Mechanical Ventilators Available"
              },
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasurePopulationSystem",
                "code": "numerator-complement"
              }
            ],
            "text": "Total number of ventilators not presently in use."
          },
          "description": "Count of all ventilators not presently in use.",
          "criteria": {
            "description": "Computes the number of ventilators available by substracting the number of ventilators in use\n determined by population 1 from thee total number of ventilators given in population 0",
            "name": "NumVentAvail",
            "language": "text/fhirpath",
            "expression": "%NumVent - %NumVentUse.total.toInteger()"
          }
        }
      ]
    },
    {
      "extension": [
        {
          "extension": [
            {
              "url": "subject",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/resource-types",
                    "code": "Device"
                  },
                  {
                    "system": "http://snomed.info/sct",
                    "code": "91537007",
                    "display": "Hospital Bed"
                  }
                ],
                "text": "Bed capacity"
              }
            },
            {
              "url": "scoring",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/uv/saner/CodeSystem/PublicHealthMeasureScoring",
                    "code": "capacity"
                  }
                ]
              }
            },
            {
              "url": "type",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-type",
                    "code": "structure"
                  }
                ]
              }
            },
            {
              "url": "improvementNotation",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/measure-improvement-notation",
                    "code": "decrease"
                  }
                ]
              }
            },
            {
              "url": "rateAggregation",
              "valueString": "point-in-time"
            }
          ],
          "url": "http://hl7.org/fhir/uv/saner/StructureDefinition/MeasureGroupAttributes"
        }
      ],
      "code": {
        "coding": [
          {
            "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasureGroupSystem",
            "code": "Beds",
            "display": "Beds"
          }
        ],
        "text": "Bed Reporting"
      },
      "population": [
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numTotBeds",
                "display": "All Hospital Beds"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "denominator"
              }
            ],
            "text": "Total number of beds"
          },
          "description": "Total number of all Inpatient and outpatient beds, including all staffed, ICU,\nlicensed, and overflow (surge) beds used for inpatients or outpatients",
          "criteria": {
            "description": "Computes the total number of beds from the previously reported MeasureReport",
            "name": "NumTotBeds",
            "language": "text/fhirpath",
            "expression": "iif(%PriorReport.exists(),%PriorReport.group[3].population[0].count,0)"
          }
        },
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numTotBedsOcc",
                "display": "Hospital Beds Occupied"
              },
              {
                "system": "http://terminology.hl7.org/CodeSystem/measure-population",
                "code": "numerator"
              }
            ],
            "text": "Total number of beds in use"
          },
          "description": "Total number of all Inpatient and outpatient beds that are occupied",
          "criteria": {
            "description": "Identifies the number of beds in use by counting the most recent Encounter for each patient where the encounter\nwas in-progress or finished within the period.",
            "name": "NumTotBedsOcc",
            "language": "text/fhirpath",
            "expression": "findAll('Encounter',\n  with('status').equalTo('in-progress'),\n  with('date').within(%ReportingPeriod)\n).onServers(%Base)\n.aggregate(\n   iif($total.select(location[0]).location contains $this.location.location.first(),\n       $total,\n       $total | $this\n   )\n)"
          }
        },
        {
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasuredValues",
                "code": "numTotBedsAvail",
                "display": "Hospital Beds Available"
              },
              {
                "system": "http://hl7.org/fhir/uv/saner/CodeSystem/MeasurePopulationSystem",
                "code": "numerator-complement"
              }
            ],
            "text": "Total number of hospital beds available"
          },
          "description": "Total number of all hospital inpatient and outpatient beds that are available",
          "criteria": {
            "description": "Computes the number of beds  available by substracting the number of beds in use\n determined by population 1 from the total number of beds given in population 0",
            "name": "NumTotBedsAvail",
            "language": "text/fhirpath",
            "expression": "%NumTotBeds - %NumTotBedsOcc.count()"
          }
        }
      ],
      "stratifier": [
        {
          "code": {
            "text": "By Type of Location"
          },
          "description": "Inpatient Non-ICU, Inpatient ICU, Other",
          "criteria": {
            "description": "Determines the location of the encounter based on the membership\nof location.type in the InpatientLocations and ICULocations ValueSet resources.\nWhen location.type is assigned to any other value, it is reported to be Other",
            "language": "text/fhirpath",
            "expression": "Encounter.location.location.resolve()\n.iif(myMemberOf(type, %InpatientLocations.url),\n    iif (myMemberOf(type, %ICULocations.url),\n        'Inpatient ICU',\n        'Inpatient Non-ICU'\n    ),\n    'Other'\n)"
          }
        }
      ]
    }
  ]
}