eCQM QICore Content Subset Implementation Guide
2024.0.0 - CI Build

eCQM QICore Content Subset Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2024.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-2024-subset/ and changes regularly. See the Directory of published versions

Measure: Severe Obstetric ComplicationsFHIR (Experimental)

Official URL: https://madie.cms.gov/Measure/SevereObstetricComplicationsFHIR Version: 0.1.000
Active as of 2024-09-09 Responsible: The Joint Commission Computable Name: SevereObstetricComplicationsFHIR
Other Identifiers: Short Name: CMS1028FHIR (use: usual, ), UUID:6cf03fe2-b962-4f83-ac37-26d7477183c7 (use: official, ), UUID:3efa7f95-1d8e-45fa-af68-023d3554e8c1 (use: official, ), Publisher: 1028FHIR (use: official, )

Usage:Setting: Hospital

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

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

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

UNKNOWN

Knowledge Artifact Metadata
Name (machine-readable) SevereObstetricComplicationsFHIR
Title (human-readable) Severe Obstetric ComplicationsFHIR
Status Active
Experimental true
Description

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

Purpose

UNKNOWN

Clinical Usage In the case of multiple births, map the first delivery date/time (Baby A) as the delivery date/time for the encounter. 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 (ACOG, 2014): 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 down 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). Note: This measure will be stratified by race/ethnicity and payer after measure submission. 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 CMS1028v3. Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html).
Effective Period 2025-01-01..2025-12-31
Use Context Setting (Details: Extended Usage Context Type Codes code setting = ' Setting ', stated as ' Setting '): Hospital
Measure Developer The Joint Commission: https://www.jointcommission.org/
Measure Developer Centers for Medicare & Medicaid Services (CMS): https://www.cms.gov/
Measure Developer Yale New Haven Health Service Corporation/ Center for Outcomes Research and Evaluation: https://medicine.yale.edu/core/
Measure Steward The Joint Commission
Steward Contact Details https://www.jointcommission.org/
Copyright

Measure specifications are in the Public Domain.

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

Measure Metadata
Short Name Identifier CMS1028FHIR
Version Independent Identifier urn:uuid:6cf03fe2-b962-4f83-ac37-26d7477183c7
Version Specific Identifier urn:uuid:3efa7f95-1d8e-45fa-af68-023d3554e8c1
Publisher (CMS) Identifier 1028FHIR
Version Number 0.1.000
Measure Scoring Proportion
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, 2021). 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, 2021), 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, 2021). Racial and ethnic disparities exist: Black women and Hispanic women are at a significantly higher risk for developing these complications than are Non-Hispanic White women (Leonard, Main, Scott, Profit, & Carmichael, 2019). Increasing rates of SMM are resulting in increased healthcare costs, longer hospitalization stays and impacts on a woman's health (Callaghan, Creanga, & Kuklina, 2012).

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 that 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 (U.S. Department of Health and Human Services, n.d.).

The American College of Obstetricians and Gynecologists (ACOG) and the Society for Maternal-Fetal Medicine 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 (American College of Obstetricians and Gynecologists and the Society for Maternal–Fetal Medicine, Kilpatrick, & Ecker, 2016).

Guidance

In the case of multiple births, map the first delivery date/time (Baby A) as the delivery date/time for the encounter. 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 (ACOG, 2014):

                            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 down 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).

Note: This measure will be stratified by race/ethnicity and payer after measure submission.

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 CMS1028v3.

Please refer to the HL7 QI-Core Implementation Guide (https://hl7.org/fhir/us/qicore/STU4.1.1/) for more information on QI-Core and mapping recommendations from QDM to QI-Core 4.1.1 (https://hl7.org/fhir/us/qicore/STU4.1.1/qdm-to-qicore.html).

Supplemental Data Guidance For every patient evaluated by this measure also identify payer, race, ethnicity, sex, variable calculated gestational age, SOC diagnosis details, and SOC procedure details
Supplemental Data Guidance 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 extracted from billing/claims data that was entered by coding staff (Leonard, Kennedy, Carmichael, Lyell, & Main, 2020; Main, Leonard, & Menard, 2020). - Anemia (includes sickle cell disease) - Asthma - Autoimmune Disease - Bariatric Surgery - Bleeding Disorder - Cardiac Disease - Economic Housing Instability - Gastrointestinal Disease - Gestational Diabetes - HIV - Hypertension - Long-term Anticoagulant Use - Maternal Age (derived from birthdate) - Mental Health Disorder - Morbid Obesity - Multiple Pregnancy - Neuromuscular Disease - Obstetric VTE - Other Pre-eclampsia - Placenta Previa - Placental Abruption - Placental Accreta Spectrum - Pre-existing Diabetes - Preterm Birth - Previous Cesarean - Pulmonary Hypertension - Renal Disease - Severe Pre-eclampsia - Substance Abuse - Thyrotoxicosis 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] - Hematocrit: % - White blood cell count: 10*3/uL Note regarding submission of risk variable data: The risk variable definitions are included in the specifications and risk variable data should be sent with eCQM data in the QRDA1 file. Specific risk variable templates are not needed in the QRDA1 files.
Measure Population Criteria (ID: 64efa90856d636294b157c9a)
Summary All Severe Obstetric Complications (SOC)
Initial Population ID: 8D56845B-BA26-4F6A-8D23-BBFD696C9450
Description:

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 during the measurement period

Logic Definition: Initial Population
Denominator ID: 8542DE86-6114-4575-9A2B-D09A0FA7C671
Description:

Inpatient hospitalizations for patients delivering stillborn or live birth with greater than or equal to 20 weeks, 0 days gestation completed

Logic Definition: Denominator
Denominator Exclusion ID: 16605347-8AF3-47AA-B230-65B7208909B9
Description:

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 during the encounter

Logic Definition: Denominator Exclusion
Numerator ID: 05AD3648-8C60-4938-96C4-82385B9C4F91
Description:

Two numerator populations are defined for this measure: 1. All Severe Obstetric Complications (SOC). 2. SOC excluding encounters where transfusion was the only SOC. 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 extracted from billing/claims data that was entered by coding staff. 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

Logic Definition: Numerator
Numerator Exclusion ID: e29f29ee-889e-4314-983c-e0ddc189a16c
Description:

Inpatient hospitalizations with blood transfusion or hysterectomy with a diagnosis of placenta percreta or placenta increta and no additional severe obstetrical complications.

Logic Definition: SOC with Hysterectomy or Blood Transfusion with Placenta Increta or Placenta Percreta Without Additional SOC
Population Basis Encounter
Scoring Proportion
Type Outcome
Rate Aggregation Two hospital-level measure scores are calculated as a risk-adjusted proportion reported as a rate per 10,000 delivery hospitalizations: 1. All Severe Obstetric Complications (SOC). ((Num1 – NumExcl) / (Den-DenExcl)) * 10,000 2. SOC excluding encounters where transfusion was the only SOC. ((Num2 – NumExcl) / (Den-DenExcl)) * 10,000 Num1: Number of delivery encounters with SOC Num2: Number of delivery encounters with SOC excluding encounters where transfusion was the only SOC NumExcl: Delivery encounters with blood transfusion or hysterectomy with Placenta Percreta or Placenta Increta Den: Delivery encounters with > or = 20 weeks gestation completed DenExcl: Delivery encounters for patients with a COVID diagnosis and COVID-related respiratory condition or a COVID diagnosis and COVID-related respiratory procedure
Improvement Notation Decreased score indicates improvement
Measure Population Criteria (ID: 658b2eadd4b024647cc00341)
Summary SOC excluding encounters where transfusion was the only SOC
Initial Population ID: 4e1478e6-a3d4-42e5-a5cd-0026cc5617ed
Description:

Inpatient hospitalizations for patients age >= 8 years and < 65 admitted to the hospital for inpatient acute care who undergo a delivery procedure with a discharge date that ends during the measurement period

Logic Definition: Initial Population
Denominator ID: e4a80a9b-190c-4cd1-bc7b-8d6d9e5720cd
Description:

Inpatient hospitalizations for patients delivering stillborn or live birth with >= 20 weeks, 0 days gestation completed

Logic Definition: Denominator
Denominator Exclusion ID: 4db4aa26-e64c-4d09-81fd-d119e14fee05
Description:

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 during the encounter

Logic Definition: Denominator Exclusion
Numerator ID: 0d5818b3-43e6-4d06-991f-adcc939f01b8
Description:

Inpatient hospitalizations for patients with severe obstetric complications (not present on admission that occur during the current delivery encounter) including severe maternal morbidity diagnoses (see following list), severe maternal morbidity procedures (see following list), and discharge disposition of expired, yet excluding encounters where transfusion was the only SOC. 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

Logic Definition: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions Only
Numerator Exclusion ID: b5aef46b-f0d5-442b-b1d4-564444fd471a
Description:

Inpatient hospitalizations with blood transfusion or hysterectomy with a diagnosis of placenta percreta or placenta increta and no additional severe obstetrical complications.

Logic Definition: SOC Excluding Blood Transfusions Only with Hysterectomy or Blood Transfusion with Placenta Increta or Placenta Percreta Without Additional SOC
Population Basis Encounter
Scoring Proportion
Type Outcome
Rate Aggregation SOC excluding encounters where transfusion was the only SOC, calculated as a risk-adjusted proportion reported as a rate per 10,000 delivery hospitalizations: ((Num2 – NumExcl) / (Den-DenExcl)) * 10,000 Num2: Number of delivery encounters with SOC excluding encounters where transfusion was the only SOC; NumExcl: Delivery encounters with blood transfusion or hysterectomy with Placenta Percreta or Placenta Increta; Den: Delivery encounters with > or = 20 weeks gestation completed; DenExcl: Delivery encounters for patients with a COVID diagnosis and COVID-related respiratory condition or a COVID diagnosis and COVID-related respiratory procedure
Supplemental Data Elements
Supplemental Data Element ID: sde-ethnicity
Usage Code: Supplemental Data
Description: SDE Ethnicity
Logic Definition: SDE Ethnicity
Supplemental Data Element ID: sde-payer
Usage Code: Supplemental Data
Description: SDE Payer
Logic Definition: SDE Payer
Supplemental Data Element ID: sde-race
Usage Code: Supplemental Data
Description: SDE Race
Logic Definition: SDE Race
Supplemental Data Element ID: sde-sex
Usage Code: Supplemental Data
Description: SDE Sex
Logic Definition: SDE Sex
Supplemental Data Element ID: sde-variable-calculated-gestational-age
Usage Code: Supplemental Data
Description: SDE Variable Calculated Gestational Age
Logic Definition: SDE Variable Calculated Gestational Age
Supplemental Data Element ID: sde-soc-diagnoses-detail
Usage Code: Supplemental Data
Description: SDE SOC Diagnoses Detail
Logic Definition: SDE SOC Diagnoses Detail
Supplemental Data Element ID: sde-soc-procedure-detail
Usage Code: Supplemental Data
Description: SDE SOC Procedure Detail
Logic Definition: SDE SOC Procedure Detail
Supplemental Data Element ID: sde-delivery-encounters-with-severe-obstetric-complication-diagnosis
Usage Code: Supplemental Data
Description: SDE Delivery Encounters with Severe Obstetric Complication Diagnosis
Logic Definition: SDE Delivery Encounters with Severe Obstetric Complication Diagnosis
Supplemental Data Element ID: sde-delivery-encounters-with-severe-obstetric-complication-procedures
Usage Code: Supplemental Data
Description: SDE Delivery Encounters with Severe Obstetric Complication Procedures
Logic Definition: SDE Delivery Encounters with Severe Obstetric Complication Procedures
Supplemental Data Element ID: risk-variable-lab-and-physical-exam-results
Usage Code: Risk Adjustment Factor
Description: Risk Variable Lab and Physical Exam Results
Logic Definition: Risk Variable Lab and Physical Exam Results
Supplemental Data Element ID: risk-variable-asthma
Usage Code: Risk Adjustment Factor
Description: Risk Variable Asthma
Logic Definition: Risk Variable Asthma
Supplemental Data Element ID: risk-variable-autoimmune-disease
Usage Code: Risk Adjustment Factor
Description: Risk Variable Autoimmune Disease
Logic Definition: Risk Variable Autoimmune Disease
Supplemental Data Element ID: risk-variable-bariatric-surgery
Usage Code: Risk Adjustment Factor
Description: Risk Variable Bariatric Surgery
Logic Definition: Risk Variable Bariatric Surgery
Supplemental Data Element ID: risk-variable-bleeding-disorder
Usage Code: Risk Adjustment Factor
Description: Risk Variable Bleeding Disorder
Logic Definition: Risk Variable Bleeding Disorder
Supplemental Data Element ID: risk-variable-morbid-obesity
Usage Code: Risk Adjustment Factor
Description: Risk Variable Morbid Obesity
Logic Definition: Risk Variable Morbid Obesity
Supplemental Data Element ID: risk-variable-cardiac-disease
Usage Code: Risk Adjustment Factor
Description: Risk Variable Cardiac Disease
Logic Definition: Risk Variable Cardiac Disease
Supplemental Data Element ID: risk-variable-economic-housing-instability
Usage Code: Risk Adjustment Factor
Description: Risk Variable Economic Housing Instability
Logic Definition: Risk Variable Economic Housing Instability
Supplemental Data Element ID: risk-variable-gastrointestinal-disease
Usage Code: Risk Adjustment Factor
Description: Risk Variable Gastrointestinal Disease
Logic Definition: Risk Variable Gastrointestinal Disease
Supplemental Data Element ID: risk-variable-gestational-diabetes
Usage Code: Risk Adjustment Factor
Description: Risk Variable Gestational Diabetes
Logic Definition: Risk Variable Gestational Diabetes
Supplemental Data Element ID: risk-variable-hiv
Usage Code: Risk Adjustment Factor
Description: Risk Variable HIV
Logic Definition: Risk Variable HIV
Supplemental Data Element ID: risk-variable-hypertension
Usage Code: Risk Adjustment Factor
Description: Risk Variable Hypertension
Logic Definition: Risk Variable Hypertension
Supplemental Data Element ID: risk-variable-long-term-anticoagulant-use
Usage Code: Risk Adjustment Factor
Description: Risk Variable Long Term Anticoagulant Use
Logic Definition: Risk Variable Long Term Anticoagulant Use
Supplemental Data Element ID: risk-variable-mental-health-disorder
Usage Code: Risk Adjustment Factor
Description: Risk Variable Mental Health Disorder
Logic Definition: Risk Variable Mental Health Disorder
Supplemental Data Element ID: risk-variable-multiple-pregnancy
Usage Code: Risk Adjustment Factor
Description: Risk Variable Multiple Pregnancy
Logic Definition: Risk Variable Multiple Pregnancy
Supplemental Data Element ID: risk-variable-neuromuscular
Usage Code: Risk Adjustment Factor
Description: Risk Variable Neuromuscular
Logic Definition: Risk Variable Neuromuscular
Supplemental Data Element ID: risk-variable-obstetrical-vte
Usage Code: Risk Adjustment Factor
Description: Risk Variable Obstetrical VTE
Logic Definition: Risk Variable Obstetrical VTE
Supplemental Data Element ID: risk-variable-placenta-previa
Usage Code: Risk Adjustment Factor
Description: Risk Variable Placenta Previa
Logic Definition: Risk Variable Placenta Previa
Supplemental Data Element ID: risk-variable-placental-abruption
Usage Code: Risk Adjustment Factor
Description: Risk Variable Placental Abruption
Logic Definition: Risk Variable Placental Abruption
Supplemental Data Element ID: risk-variable-placental-accreta-spectrum
Usage Code: Risk Adjustment Factor
Description: Risk Variable Placental Accreta Spectrum
Logic Definition: Risk Variable Placental Accreta Spectrum
Supplemental Data Element ID: risk-variable-preexisting-diabetes
Usage Code: Risk Adjustment Factor
Description: Risk Variable Preexisting Diabetes
Logic Definition: Risk Variable Preexisting Diabetes
Supplemental Data Element ID: risk-variable-previous-cesarean
Usage Code: Risk Adjustment Factor
Description: Risk Variable Previous Cesarean
Logic Definition: Risk Variable Previous Cesarean
Supplemental Data Element ID: risk-variable-pulmonary-hypertension
Usage Code: Risk Adjustment Factor
Description: Risk Variable Pulmonary Hypertension
Logic Definition: Risk Variable Pulmonary Hypertension
Supplemental Data Element ID: risk-variable-renal-disease
Usage Code: Risk Adjustment Factor
Description: Risk Variable Renal Disease
Logic Definition: Risk Variable Renal Disease
Supplemental Data Element ID: risk-variable-severe-preeclampsia
Usage Code: Risk Adjustment Factor
Description: Risk Variable Severe Preeclampsia
Logic Definition: Risk Variable Severe Preeclampsia
Supplemental Data Element ID: risk-variable-substance-abuse
Usage Code: Risk Adjustment Factor
Description: Risk Variable Substance Abuse
Logic Definition: Risk Variable Substance Abuse
Supplemental Data Element ID: risk-variable-thyrotoxicosis
Usage Code: Risk Adjustment Factor
Description: Risk Variable Thyrotoxicosis
Logic Definition: Risk Variable Thyrotoxicosis
Supplemental Data Element ID: risk-variable-other-preeclampsia
Usage Code: Risk Adjustment Factor
Description: Risk Variable Other Preeclampsia
Logic Definition: Risk Variable Other Preeclampsia
Supplemental Data Element ID: risk-variable-preterm-birth
Usage Code: Risk Adjustment Factor
Description: Risk Variable Preterm Birth
Logic Definition: Risk Variable Preterm Birth
Supplemental Data Element ID: risk-variable-anemia
Usage Code: Risk Adjustment Factor
Description: Risk Variable Anemia
Logic Definition: Risk Variable Anemia
Supplemental Data Element ID: risk-variable-systolic-blood-pressure
Usage Code: Risk Adjustment Factor
Description: Risk Variable Systolic Blood Pressure
Logic Definition: Risk Variable Systolic Blood Pressure
Supplemental Data Element ID: risk-variable-heart-rate
Usage Code: Risk Adjustment Factor
Description: Risk Variable Heart Rate
Logic Definition: Risk Variable Heart Rate
Supplemental Data Element ID: risk-variable-first-white-blood-cell-count-lab-test
Usage Code: Risk Adjustment Factor
Description: Risk Variable First White Blood Cell Count Lab Test
Logic Definition: Risk Variable First White Blood Cell Count Lab Test
Supplemental Data Element ID: risk-variable-first-hematocrit-lab-test
Usage Code: Risk Adjustment Factor
Description: Risk Variable First Hematocrit Lab Test
Logic Definition: Risk Variable First Hematocrit Lab Test
Supplemental Data Element ID: delivery-encounters-with-blood-transfusion
Usage Code: Risk Adjustment Factor
Description: Delivery Encounters with Blood Transfusion
Logic Definition: Delivery Encounters with Blood Transfusion
Supplemental Data Element ID: risk-variable-maternal-age
Usage Code: Risk Adjustment Factor
Description: Risk Variable Maternal Age
Logic Definition: Risk Variable Maternal Age
Measure Logic
Primary Library SevereObstetricComplicationsFHIR
Dependency Description: Library PCMaternal
Resource: Library/PCMaternal|5.19.000
Canonical URL: Library/PCMaternal|5.19.000
Dependency Description: Library CQMCommon
Resource: Library/CQMCommon|2.2.000
Canonical URL: Library/CQMCommon|2.2.000
Dependency Description: Library FHIRHelpers
Resource: Library/FHIRHelpers|4.4.000
Canonical URL: Library/FHIRHelpers|4.4.000
Dependency Description: Library QICoreCommon
Resource: Library/QICoreCommon|2.1.000
Canonical URL: Library/QICoreCommon|2.1.000
Dependency Description: Library SDE
Resource: Library/SupplementalDataElements|3.5.000
Canonical URL: Library/SupplementalDataElements|3.5.000
Dependency Description: Code system LOINC
Resource: Logical Observation Identifiers, Names and Codes (LOINC)
Canonical URL: http://loinc.org
Dependency Description: Code system AdministrativeGender
Resource: AdministrativeGender
Canonical URL: http://hl7.org/fhir/administrative-gender
Dependency Description: Value set Encounter Inpatient
Resource: Encounter Inpatient
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307
Dependency Description: Value set Delivery Procedures
Resource: Delivery Procedures
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.59
Dependency Description: Value set Observation Services
Resource: Observation Services
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143
Dependency Description: Value set ED Visit and OB Triage
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.369
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.369
Dependency Description: Value set Estimated Gestational Age at Delivery
Resource: Estimated Gestational Age at Delivery
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.26
Dependency Description: Value set 20 to 42 Plus Weeks Gestation
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.67
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.67
Dependency Description: Value set Present On Admission is Yes or Exempt
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.63
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.63
Dependency Description: Value set Acute or Persistent Asthma
Resource: Asthma
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.271
Dependency Description: Value set Present on Admission is No or Unable To Determine
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.370
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.370
Dependency Description: Value set Severe Maternal Morbidity Diagnoses
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.255
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.255
Dependency Description: Value set Severe Maternal Morbidity Procedures
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.256
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.256
Dependency Description: Value set Patient Expired
Resource: Patient Expired
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309
Dependency Description: Value set Blood Transfusion
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.213
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.213
Dependency Description: Value set Placenta Increta or Percreta
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.388
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.388
Dependency Description: Value set Hysterectomy
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.358
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.358
Dependency Description: Value set Conversion of Cardiac Rhythm
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.357
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.357
Dependency Description: Value set Tracheostomy
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.359
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.359
Dependency Description: Value set Ventilation
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.360
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.360
Dependency Description: Value set Placenta Accreta
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.302
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.302
Dependency Description: Value set Neuromuscular Disease
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.308
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.308
Dependency Description: Value set Hypertension
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.332
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.332
Dependency Description: Value set Preterm Birth
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.299
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.299
Dependency Description: Value set Payer Type
Resource: Payer
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
Dependency Description: Value set Placental Abruption
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.305
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.305
Dependency Description: Value set COVID 19 Confirmed
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.373
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.373
Dependency Description: Value set Respiratory Conditions Related to COVID 19
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.376
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.376
Dependency Description: Value set Respiratory Support Procedures Related to COVID 19
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.379
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.379
Dependency Description: Value set Morbid or Severe Obesity
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.290
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.290
Dependency Description: Value set Preexisting Diabetes
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.275
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.275
Dependency Description: Value set Bariatric Surgery
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.317
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.317
Dependency Description: Value set Placenta Previa
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.78
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.78
Dependency Description: Value set Bleeding Disorder
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.287
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.287
Dependency Description: Value set White blood cells count lab test
Resource: White blood cells count lab test
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129
Dependency Description: Value set Hematocrit lab test
Resource: Hematocrit lab test
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114
Dependency Description: Value set Severe Preeclampsia
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.327
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.327
Dependency Description: Value set Anemia
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.323
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.323
Dependency Description: Value set Cardiac Disease
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.341
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.341
Dependency Description: Value set Long Term Anticoagulant Use
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.366
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.366
Dependency Description: Value set Acute Heart Failure
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.233
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.233
Dependency Description: Value set Acute Myocardial Infarction
Resource: Acute Myocardial Infarction (AMI)
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.623
Dependency Description: Value set Acute Renal Failure
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.53
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.53
Dependency Description: Value set Acute Respiratory Distress Syndrome
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.214
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.214
Dependency Description: Value set Air and Thrombotic Embolism
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.243
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.243
Dependency Description: Value set Amniotic Fluid Embolism
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.217
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.217
Dependency Description: Value set Aortic Aneurysm
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.219
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.219
Dependency Description: Value set Cardiac Arrest Ventricular Fibrillation
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.221
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.221
Dependency Description: Value set Disseminated Intravascular Coagulation
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.223
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.223
Dependency Description: Value set Eclampsia
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.225
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.225
Dependency Description: Value set Heart Failure Cardiac Arrest Related to Procedure or Surgery
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.227
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.227
Dependency Description: Value set Puerperal Cerebrovascular Disorder
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.229
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.229
Dependency Description: Value set Pulmonary Edema
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.231
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.231
Dependency Description: Value set Sepsis
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.237
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.237
Dependency Description: Value set Severe Anesthesia Complications
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.235
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.235
Dependency Description: Value set Shock
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.239
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.239
Dependency Description: Value set Sickle Cell Disease with Crisis
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.241
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.241
Dependency Description: Value set Substance Abuse
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.320
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.320
Dependency Description: Value set Renal Disease
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.335
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.335
Dependency Description: Value set Gastrointestinal Disease
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.338
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.338
Dependency Description: Value set Pulmonary Hypertension
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.281
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.281
Dependency Description: Value set Thyrotoxicosis
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.296
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.296
Dependency Description: Value set Mild or Moderate Preeclampsia
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.329
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.329
Dependency Description: Value set Economic Housing Instability
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.292
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.292
Dependency Description: Value set HIV in Pregnancy Childbirth and Puerperium
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.272
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.272
Dependency Description: Value set Mental Health Disorder
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.314
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.314
Dependency Description: Value set Venous Thromboembolism in Pregnancy
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.363
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.363
Dependency Description: Value set Autoimmune Disease
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.311
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.311
Dependency Description: Value set Previous Cesarean
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.278
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.278
Dependency Description: Value set Gestational Diabetes
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.269
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.269
Dependency Description: Value set Multiple Pregnancy
Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.284
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.284
Direct Reference Code Display: Date and time of obstetric delivery
Code: 93857-1
System: http://loinc.org
Direct Reference Code Display: Delivery date Estimated
Code: 11778-8
System: http://loinc.org
Direct Reference Code Display: Male
Code: M
System: http://hl7.org/fhir/administrative-gender
Direct Reference Code Display: Female
Code: F
System: http://hl7.org/fhir/administrative-gender
Direct Reference Code Display: Systolic BP
Code: 8480-6
System: http://loinc.org
Parameter Name: Measurement Period
Use: In
Min Cardinality: 0
Max Cardinality: 1
Type: Period
Parameter Name: Risk Variable Asthma
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Delivery Encounters with Severe Obstetric Complication Diagnosis
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Placental Accreta Spectrum
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Neuromuscular
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Hypertension
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SOC with Hysterectomy or Blood Transfusion with Placenta Increta or Placenta Percreta Without Additional SOC
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Preterm Birth
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Payer
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Placental Abruption
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Denominator Exclusion
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Morbid Obesity
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Preexisting Diabetes
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Bariatric Surgery
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Race
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Resource
Parameter Name: Risk Variable Placenta Previa
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Sex
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Coding
Parameter Name: Risk Variable Bleeding Disorder
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable First White Blood Cell Count Lab Test
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable First Hematocrit Lab Test
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Severe Preeclampsia
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Anemia
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Cardiac Disease
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Long Term Anticoagulant Use
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Systolic Blood Pressure
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE SOC Diagnoses Detail
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Substance Abuse
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Renal Disease
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Variable Calculated Gestational Age
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Gastrointestinal Disease
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions Only
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Pulmonary Hypertension
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Thyrotoxicosis
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Other Preeclampsia
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Initial Population
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Economic Housing Instability
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable HIV
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Delivery Encounters with Severe Obstetric Complication Procedures
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SOC Excluding Blood Transfusions Only with Hysterectomy or Blood Transfusion with Placenta Increta or Placenta Percreta Without Additional SOC
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Heart Rate
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Maternal Age
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Mental Health Disorder
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Obstetrical VTE
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Autoimmune Disease
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Previous Cesarean
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Gestational Diabetes
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE SOC Procedure Detail
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Numerator
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Risk Variable Multiple Pregnancy
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Denominator
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Delivery Encounters with Blood Transfusion
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: SDE Ethnicity
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: Resource
Measure Logic Data Requirements
Data Requirement Type: Encounter
Profile(s): QICoreEncounter
Must Support Elements: type, period, status, status.value, condition, condition.reference, condition.reference.value, extension, condition.code, hospitalization, hospitalization.dischargeDisposition, id, id.value
Code Filter(s):
Path: type
ValueSet: Observation Services
Path: status.value
Code:
Data Requirement Type: Encounter
Profile(s): QICoreEncounter
Must Support Elements: type, period, status, status.value, condition, condition.reference, condition.reference.value, extension, condition.code, hospitalization, hospitalization.dischargeDisposition, id, id.value
Code Filter(s):
Path: type
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.369
Path: status.value
Code:
Data Requirement Type: Encounter
Profile(s): QICoreEncounter
Must Support Elements: type, status, status.value, period, condition, condition.reference, condition.reference.value, extension, condition.code, hospitalization, hospitalization.dischargeDisposition, id, id.value
Code Filter(s):
Path: type
ValueSet: Encounter Inpatient
Path: status.value
Code:
Data Requirement Type: Patient
Profile(s): QICorePatient
Must Support Elements: race, ethnicity
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: Delivery Procedures
Path: status.value
Code:
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.256
Path: status.value
Code:
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.358
Path: status.value
Code:
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.357
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.359
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.360
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.379
Path: status.value
Code:
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.256
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.213
Data Requirement Type: Procedure
Profile(s): QICoreProcedure
Must Support Elements: code, status, status.value, performed
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1029.213
Path: status.value
Code:
Data Requirement Type: Observation
Profile(s): QICoreObservation
Must Support Elements: code, value, status, status.value, effective
Code Filter(s):
Path: code
Code:
Data Requirement Type: Observation
Profile(s): QICoreObservation
Must Support Elements: code, value, status, status.value, effective
Code Filter(s):
Path: code
Code:
Data Requirement Type: Observation
Profile(s): QICoreObservation
Must Support Elements: code, effective, value, status, status.value
Code Filter(s):
Path: code
ValueSet: Estimated Gestational Age at Delivery
Data Requirement Type: Condition
Profile(s): QICoreCondition
Must Support Elements: id, id.value, code
Data Requirement Type: Coverage
Profile(s): QICoreCoverage
Must Support Elements: type, period
Code Filter(s):
Path: type
ValueSet: Payer
Data Requirement Type: Observation
Profile(s): US Core Laboratory Result Observation Profile
Must Support Elements: code, issued, issued.value, status, status.value, value
Code Filter(s):
Path: code
ValueSet: White blood cells count lab test
Data Requirement Type: Observation
Profile(s): US Core Laboratory Result Observation Profile
Must Support Elements: code, issued, issued.value, status, status.value, value
Code Filter(s):
Path: code
ValueSet: Hematocrit lab test
Data Requirement Type: Observation
Profile(s): Observation Blood Pressure Profile
Must Support Elements: effective, status, status.value, component
Data Requirement Type: Observation
Profile(s): Observation Heart Rate Profile
Must Support Elements: effective, status, status.value, value
Measure Logic Definitions
Logic Definition Library Name: CQMCommon
define "Inpatient Encounter":
  [Encounter: "Encounter Inpatient"] EncounterInpatient
		where EncounterInpatient.status = 'finished'
		and EncounterInpatient.period ends during day of "Measurement Period"
Logic Definition Library Name: PCMaternal
define "Encounter with Age Range":
 CQMCommon."Inpatient Encounter" InpatientEncounter
                      where AgeInYearsAt(date from start of InpatientEncounter.period) in Interval[ 8, 65 )
Logic Definition Library Name: PCMaternal
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 EncounterWithAge.hospitalizationWithEDOBTriageObservation ()
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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 )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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"
      )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Asthma":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Acute or Persistent Asthma"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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 TwentyWeeksPlusEncounter.pOAIsNoOrUTD ( ) in "Severe Maternal Morbidity Diagnoses"
      or exists ( ["Procedure": "Severe Maternal Morbidity Procedures"] SMMProcedures
          where SMMProcedures.status = 'completed'
            and SMMProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )
      )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Delivery Encounters with Expiration":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.hospitalization.dischargeDisposition in "Patient Expired"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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 ( )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Delivery Encounters with Hysterectomy":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    with ["Procedure": "Hysterectomy"] Hysterectomy
      such that Hysterectomy.status = 'completed'
        and Hysterectomy.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Cardiac Conversion, Tracheostomy or Ventilation Procedures":
  ["Procedure": "Conversion of Cardiac Rhythm"]
    union ["Procedure": "Tracheostomy"]
    union ["Procedure": "Ventilation"]
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Delivery Encounters with Cardiac Conversion, Tracheostomy or Ventilation Procedures":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    with "Cardiac Conversion, Tracheostomy or Ventilation Procedures" ConvTrachVentProcedures
      such that ConvTrachVentProcedures.status = 'completed'
        and ConvTrachVentProcedures.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SOC with Hysterectomy or Blood Transfusion with Placenta Increta or Placenta Percreta Without Additional SOC":
  ( "Delivery Encounters with Severe Obstetric Complications" SOCEncounter
      where exists ( ( SOCEncounter.encounterDiagnosis ( ) ) EncounterDiagnosis
          where EncounterDiagnosis.code in "Placenta Increta or Percreta"
      )
        and ( exists "Delivery Encounters with Blood Transfusion"
            or exists "Delivery Encounters with Hysterectomy"
        )
  )
	//The following logic keeps encounter in the numerator if there is an additional SOC besides Blood Transfusion or Hysterectomy
    
    except ( ( "Delivery Encounters with Severe Obstetric Complications" SOCEncounter
          where ( SOCEncounter.pOAIsNoOrUTD ( ) in "Severe Maternal Morbidity Diagnoses" )
      )
        union "Delivery Encounters with Cardiac Conversion, Tracheostomy or Ventilation Procedures"
        union "Delivery Encounters with Expiration"
    )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SDE Delivery Encounters with Severe Obstetric Complication Diagnosis":
  ( "Delivery Encounters with Severe Obstetric Complications"
    except "SOC with Hysterectomy or Blood Transfusion with Placenta Increta or Placenta Percreta Without Additional SOC" ) Encounter
    where Encounter.pOAIsNoOrUTD ( ) in "Severe Maternal Morbidity Diagnoses"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Placental Accreta Spectrum":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Placenta Accreta"
      or TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Placenta Increta or Percreta"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Neuromuscular":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Neuromuscular Disease"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Hypertension":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Hypertension"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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 DeliveryEncounter.pOAIsYesOrExempt ( ) in "Preterm Birth"
    )
Logic Definition Library Name: SupplementalDataElements
define "SDE Payer":
  [Coverage: type in "Payer Type"] Payer
    return {
      code: Payer.type,
      period: Payer.period
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SDE Payer":
  SDE."SDE Payer"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Placental Abruption":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Placental Abruption"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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"] COVIDRespiratoryProcedure
              where COVIDRespiratoryProcedure.status = 'completed'
                and COVIDRespiratoryProcedure.performed.toInterval ( ) starts during day of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation ( )
          )
      )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Denominator Exclusion":
  "Delivery Encounters with COVID and Respiratory Condition or Procedure"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Morbid Obesity":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Morbid or Severe Obesity"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Preexisting Diabetes":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Preexisting Diabetes"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Bariatric Surgery":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Bariatric Surgery"
Logic Definition Library Name: SupplementalDataElements
define "SDE Race":
  Patient.race R
    return Tuple {
      codes: R.ombCategory union R.detailed,
      display: R.text
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SDE Race":
  SDE."SDE Race"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Placenta Previa":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Placenta Previa"
Logic Definition Library Name: SupplementalDataElements
define "SDE Sex":
  case
    when Patient.gender = 'male' then "M"
    when Patient.gender = 'female' then "F"
    else null
  end
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SDE Sex":
  SDE."SDE Sex"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Bleeding Disorder":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Bleeding Disorder"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
//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":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    let FirstWBC: First(["USCoreLaboratoryResultObservationProfile": "White blood cells count lab test"] WBC
        where WBC.issued during Interval[start of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, TwentyWeeksPlusEncounter.lastTimeOfDelivery()]
          and WBC.status in { 'final', 'amended', 'corrected' }
          and WBC.value is not null
        sort by issued.earliest()
    )
    return {
      EncounterId: TwentyWeeksPlusEncounter.id,
      FirstWBCResult: FirstWBC.value as Quantity,
      Timing: FirstWBC.issued
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
//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":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    let FirstHematocrit: First(["USCoreLaboratoryResultObservationProfile": "Hematocrit lab test"] Hematocrit
        where Hematocrit.issued during Interval[start of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, TwentyWeeksPlusEncounter.lastTimeOfDelivery()]
          and Hematocrit.status in { 'final', 'amended', 'corrected' }
          and Hematocrit.value is not null
        sort by issued.earliest()
    )
    return {
      EncounterId: TwentyWeeksPlusEncounter.id,
      FirstHematocritResult: FirstHematocrit.value as Quantity,
      Timing: FirstHematocrit.issued
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Severe Preeclampsia":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Severe Preeclampsia"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Anemia":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Anemia"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Cardiac Disease":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Cardiac Disease"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Long Term Anticoagulant Use":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Long Term Anticoagulant Use"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
//First resulted value 24 hours prior to start of encounter and before time of delivery
//Report systolic blood pressure as mm[Hg]
//Systolic blood pressure value cannot be null per QICore profile requirement.




define "Risk Variable Systolic Blood Pressure":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    let FirstSystolicBP: First(["observation-bp"] BP
        where BP.effective.earliest() during Interval[start of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, TwentyWeeksPlusEncounter.lastTimeOfDelivery()]
          and BP.status in { 'final', 'amended', 'corrected' }
          and BP.component.value is not null
        sort by effective.earliest()
    )
    return {
      EncounterId: TwentyWeeksPlusEncounter.id,
      FirstSBPResult: FirstSystolicBP.component C
        where C.code ~ "Systolic blood pressure"
        return C.value as Quantity,
      Timing: FirstSystolicBP.effective.earliest ( )
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SDE SOC Diagnoses Detail":
  "SDE Delivery Encounters with Severe Obstetric Complication Diagnosis" Encounter
    let complication: Encounter.pOAIsNoOrUTD ( )
    return {
      id: Encounter.id,
	  //  code: Encounter.type,
      
      complications: complication C
        where C in "Severe Maternal Morbidity Diagnoses"
        return {
          code: C,
          SOCDxCategory: C.sOCDxCategory ( )
        }
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Substance Abuse":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Substance Abuse"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Renal Disease":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Renal Disease"
Logic Definition Library Name: PCMaternal
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
  "Delivery Encounter with Age Range" DeliveryEncounter
    let CGA: DeliveryEncounter.calculatedGestationalAge()
  //  return { QualifyingEncounter, CGA }
    return {
      EncounterID: DeliveryEncounter.id,
      CalculatedCGA: CGA
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SDE 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"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Gastrointestinal Disease":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Gastrointestinal Disease"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
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"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions Only":
  "Delivery Encounters with Severe Obstetric Complications"
    intersect "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Pulmonary Hypertension":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Pulmonary Hypertension"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Thyrotoxicosis":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Thyrotoxicosis"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Other Preeclampsia":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Mild or Moderate Preeclampsia"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Initial Population":
  PCMaternal."Delivery Encounter with Age Range"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Economic Housing Instability":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Economic Housing Instability"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable HIV":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "HIV in Pregnancy Childbirth and Puerperium"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SDE Delivery Encounters with Severe Obstetric Complication Procedures":
  ( "Delivery Encounters with Severe Obstetric Complications"
    except "SOC with Hysterectomy or Blood Transfusion with Placenta Increta or Placenta Percreta Without Additional SOC" ) Encounter
    where exists ( ["Procedure": "Severe Maternal Morbidity Procedures"]
      union ["Procedure": "Blood Transfusion"] ) SMMProcedures
      where SMMProcedures.status = 'completed'
        and SMMProcedures.performed.toInterval ( ) starts during day of Encounter.hospitalizationWithEDOBTriageObservation ( )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SOC Excluding Blood Transfusions Only with Hysterectomy or Blood Transfusion with Placenta Increta or Placenta Percreta Without Additional SOC":
  ( "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions Only" SOCExcludingTransfusion
      where exists ( ( SOCExcludingTransfusion.encounterDiagnosis ( ) ) EncounterDiagnoses
          where EncounterDiagnoses.code in "Placenta Increta or Percreta"
      )
        and ( exists "Delivery Encounters with Blood Transfusion"
            or exists "Delivery Encounters with Hysterectomy"
        )
  )
	
	//The following logic keeps encounter in the numerator if there is an additional SOC besides Blood Transfusion or Hysterectomy
    
    except ( ( "Delivery Encounters with Severe Obstetric Complications Excluding Blood Transfusions Only" SOCExcludingTransfusion
          where SOCExcludingTransfusion.pOAIsNoOrUTD ( ) in "Severe Maternal Morbidity Diagnoses"
      )
        union "Delivery Encounters with Cardiac Conversion, Tracheostomy or Ventilation Procedures"
        union "Delivery Encounters with Expiration"
    )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
//First resulted value 24 hours prior to start of encounter and before time of delivery
 //Report heart rate as beats/min
 //Heart rate value cannot be null per QICore profile requirement.




define "Risk Variable Heart Rate":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    let FirstHeartRate: First(["observation-heartrate"] HeartRate
        where HeartRate.effective.earliest() during Interval[start of TwentyWeeksPlusEncounter.hospitalizationWithEDOBTriageObservation() - 1440 minutes, TwentyWeeksPlusEncounter.lastTimeOfDelivery()]
          and HeartRate.status in { 'final', 'amended', 'corrected' }
        sort by effective.earliest()
    )
    return {
      EncounterId: TwentyWeeksPlusEncounter.id,
      FirstHRResult: FirstHeartRate.value as Quantity,
      Timing: FirstHeartRate.effective.earliest ( )
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Maternal Age":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    let MaternalAge: AgeInYearsAt(date from start of TwentyWeeksPlusEncounter.period)
    return { TwentyWeeksPlusEncounter, MaternalAge }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Mental Health Disorder":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Mental Health Disorder"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Obstetrical VTE":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Venous Thromboembolism in Pregnancy"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Autoimmune Disease":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Autoimmune Disease"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Previous Cesarean":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Previous Cesarean"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Gestational Diabetes":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Gestational Diabetes"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SDE SOC Procedure Detail":
  "SDE Delivery Encounters with Severe Obstetric Complication Procedures" Encounter
    let procedure: Encounter.sOCProcedures ( )
    return {
      id: Encounter.id,
 //   code: Encounter.code,
      
      procedures: procedure P
        return {
          code: P,
          SOCProcedureCategory: P.sOCProcedureCategory ( )
        }
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Numerator":
  "Delivery Encounters with Severe Obstetric Complications"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Risk Variable Multiple Pregnancy":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation" TwentyWeeksPlusEncounter
    where TwentyWeeksPlusEncounter.pOAIsYesOrExempt ( ) in "Multiple Pregnancy"
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "Denominator":
  "Delivery Encounters At Greater than or Equal to 20 Weeks Gestation"
Logic Definition Library Name: SupplementalDataElements
define "SDE Ethnicity":
  Patient.ethnicity E
    return Tuple {
      codes: { E.ombCategory } union E.detailed,
      display: E.text
    }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define "SDE Ethnicity":
  SDE."SDE Ethnicity"
Logic Definition Library Name: PCMaternal
/*define function "HospitalizationWithEDOBTriageObservation"(Encounter Encounter ):
  HospitalizationWithEDOBTriageObservation returns the total interval from the start of any immediately prior emergency department visit or OB Triage visit through the observation visit to the discharge of the given encounter
  Encounter Visit
    let ObsVisit: Last(["Encounter": "Observation Services"] LastObs
        where LastObs.period ends 1 hour or less on or before start of Visit.period
          and LastObs.status = 'finished'
        sort by 
        end of period
    ),
    VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
    EDOBTriageVisit: Last(["Encounter": "ED Visit and OB Triage"] LastEDOBTriage
        where LastEDOBTriage.period ends 1 hour or less on or before VisitStart
          and LastEDOBTriage.status = 'finished'
        sort by 
        end of period
    )
    return Interval[Coalesce(start of EDOBTriageVisit.period, VisitStart), 
    end of Visit.period]*/
    
    
define fluent function hospitalizationWithEDOBTriageObservation (TheEncounter Encounter ):
  /*hospitalizationWithEDOBTriageObservation returns the total interval from the start of any immediately prior emergency department visit or OB Triage visit through the observation visit to the discharge of the given encounter*/
  TheEncounter Visit
    let ObsVisit: Last(["Encounter": "Observation Services"] LastObs
        where LastObs.period ends 1 hour or less on or before start of Visit.period
          and LastObs.status = 'finished'
        sort by 
        end of period
    ),
    VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),
    EDOBTriageVisit: Last(["Encounter": "ED Visit and OB Triage"] LastEDOBTriage
        where LastEDOBTriage.period ends 1 hour or less on or before VisitStart
          and LastEDOBTriage.status = 'finished'
        sort by 
        end of period
    )
    return Interval[Coalesce(start of EDOBTriageVisit.period, VisitStart), 
    end of Visit.period]
Logic Definition Library Name: PCMaternal
define fluent function calculatedGestationalAge (TheEncounter Encounter ):
  //Gestational Age = (280-(Estimated Delivery Date minus Reference Date/Delivery Date))/7
 ( 280 - ( difference in days between TheEncounter.lastTimeOfDelivery () and TheEncounter.lastEstimatedDeliveryDate( )) ) div 7
Logic Definition Library Name: PCMaternal
define fluent function lastTimeOfDelivery (TheEncounter Encounter ):
  Last(["Observation": "Date and time of obstetric delivery"] TimeOfDelivery
      where TimeOfDelivery.value as DateTime is not null
        and TimeOfDelivery.status in { 'final', 'amended', 'corrected' }
        and TimeOfDelivery.effective.earliest () during TheEncounter.hospitalizationWithEDOBTriageObservation ()
        and TimeOfDelivery.value as DateTime during TheEncounter.hospitalizationWithEDOBTriageObservation()
      sort by effective.earliest()
  ).value as DateTime
Logic Definition Library Name: QICoreCommon
/*
@description: Given an interval, return the starting point if the interval has a starting boundary specified,
otherwise, return the ending point
*/
define fluent function earliest(choice Choice<DateTime, Quantity, Interval<DateTime>, Interval<Quantity>> ):
  (choice.toInterval()) period
    return
      if (period."hasStart"()) then start of period
      else end of period
Logic Definition Library Name: PCMaternal
/*===============================================================*/
  /*  03/14/2022 from MATGlobalCommonFunctionsv7.000 - latest QDM  */
  /*     even though this PCMaternalFHIR was derived from          */
  /*     PCMaternal=2.1.000 cql, to make next update easier.       */
  /*     Will need to re-insert "Global". in front of these        */
  /*     function names later (whereever they are directly used.*/

define fluent function lastEstimatedDeliveryDate (TheEncounter Encounter ):
  /*This function identifies the last time the EDD was assessed 42 weeks or less prior to or on delivery and stores the result of that assessment.*/
  Last(["Observation": "Delivery date Estimated"] EstimatedDateOfDelivery
      where EstimatedDateOfDelivery.value as DateTime is not null
        and EstimatedDateOfDelivery.status in { 'final', 'amended', 'corrected' }
        and EstimatedDateOfDelivery.effective.earliest ( ) 42 weeks or less before or on TheEncounter.lastTimeOfDelivery ()
      sort by effective.earliest ( )
  ).value as DateTime
Logic Definition Library Name: PCMaternal
/*define fluent function lastEstimatedGestationalAge (TheEncounter Encounter ):
  Last(["Observation": "Estimated Gestational Age at Delivery"] EstimatedGestationalAge
      where EstimatedGestationalAge.value is not null
        and EstimatedGestationalAge.status in { 'final', 'amended', 'corrected' }
        and EstimatedGestationalAge.effective.earliest() 24 hours or less before or on TheEncounter.lastTimeOfDelivery ()
      sort by effective.earliest ()
  ).value as Quantity*/
  
  define fluent function lastEstimatedGestationalAge (TheEncounter Encounter ):
  Last(["Observation": "Estimated Gestational Age at Delivery"] EstimatedGestationalAge
  let EGATiming:  EstimatedGestationalAge.effective.earliest() where 
  (EGATiming 24 hours or less before or on TheEncounter.lastTimeOfDelivery () 
  and EstimatedGestationalAge.value is not null 
  and EstimatedGestationalAge.status in { 'final', 'amended', 'corrected' }) or 
      (EGATiming same day as TheEncounter.lastTimeOfDelivery () 
      and EGATiming during TheEncounter.hospitalizationWithEDOBTriageObservation() 
      and EstimatedGestationalAge.value is not null)
 sort by effective.earliest ())
         .value as Quantity
Logic Definition Library Name: CQMCommon
/*
@description: Returns the Condition resources referenced by the diagnosis element of the Encounter
*/
define fluent function encounterDiagnosis(Encounter Encounter ):
  Encounter.diagnosis D
    return singleton from ([Condition] C where C.id = D.condition.reference.getId())
Logic Definition Library Name: QICoreCommon
/*
@description: Returns the tail of the given uri (i.e. everything after the last slash in the URI).
@comment: This function can be used to determine the logical id of a given resource. It can be used in
a single-server environment to trace references. However, this function does not attempt to resolve
or distinguish the base of the given url, and so cannot be used safely in multi-server environments.
*/
define fluent function getId(uri String):
  Last(Split(uri, '/'))
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define fluent function pOAIsYesOrExempt(TheEncounter Encounter):
  TheEncounter.diagnosis EncounterDiagnoses
    where EncounterDiagnoses.diagnosisPresentOnAdmission in "Present On Admission is Yes or Exempt"
    return EncounterDiagnoses.condition.getCondition ( ).code
Logic Definition Library Name: FHIRHelpers
define function ToString(value uri): value.value
Logic Definition Library Name: CQMCommon
/*
@description: Returns the Condition resource for the given reference
*/
define fluent function getCondition(reference Reference):
  singleton from ([Condition] C where C.id = reference.reference.getId())
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define fluent function pOAIsNoOrUTD(TheEncounter Encounter):
  TheEncounter.diagnosis EncounterDiagnoses
    where EncounterDiagnoses.diagnosisPresentOnAdmission in "Present on Admission is No or Unable To Determine"
    return EncounterDiagnoses.condition.getCondition ( ).code
Logic Definition Library Name: FHIRHelpers
/*
@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.
*/
define function ToCode(coding FHIR.Coding):
    if coding is null then
        null
    else
        System.Code {
          code: coding.code.value,
          system: coding.system.value,
          version: coding.version.value,
          display: coding.display.value
        }
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define fluent function sOCDxCategory(Dx Concept):
  case
    when Dx in "Acute Heart Failure" then 'Acute Heart Failure'
    when Dx in "Acute Myocardial Infarction" then 'Acute Myocardial Infarction'
    when Dx in "Acute Renal Failure" then 'Acute Renal Failure'
    when Dx in "Acute Respiratory Distress Syndrome" then 'Acute Respiratory Distress Syndrome'
    when Dx in "Air and Thrombotic Embolism" then 'Air and Thrombotic Embolism'
    when Dx in "Amniotic Fluid Embolism" then 'Amniotic Fluid Embolism'
    when Dx in "Aortic Aneurysm" then 'Aortic Aneurysm'
    when Dx in "Cardiac Arrest Ventricular Fibrillation" then 'Cardiac Arrest Ventricular Fibrillation'
    when Dx in "Disseminated Intravascular Coagulation" then 'Disseminated Intravascular Coagulation'
    when Dx in "Eclampsia" then 'Eclampsia'
    when Dx in "Heart Failure Cardiac Arrest Related to Procedure or Surgery" then 'Heart Failure Cardiac Arrest Related to Procedure or Surgery'
    when Dx in "Puerperal Cerebrovascular Disorder" then 'Puerperal Cerebrovascular Disorder'
    when Dx in "Pulmonary Edema" then 'Pulmonary Edema'
    when Dx in "Sepsis" then 'Sepsis'
    when Dx in "Severe Anesthesia Complications" then 'Severe Anesthesia Complications'
    when Dx in "Shock" then 'Shock'
    when Dx in "Sickle Cell Disease with Crisis" then 'Sickle Cell Disease with Crisis' 
    else null end
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define fluent function sOCProcedures(TheEncounter Encounter):
  ( ["Procedure": "Severe Maternal Morbidity Procedures"]
    union ["Procedure": "Blood Transfusion"] ) SMMProcedures
    where SMMProcedures.status = 'completed'
      and SMMProcedures.performed.toInterval ( ) starts during day of TheEncounter.hospitalizationWithEDOBTriageObservation ( )
Logic Definition Library Name: SevereObstetricComplicationsFHIR
define fluent function sOCProcedureCategory(TheProcedure Procedure):
  case
    when TheProcedure.code in "Blood Transfusion" then 'Blood Transfusion'
    when TheProcedure.code in "Conversion of Cardiac Rhythm" then 'Conversion of cardiac rhythm'
    when TheProcedure.code in "Hysterectomy" then 'Hysterectomy'
    when TheProcedure.code in "Tracheostomy" then 'Tracheostomy'
    when TheProcedure.code in "Ventilation" then 'Ventilation' 
    else null end
Generated using version 0.4.6 of the sample-content-ig Liquid templates