eCQM QICore Content Implementation Guide
2023.0.0 - CI Build

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

Measure: Severe Obstetric ComplicationsFHIR

Official URL: http://ecqi.healthit.gov/ecqms/Measure/SevereObstetricComplicationsFHIR Version: 0.0.007
Draft as of 2023-08-08 Responsible: The Joint Commission Computable Name: SevereObstetricComplicationsFHIR
Other Identifiers: Short Name (use: usual, ), UUID:6cf03fe2-b962-4f83-ac37-26d7477183c7 (use: official, ), UUID:2c92808482ead7c5018384daff512547 (use: official, ), Publisher (use: official, )

Usage:Program: EH/CAH

Copyright/Legal: Measure specifications are in the Public Domain.

LOINC(R) copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 copyright 2022 World Health Organization. All Rights Reserved.

Patients with severe obstetric complications which occur during the inpatient delivery hospitalization

UNKNOWN

Title: Severe Obstetric ComplicationsFHIR
Id: SevereObstetricComplicationsFHIR
Download cql: SevereObstetricComplicationsFHIR.cql
Version: 0.0.007
Url: Severe Obstetric ComplicationsFHIR
short-name identifier:

CMS1028FHIR

version-independent identifier:

urn:uuid:6cf03fe2-b962-4f83-ac37-26d7477183c7

version-specific identifier:

urn:uuid:2c92808482ead7c5018384daff512547

publisher (CMS) identifier:

1028FHIR

Effective Period: 2024-01-01 ..2024-12-31
Status: draft
Date: 2023-08-08 18:35:06+0000
Approval Date: 2023-08-21
Last Review Date: 2023-08-21
Name: SevereObstetricComplicationsFHIR
Publisher: The Joint Commission
Author: The Joint Commission: https://www.jointcommission.org/, Centers for Medicare & Medicaid Services (CMS): https://www.cms.gov/, Yale New Haven Health Service Corporation/ Center for Outcomes Research and Evaluation: https://medicine.yale.edu/core/
Description:

Patients with severe obstetric complications which occur during the inpatient delivery hospitalization

Use Context:
code value
program
Purpose:

UNKNOWN

Copyright:

Measure specifications are in the Public Domain.

LOINC(R) copyright 2004-2022 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2022 International Health Terminology Standards Development Organisation. ICD-10 copyright 2022 World Health Organization. All Rights Reserved.

Disclaimer:

These performance measures are not clinical guidelines and do not establish a standard of medical care, and have not been tested for all potential applications. The measures and specifications are provided without warranty.

Risk Adjustment Factor:

Risk Variable Lab and Physical Exam Results

Risk Adjustment Factor:

Risk Variable Anemia

Risk Adjustment Factor:

Risk Variable Asthma

Risk Adjustment Factor:

Risk Variable Autoimmune Disease

Risk Adjustment Factor:

Risk Variable Bariatric Surgery

Risk Adjustment Factor:

Risk Variable Bleeding Disorder

Risk Adjustment Factor:

Risk Variable Morbid Obesity

Risk Adjustment Factor:

Risk Variable Cardiac Disease

Risk Adjustment Factor:

Risk Variable Economic Housing Instability

Risk Adjustment Factor:

Risk Variable Gastrointestinal Disease

Risk Adjustment Factor:

Risk Variable Gestational Diabetes

Risk Adjustment Factor:

Risk Variable HIV

Risk Adjustment Factor:

Risk Variable Hypertension

Risk Adjustment Factor:

Risk Variable Long Term Anticoagulant Use

Risk Adjustment Factor:

Risk Variable Mental Health Disorder

Risk Adjustment Factor:

Risk Variable Multiple Pregnancy

Risk Adjustment Factor:

Risk Variable Neuromuscular

Risk Adjustment Factor:

Risk Variable Obstetrical VTE

Risk Adjustment Factor:

Risk Variable Placenta Previa

Risk Adjustment Factor:

Risk Variable Placental Abruption

Risk Adjustment Factor:

Risk Variable Placental Accreta Spectrum

Risk Adjustment Factor:

Risk Variable Preexisting Diabetes

Risk Adjustment Factor:

Risk Variable Previous Cesarean

Risk Adjustment Factor:

Risk Variable Pulmonary Hypertension

Risk Adjustment Factor:

Risk Variable Renal Disease

Risk Adjustment Factor:

Risk Variable Severe Preeclampsia

Risk Adjustment Factor:

Risk Variable Substance Abuse

Risk Adjustment Factor:

Risk Variable Thyrotoxicosis

Risk Adjustment Factor:

Risk Variable Other Preeclampsia

Risk Adjustment Factor:

Risk Variable Preterm Birth

Risk Adjustment Factor:

Risk Variable First Hematocrit Lab Test

Risk Adjustment Factor:

Risk Variable First White Blood Cell Count Lab Test

Risk Adjustment Factor:

Risk Variable Heart Rate

Risk Adjustment Factor:

Risk Variable Systolic Blood Pressure

Rationale:

The United States (US) experiences higher rates of maternal morbidity and mortality than most other developed countries. These rates have continued to trend upward in recent decades (CDC, n.d.). Research indicates that the overall rate of severe maternal morbidity (SMM) increased by almost 200% between 1993 and 2014 to 144 per 10,000 delivery hospitalizations (CDC, n.d.), with more than 25,000 women per year experiencing obstetric complications (U.S. Department of Health and Human Services, 2020). Recent maternal mortality data from 2018 reveal that 658 women in the US died from maternal causes, resulting in a rate of 17.4 deaths per 100,000 live births, with 77% of the deaths attributed to direct obstetric causes like hemorrhage, preeclampsia, obstetric embolism, and other complications (Hoyert & Minino, 2018). 144 per 10,000 women hospitalized for delivery have experienced SMM, including hemorrhage, embolism, hypertension, stroke, and other serious complications (CDC,2020). Racial and ethnic disparities for Black women and Hispanic women are at a significantly higher risk for developing these complications than are Non-Hispanic White women (Leonard et al., 2019). Increasing rates of SMM are resulting in increased healthcare costs, longer hospitalization stays and impacts on a woman's health.

There is limited national evaluation of hospitals' performance on maternal morbidity and mortality although SMM is widely used at the population level. SMM is linked to maternal mortality, varies significantly among hospitals, and has significant racial/ethnic and urban/rural disparities. SMM is a cost driver for both Medicaid and commercial plans. This measure is important as it will assist in the discovery and understanding of SMM patterns which can lead to improvements in the safety and quality of maternal care necessary to reduce SMM rates.

Clinical recommendation statement:

Healthy People 2030 Measure (MICH-05): Reduce severe maternal complications identified during delivery hospitalizations

The American College of Obstetricians and Gynecologists (the College) and the Society for Maternal-Fetal Medicine (SMFM) recommend identifying potential cases of severe maternal morbidity for further review, with a focus on outcomes and complications, and consider this an important step toward promoting safe obstetric care.

Guidance (Usage): This measure allows for 3 approaches to determine gestational age (GA) in the following order of precedence: 1. The GA is calculated using the American College of Obstetricians and Gynecologists ReVITALize guidelines.* 2. The GA is obtained from a discrete field in the electronic health record. This option is only used when the calculated GA is not available. 3. The GA is based on ICD10 or SNOMED codes indicative of weeks gestation. This option is only used when results from items #1 and #2 (see above) are not available. Wherever gestational age is mentioned, relative to the delivery, the intent is to capture the last estimated gestational age prior to or at the time of delivery. *ACOG ReVITALize Guidelines for Calculating Gestational Age: Gestational Age = (280-(Estimated Due Date minus Reference Date))/7 --Estimated Due Date (EDD): The best obstetrical EDD is determined by last menstrual period if confirmed by early ultrasound or no ultrasound performed, or early ultrasound if no known last menstrual period or the ultrasound is not consistent with last menstrual period, or known date of fertilization (e.g., assisted reproductive technology) --Reference Date is the date on which you are trying to determine gestational age. For purposes of this eCQM, Reference Date would be the Date of Delivery. Note however the calculation may yield a non-whole number and gestational age should be rounded off to the nearest completed week. For example, an infant born on the 5th day of the 36th week (35 weeks and 5/7 days) is at a gestational age of 35 weeks, not 36 weeks. Definition: For this measure, specifications are modeled after the nationally available and adopted CDC definition for Severe Maternal Morbidity (SMM) with the addition of maternal mortality. At times, we may refer to the CDC indicators of morbidity as SMM, but the outcome of the measure, which includes morbidity and mortality, is referred to as Severe Obstetric Complications (SOC). This eCQM is an episode-based measure. An episode is defined as each inpatient hospitalization or encounter that ends during the measurement period. This FHIR-based measure has been derived from the QDM-based measure CMS1028v2. Please refer to the HL7 QI-Core Implementation Guide (http://hl7.org/fhir/us/qicore/index.html) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (http://hl7.org/fhir/us/qicore/qdm-to-qicore.html).
Population Criteria: Stratifier Criteria:
638907ab4ba3d47c885c02fd
Initial Population: Inpatient hospitalizations for patients age greater than or equal to 8 years and less than 65 admitted to the hospital for inpatient acute care who undergo a delivery procedure with a discharge date that ends during the measurement period
Denominator: Inpatient hospitalizations for patients delivering stillborn or live birth with greater than or equal to 20 weeks, 0 days gestation completed
Denominator Exclusion: Inpatient hospitalizations for patients with confirmed diagnosis of COVID with COVID-related respiratory condition or patients with confirmed diagnosis of COVID with COVID-related respiratory procedure
Numerator: Inpatient hospitalizations for patients with severe obstetric complications (not present on admission that occur during the current delivery encounter) including the following: - Severe maternal morbidity diagnoses (see list below) - Severe maternal morbidity procedures (see list below) - Discharge disposition of expired Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. Severe Maternal Morbidity Diagnoses: - Cardiac Acute heart failure Acute myocardial infarction Aortic aneurysm Cardiac arrest/ventricular fibrillation Heart failure/arrest during procedure or surgery - Hemorrhage Disseminated intravascular coagulation Shock - Renal Acute renal failure - Respiratory Adult respiratory distress syndrome Pulmonary edema - Sepsis - Other OB Air and thrombotic embolism Amniotic fluid embolism Eclampsia Severe anesthesia complications - Other Medical Puerperal cerebrovascular disorder Sickle cell disease with crisis Severe Maternal Morbidity Procedures: - Blood transfusion - Conversion of cardiac rhythm - Hysterectomy - Temporary tracheostomy - Ventilation
Numerator Exclusion: None
Denominator Exception: None
: Stratum1: Delivery hospitalizations with severe obstetric complications excluding hospitalizations where transfusion was the only severe obstetric complication. Additionally, this measure will be stratified by race and ethnicity after measure submission.
: None
Supplemental Data Guidance : Patient's Ethnicity: Hispanic or Latino Not Hispanic or Latino Patient's Payer: Categories of types of health care payer entities as defined by the US Public Health Data Consortium SOP code system Patient's Race: Native Hawaiian or Other Pacific Islander Asian American Indian or Alaska Native Other Race White Black or African American Patient's Sex: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories. This definition establishes a variable of CGA (Calculated Gestational Age). CGA is a supplemental data element to store the calculated gestational age result from the "calculatedGestationalAge" function. The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition.
Risk Adjustment Variable Guidance : The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Lab and Physical Exam Results: Report the first resulted value 24 hours prior to start of encounter and before time of delivery in UCUM units specified: - Heart rate: {beats}/min - Systolic blood pressure: mm[Hg] - White blood cell count: 10*3/uL - Hematocrit: % The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data. The Severe Obstetric Complications Risk Adjustment Methodology Report is available on the eCQI Resource Center (https://ecqi.healthit.gov). Pre-existing conditions and variables must be present on admission:. Please note that present on admission codes may be those entered by coding staff, extracted from billing/claims data.
Supplemental Data Elements: SDE Ethnicity SDE Payer SDE Race SDE Sex Variable Calculated Gestational Age
Libraries:
SevereObstetricComplicationsFHIR
Related Artifact Dependencies:
  • Library/PCMaternal|5.10.000
  • Library/FHIRHelpers|4.3.000
  • Library/QICoreCommon|1.5.000
  • Library/CQMCommon|1.4.000
  • Library/QICoreCommon|1.5.000
  • Library/FHIRHelpers|4.3.000
  • Library/QICoreCommon|1.5.000
  • Library/SupplementalDataElements|3.4.000
  • Library/FHIRHelpers|4.3.000
  • LOINC
  • Encounter Inpatient
  • Delivery Procedures
  • Observation Services
  • ED Visit and OB Triage
  • Estimated Gestational Age at Delivery
  • 20 to 42 Plus Weeks Gestation
  • Asthma
  • Present On Admission is Yes or Exempt
  • Substance Abuse
  • Placenta Accreta
  • Neuromuscular Disease
  • Renal Disease
  • Gastrointestinal Disease
  • Hypertension
  • Preterm Birth
  • Pulmonary Hypertension
  • Payer
  • Thyrotoxicosis
  • Mild or Moderate Preeclampsia
  • Economic Housing Instability
  • Placental Abruption
  • COVID 19 Confirmed
  • Respiratory Conditions Related to COVID 19
  • Respiratory Support Procedures Related to COVID 19
  • HIV in Pregnancy Childbirth and Puerperium
  • Morbid or Severe Obesity
  • Preexisting Diabetes
  • Mental Health Disorder
  • Venous Thromboembolism in Pregnancy
  • Autoimmune Disease
  • Bariatric Surgery
  • Previous Cesarean
  • Placenta Previa
  • Gestational Diabetes
  • Severe Maternal Morbidity Diagnoses
  • Present on Admission is No or Unable To Determine
  • Severe Maternal Morbidity Procedures
  • Patient Expired
  • Blood Transfusion
  • Bleeding Disorder
  • Multiple Pregnancy
  • White blood cells count lab test
  • Hematocrit lab test
  • Anemia
  • Severe Preeclampsia
  • Cardiac Disease
  • Long Term Anticoagulant Use
  • Parameters:
    name use min max type
    Measurement Period In 0 1 Period
    Risk Variable Systolic Blood Pressure Out 0 1 Resource
    Risk Variable Asthma Out 0 * Resource
    Risk Variable Substance Abuse Out 0 * Resource
    Risk Variable Placental Accreta Spectrum Out 0 * Resource
    Risk Variable Neuromuscular Out 0 * Resource
    Risk Variable Renal Disease Out 0 * Resource
    Risk Variable Gastrointestinal Disease Out 0 * Resource
    Risk Variable Hypertension Out 0 * Resource
    Risk Variable Preterm Birth Out 0 * Resource
    Risk Variable Pulmonary Hypertension Out 0 * Resource
    Variable Calculated Gestational Age Out 0 * Resource
    SDE Payer Out 0 * Resource
    Risk Variable Thyrotoxicosis Out 0 * Resource
    Risk Variable Other Preeclampsia Out 0 * Resource
    Initial Population Out 0 * Resource
    Risk Variable Economic Housing Instability Out 0 * Resource
    Risk Variable Placental Abruption Out 0 * Resource
    Denominator Exclusion Out 0 * Resource
    Risk Variable HIV Out 0 * Resource
    Risk Variable Morbid Obesity Out 0 * Resource
    Risk Variable Preexisting Diabetes Out 0 * Resource
    Risk Variable Heart Rate Out 0 1 Resource
    Risk Variable Mental Health Disorder Out 0 * Resource
    Risk Variable Obstetrical VTE Out 0 * Resource
    Risk Variable Autoimmune Disease Out 0 * Resource
    Risk Variable Bariatric Surgery Out 0 * Resource
    Risk Variable Previous Cesarean Out 0 * Resource
    SDE Race Out 0 1 Resource
    Risk Variable Placenta Previa Out 0 * Resource
    SDE Sex Out 0 1 Coding
    Risk Variable Gestational Diabetes Out 0 * Resource
    Numerator Out 0 * Resource
    Stratum 1 Out 0 * Resource
    Risk Variable Bleeding Disorder Out 0 * Resource
    Risk Variable Multiple Pregnancy Out 0 * Resource
    Risk Variable First White Blood Cell Count Lab Test Out 0 1 Resource
    Denominator Out 0 * Resource
    Risk Variable First Hematocrit Lab Test Out 0 1 Resource
    SDE Ethnicity Out 0 1 Resource
    Risk Variable Anemia Out 0 * Resource
    Risk Variable Severe Preeclampsia Out 0 * Resource
    Risk Variable Cardiac Disease Out 0 * Resource
    Risk Variable Long Term Anticoagulant Use Out 0 * Resource
    DataRequirements:
    Type Elements Valueset Name Valueset
    Patient(QICorePatient)
    Encounter(QICoreEncounter) type status status.value period Encounter Inpatient Encounter Inpatient
    Encounter(QICoreEncounter) type period status status.value Observation Services Observation Services
    Encounter(QICoreEncounter) type period status status.value ED Visit and OB Triage ED Visit and OB Triage
    Encounter(QICoreEncounter) type period status status.value Observation Services Observation Services
    Encounter(QICoreEncounter) type period status status.value ED Visit and OB Triage ED Visit and OB Triage
    Procedure(QICoreProcedure) code status status.value performed Delivery Procedures Delivery Procedures
    Encounter(QICoreEncounter) type status status.value period Encounter Inpatient Encounter Inpatient
    Patient(QICorePatient)
    Patient(http://hl7.org/fhir/Patient) birthDate birthDate.value gender gender.value
    Observation(QICoreObservation) code value status status.value effective
    Observation(http://hl7.org/fhir/Observation) value
    Observation(QICoreObservation) code value status status.value effective
    Observation(QICoreObservation) code value status status.value effective Estimated Gestational Age at Delivery Estimated Gestational Age at Delivery
    Condition(QICoreCondition) id id.value
    uri(http://hl7.org/fhir/uri) value
    string(http://hl7.org/fhir/string) value
    Observation(Observation Blood Pressure Profile) effective status status.value component
    (http://hl7.org/fhir/Observation.Component) value
    Condition(QICoreCondition) id id.value
    Reference(http://hl7.org/fhir/Reference) reference reference.value
    Coverage(QICoreCoverage) type period Payer Type Payer
    Procedure(QICoreProcedure) code status status.value performed Respiratory Support Procedures Related to COVID 19 Respiratory Support Procedures Related to COVID 19
    Observation(Observation Heart Rate Profile) effective status status.value value
    Patient(QICorePatient)
    Patient(QICorePatient) url extension
    Patient(QICorePatient) url extension
    Procedure(QICoreProcedure) code status status.value performed Severe Maternal Morbidity Procedures Severe Maternal Morbidity Procedures
    Procedure(QICoreProcedure) code status status.value performed Blood Transfusion Blood Transfusion
    Observation(US Core Laboratory Result Observation Profile) code issued issued.value status status.value value White blood cells count lab test White blood cells count lab test
    Observation(US Core Laboratory Result Observation Profile) code issued issued.value status status.value value Hematocrit lab test Hematocrit lab test
    Patient(QICorePatient) url extension
    Patient(QICorePatient) url extension
    Coverage(QICoreCoverage) type period Payer Type Payer
    Patient(QICorePatient) url extension
    Patient(QICorePatient) url extension
    Direct Reference Codes:
    display code system
    Date and time of obstetric delivery 93857-1 http://loinc.org
    Delivery date Estimated 11778-8 http://loinc.org
    Logic Definitions:
    Group Scoring Population Criteria Expression
    638907ab4ba3d47c885c02fd Group scoring: proportion
    Initial Population
    define "Initial Population":
      PCMaternal."Delivery Encounter with Age Range"
    Denominator
    define "Denominator":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"
    Denominator Exclusion
    define "Denominator Exclusion":
      "Delivery Encounters with COVID and Respiratory Condition or Procedure"
    Numerator
    define "Numerator":
      "Delivery Encounters with Severe Obstetric Complications"
    Numerator Exclusion None
    Denominator Exception None
    None
    Library Name Name
    PCMaternal Encounter with Age Range
    define "Encounter with Age Range":
      ["Encounter": "Encounter Inpatient"] EncounterInpatient
                          where EncounterInpatient.status = 'finished'
                            and AgeInYearsAt(date from start of EncounterInpatient.period) in Interval[ 8, 65 )
                            and EncounterInpatient.period ends during day of "Measurement Period"
    Library Name Name
    PCMaternal Delivery Encounter with Age Range
    define "Delivery Encounter with Age Range":
      "Encounter with Age Range" EncounterWithAge
                    with ["Procedure": "Delivery Procedures"] DeliveryProcedure
                    such that DeliveryProcedure.status = 'completed'
                    and DeliveryProcedure.performed.toInterval  ( ) starts during day of EncounterWithAge.hospitalizationWithEDOBTriageObservation ()
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks
    define "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks":
      PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter
        where DeliveryEncounter.calculatedGestationalAge ( ) >= 20
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks
    define "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks":
      PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter
        where DeliveryEncounter.calculatedGestationalAge ( ) is null
          and ( DeliveryEncounter.lastEstimatedGestationalAge ( ) >= 20 weeks )
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding
    define "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding":
      PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter
        let CGA: DeliveryEncounter.calculatedGestationalAge ( ),
        EGA: DeliveryEncounter.lastEstimatedGestationalAge ( )
        where CGA is null
          and EGA is null
          and exists ( ( DeliveryEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis
              where EncounterDiagnosis.code in "20 to 42 Plus Weeks Gestation"
          )
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters At Greater than or Equal to 20 Weeks Gestation
    define "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation":
      "Delivery Encounters with Calculated Gestational Age Greater than or Equal to 20 Weeks"
        union "Delivery Encounters with Estimated Gestational Age Assessment Greater than or Equal to 20 Weeks"
        union "Delivery Encounters with Gestational Age Greater than or Equal to 20 Weeks Based on Coding"
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Systolic Blood Pressure
    //First resulted value 24 hours prior to start of encounter and before time of delivery
     //Report systolic blood pressure as mm[Hg]
    
    
    
    define "Risk Variable Systolic Blood Pressure":
      First(from
          "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter,
          ["observation-bp"] BP
          where BP.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())
            and BP.status in { 'final', 'amended', 'corrected' }
          return {
            EncounterId: Encounter.id,
            FirstResult: BP.SystolicBP.value as Quantity,
            Timing: BP.effective.earliest()
          }
          sort by Timing
      )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Asthma
    define "Risk Variable Asthma":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Acute or Persistent Asthma"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Substance Abuse
    define "Risk Variable Substance Abuse":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Substance Abuse"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Placental Accreta Spectrum
    define "Risk Variable Placental Accreta Spectrum":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Accreta Spectrum"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Neuromuscular
    define "Risk Variable Neuromuscular":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Neuromuscular Disease"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Renal Disease
    define "Risk Variable Renal Disease":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Renal Disease"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Gastrointestinal Disease
    define "Risk Variable Gastrointestinal Disease":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Gastrointestinal Disease"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Hypertension
    define "Risk Variable Hypertension":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Hypertension"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Preterm Birth
    define "Risk Variable Preterm Birth":
    /*  CGA = Calculated Gestational Age.  EGA = Estimated Gestational Age. */
      
      ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter
          let CGA: DeliveryEncounter.calculatedGestationalAge ( ),
          EGA: DeliveryEncounter.lastEstimatedGestationalAge ( )
          where CGA in Interval[20, 36]
            or ( CGA is null
                and ( EGA >= 20 weeks
                    and EGA <= 36 weeks
                )
            )
      )
        union ( PCMaternal."Delivery Encounter with Age Range" DeliveryEncounter
            let CGA: DeliveryEncounter.calculatedGestationalAge ( ),
            EGA: DeliveryEncounter.lastEstimatedGestationalAge ( )
            where CGA is null
              and EGA is null
              and exists ( DeliveryEncounter.diagnosis DeliveryEncounterDiagnoses
                  where DeliveryEncounterDiagnoses.condition.getCondition ( ).code in "Preterm Birth"
                    and ( DeliveryEncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
              )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Pulmonary Hypertension
    define "Risk Variable Pulmonary Hypertension":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Pulmonary Hypertension"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    PCMaternal Variable Calculated Gestational Age
    define "Variable Calculated Gestational Age":
      //This definition establishes a variable of CGA (Calculated Gestational Age) for all patients for the sole purpose of displaying the Calculated Gestational Age. This definition is not used in the measure logic.
      "Delivery Encounter with Age Range" QualifyingEncounter
        let CGA: QualifyingEncounter.calculatedGestationalAge()
      //  return { QualifyingEncounter, CGA }
        return {
          EncounterID: QualifyingEncounter.id,
          CalculatedCGA: CGA
        }
    Library Name Name
    SevereObstetricComplicationsFHIR Variable Calculated Gestational Age
    define "Variable Calculated Gestational Age":
      //This definition establishes a variable of CGA (Calculated Gestational Age).  CGA is a supplemental data element to store the calculated gestational age result from the "CalculatedGestationalAge" function.  The data element enables the capturing and saving of the CGA for data analysis post data receipt. Hospitals do not need to submit any additional data to comply with this definition. 
      
      PCMaternal."Variable Calculated Gestational Age"
    Library Name Name
    SupplementalDataElements SDE Payer
    define "SDE Payer":
      [Coverage: type in "Payer Type"] Payer
        return {
          code: Payer.type,
          period: Payer.period
        }
    Library Name Name
    SevereObstetricComplicationsFHIR SDE Payer
    define "SDE Payer":
      SDE."SDE Payer"
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Thyrotoxicosis
    define "Risk Variable Thyrotoxicosis":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Thyrotoxicosis"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Other Preeclampsia
    define "Risk Variable Other Preeclampsia":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Mild or Moderate Preeclampsia"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Initial Population
    define "Initial Population":
      PCMaternal."Delivery Encounter with Age Range"
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Economic Housing Instability
    define "Risk Variable Economic Housing Instability":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Economic Housing Instability"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Placental Abruption
    define "Risk Variable Placental Abruption":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Placental Abruption"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters with COVID and Respiratory Condition or Procedure
    define "Delivery Encounters with COVID and Respiratory Condition or Procedure":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis
            where EncounterDiagnosis.code in "COVID 19 Confirmed"
        )
          and ( exists ( ( TwentyWeeksPlusEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis
                where EncounterDiagnosis.code in "Respiratory Conditions Related to COVID 19"
            )
              or exists ( ["Procedure": "Respiratory Support Procedures Related to COVID 19"] EncounterProcedures
                  where EncounterProcedures.status = 'completed'
                    and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )
              )
          )
    Library Name Name
    SevereObstetricComplicationsFHIR Denominator Exclusion
    define "Denominator Exclusion":
      "Delivery Encounters with COVID and Respiratory Condition or Procedure"
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable HIV
    define "Risk Variable HIV":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "HIV in Pregnancy Childbirth and Puerperium"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Morbid Obesity
    define "Risk Variable Morbid Obesity":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Morbid or Severe Obesity"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Preexisting Diabetes
    define "Risk Variable Preexisting Diabetes":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Preexisting Diabetes"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Heart Rate
    //First resulted value 24 hours prior to start of encounter and before time of delivery
     //Report heart rate as beats/min
    
    
    
    define "Risk Variable Heart Rate":
      First(from
          "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter,
          ["observation-heartrate"] HeartRate
          where HeartRate.effective.earliest() during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())
            and HeartRate.status in { 'final', 'amended', 'corrected' }
          return {
            EncounterId: Encounter.id,
            FirstResult: HeartRate.value as Quantity,
            Timing: HeartRate.effective.earliest()
          }
          sort by Timing
      )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Mental Health Disorder
    define "Risk Variable Mental Health Disorder":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Mental Health Disorder"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Obstetrical VTE
    define "Risk Variable Obstetrical VTE":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Venous Thromboembolism in Pregnancy"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Autoimmune Disease
    define "Risk Variable Autoimmune Disease":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Autoimmune Disease"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Bariatric Surgery
    define "Risk Variable Bariatric Surgery":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Bariatric Surgery"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Previous Cesarean
    define "Risk Variable Previous Cesarean":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Previous Cesarean"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SupplementalDataElements SDE Race
    define "SDE Race":
      Patient.race R
        return Tuple {
          codes: R.ombCategory union R.detailed,
          display: R.text
        }
    Library Name Name
    SevereObstetricComplicationsFHIR SDE Race
    define "SDE Race":
      SDE."SDE Race"
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Placenta Previa
    define "Risk Variable Placenta Previa":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Placenta Previa"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SupplementalDataElements SDE Sex
    define "SDE Sex":
      case
          when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }
          when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }
          else null
        end
    Library Name Name
    SevereObstetricComplicationsFHIR SDE Sex
    define "SDE Sex":
      SDE."SDE Sex"
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Gestational Diabetes
    define "Risk Variable Gestational Diabetes":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Gestational Diabetes"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion
    define "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Maternal Morbidity Diagnoses"
              and EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine"
        )
    //EncounterDiagnoses.diagnosisPresentOnAdmission ~ 'N')
          
          or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] EncounterProcedures
              where EncounterProcedures.status = 'completed'
                and EncounterProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )
          )
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters with Expiration
    define "Delivery Encounters with Expiration":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters with Blood Transfusion
    define "Delivery Encounters with Blood Transfusion":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        with ["Procedure": "Blood Transfusion"] BloodTransfusion
          such that BloodTransfusion.status = 'completed'
            and BloodTransfusion.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters with Severe Obstetric Complications
    define "Delivery Encounters with Severe Obstetric Complications":
      "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion"
        union "Delivery Encounters with Expiration"
        union "Delivery Encounters with Blood Transfusion"
    Library Name Name
    SevereObstetricComplicationsFHIR Numerator
    define "Numerator":
      "Delivery Encounters with Severe Obstetric Complications"
    Library Name Name
    SevereObstetricComplicationsFHIR Stratification Encounter
    define "Stratification Encounter":
      "Numerator"
        except "Denominator Exclusion"
    Library Name Name
    SevereObstetricComplicationsFHIR Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions
    define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions":
      "Delivery Encounters with Severe Obstetric Complications Diagnosis or Procedure Excluding Blood Transfusion"
        union "Delivery Encounters with Expiration"
    Library Name Name
    SevereObstetricComplicationsFHIR Stratum 1
    define "Stratum 1":
      //This logic identifies a subset of the numerator population with severe obstetric complications excluding cases where transfusion was the only severe obstetric complication.
      
      "Stratification Encounter"
        intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Bleeding Disorder
    define "Risk Variable Bleeding Disorder":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Bleeding Disorder"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Multiple Pregnancy
    define "Risk Variable Multiple Pregnancy":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Multiple Pregnancy"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable First White Blood Cell Count Lab Test
    //First resulted value 24 hours prior to start of encounter and before time of delivery
     //Report white blood cell count as 10*3/uL
    
    
    
    define "Risk Variable First White Blood Cell Count Lab Test":
      First(from
          "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter,
          ["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC
          where WBC.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())
            and WBC.status in { 'final', 'amended', 'corrected' }
          return {
            EncounterId: Encounter.id,
            FirstResult: WBC.value as Quantity,
            Timing: WBC.issued
          }
          sort by Timing
      )
    Library Name Name
    SevereObstetricComplicationsFHIR Denominator
    define "Denominator":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable First Hematocrit Lab Test
    //First resulted value 24 hours prior to start of encounter and before time of delivery
     //Report hematocrit as %
    
    
    
    define "Risk Variable First Hematocrit Lab Test":
      First(from
          "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" Encounter,
          ["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit
          where Hematocrit.issued during Interval[start of Encounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, Encounter.lastTimeOfDelivery())
            and Hematocrit.status in { 'final', 'amended', 'corrected' }
          return {
            EncounterId: Encounter.id,
            FirstResult: Hematocrit.value as Quantity,
            Timing: Hematocrit.issued
          }
          sort by Timing
      )
    Library Name Name
    SupplementalDataElements SDE Ethnicity
    define "SDE Ethnicity":
      Patient.ethnicity E
        return Tuple {
          codes: { E.ombCategory } union E.detailed,
          display: E.text
        }
    Library Name Name
    SevereObstetricComplicationsFHIR SDE Ethnicity
    define "SDE Ethnicity":
      SDE."SDE Ethnicity"
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Anemia
    define "Risk Variable Anemia":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Anemia"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Severe Preeclampsia
    define "Risk Variable Severe Preeclampsia":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Severe Preeclampsia"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Cardiac Disease
    define "Risk Variable Cardiac Disease":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Cardiac Disease"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )
    Library Name Name
    SevereObstetricComplicationsFHIR Risk Variable Long Term Anticoagulant Use
    define "Risk Variable Long Term Anticoagulant Use":
      "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
        where exists ( TwentyWeeksPlusEncounter.diagnosis EncounterDiagnoses
            where EncounterDiagnoses.condition.getCondition ( ).code in "Long Term Anticoagulant Use"
              and ( EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt" )
        )